pub struct Client<CTXEXT, FENSLLM, RTRVL> {
pub ensemble_llm_fetcher: Arc<CachingFetcher<CTXEXT, FENSLLM>>,
pub retrieval_client: Arc<RTRVL>,
pub _ctx_ext: PhantomData<CTXEXT>,
}Expand description
Client for Ensemble LLM operations.
Combines a caching fetcher for Ensemble LLM definitions with a retrieval client for listing and usage statistics.
Fields§
§ensemble_llm_fetcher: Arc<CachingFetcher<CTXEXT, FENSLLM>>Caching fetcher for Ensemble LLM definitions.
retrieval_client: Arc<RTRVL>Client for listing Ensemble LLMs and getting usage.
_ctx_ext: PhantomData<CTXEXT>Phantom data for the context extension type.
Implementations§
Source§impl<CTXEXT, FENSLLM, RTRVL> Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> Client<CTXEXT, FENSLLM, RTRVL>
Sourcepub fn new(
ensemble_llm_fetcher: Arc<CachingFetcher<CTXEXT, FENSLLM>>,
retrieval_client: Arc<RTRVL>,
) -> Self
pub fn new( ensemble_llm_fetcher: Arc<CachingFetcher<CTXEXT, FENSLLM>>, retrieval_client: Arc<RTRVL>, ) -> Self
Creates a new Ensemble LLM client.
Source§impl<CTXEXT, FENSLLM, RTRVL> Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> Client<CTXEXT, FENSLLM, RTRVL>
Sourcepub async fn list(
&self,
ctx: Context<CTXEXT>,
) -> Result<ListEnsembleLlm, ResponseError>
pub async fn list( &self, ctx: Context<CTXEXT>, ) -> Result<ListEnsembleLlm, ResponseError>
Lists all Ensemble LLMs.
Sourcepub async fn get(
&self,
ctx: Context<CTXEXT>,
id: &str,
) -> Result<GetEnsembleLlm, ResponseError>
pub async fn get( &self, ctx: Context<CTXEXT>, id: &str, ) -> Result<GetEnsembleLlm, ResponseError>
Retrieves an Ensemble LLM by its ID.
Returns a 404 error if the Ensemble LLM is not found.
Sourcepub async fn get_usage(
&self,
ctx: Context<CTXEXT>,
id: &str,
) -> Result<UsageEnsembleLlm, ResponseError>
pub async fn get_usage( &self, ctx: Context<CTXEXT>, id: &str, ) -> Result<UsageEnsembleLlm, ResponseError>
Retrieves usage statistics for an Ensemble LLM.
Auto Trait Implementations§
impl<CTXEXT, FENSLLM, RTRVL> Freeze for Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> RefUnwindSafe for Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> Send for Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> Sync for Client<CTXEXT, FENSLLM, RTRVL>
impl<CTXEXT, FENSLLM, RTRVL> Unpin for Client<CTXEXT, FENSLLM, RTRVL>where
CTXEXT: Unpin,
impl<CTXEXT, FENSLLM, RTRVL> UnwindSafe for Client<CTXEXT, FENSLLM, RTRVL>
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
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>
Converts
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>
Converts
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