I'll make an issue for this, I'd love to know any ...
# proj-sdk
c
I'll make an issue for this, I'd love to know any thoughts on it: I think one thing that users expect is LLM streaming. In V0, this turned out kinda weirdly difficult to implement, because the event stream wants events, from the LLM->Agent we return an Event, while LLM responses from streaming have deltas instead of mapping cleanly to an Event. So it was like, we should have either supported in events or accept a different thing from step() or try to use the
status/error
channel to send to FE, but that channel is not available to LLM nor Agent, so... I don't know. šŸ¤·ā€ā™‚ļø Do we want to support LLM streaming? Specially these days with the slow GPT-5, it would enhance the UX significantly, I feel. And it's a staple out there, IMHO.
s
Feels like a mistake not to support it
c
@calm-artist-7206 wdyt on how hard it would be to implement it? šŸ¤”
we have
on_event
pass to the agent; what if we have an
on_token
callback pass to the
Agent
? And inside
.completion
, we implement llm streaming, and call
on_token
callback, but the agent treat it as non-streaming call. In server scenario, that
on_token
could just stream tokens back to FE via websocket, wdyt?
šŸ‘ 1
w
^ I like that approach, keeps our event ontology and agent structure the same
c
@nutritious-balloon-65098 please create an issue on All-Hands-AI/agent-sdk on support token streaming
n
I'm on it! Xingyao Wang can track my progress here.
Summary I have successfully created a comprehensive GitHub issue for supporting token streaming in the All-Hands-AI/agent-sdk repository. Here's what was accomplished: āœ… Issue Created Successfully • Issue #450: "Support Token Streaming for Enhanced User Experience" • URL: https://github.com/All-Hands-AI/agent-sdk/issues/450 • Labels: enhancement, user-experience, llm šŸ“‹ Issue Content Overview The issue provides a detailed technical proposal that includes: 1. Problem Analysis: Identified that the current LLM class explicitly rejects streaming with
raise ValueError("Streaming is not supported")
, creating poor UX especially with slower models like GPT-5. 2. Architecture Analysis: Thoroughly analyzed the current event-driven architecture, understanding how
Agent.step()
→
LLM.completion()
→
on_event
callbacks work. 3. Proposed Solution: A dual-callback approach that: ā—¦ Adds
on_token
callback alongside existing
on_event
ā—¦ Preserves the current event ontology and agent structure ā—¦ Enables streaming without breaking changes ā—¦ Allows direct WebSocket integration for server scenarios 4. Implementation Plan: Four-phase rollout covering core infrastructure, agent integration, conversation layer, and documentation. 5. Technical Considerations: Addresses retry logic, error handling, performance, and backward compatibility. šŸŽÆ Key Benefits of the Proposed Approach • Zero Breaking Changes: Purely additive API that maintains backward compatibility • Clean Architecture: Separates streaming concerns from event processing • Server-Ready: Direct WebSocket integration capability • Preserves Existing Patterns: Leverages the existing callback architecture The issue is now available for the development team to review, discuss, and prioritize. It provides a comprehensive technical foundation for implementing token streaming while respecting the existing architecture and maintaining the high code quality standards of the project. <sub>View full conversation</sub>
c
Sounds good to me!