Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.56k stars 4.82k forks source link

Tool Calling in in ChatClient #46840

Open karim-daw opened 1 month ago

karim-daw commented 1 month ago

Library name and version

ChatCompletion

Query/Question

Hello, I was going over the SDK to use the Tool Calling capabilities and i noticed this in the documentation:

ChatCompletionOptions options = new()
{
    Tools = { getCurrentLocationTool, getCurrentWeatherTool },
};

List<ChatMessage> conversationMessages =
    [
        new UserChatMessage("What's the weather like in Boston?"),
    ];
ChatCompletion completion = chatClient.CompleteChat(conversationMessages);

I was wondering whether the optionsneed to be passed into the CompleteChat method?

Kind of like this:

ChatCompletion completion = chatClient.CompleteChat(conversationMessages, options);

referring to this: https://github.com/Azure/azure-sdk-for-net/blob/730b202eb01c409e439781124a3ea21ea39d01a7/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs#L49

-- is there a reason this piece of the doc does not reflect that?

Environment

No response

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @ralph-msft @trrwilson.