pub struct ExtensionContextBuilder { /* private fields */ }Expand description
Builder for ExtensionContext.
Implementations§
Source§impl ExtensionContextBuilder
impl ExtensionContextBuilder
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Set the session ID.
Sourcepub fn tool_registrar(
self,
registrar: Arc<dyn Fn(ExtensionToolArc) + Send + Sync>,
) -> Self
pub fn tool_registrar( self, registrar: Arc<dyn Fn(ExtensionToolArc) + Send + Sync>, ) -> Self
Set the tool registration callback.
Sourcepub fn message_sender(self, sender: Arc<dyn Fn(&str) + Send + Sync>) -> Self
pub fn message_sender(self, sender: Arc<dyn Fn(&str) + Send + Sync>) -> Self
Set the message sender callback.
Sourcepub fn errors(self, errors: Arc<RwLock<Vec<ExtensionErrorRecord>>>) -> Self
pub fn errors(self, errors: Arc<RwLock<Vec<ExtensionErrorRecord>>>) -> Self
Set the shared error collection.
Sourcepub fn tool_getter(
self,
getter: Arc<dyn Fn() -> Vec<ExtensionToolArc> + Send + Sync>,
) -> Self
pub fn tool_getter( self, getter: Arc<dyn Fn() -> Vec<ExtensionToolArc> + Send + Sync>, ) -> Self
Set the tool getter callback.
Sourcepub fn tool_setter(
self,
setter: Arc<dyn Fn(Vec<ExtensionToolArc>) + Send + Sync>,
) -> Self
pub fn tool_setter( self, setter: Arc<dyn Fn(Vec<ExtensionToolArc>) + Send + Sync>, ) -> Self
Set the tool setter callback.
Sourcepub fn model_setter(self, setter: Arc<dyn Fn(&str) + Send + Sync>) -> Self
pub fn model_setter(self, setter: Arc<dyn Fn(&str) + Send + Sync>) -> Self
Set the model setter callback.
Sourcepub fn thinking_level_setter(
self,
setter: Arc<dyn Fn(&str) + Send + Sync>,
) -> Self
pub fn thinking_level_setter( self, setter: Arc<dyn Fn(&str) + Send + Sync>, ) -> Self
Set the thinking-level setter callback.
Sourcepub fn system_prompt_appender(
self,
appender: Arc<dyn Fn(&str) + Send + Sync>,
) -> Self
pub fn system_prompt_appender( self, appender: Arc<dyn Fn(&str) + Send + Sync>, ) -> Self
Set the system-prompt appender callback.
Sourcepub fn session_name_setter(
self,
setter: Arc<dyn Fn(&str) + Send + Sync>,
) -> Self
pub fn session_name_setter( self, setter: Arc<dyn Fn(&str) + Send + Sync>, ) -> Self
Set the session-name setter callback.
Sourcepub fn session_entries_getter(
self,
getter: Arc<dyn Fn() -> Vec<Value> + Send + Sync>,
) -> Self
pub fn session_entries_getter( self, getter: Arc<dyn Fn() -> Vec<Value> + Send + Sync>, ) -> Self
Set the session-entries getter callback.
Sourcepub fn session_fork(
self,
fork: Arc<dyn Fn(&str) -> Result<String> + Send + Sync>,
) -> Self
pub fn session_fork( self, fork: Arc<dyn Fn(&str) -> Result<String> + Send + Sync>, ) -> Self
Set the session-fork callback.
Sourcepub fn build(self) -> ExtensionContext
pub fn build(self) -> ExtensionContext
Build the ExtensionContext.
Auto Trait Implementations§
impl Freeze for ExtensionContextBuilder
impl !RefUnwindSafe for ExtensionContextBuilder
impl Send for ExtensionContextBuilder
impl Sync for ExtensionContextBuilder
impl Unpin for ExtensionContextBuilder
impl UnsafeUnpin for ExtensionContextBuilder
impl !UnwindSafe for ExtensionContextBuilder
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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