MCPcopy Create free account
hub / github.com/AI45Lab/Code / stream

Function stream

core/src/agent_api/conversation_runtime.rs:75–89  ·  view source on GitHub ↗
(
    session: &AgentSession,
    prompt: &str,
    history: Option<&[Message]>,
)

Source from the content-addressed store, hash-verified

73}
74
75pub(super) async fn stream(
76 session: &AgentSession,
77 prompt: &str,
78 history: Option<&[Message]>,
79) -> Result<(mpsc::Receiver<AgentEvent>, JoinHandle<()>)> {
80 bail_if_closed(session)?;
81
82 if let Some(stream) = command_runtime::dispatch_streaming(session, prompt).await {
83 return Ok(stream);
84 }
85
86 let input = ConversationInput::from_history(session, history);
87 let stream_run = StreamRunContext::start(session, prompt, input.persistence).await;
88 Ok(stream_run.spawn_with_prompt(input.messages, prompt.to_string()))
89}
90
91/// Resume a previously-checkpointed run on this session (P3 cut 2).
92///

Callers 1

streamMethod · 0.85

Calls 3

bail_if_closedFunction · 0.85
dispatch_streamingFunction · 0.85
spawn_with_promptMethod · 0.80

Tested by

no test coverage detected