objectiveai-api 2.0.5

ObjectiveAI API Server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Trait for handling Function execution usage.

use crate::ctx;
use std::sync::Arc;

/// Handler for recording usage after Function execution.
#[async_trait::async_trait]
pub trait UsageHandler<CTXEXT> {
    /// Records usage from a completed Function execution.
    async fn handle_usage<PC: crate::ctx::persistent_cache::PersistentCacheClient>(
        &self,
        ctx: ctx::Context<CTXEXT, PC>,
        request: Arc<objectiveai_sdk::functions::executions::request::FunctionExecutionCreateParams>,
        response: objectiveai_sdk::functions::executions::response::unary::FunctionExecution,
    );
}