Struct ToolNote
pub struct ToolNote {
pub tool: String,
pub reports_step: bool,
pub timeout_ms: Option<u64>,
pub label: Option<String>,
}Expand description
What a ToolSource says, when it lists a tool, about how a call to it is carried out: not for
the model, for the agent and for the source’s own call later.
The agent keeps the notes of the turn in the run’s state (journaled with the model’s answer), so a call made in a later transition, by another worker, after a restart, reads what the listing said without listing again.
Fields§
§tool: StringThe tool’s name, as listed.
reports_step: boolThe system behind the source reports each call of this tool as a step itself, so the agent reports none of its own (it would be drawn twice).
timeout_ms: Option<u64>The longest the system behind the source lets a call of this tool run, in milliseconds: how long
the source should wait for it, within its own limits. None: the source’s default.
label: Option<String>What the step of a call of this tool is called, when the listing gave the tool a human title
(Search the web for search__web_search). None: the tool’s name. An agent’s own tool
says it with Tool::step_style; this is for a source’s.
Implementations§
§impl ToolNote
impl ToolNote
pub fn new(tool: impl Into<String>) -> ToolNote
pub fn new(tool: impl Into<String>) -> ToolNote
A note for tool that says nothing yet (such a note is not kept).
pub fn with_label(self, label: impl Into<String>) -> ToolNote
pub fn with_label(self, label: impl Into<String>) -> ToolNote
Call the step of this tool’s calls label instead of its name.
pub fn reporting_steps(self) -> ToolNote
pub fn reporting_steps(self) -> ToolNote
The system behind the source reports this tool’s calls as steps.
pub fn with_timeout(self, timeout: Duration) -> ToolNote
pub fn with_timeout(self, timeout: Duration) -> ToolNote
A call of this tool may run timeout at most.
pub fn is_meaningful(&self) -> bool
pub fn is_meaningful(&self) -> bool
Whether the note says anything (a note that does not is not kept).
Trait Implementations§
§impl<'de> Deserialize<'de> for ToolNote
impl<'de> Deserialize<'de> for ToolNote
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolNote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolNote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ToolNote
§impl Serialize for ToolNote
impl Serialize for ToolNote
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ToolNote
Auto Trait Implementations§
impl Freeze for ToolNote
impl RefUnwindSafe for ToolNote
impl Send for ToolNote
impl Sync for ToolNote
impl Unpin for ToolNote
impl UnsafeUnpin for ToolNote
impl UnwindSafe for ToolNote
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].