-
Notifications
You must be signed in to change notification settings - Fork 2k
Refactor advisor architecture in Spring AI #1422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
tzolov
wants to merge
24
commits into
spring-projects:main
from
tzolov:inline-advised-response-fluxed-3
Closed
Refactor advisor architecture in Spring AI #1422
tzolov
wants to merge
24
commits into
spring-projects:main
from
tzolov:inline-advised-response-fluxed-3
Conversation
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
Contributor
tzolov
commented
Sep 26, 2024
- Replace RequestAdvisor and ResponseAdvisor with CallAroundAdvisor and StreamAroundAdvisor
- Update AbstractChatMemoryAdvisor to implement new advisor interfaces
- Modify DefaultChatClient to use new advisor chain approach
- Deprecate RequestResponseAdvisor in favor of new advisor types
- Introduce AdvisedRequest and AdvisedResponse classes for better encapsulation
- Introduce AdvisedResponse class to encapsulate ChatResponse and advice context
- Update AdvisedRequest to include adviseContext and add toPrompt() method
- Remove AdvisorObservableHelper class
- Update MessageAggregator to support AdvisedResponse
- Refactor ChatClientAdvisorTests and add new AdvisorsTests
- Update observation conventions and context handling in advisors
- Improve type safety and consistency in advisor implementations
- Update integration tests to reflect new advisor structure
- Refactor DefaultAroundAdvisorChain for better ordering and observation
- Update MessageChatMemoryAdvisor to use new AroundAdvisor interface
- Revise PromptChatMemoryAdvisor for compatibility with new advisor chain
- Refactor QuestionAnswerAdvisor to implement CallAroundAdvisor and StreamAroundAdvisor
- Move and update SafeGuardAroundAdvisor for consistency
- Enhance SimpleLoggerAdvisor with new AroundAdvisor capabilities
- Modify VectorStoreChatMemoryAdvisor to use new advisor interfaces
- Remove CacheAroundAdvisor (functionality likely moved elsewhere)
- Make CallAroundAdvisor and StreamAroundAdvisor extend Ordered interface
b879dbc to
c171dd4
Compare
- Replace RequestAdvisor and ResponseAdvisor with CallAroundAdvisor and StreamAroundAdvisor - Update AbstractChatMemoryAdvisor to implement new advisor interfaces - Modify DefaultChatClient to use new advisor chain approach - Deprecate RequestResponseAdvisor in favor of new advisor types - Introduce AdvisedRequest and AdvisedResponse classes for better encapsulation - Introduce AdvisedResponse class to encapsulate ChatResponse and advice context - Update AdvisedRequest to include adviseContext and add toPrompt() method - Remove AdvisorObservableHelper class - Update MessageAggregator to support AdvisedResponse - Refactor ChatClientAdvisorTests and add new AdvisorsTests - Update observation conventions and context handling in advisors - Improve type safety and consistency in advisor implementations - Update integration tests to reflect new advisor structure - Refactor DefaultAroundAdvisorChain for better ordering and observation - Update MessageChatMemoryAdvisor to use new AroundAdvisor interface - Revise PromptChatMemoryAdvisor for compatibility with new advisor chain - Refactor QuestionAnswerAdvisor to implement CallAroundAdvisor and StreamAroundAdvisor - Move and update SafeGuardAroundAdvisor for consistency - Enhance SimpleLoggerAdvisor with new AroundAdvisor capabilities - Modify VectorStoreChatMemoryAdvisor to use new advisor interfaces - Remove CacheAroundAdvisor (functionality likely moved elsewhere) - Make CallAroundAdvisor and StreamAroundAdvisor extend Ordered interface
…ndAdvisorChain - Refactor DefaultChatClient to use a builder pattern for advisor chain construction - Update DefaultAroundAdvisorChain to separate call and stream advisors - Improve advisor ordering and management in DefaultAroundAdvisorChain.Builder - Enhance AdvisorsTests to verify correct advisor execution order - Remove redundant reordering logic from DefaultAroundAdvisorChain
- Introduce Advisor constants for precedence ordering - Update AbstractChatMemoryAdvisor to use new precedence constant - Enhance advisors documentation with order explanation and Re2 example - Add (experimental) Re2 advisor to enhance reasoning capabilities of LLMs - Add disabled Re2 test in OpenAiChatClientIT
- Introduce 'order' field to track advisor position in chain - Update AdvisorObservationDocumentation with ADVISOR_ORDER - Modify DefaultAdvisorObservationConvention to include order in high cardinality key values - Update tests to reflect new order field and AROUND advisor type
033ccd4 to
c659223
Compare
|
did minor code clean up and added more into the docs along with some edits. merged in 6fc76b7 |
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.