-
Notifications
You must be signed in to change notification settings - Fork 279
Update GenericRAGHook #763
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
base: main
Are you sure you want to change the base?
Conversation
…ScopeChatModel#defaultOptions配置无效问题。
- Add stream() methods to FanoutPipeline for real-time event streaming - Support both concurrent (merge) and sequential (concat) streaming modes - Add StreamOptions support for event type filtering - Add unit tests for streaming functionality
…date_generic_rag_hook
Summary of ChangesHello @xseruer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a streaming API to FanoutPipeline for both concurrent and sequential execution, complete with thorough unit tests. It also includes a beneficial refactoring in DashScopeChatModel to better merge generation options. The core change in GenericRAGHook correctly places the retrieved knowledge message before the user input, achieving the main goal of the PR. The overall implementation is solid. I have one suggestion to improve the precision of a new test case.
| AtomicInteger eventCount = new AtomicInteger(0); | ||
| pipeline.stream(input).doOnNext(event -> eventCount.incrementAndGet()).blockLast(TIMEOUT); | ||
|
|
||
| assertTrue( | ||
| eventCount.get() >= 3, | ||
| "Should have at least 3 AGENT_RESULT events (one per agent)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current test implementation counts all events, but the assertion message specifically refers to AGENT_RESULT events. This is a bit misleading, and the assertion is not as precise as it could be.
To make the test stronger and clearer, it would be better to filter for AGENT_RESULT events and assert their count directly. This ensures the test is verifying exactly what the description claims.
long agentResultCount =
pipeline.stream(input)
.filter(event -> event.getType() == EventType.AGENT_RESULT)
.count()
.block(TIMEOUT);
assertEquals(3, agentResultCount, "Should have exactly 3 AGENT_RESULT events (one per agent)");
AgentScope-Java Version
1.0.9-SNAPSHOT
Description
Place the knowledge message before the user input message.
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)