-
Notifications
You must be signed in to change notification settings - Fork 2k
refactor: stream_llm_answer #4772
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Refactored LLM answer streaming functionality across multiple agent components by introducing a centralized stream_llm_answer
utility function.
- New
backend/onyx/agents/agent_search/shared_graph_utils/llm.py
implements shared streaming logic with consistent error handling and timing measurements - Removed duplicate streaming code from
a5_consolidate_research.py
,generate_validate_refined_answer.py
,generate_initial_answer.py
, andgenerate_sub_answer.py
- Added type safety with
Literal
type foragent_answer_type
parameter - Improved error handling by explicitly checking content type before streaming
- Maintained consistent timeout and token restriction behavior across all agent components
5 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
backend/onyx/agents/agent_search/dc_search_analysis/nodes/a5_consolidate_research.py
Outdated
Show resolved
Hide resolved
* refactor: stream_llm_answer * fix: lambda * fix: mypy, docstring
* refactor: stream_llm_answer * fix: lambda * fix: mypy, docstring
* refactor: stream_llm_answer * fix: lambda * fix: mypy, docstring
* refactor: stream_llm_answer * fix: lambda * fix: mypy, docstring
Description
Removed a lot of duplicate code on the way the llm answer is streamed
How Has This Been Tested?
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.