Skip to content

Name not being set in ChatMessage for Function Call results #38168

Open
@nganju98

Description

@nganju98

Library name and version

Azure.AI.OpenAI

Describe the bug

In the Readme.MD as well as Sample07_ChatFunctions.cs (line 89), you're not setting the ChatMessage.Name attribute to be the function name in the functionResponseMessage. However you are correctly setting the name in ChatFunctionsTests.cs, albeit via an internal constructor that none of us can access.

Expected behavior

The test file has access to an internal constuctor while we the clients only have a public constructor which does not include Name as an argument. So at best we have to call the constructor and then the public setter, i.e. chatMessage.Name = "get_weather". This is awkward and I'd suggest letting us have the other constructor as public as well.

Actual behavior

Nevertheless, one way or another the ChatMessage.Name needs to be set for OpenAI to properly process the functionResponseMessage. Your contributor @trrwilson talks about this very problem in this other issue: Azure/azure-rest-api-specs#24867 .

Reproduction Steps

So please fix the Readme.MD and Sample07_ChatFunctions.cs to set the Name attribute one way or another in the functionCallResponse. Else you're misguiding people; I would have followed your sample and hence been using function calls wrong had I not already been using the python version before switching to .Net.

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.OpenAIService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions