pub struct ChatBuilder { /* private fields */ }Expand description
A chat request with optional registered tools, executed when awaited.
Implementations§
Source§impl ChatBuilder
impl ChatBuilder
Sourcepub fn with_tool<T, F, Fut>(self, handler: F) -> Selfwhere
T: ToolSchema + DeserializeOwned + Send + 'static,
F: Fn(T) -> Fut + Send + Sync + 'static,
Fut: Future<Output = LlmResult<String>> + Send + 'static,
pub fn with_tool<T, F, Fut>(self, handler: F) -> Selfwhere
T: ToolSchema + DeserializeOwned + Send + 'static,
F: Fn(T) -> Fut + Send + Sync + 'static,
Fut: Future<Output = LlmResult<String>> + Send + 'static,
Register a typed tool and its async handler.
The tool’s name, description, and JSON Schema come from T’s
ToolSchema impl; the handler receives the deserialized input.
Trait Implementations§
Source§impl IntoFuture for ChatBuilder
impl IntoFuture for ChatBuilder
Source§type Output = Result<ChatResponse, LlmError>
type Output = Result<ChatResponse, LlmError>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<ChatResponse, LlmError>> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<ChatResponse, LlmError>> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ChatBuilder
impl !UnwindSafe for ChatBuilder
impl Freeze for ChatBuilder
impl Send for ChatBuilder
impl Sync for ChatBuilder
impl Unpin for ChatBuilder
impl UnsafeUnpin for ChatBuilder
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