pub struct ModelRequest { /* private fields */ }Expand description
Provider-neutral input for one model request.
Implementations§
Source§impl ModelRequest
impl ModelRequest
Sourcepub fn new(prompt: impl Into<String>, schema: OutputSchema) -> Self
pub fn new(prompt: impl Into<String>, schema: OutputSchema) -> Self
Creates a model request whose response must match schema.
Sourcepub fn with_tool(self, tool: ToolDefinition) -> Self
pub fn with_tool(self, tool: ToolDefinition) -> Self
Advertises one native function tool for this request.
Sourcepub fn schema(&self) -> &OutputSchema
pub fn schema(&self) -> &OutputSchema
Returns the schema that the response must match.
Sourcepub fn tools(&self) -> &[ToolDefinition]
pub fn tools(&self) -> &[ToolDefinition]
Returns the native function tools explicitly advertised by the caller.
Trait Implementations§
Source§impl Clone for ModelRequest
impl Clone for ModelRequest
Source§fn clone(&self) -> ModelRequest
fn clone(&self) -> ModelRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelRequest
impl Debug for ModelRequest
impl Eq for ModelRequest
Source§impl PartialEq for ModelRequest
impl PartialEq for ModelRequest
impl StructuralPartialEq for ModelRequest
Auto Trait Implementations§
impl !RefUnwindSafe for ModelRequest
impl !UnwindSafe for ModelRequest
impl Freeze for ModelRequest
impl Send for ModelRequest
impl Sync for ModelRequest
impl Unpin for ModelRequest
impl UnsafeUnpin for ModelRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.