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

Method stream

core/src/agent_api.rs:790–796  ·  view source on GitHub ↗

Send a prompt and stream events back. When `history` is `None`, uses the session's internal history and updates it when the stream completes. When `Some`, uses the provided history instead. If the prompt starts with `/`, it is dispatched as a slash command and the result is emitted as a single `TextDelta` + `End` event.

(
        &self,
        prompt: &str,
        history: Option<&[Message]>,
    )

Source from the content-addressed store, hash-verified

788 /// If the prompt starts with `/`, it is dispatched as a slash command
789 /// and the result is emitted as a single `TextDelta` + `End` event.
790 pub async fn stream(
791 &self,
792 prompt: &str,
793 history: Option<&[Message]>,
794 ) -> Result<(mpsc::Receiver<AgentEvent>, JoinHandle<()>)> {
795 conversation_runtime::stream(self, prompt, history).await
796 }
797
798 /// Cancel the current ongoing operation (send/stream).
799 ///

Calls 1

streamFunction · 0.85