pub struct FunctionOutputFunction<F> { /* private fields */ }Expand description
Function-backed output function.
Implementations§
Source§impl<F> FunctionOutputFunction<F>
impl<F> FunctionOutputFunction<F>
Sourcepub const fn new(definition: OutputFunctionDefinition, function: F) -> Self
pub const fn new(definition: OutputFunctionDefinition, function: F) -> Self
Build a function-backed output function.
Trait Implementations§
Source§impl<F, Fut> OutputFunction for FunctionOutputFunction<F>where
F: Send + Sync + Fn(OutputFunctionContext, Value) -> Fut,
Fut: Send + Future<Output = OutputValidationResult<OutputValue>>,
impl<F, Fut> OutputFunction for FunctionOutputFunction<F>where
F: Send + Sync + Fn(OutputFunctionContext, Value) -> Fut,
Fut: Send + Future<Output = OutputValidationResult<OutputValue>>,
Source§fn definition(&self) -> OutputFunctionDefinition
fn definition(&self) -> OutputFunctionDefinition
Output function definition exposed to the model.
Source§fn call<'life0, 'async_trait>(
&'life0 self,
context: OutputFunctionContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = OutputValidationResult<OutputValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
context: OutputFunctionContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = OutputValidationResult<OutputValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the output function with model-provided arguments. Read more
Auto Trait Implementations§
impl<F> Freeze for FunctionOutputFunction<F>where
F: Freeze,
impl<F> RefUnwindSafe for FunctionOutputFunction<F>where
F: RefUnwindSafe,
impl<F> Send for FunctionOutputFunction<F>where
F: Send,
impl<F> Sync for FunctionOutputFunction<F>where
F: Sync,
impl<F> Unpin for FunctionOutputFunction<F>where
F: Unpin,
impl<F> UnsafeUnpin for FunctionOutputFunction<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FunctionOutputFunction<F>where
F: UnwindSafe,
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