pub struct Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> {
pub chat_client: Arc<Client<CTXEXT, FENSLLM, CUSG>>,
pub ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>,
pub vector_client: Arc<Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG>>,
pub function_fetcher: Arc<FFN>,
pub profile_fetcher: Arc<FPFL>,
pub usage_handler: Arc<FUSG>,
}Expand description
Client for executing Functions.
Orchestrates Function execution by flattening the Function and Profile into executable tasks and running them (Vector Completions or nested Functions) with streaming output support.
Fields§
§chat_client: Arc<Client<CTXEXT, FENSLLM, CUSG>>Chat completions client for reasoning summaries.
ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>Fetcher for Ensemble definitions.
vector_client: Arc<Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG>>Vector completions client for executing Vector Completion tasks.
function_fetcher: Arc<FFN>Fetcher for Function definitions.
profile_fetcher: Arc<FPFL>Fetcher for Profile definitions.
usage_handler: Arc<FUSG>Handler for recording usage after execution.
Implementations§
Source§impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
Sourcepub fn new(
chat_client: Arc<Client<CTXEXT, FENSLLM, CUSG>>,
ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>,
vector_client: Arc<Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG>>,
function_fetcher: Arc<FFN>,
profile_fetcher: Arc<FPFL>,
usage_handler: Arc<FUSG>,
) -> Self
pub fn new( chat_client: Arc<Client<CTXEXT, FENSLLM, CUSG>>, ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>, vector_client: Arc<Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG>>, function_fetcher: Arc<FFN>, profile_fetcher: Arc<FPFL>, usage_handler: Arc<FUSG>, ) -> Self
Creates a new Function execution client.
Source§impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>where
CTXEXT: ContextExt + Send + Sync + 'static,
FENSLLM: Fetcher<CTXEXT> + Send + Sync + 'static,
CUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FENS: Fetcher<CTXEXT> + Send + Sync + 'static,
FVVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
FCVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
VUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FFN: Fetcher<CTXEXT> + Send + Sync + 'static,
FPFL: Fetcher<CTXEXT> + Send + Sync + 'static,
FUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>where
CTXEXT: ContextExt + Send + Sync + 'static,
FENSLLM: Fetcher<CTXEXT> + Send + Sync + 'static,
CUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FENS: Fetcher<CTXEXT> + Send + Sync + 'static,
FVVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
FCVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
VUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FFN: Fetcher<CTXEXT> + Send + Sync + 'static,
FPFL: Fetcher<CTXEXT> + Send + Sync + 'static,
FUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
Sourcepub async fn create_unary_handle_usage(
self: Arc<Self>,
ctx: Context<CTXEXT>,
request: Arc<Request>,
) -> Result<FunctionExecution, Error>
pub async fn create_unary_handle_usage( self: Arc<Self>, ctx: Context<CTXEXT>, request: Arc<Request>, ) -> Result<FunctionExecution, Error>
Executes a Function and returns the complete response.
Collects the full streaming response and records usage.
Sourcepub async fn create_streaming_handle_usage(
self: Arc<Self>,
ctx: Context<CTXEXT>,
request: Arc<Request>,
) -> Result<impl Stream<Item = FunctionExecutionChunk> + Send + Unpin + 'static, Error>
pub async fn create_streaming_handle_usage( self: Arc<Self>, ctx: Context<CTXEXT>, request: Arc<Request>, ) -> Result<impl Stream<Item = FunctionExecutionChunk> + Send + Unpin + 'static, Error>
Executes a Function with streaming output and records usage.
Streams chunks as they become available and records usage after completion.
Source§impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>where
CTXEXT: ContextExt + Send + Sync + 'static,
FENSLLM: Fetcher<CTXEXT> + Send + Sync + 'static,
CUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FENS: Fetcher<CTXEXT> + Send + Sync + 'static,
FVVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
FCVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
VUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FFN: Fetcher<CTXEXT> + Send + Sync + 'static,
FPFL: Fetcher<CTXEXT> + Send + Sync + 'static,
FUSG: Send + Sync + 'static,
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>where
CTXEXT: ContextExt + Send + Sync + 'static,
FENSLLM: Fetcher<CTXEXT> + Send + Sync + 'static,
CUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FENS: Fetcher<CTXEXT> + Send + Sync + 'static,
FVVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
FCVOTE: Fetcher<CTXEXT> + Send + Sync + 'static,
VUSG: UsageHandler<CTXEXT> + Send + Sync + 'static,
FFN: Fetcher<CTXEXT> + Send + Sync + 'static,
FPFL: Fetcher<CTXEXT> + Send + Sync + 'static,
FUSG: Send + Sync + 'static,
Sourcepub async fn create_streaming(
self: Arc<Self>,
ctx: Context<CTXEXT>,
request: Arc<Request>,
) -> Result<impl Stream<Item = FunctionExecutionChunk> + Send + 'static, Error>
pub async fn create_streaming( self: Arc<Self>, ctx: Context<CTXEXT>, request: Arc<Request>, ) -> Result<impl Stream<Item = FunctionExecutionChunk> + Send + 'static, Error>
Executes a Function with streaming output.
Fetches the Function and Profile, flattens them into tasks, and executes all tasks with streaming output. Handles reasoning summaries if requested.
Auto Trait Implementations§
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Freeze for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> !RefUnwindSafe for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Send for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Sync for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> Unpin for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
impl<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG> !UnwindSafe for Client<CTXEXT, FENSLLM, CUSG, FENS, FVVOTE, FCVOTE, VUSG, FFN, FPFL, FUSG>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more