[agents] refactor to use IChatClient#1109
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.