pub struct SessionBuilder<T, S = Value> { /* private fields */ }Expand description
Builds a Session.
Implementations§
Source§impl<T, S> SessionBuilder<T, S>
impl<T, S> SessionBuilder<T, S>
Sourcepub fn new(transport: T, thread_id: impl Into<ThreadId>) -> Selfwhere
T: Transport,
pub fn new(transport: T, thread_id: impl Into<ThreadId>) -> Selfwhere
T: Transport,
A builder for a conversation over transport.
The one bounded method here: see Session::new for why the check
belongs on the constructor and not on the type.
Sourcepub fn messages(self, messages: impl Into<Vec<Message>>) -> Self
pub fn messages(self, messages: impl Into<Vec<Message>>) -> Self
Seeds the conversation with existing history.
Sourcepub fn tools(self, tools: impl Into<Vec<Tool>>) -> Self
pub fn tools(self, tools: impl Into<Vec<Tool>>) -> Self
Offers tools on every run.
The client’s responsibility, not the agent’s: there is no discovery in AG-UI. See the crate docs.
Sourcepub fn context(self, context: impl Into<Vec<Context>>) -> Self
pub fn context(self, context: impl Into<Vec<Context>>) -> Self
Sets the ambient context entries sent on every run.
Sourcepub fn forwarded_props(self, props: impl Into<Value>) -> Self
pub fn forwarded_props(self, props: impl Into<Value>) -> Self
Sets the passthrough properties sent on every run.
Sourcepub fn verify(self, verify: bool) -> Self
pub fn verify(self, verify: bool) -> Self
Turns protocol verification on or off. On by default.
Off is for producers whose quirks you have decided to live with; the applier stays tolerant either way, so what you lose is the diagnosis, not the conversation.
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for SessionBuilder<T, S>where
T: Freeze,
impl<T, S> RefUnwindSafe for SessionBuilder<T, S>where
T: RefUnwindSafe,
impl<T, S> Send for SessionBuilder<T, S>where
T: Send,
impl<T, S> Sync for SessionBuilder<T, S>where
T: Sync,
impl<T, S> Unpin for SessionBuilder<T, S>where
T: Unpin,
impl<T, S> UnsafeUnpin for SessionBuilder<T, S>where
T: UnsafeUnpin,
impl<T, S> UnwindSafe for SessionBuilder<T, S>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more