-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Advisor Interfaces and add AroundAdvisor support
Refactoring and enhancements to the advisor functionality. New Advisor interfaces in the org.springframework.ai.chat.client.advisor.api package: - Advisor: Base interface for all advisor types. - RequestAdvisor: For advising on request data before execution. - ResponseAdvisor: For advising on response data after execution, with enhanced streaming modes. - CallAroundAdvisor and StreamAroundAdvisor: For around advice on synchronous and streaming requests respectively. - AroundAdvisorChain and DefaultAroundAdvisorChain: To manage chaining of around advisors. Advisor Chain and Prompt Generation: - Added the DefaultAroundAdvisorChain class to manage the sequence of advisors applied around chat model methods. - Adjusted the prompt generation (toPrompt) to integrate with the refactored AdvisedRequest object. Refactoring and Updates: - Replaced the deprecated RequestResponseAdvisor interface with RequestAdvisor and ResponseAdvisor across the spring-ai-core and test modules. - Updated the DefaultChatClient and related classes to use the new Advisor interface, improving modularity and consistency. - Refactored DefaultAdvisorSpec and DefaultChatClientRequestSpec to handle the new Advisor type, and revised advisor lists and methods accordingly. - Enhanced the handling of streaming responses, introducing StreamResponseMode for better control during streaming scenarios.
- Loading branch information
1 parent
53721c6
commit 28276d1
Showing
22 changed files
with
955 additions
and
256 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.