Skip to main content

ToolProgram

Struct ToolProgram 

Source
pub struct ToolProgram { /* private fields */ }
Expand description

Captured from the effective executing loop, never from a root registry.

Implementations§

Source§

impl ToolProgram

Source

pub fn resolve_result_reference( &self, id: &str, ) -> Result<(AgentToolResult, bool), String>

Resolve native authority only within this owning program’s active lifetime. Usage/names remain in the receipt for inspection but are merged by host accounting, never by the attachment. No transcript calls are synthesized.

Source§

impl ToolProgram

Source

pub fn resolve_content_parts( &self, parts: Vec<ToolProgramContentPart>, ) -> Result<Vec<TextContentOrImage>, String>

Resolve from this invocation’s authentic native store. Count each block before cloning it, including repeated selections, to bound expansion. The serialized array limit is not an RSS ceiling or a retained-tree charge.

Source§

impl ToolProgram

Source

pub fn active_tool_names(&self) -> Vec<String>

Effective names, including this tool, for the existing names-only action.

Source

pub fn cancel_all(&self)

Cancellation stops admission. Cleanup/poll remain available to the binding.

Source

pub fn bind_signal(self: &Arc<Self>, signal: CancellationToken)

Observe driver-local cancellation, without retaining a finished invocation.

Source

pub fn handle( self: &Arc<Self>, args: Value, ) -> BoxFuture<'static, Result<Value, String>>

Auto Trait Implementations§

§

impl !Freeze for ToolProgram

§

impl !RefUnwindSafe for ToolProgram

§

impl !UnwindSafe for ToolProgram

§

impl Forget for ToolProgram

§

impl Move for ToolProgram

§

impl Send for ToolProgram
where Arc<AgentContext>: Send, Arc<AssistantMessage>: Send, RawVecInner: Send, NodeRef<Owned, ThinkingLevel, Option<String>, LeafOrInternal>: Send, BoxRaw<(ThinkingLevel, Option<String>)>: Send, RawTable<usize>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Send, Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Send, Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Send, Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Send, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Send, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Send, Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Send, Arc<dyn Fn() -> usize + Sync + Send>: Send, Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Send, Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Send, Arc<dyn ProviderHooks>: Send, Arc<TreeNode>: Send, Arc<ToolExecutionScope>: Send, Arc<dyn ToolProgramObserver>: Send, Arc<Atomic<usize>>: Send, Mutex<State>: Send, RwLock<()>: Send, Arc<Semaphore>: Send, Atomic<bool>: Send, Arc<Progress>: Send,

§

impl Sync for ToolProgram
where Arc<AgentContext>: Sync, Arc<AssistantMessage>: Sync, RawVecInner: Sync, NodeRef<Owned, ThinkingLevel, Option<String>, LeafOrInternal>: Sync, BoxRaw<(ThinkingLevel, Option<String>)>: Sync, RawTable<usize>: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Sync, Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Sync, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn() -> usize + Sync + Send>: Sync, Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Sync, Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Sync, Arc<dyn ProviderHooks>: Sync, Arc<TreeNode>: Sync, Arc<ToolExecutionScope>: Sync, Arc<dyn ToolProgramObserver>: Sync, Arc<Atomic<usize>>: Sync, Mutex<State>: Sync, RwLock<()>: Sync, Arc<Semaphore>: Sync, Atomic<bool>: Sync, Arc<Progress>: Sync,

§

impl Unpin for ToolProgram
where Arc<AgentContext>: Unpin, Arc<AssistantMessage>: Unpin, *const u8 is !null: Unpin, *const LeafNode<ThinkingLevel, Option<String>> is !null: Unpin, Box<(ThinkingLevel, Option<String>)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Unpin, Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn() -> usize + Sync + Send>: Unpin, Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Unpin, Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Unpin, Arc<dyn ProviderHooks>: Unpin, Arc<TreeNode>: Unpin, Arc<ToolExecutionScope>: Unpin, Arc<dyn ToolProgramObserver>: Unpin, Arc<Atomic<usize>>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, *const LeafNode<String, SetValZST> is !null: Unpin, Box<(String, SetValZST)>: Unpin, Arc<str>: Unpin, Box<str>: Unpin, Arc<Semaphore>: Unpin, *const Waiter is !null: Unpin, Align8<usize>: Unpin, Arc<Progress>: Unpin,

§

impl UnsafeUnpin for ToolProgram
where *const ArcInner<AgentContext> is !null: UnsafeUnpin, PhantomData<ArcInner<AgentContext>>: UnsafeUnpin, *const ArcInner<AssistantMessage> is !null: UnsafeUnpin, PhantomData<ArcInner<AssistantMessage>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const LeafNode<ThinkingLevel, Option<String>> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(ThinkingLevel, Option<String>)>>: UnsafeUnpin, PhantomData<InputModality>: UnsafeUnpin, PhantomData<ModelCostTier>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<Bucket<String, Value>>: UnsafeUnpin, *const LeafNode<String, String> is !null: UnsafeUnpin, PhantomData<Box<(String, String)>>: UnsafeUnpin, PhantomData<Value>: UnsafeUnpin, *const ArcInner<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn() -> usize + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn() -> usize + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn ProviderHooks> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn ProviderHooks>>: UnsafeUnpin, *const ArcInner<TreeNode> is !null: UnsafeUnpin, PhantomData<ArcInner<TreeNode>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, *const ArcInner<ToolExecutionScope> is !null: UnsafeUnpin, PhantomData<ArcInner<ToolExecutionScope>>: UnsafeUnpin, *const ArcInner<dyn ToolProgramObserver> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn ToolProgramObserver>>: UnsafeUnpin, *const ArcInner<Atomic<usize>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, PhantomData<(String, Request)>: UnsafeUnpin, *const LeafNode<String, SetValZST> is !null: UnsafeUnpin, PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin, PhantomData<(String, Retained)>: UnsafeUnpin, *const Waiter is !null: UnsafeUnpin, Align8<usize>: UnsafeUnpin, *const ArcInner<Semaphore> is !null: UnsafeUnpin, PhantomData<ArcInner<Semaphore>>: UnsafeUnpin, *const ArcInner<Progress> is !null: UnsafeUnpin, PhantomData<ArcInner<Progress>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more