pub struct HostChannelAdapter { /* private fields */ }Expand description
Delivers a message by asking the host to do it.
Implementations§
Source§impl HostChannelAdapter
impl HostChannelAdapter
Sourcepub fn new(executor: Arc<dyn ToolExecutor>) -> Self
pub fn new(executor: Arc<dyn ToolExecutor>) -> Self
Wrap the session’s composed tool executor — the same one the runtime dispatches ordinary tool calls to, so the host sees this callback on the channel it is already serving.
Trait Implementations§
Source§impl OutboundAdapter for HostChannelAdapter
impl OutboundAdapter for HostChannelAdapter
Source§fn channel(&self) -> &str
fn channel(&self) -> &str
The channel name this adapter answers to (matched against
OutboundMessage::channel).Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
msg: &'life1 OutboundMessage,
) -> Pin<Box<dyn Future<Output = Result<MessageReceipt, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
msg: &'life1 OutboundMessage,
) -> Pin<Box<dyn Future<Output = Result<MessageReceipt, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deliver one message, or explain why it was not delivered. The error
text reaches the model as the tool’s error, so it should say what would
make the send work.
Auto Trait Implementations§
impl !RefUnwindSafe for HostChannelAdapter
impl !UnwindSafe for HostChannelAdapter
impl Freeze for HostChannelAdapter
impl Send for HostChannelAdapter
impl Sync for HostChannelAdapter
impl Unpin for HostChannelAdapter
impl UnsafeUnpin for HostChannelAdapter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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