pub struct StatelessExecutor { /* private fields */ }Expand description
Stateless executor for single LLM requests without session state. Safe for concurrent use - multiple tasks can call execute simultaneously.
Implementations§
Source§impl StatelessExecutor
impl StatelessExecutor
Sourcepub fn new(config: StatelessConfig) -> Result<Self, StatelessError>
pub fn new(config: StatelessConfig) -> Result<Self, StatelessError>
Creates a new stateless executor with the given configuration.
Sourcepub async fn execute(
&self,
input: &str,
options: Option<RequestOptions>,
) -> Result<StatelessResult, StatelessError>
pub async fn execute( &self, input: &str, options: Option<RequestOptions>, ) -> Result<StatelessResult, StatelessError>
Sends a single request to the LLM and waits for the complete response. This is the simplest API - use execute_stream for progress feedback.
Sourcepub async fn execute_stream(
&self,
input: &str,
callback: StreamCallback,
options: Option<RequestOptions>,
cancel_token: Option<CancellationToken>,
) -> Result<StatelessResult, StatelessError>
pub async fn execute_stream( &self, input: &str, callback: StreamCallback, options: Option<RequestOptions>, cancel_token: Option<CancellationToken>, ) -> Result<StatelessResult, StatelessError>
Sends a request and streams the response via callback. The callback is called for each text chunk as it arrives. Returns the complete Result after streaming finishes.
Auto Trait Implementations§
impl Freeze for StatelessExecutor
impl !RefUnwindSafe for StatelessExecutor
impl Send for StatelessExecutor
impl Sync for StatelessExecutor
impl Unpin for StatelessExecutor
impl !UnwindSafe for StatelessExecutor
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> 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