Skip to content

[agents] refactor to use IChatClient#1109

Merged
cleftheris merged 5 commits into
fix/agents-sourcesfrom
fix/agents-sources-refactor
Jul 17, 2026
Merged

[agents] refactor to use IChatClient#1109
cleftheris merged 5 commits into
fix/agents-sourcesfrom
fix/agents-sources-refactor

Conversation

@cleftheris

Copy link
Copy Markdown
Contributor

No description provided.

Refactored codebase to replace custom chat models and Azure.AI.OpenAI usage with Microsoft.Extensions.AI types and OpenAI client integration. Updated service registration, workflow steps, and persistence logic to use new abstractions. Removed obsolete files and updated dependencies to Microsoft.Extensions.AI 10.8.0. Streamlined message and event models for improved compatibility and maintainability.
Replaced OpenAIClient with AzureOpenAIClient for chat and embedding services. Updated all related service registrations. Added Azure.AI.OpenAI 2.9.0-beta.1 NuGet package.
Changed "failed" in AdditionalProperties to retain its original type in ChatsService.cs. Removed an unused using directive from OutOfScopeResponder.cs for cleaner code.
Refactored codebase to remove custom pipeline envelope and state types in favor of ConversationState, IntentState, and direct payload records. Replaced IDexRunner/DexRunner with IDexChatClient/DexChatClient, aligning with Microsoft.Extensions.AI chat abstractions. Updated all pipeline step executors and workflow context to use new state and payload handling. Revised service registration and ChatsService to use new chat client and response types. Improved maintainability and reduced boilerplate by adopting the new chat pipeline model.
Citations and sources are now extracted from `final?.AdditionalProperties` in `ChatsService.cs` instead of defaulting to empty arrays. In `DexChatClient.cs`, the final chat response's `RawRepresentation` is simplified, and citations/sources are added to `AdditionalProperties`. All event class definitions are removed from `DexStreamEvent.cs`, reflecting a shift to a new event handling mechanism.
@cleftheris
cleftheris merged commit 09e156a into fix/agents-sources Jul 17, 2026
4 checks passed
@cleftheris
cleftheris deleted the fix/agents-sources-refactor branch July 17, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant