pub struct LanguageModelCallOptions {Show 17 fields
pub prompt: LanguageModelPrompt,
pub stream: Option<bool>,
pub max_output_tokens: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<u32>,
pub stop_sequences: Option<Vec<String>>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub response_format: Option<LanguageModelResponseFormat>,
pub seed: Option<u64>,
pub tools: Option<Vec<LanguageModelTool>>,
pub tool_choice: Option<LanguageModelToolChoice>,
pub include_raw_chunks: Option<bool>,
pub abort_signal: Option<CancellationToken>,
pub headers: Option<HeaderMap>,
pub provider_options: Option<ProviderOptions>,
}Expand description
Options for calling a language model
Fields§
§prompt: LanguageModelPromptThe prompt to send to the language model, which is a sequence of messages from the system, user, assistant, and tools
stream: Option<bool>Whether to stream the response as it’s generated, or return it all at once when complete
max_output_tokens: Option<u32>The maximum number of tokens to generate in the response
temperature: Option<f32>Sampling temperature to use, between 0 and 1
top_p: Option<f32>Top-p (nucleus) sampling probability
top_k: Option<u32>Top-k sampling
stop_sequences: Option<Vec<String>>Stop sequences to end generation when encountered
presence_penalty: Option<f32>Presence penalty to penalize new tokens based on whether they appear in the prompt
frequency_penalty: Option<f32>Frequency penalty to penalize new tokens based on their frequency in the prompt
response_format: Option<LanguageModelResponseFormat>The format of the response
seed: Option<u64>Seed for random number generation
tools: Option<Vec<LanguageModelTool>>Tools available to the language model
tool_choice: Option<LanguageModelToolChoice>The tool choice strategy to use when the model calls a tool
include_raw_chunks: Option<bool>Whether to include raw chunks in the response
abort_signal: Option<CancellationToken>Signal to abort the request
headers: Option<HeaderMap>Custom headers to include in the request
provider_options: Option<ProviderOptions>Provider-specific options that can be used to pass additional information to the provider or control provider-specific behavior
Trait Implementations§
Source§impl Clone for LanguageModelCallOptions
impl Clone for LanguageModelCallOptions
Source§fn clone(&self) -> LanguageModelCallOptions
fn clone(&self) -> LanguageModelCallOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LanguageModelCallOptions
impl RefUnwindSafe for LanguageModelCallOptions
impl Send for LanguageModelCallOptions
impl Sync for LanguageModelCallOptions
impl Unpin for LanguageModelCallOptions
impl UnsafeUnpin for LanguageModelCallOptions
impl UnwindSafe for LanguageModelCallOptions
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> 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>
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