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]>,
)
| 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 | /// |