#[non_exhaustive]pub struct CohereOptions {
pub shared: CohereShared,
pub chat: CohereNative,
}Expand description
Cohere’s request options.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.The fields both routes read.
chat: CohereNativeThe fields only the native chat API reads.
Implementations§
Source§impl CohereOptions
impl CohereOptions
Sourcepub fn frequency_penalty(self, penalty: f64) -> Self
pub fn frequency_penalty(self, penalty: f64) -> Self
Penalize tokens by how often they appeared (frequency_penalty,
0.0 to 1.0).
Sourcepub fn presence_penalty(self, penalty: f64) -> Self
pub fn presence_penalty(self, penalty: f64) -> Self
Penalize tokens that appeared at all (presence_penalty, 0.0 to
1.0).
Sourcepub fn citation_mode(self, mode: CitationMode) -> Self
pub fn citation_mode(self, mode: CitationMode) -> Self
How the native API cites the documents (citation_options.mode).
Sourcepub fn safety_mode(self, mode: SafetyMode) -> Self
pub fn safety_mode(self, mode: SafetyMode) -> Self
The safety instruction the native API adds (safety_mode).
Sourcepub fn priority(self, priority: u32) -> Self
pub fn priority(self, priority: u32) -> Self
The request’s queue priority on the native API (priority): lower
is served first, and 0 is the default.
Sourcepub fn top_k(self, top_k: u32) -> Self
pub fn top_k(self, top_k: u32) -> Self
Sample from the top_k most likely tokens on the native API (k,
0 to 500).
Sourcepub fn logprobs(self, logprobs: bool) -> Self
pub fn logprobs(self, logprobs: bool) -> Self
Return each generated token’s log probability on the native API
(logprobs), read back as CohereExtras::logprobs.
Trait Implementations§
Source§impl Clone for CohereOptions
impl Clone for CohereOptions
Source§impl Debug for CohereOptions
impl Debug for CohereOptions
Source§impl Default for CohereOptions
impl Default for CohereOptions
Source§impl ExtensionOptions for CohereOptions
impl ExtensionOptions for CohereOptions
Source§type Ext = CohereExt
type Ext = CohereExt
The provider these options are for: the entry
ProviderOptions::set stores them under. A type that serves as the
Options of several providers names one of them here, and is stored
for the others with ProviderOptions::with.Source§fn unsupported(
&self,
target: &dyn ReplayTarget,
request: &CompletionRequest,
) -> Vec<(&'static str, String)>
fn unsupported( &self, target: &dyn ReplayTarget, request: &CompletionRequest, ) -> Vec<(&'static str, String)>
The fields
target cannot send for request, each a top-level body
key with the reason. Each one set is reported through the request’s
OnUnsupported policy under the
name "<provider>.<section>.<field>". It must not call
options::param, which reads
it. By default every field is sent.Source§impl PartialEq for CohereOptions
impl PartialEq for CohereOptions
Source§impl Serialize for CohereOptions
impl Serialize for CohereOptions
impl StructuralPartialEq for CohereOptions
Auto Trait Implementations§
impl Freeze for CohereOptions
impl RefUnwindSafe for CohereOptions
impl Send for CohereOptions
impl Sync for CohereOptions
impl Unpin for CohereOptions
impl UnsafeUnpin for CohereOptions
impl UnwindSafe for CohereOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.