-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: Fix: OpenAI ChatClients do not send entity_id in AgentChatWebEx… #2378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue where OpenAI ChatClients were not sending the required entity_id metadata in the AgentChatWebExample. The fix adds RawRepresentationFactory to the ChatOptions to supply the correct metadata for HostedAgentResponseExecutor.
Key Changes
- Added
RawRepresentationFactorytoChatOptionsin both OpenAI client implementations to includeentity_idmetadata - Added
using OpenAI.Responses;namespace inOpenAIChatCompletionsAgentClient.cs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/samples/AgentWebChat/AgentWebChat.Web/OpenAIResponsesAgentClient.cs | Added RawRepresentationFactory to create ResponseCreationOptions with entity_id metadata |
| dotnet/samples/AgentWebChat/AgentWebChat.Web/OpenAIChatCompletionsAgentClient.cs | Added using statement for OpenAI.Responses, introduced chatOptions variable with RawRepresentationFactory to create ChatCompletionOptions with entity_id metadata |
dotnet/samples/AgentWebChat/AgentWebChat.Web/OpenAIResponsesAgentClient.cs
Show resolved
Hide resolved
dotnet/samples/AgentWebChat/AgentWebChat.Web/OpenAIChatCompletionsAgentClient.cs
Show resolved
Hide resolved
dotnet/samples/AgentWebChat/AgentWebChat.Web/OpenAIResponsesAgentClient.cs
Outdated
Show resolved
Hide resolved
arjendeblok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this example it works but for other LLM providers it may fail on the name of the model.
Modified the OpenAI clients in AgentChatWebExample to send the needed metadata.
Motivation and Context
Fixes #2376
Description
I've added RawRepresentationFactory as suggested with now supplies the correct metadata for HostedAgentResponseExecutor.
Contribution Checklist