pub struct Client<CTXEXT, FVVOTE, FCVOTE> {
pub completion_votes_fetcher: Arc<FVVOTE>,
pub cache_vote_fetcher: Arc<FCVOTE>,
/* private fields */
}Expand description
Client for retrieving cached votes.
Fields§
§completion_votes_fetcher: Arc<FVVOTE>Fetcher for votes from historical completions.
cache_vote_fetcher: Arc<FCVOTE>Fetcher for votes from the global cache.
Implementations§
Source§impl<CTXEXT, FVVOTE, FCVOTE> Client<CTXEXT, FVVOTE, FCVOTE>
impl<CTXEXT, FVVOTE, FCVOTE> Client<CTXEXT, FVVOTE, FCVOTE>
Sourcepub async fn fetch_completion_votes(
&self,
ctx: Context<CTXEXT>,
id: &str,
) -> Result<CompletionVotes, ResponseError>
pub async fn fetch_completion_votes( &self, ctx: Context<CTXEXT>, id: &str, ) -> Result<CompletionVotes, ResponseError>
Retrieves all votes from a historical vector completion.
Sourcepub async fn fetch_cache_vote(
&self,
ctx: Context<CTXEXT>,
model: &Model,
models: Option<&[Model]>,
messages: &[Message],
tools: Option<&[Tool]>,
responses: &[RichContent],
) -> Result<CacheVote, ResponseError>
pub async fn fetch_cache_vote( &self, ctx: Context<CTXEXT>, model: &Model, models: Option<&[Model]>, messages: &[Message], tools: Option<&[Tool]>, responses: &[RichContent], ) -> Result<CacheVote, ResponseError>
Requests a vote from the global ObjectiveAI cache.
Returns a cached vote if one exists for the given model, messages, tools, and responses.
Trait Implementations§
Auto Trait Implementations§
impl<CTXEXT, FVVOTE, FCVOTE> Freeze for Client<CTXEXT, FVVOTE, FCVOTE>
impl<CTXEXT, FVVOTE, FCVOTE> RefUnwindSafe for Client<CTXEXT, FVVOTE, FCVOTE>
impl<CTXEXT, FVVOTE, FCVOTE> Send for Client<CTXEXT, FVVOTE, FCVOTE>
impl<CTXEXT, FVVOTE, FCVOTE> Sync for Client<CTXEXT, FVVOTE, FCVOTE>
impl<CTXEXT, FVVOTE, FCVOTE> Unpin for Client<CTXEXT, FVVOTE, FCVOTE>where
CTXEXT: Unpin,
impl<CTXEXT, FVVOTE, FCVOTE> UnwindSafe for Client<CTXEXT, FVVOTE, FCVOTE>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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