Commit Graph

15 Commits

  • .NET: Fix OpenAIResponsesAgentClient to include agentName in endpoint path (#5748)
    * 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>
  • .NET: Fix role assignment in ChatMessage construction (#4290)
    * 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>
  • .NET: Update to OpenAI 2.9.1, Azure.AI.OpenAI 2.9.0-beta.1, Microsoft.Extensions.AI 10.4.0, and Azure.AI.Projects 2.0.0-beta.2 (#4613)
    * Initial plan
    
    * Update code for Microsoft.Extensions.AI.Abstractions 10.4.0 breaking changes
    
    - Rename FunctionApprovalRequestContent → ToolApprovalRequestContent
    - Rename FunctionApprovalResponseContent → ToolApprovalResponseContent
    - Rename UserInputRequestContent → ToolApprovalRequestContent
    - Rename UserInputResponseContent → ToolApprovalResponseContent
    - Update .FunctionCall property → .ToolCall with FunctionCallContent casts where needed
    - Update .Id property → .RequestId on the renamed types
    - Rename FunctionApprovalRequestEventGenerator → ToolApprovalRequestEventGenerator
    - Rename FunctionApprovalResponseEventGenerator → ToolApprovalResponseEventGenerator
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update OpenAI 2.9.1, ME.AI 10.4.0, fix breaking API changes
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Fix remaining ME.AI 10.4.0 breaking changes: MCP approval types, .Output→.Outputs
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Use pattern matching with `when` for ToolApprovalRequestContent/FunctionCallContent
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Update Azure.AI.OpenAI to 2.9.0-beta.1
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Fix remaining GetResponsesClient(model) build failures for Azure.AI.OpenAI 2.9.0-beta.1
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Address review feedback: remove redundant type checks in TestRequestAgent.cs and fix error message in AIAgentHostExecutor.cs
    
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    
    * Update Azure.AI.Projects to 2.0.0-beta.2 with namespace migration
    
    - Azure.AI.Projects 2.0.0-beta.1 → 2.0.0-beta.2
    - Azure.AI.Projects.OpenAI → Azure.AI.Extensions.OpenAI (transitive)
    - Agent types moved to Azure.AI.Projects.Agents namespace
    - AgentRecord.Versions.Latest → AgentRecord.GetLatestVersion()
    - OpenAPIFunctionDefinition → OpenApiFunctionDefinition
    - BingCustomSearchToolParameters → BingCustomSearchToolOptions
    - MemorySearchPreviewTool.UpdateDelay → UpdateDelayInSecs
    - Azure.Identity 1.17.1 → 1.19.0
    - Microsoft.Identity.Client.Extensions.Msal 4.78.0 → 4.83.1
    
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    
    * Fix remaining type renames for Azure.AI.Projects 2.0.0-beta.2
    
    - BrowserAutomationToolParameters → BrowserAutomationToolOptions
    - MemoryUpdateOptions.UpdateDelay stays as UpdateDelay (not renamed)
    - WaitForMemoriesUpdateAsync parameter order: pollingInterval before options
    - AIProjectAgentsOperations → AgentsClient
    
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    
    * Fix format errors and OpenTelemetry test for ME.AI 10.4.0
    
    - Remove unused 'using Azure.AI.Extensions.OpenAI' and fix import ordering
      in Agent_With_AzureAIProject/Program.cs
    - Update OpenTelemetryAgentTests: gen_ai.tool.definitions is now always
      emitted regardless of EnableSensitiveData per ME.AI 10.4.0 change
      (dotnet/extensions#7346). Tool definitions are not considered sensitive.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix GetRepoFolder() to work in git worktrees
    
    Use 'workflow-samples' directory as repo root marker instead of '.git',
    which fails in worktrees (.git is a file) and also matches too early
    when a '.github' folder exists in subdirectories.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix formatting: remove unused usings and fix import ordering
    
    dotnet format applied across 59 impacted projects. Primarily removes
    unnecessary 'using Azure.AI.Projects' where Azure.AI.Projects.Agents
    provides all needed types, and fixes import ordering per editorconfig.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Disable AzureAIAgentsPersistent integration tests (#4769)
    
    Azure.AI.Agents.Persistent 1.2.0-beta.9 references McpServerToolApprovalResponseContent
    which was removed in ME.AI 10.4.0 (renamed to ToolApprovalResponseContent), causing
    TypeLoadException at runtime. Mark all 6 test classes with IntegrationDisabled trait
    until Persistent ships a version targeting ME.AI 10.4.0+.
    
    Upstream fix: https://github.com/Azure/azure-sdk-for-net/pull/56929
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add README with compatibility note for AzureAI.Persistent (#4769)
    
    Documents that Azure.AI.Agents.Persistent 1.2.0-beta.9 is only compatible
    with ME.AI ≤10.3.0 and OpenAI ≤2.8.0 due to type renames in ME.AI 10.4.0.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix file encoding: restore UTF-8 BOM on Persistent test files
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Mark AzureAI.Persistent as IsPackable=false (#4769)
    
    Prevent shipping until Azure.AI.Agents.Persistent targets ME.AI 10.4.0+.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Moving IsPackable after import
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
  • Python: .NET: Fix .NET conversation memory in DevUI (#3484) (#4294)
    * 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
  • .NET: Update to latest Azure.AI.*, OpenAI, and M.E.AI* (#2850)
    * 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>
  • .NET: Upgrade to .NET 10 (#2128)
    * 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
  • .NET: fix ChatCompletions Tools serialization (#2043)
    * fix serialization in chat completions on tools
    
    * nit
  • Python: DevUI: Use metadata.entity_id instead of model field (#1984)
    * DevUI: Use metadata.entity_id for agent/workflow name instead of model field
    
    * OpenAI Responses: add explicit request validation
    
    * Review feedback
  • .NET: Improve fidelity of OpenAI Responses server and add Conversations (#1907)
    * Improve fidelity of OpenAI Responses server and add Conversations
    
    * Merge
    
    * nit
    
    * Undo prior change
    
    * Undo prior change
    
    * Review feedback
    
    * Review feedback
    
    * Fix test
    
    * Use simpler JsonDocument approach for polymorphic deserialization
    
    * More review feedback
    
    * dotnet format
  • .NET: AG-UI support for .NET (#1776)
    * 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
  • .NET: Improve fidelity of OpenAI ChatCompletions Hosting (#1785)
    * rename, support json serialization
    
    * wip
    
    * non-streaming
    
    * streaming?
    
    * proper streaming types
    
    * comments + fix audio parse
    
    * copilot suggestions
    
    * proper stopsequences type
    
    * build options as i could
    
    * annotations
    
    * proper generation of Id for chatcompletions
    
    * string length as in chatcompletions api ref
    
    * image url
    
    * support tools
    
    * rework API
    
    * introduce tests for chatcompletions
    
    * function calling / serialization tests / fixes
    
    * more tests and coverage
    
    * fix format
    
    * sort usings
    
    * nit
    
    * address PR comments
    
    * nits
  • .NET: Improve fidelity of OpenAI Responses hosting (#1550)
    * 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>