pub struct TaskEngine { /* private fields */ }Expand description
Runs model tasks. Cheap to clone; shared by every turn.
Implementations§
Source§impl TaskEngine
impl TaskEngine
Sourcepub fn builder(router: Arc<dyn ProviderRouter>) -> TaskEngineBuilder
pub fn builder(router: Arc<dyn ProviderRouter>) -> TaskEngineBuilder
An engine over router with the shipped profiles.
Sourcepub const fn profiles(&self) -> &TaskProfiles
pub const fn profiles(&self) -> &TaskProfiles
The profiles in force.
Sourcepub fn profile(&self, scope: &TaskScope, kind: TaskKind) -> TaskProfile
pub fn profile(&self, scope: &TaskScope, kind: TaskKind) -> TaskProfile
The profile kind runs under in scope: the scope’s, else the engine’s.
Sourcepub async fn run<T: ModelTask>(
&self,
scope: &TaskScope,
call: TaskCall<'_>,
task: &T,
input: &T::Input,
) -> TaskOutcome<T::Output>
pub async fn run<T: ModelTask>( &self, scope: &TaskScope, call: TaskCall<'_>, task: &T, input: &T::Input, ) -> TaskOutcome<T::Output>
Runs task on input.
Sourcepub async fn run_with_feedback<T: ModelTask>(
&self,
scope: &TaskScope,
call: TaskCall<'_>,
task: &T,
input: &T::Input,
previous: &T::Output,
feedback: &str,
) -> TaskOutcome<T::Output>
pub async fn run_with_feedback<T: ModelTask>( &self, scope: &TaskScope, call: TaskCall<'_>, task: &T, input: &T::Input, previous: &T::Output, feedback: &str, ) -> TaskOutcome<T::Output>
Runs task again after previous was found wanting, telling the model why.
For a semantic check made by another task (a verifier) and not by check.
Trait Implementations§
Source§impl Clone for TaskEngine
impl Clone for TaskEngine
Auto Trait Implementations§
impl !RefUnwindSafe for TaskEngine
impl !UnwindSafe for TaskEngine
impl Freeze for TaskEngine
impl Send for TaskEngine
impl Sync for TaskEngine
impl Unpin for TaskEngine
impl UnsafeUnpin for TaskEngine
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