Expand description
AI Agent conversation types and context
Re-exports§
pub use types::*;
Modules§
Structs§
- Agent
Context - AI Agent conversation context.
- Conversation
Stream Iter - A blocking
Iteratorover conversation stream events, backed by a background task on the shared runtime ([crate::runtime_handle]). Useful for sync/FFI bindings that need to pull events one at a time from a plain OS thread instead of polling a [Stream] directly. - Conversation
Stream Subscription - Bridges a conversation event [
Stream] to a Reactive-Streams-style consumer with real backpressure, matchingjava.util.concurrent.Flow.Subscription’srequest(n)/cancel()contract. Only Java’sFlow.Publisherexposure needs this — every other binding either pulls synchronously (conversation_stream_iter) or has no flow control at all (drive_conversation_stream).
Functions§
- conversation_
stream_ iter - Adapt a conversation event [
Stream] into a blockingConversationStreamIter. - drive_
conversation_ stream - Drive a conversation event stream to completion, invoking
on_eventfor every event, and returning the finalConversationResponseonce aConversationStreamEvent::WorkflowFinishedorConversationStreamEvent::HumanInteractionRequiredevent is observed (or an error if the stream ends before either happens). An interrupted run emitsHumanInteractionRequiredinstead ofWorkflowFinished, never both, so exactly one of the two is expected per run.