* Fix OpenAIResponsesAgentClient endpoint to include agentName in path (#5324)
The sample OpenAIResponsesAgentClient used '/v1/' as the endpoint, which
routes to the multi-agent endpoint requiring agent.name in the request body.
However, AsIChatClient(agentName) maps agentName to the model field, not
agent.name, causing HTTP 400 errors on OpenAI-compatible endpoints.
Changed the endpoint to '/{agentName}/v1/' to match the pattern used by
OpenAIChatCompletionsAgentClient, routing to the single-agent endpoint
where no agent.name body field is needed.
Added regression test verifying that the model field alone is insufficient
for agent resolution on the multi-agent endpoint.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #5324
- URL-escape agentName in OpenAIResponsesAgentClient endpoint path to
handle reserved characters safely
- Add per-agent MapOpenAIResponses() calls in AgentHost so the sample
host serves the /{agentName}/v1/responses routes the client now targets
- Replace brittle Assert.Contains("agent.name") assertions with stable
machine-readable error code assertion ("missing_required_parameter")
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address additional review feedback for #5324
- Apply Uri.EscapeDataString to OpenAIChatCompletionsAgentClient endpoint
for consistency with OpenAIResponsesAgentClient
- Map OpenAI Responses and ChatCompletions endpoints for all builder-based
agents (chemist, mathematician, literator, science workflows) so every
discoverable agent is reachable via the single-agent endpoint path
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use actual message role when creating ChatMessage
Replace hard-coded ChatRole.User with a ChatRole constructed from the message's Role. The change ensures ToChatMessage and FunctionMessage use the original role (new ChatRole(this.Role)) for both text and contents branches, fixing incorrect role assignment when constructing ChatMessage instances.
* Update changes
* Fix formatting in ToChatMessage tests
---------
Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
* Fix .NET conversation memory in DevUI (#3484)
* formatting fixes
* fix memory regression in python devui , fix for #4123
* Fix for #3983: Added _get_event_type() helper that safely accesses event type on both objects (.type) and dicts (.get("type")). Replaced all 4 bare event.type accesses in _executor.py (lines 267, 477, 499, 523).
Root cause: PR #3690 changed event.__class__.__name__ == "RequestInfoEvent" (safe) to event.type == "request_info" (crashes on dicts), but _execute_workflow still yields raw dicts on error paths.
Test: test_workflow_error_yields_dict_event_without_crash — mocks a workflow that raises, verifies execute_entity consumes the dict error events without crashing.
* format fixes
* lint fixes
* Update to latest Azure.AI.*, OpenAI, and M.E.AI*
Absorb breaking changes in Responses surface area
* Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs
* Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs
* Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs
* Update dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Using patch to remove the model is necessary, updated the response client to actually use the the ForAgent
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
* Upgrade to .NET 10
- Require .NET 10 SDK
- Include net10.0 assets in all assemblies
- Move net9.0-only targets to net10.0
- Update LangVersion to latest
- Remove complicated distinctions between debug target TFMs and release target TFMs
- Remove unnecessary package dependencies when built into netcoreapp
- Clean up some ifdefs
- Clean up some analyzer warnings
* Fix CI
* Initial plan
* Infrastructure setup
* Plan for minimal client
* Plan update
* Basic agentic chat
* cleanup
* Cleanups
* More cleanups
* Cleanups
* More cleanups
* Test plan
* Sample
* Fix streaming and error handling
* Fix notifications
* Cleanups
* cleanup sample
* Additional tests
* Additional tests
* Run dotnet format
* Remove unnecessary files
* Mark packages as non packable
* Fix build
* Address feedback
* Fix build
* Fix remaining warnings
* Feedback
* Feedback and cleanup
* Cleanup
* Cleanups
* Cleanups
* Cleanups
* Retrieve existing messages from the store to send them along the way and update the sample client
* Run dotnet format
* Add ADR for AG-UI
* Switch to use the SG and use a convention for run ids
* Cleanup MapAGUI API
* Fix formatting
* Fix solution
* Fix solution
Javier Calvarro Nelson
·
2025-11-05 15:51:37 +00:00
* Improve conformance of OpenAI Responses API serving
* Update dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/AgentRunResponseExtensions.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/AgentRunResponseExtensions.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Sort packages
* Relax adherence where acceptable
* nit
* PromptCacheKey is not obsolete
* format
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>