pub(crate) struct ToolCallOutputContract {
tools: Vec<Tool>,
pub(crate) enforce_declared_names: bool,
}Expand description
Parameter names and declared types gathered from the request’s tool schemas. Guidance only: schemas never validate the whole call.
Fields§
§tools: Vec<Tool>§enforce_declared_names: boolModel-emitted names must match a declared tool. Set whenever tool definitions are present.
Implementations§
Source§impl ToolCallOutputContract
impl ToolCallOutputContract
Sourcepub(crate) fn from_tools(tools: &[Value]) -> Arc<Self>
pub(crate) fn from_tools(tools: &[Value]) -> Arc<Self>
Build the terminal contract from shaped tool definitions. A name declared with conflicting schemas loses type guidance and falls back to legacy text.
Sourcefn find_tool(&self, name: &str) -> Option<&Tool>
fn find_tool(&self, name: &str) -> Option<&Tool>
Structural guidance for a call. None when the name is unknown or was
declared with conflicting schemas.
fn is_declared(&self, name: &str) -> bool
Trait Implementations§
Source§impl Clone for ToolCallOutputContract
impl Clone for ToolCallOutputContract
Source§fn clone(&self) -> ToolCallOutputContract
fn clone(&self) -> ToolCallOutputContract
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 ToolCallOutputContract
impl Debug for ToolCallOutputContract
Source§impl Default for ToolCallOutputContract
impl Default for ToolCallOutputContract
Source§fn default() -> ToolCallOutputContract
fn default() -> ToolCallOutputContract
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolCallOutputContract
impl RefUnwindSafe for ToolCallOutputContract
impl Send for ToolCallOutputContract
impl Sync for ToolCallOutputContract
impl Unpin for ToolCallOutputContract
impl UnsafeUnpin for ToolCallOutputContract
impl UnwindSafe for ToolCallOutputContract
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more