pub struct CompletionOptions {Show 21 fields
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub top_p: Option<f32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
pub stop: Option<Vec<String>>,
pub stream: bool,
pub tools: Option<Vec<Tool>>,
pub tool_choice: Option<ToolChoice>,
pub user: Option<String>,
pub seed: Option<i32>,
pub n: Option<u32>,
pub logprobs: Option<bool>,
pub top_logprobs: Option<u32>,
pub api_base: Option<String>,
pub api_key: Option<String>,
pub organization: Option<String>,
pub api_version: Option<String>,
pub headers: Option<HashMap<String, String>>,
pub timeout: Option<u64>,
pub extra_params: HashMap<String, Value>,
}Expand description
Completion options - Python LiteLLM compatible
Fields§
§temperature: Option<f32>§max_tokens: Option<u32>§top_p: Option<f32>§frequency_penalty: Option<f32>§presence_penalty: Option<f32>§stop: Option<Vec<String>>§stream: bool§tools: Option<Vec<Tool>>§tool_choice: Option<ToolChoice>§user: Option<String>§seed: Option<i32>§n: Option<u32>§logprobs: Option<bool>§top_logprobs: Option<u32>§api_base: Option<String>Custom API base URL - overrides provider’s default base URL
api_key: Option<String>Custom API key - overrides provider’s default API key
organization: Option<String>Custom organization ID (for OpenAI)
api_version: Option<String>Custom API version (for Azure)
headers: Option<HashMap<String, String>>Custom headers to add to the request
timeout: Option<u64>Timeout in seconds for the request
extra_params: HashMap<String, Value>Trait Implementations§
Source§impl Clone for CompletionOptions
impl Clone for CompletionOptions
Source§fn clone(&self) -> CompletionOptions
fn clone(&self) -> CompletionOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionOptions
impl Debug for CompletionOptions
Source§impl Default for CompletionOptions
impl Default for CompletionOptions
Source§fn default() -> CompletionOptions
fn default() -> CompletionOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompletionOptions
impl<'de> Deserialize<'de> for CompletionOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompletionOptions
impl RefUnwindSafe for CompletionOptions
impl Send for CompletionOptions
impl Sync for CompletionOptions
impl Unpin for CompletionOptions
impl UnwindSafe for CompletionOptions
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> CacheValue for T
impl<T> CacheValue for T
Source§fn from_bytes(bytes: &[u8]) -> Result<T, CacheError>
fn from_bytes(bytes: &[u8]) -> Result<T, CacheError>
Deserialize from bytes
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Injectable for T
impl<T> Injectable for 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>
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 moreCreates a shared type from an unshared type.