pub struct ChatRunner { /* private fields */ }Expand description
Shared runner for provider adapters that differ only by wire dialect.
Implementations§
Source§impl ChatRunner
impl ChatRunner
Sourcepub fn new(system: &'static str, default_model: impl Into<String>) -> Self
pub fn new(system: &'static str, default_model: impl Into<String>) -> Self
Create a runner with the provider system name and default model.
Sourcepub fn with_policy(self, policy: Policy) -> Self
pub fn with_policy(self, policy: Policy) -> Self
Inject a resilience policy for outbound completion requests.
Sourcepub async fn complete<F, Fut>(
&self,
req: CompletionRequest,
complete_once: F,
) -> AppResult<CompletionResponse>where
F: Fn(CompletionRequest) -> Fut + Send + Sync,
Fut: Future<Output = AppResult<CompletionResponse>> + Send,
pub async fn complete<F, Fut>(
&self,
req: CompletionRequest,
complete_once: F,
) -> AppResult<CompletionResponse>where
F: Fn(CompletionRequest) -> Fut + Send + Sync,
Fut: Future<Output = AppResult<CompletionResponse>> + Send,
Complete a request using provider-specific wire conversion.
Trait Implementations§
Source§impl Clone for ChatRunner
impl Clone for ChatRunner
Source§fn clone(&self) -> ChatRunner
fn clone(&self) -> ChatRunner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ChatRunner
impl !UnwindSafe for ChatRunner
impl Freeze for ChatRunner
impl Send for ChatRunner
impl Sync for ChatRunner
impl Unpin for ChatRunner
impl UnsafeUnpin for ChatRunner
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