Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,16 @@ IChatClient chatClient = new Client().AsIChatClient("gemini-2.0-flash")

ChatOptions options = new()
{
Tools = [AIFunctionFactory.Create(([Description("The name of the person whose age is to be retrieved")] string personName) => personName switch
{
"Alice" => 30,
"Bob" => 25,
_ => 35
}, "get_person_age", "Gets the age of the specified person");
Tools = [AIFunctionFactory.Create(
method: ([Description("The name of the person whose age is to be retrieved")] string personName) => personName switch
{
"Alice" => 30,
"Bob" => 25,
_ => 35
},
name: "get_person_age",
description: "Gets the age of the specified person")
]
};

await foreach (var update in chatClient.GetStreamingResponseAsync("How much older is Alice than Bob?", options))
Expand Down