Forum Discussion

Liwei's avatar
Liwei
Icon for Microsoft rankMicrosoft
Jul 12, 2024

ChatToolCall.FunctionName always returns keyword 'python', is that a bug?

I used the sample code ChatWithTools in azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs at main · Azure/azure-sdk-for-net (github.com)

 

 

The only change I made is that the 'options' is passed to chatClient.CompleteChat function to make it work.

----Before the change----

 

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

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

----Afte the change----

 

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

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

 

 

 

However, it fails because toolCall.FunctionName is always 'python'. Any suggestions would be appreciated.

 

My environment

===

Azure.AI.OpenAI 2.0.0-beta.2 dll is used.

I used Azure.AI.OpenAI service.

The deployment mode is gpt-35-turbo

 

 

No RepliesBe the first to reply

Resources