#[non_exhaustive]pub struct TurnRunOptions {
pub model: ModelRef,
pub generation: GenerationOptions,
pub cache: CacheDirective,
pub limits: TurnLimits,
pub preparer: Option<Arc<dyn ContextPreparer>>,
pub observer: Option<Arc<RunObserver>>,
}Expand description
Choices fixed for one run; the model must be supplied explicitly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.model: ModelRefModel used by every logical invocation.
generation: GenerationOptionsGeneration parameters used by every logical invocation.
cache: CacheDirectiveProvider cache instruction.
limits: TurnLimitsExecution limits.
preparer: Option<Arc<dyn ContextPreparer>>Optional exclusive material preparation before each invocation.
observer: Option<Arc<RunObserver>>Optional synchronous borrowed observation callback.
Implementations§
Source§impl TurnRunOptions
impl TurnRunOptions
Sourcepub fn new(model: ModelRef) -> Self
pub fn new(model: ModelRef) -> Self
Select a model with default generation, limits and no preparation or observer.
Sourcepub fn with_generation(self, generation: GenerationOptions) -> Self
pub fn with_generation(self, generation: GenerationOptions) -> Self
Replaces the generation parameters used by every invocation.
Sourcepub fn with_cache(self, cache: CacheDirective) -> Self
pub fn with_cache(self, cache: CacheDirective) -> Self
Replaces the provider cache instruction.
Sourcepub fn with_limits(self, limits: TurnLimits) -> Self
pub fn with_limits(self, limits: TurnLimits) -> Self
Replaces the execution limits.
Sourcepub fn with_preparer(self, preparer: Arc<dyn ContextPreparer>) -> Self
pub fn with_preparer(self, preparer: Arc<dyn ContextPreparer>) -> Self
Sets the exclusive material preparation before each invocation.
Sourcepub fn with_observer(self, observer: Arc<RunObserver>) -> Self
pub fn with_observer(self, observer: Arc<RunObserver>) -> Self
Sets the synchronous borrowed observation callback.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TurnRunOptions
impl !UnwindSafe for TurnRunOptions
impl Freeze for TurnRunOptions
impl Send for TurnRunOptions
impl Sync for TurnRunOptions
impl Unpin for TurnRunOptions
impl UnsafeUnpin for TurnRunOptions
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