Skip to content

Conversation

Orbital-Web
Copy link
Contributor

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.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Orbital-Web Orbital-Web requested review from Weves and evan-onyx May 24, 2025 20:22
@Orbital-Web Orbital-Web requested a review from a team as a code owner May 24, 2025 20:22
Copy link

vercel bot commented May 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2025 8:48pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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, and generate_sub_answer.py
  • Added type safety with Literal type for agent_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

@evan-onyx evan-onyx added this pull request to the merge queue May 26, 2025
Merged via the queue into main with commit 0b01d7f May 26, 2025
11 checks passed
@evan-onyx evan-onyx deleted the refactor-agent-stream-answer branch May 26, 2025 23:43
ferdinandl007 pushed a commit to ferdinandl007/onyx that referenced this pull request May 27, 2025
* refactor: stream_llm_answer

* fix: lambda

* fix: mypy, docstring
aronszanto pushed a commit to aronszanto/onyx that referenced this pull request May 27, 2025
* refactor: stream_llm_answer

* fix: lambda

* fix: mypy, docstring
ZhipengHe pushed a commit to ZhipengHe/onyx that referenced this pull request Jun 6, 2025
* refactor: stream_llm_answer

* fix: lambda

* fix: mypy, docstring
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* refactor: stream_llm_answer

* fix: lambda

* fix: mypy, docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants