pub trait OutputFunction: Send + Sync {
// Required methods
fn definition(&self) -> OutputFunctionDefinition;
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;
}Expand description
Output function called by the model to finish a run.
Required Methods§
Sourcefn definition(&self) -> OutputFunctionDefinition
fn definition(&self) -> OutputFunctionDefinition
Output function definition exposed to the model.
Sourcefn 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.
§Errors
Returns an error when the output function rejects the arguments or fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".