pub struct OpenAIModelOptions {Show 14 fields
pub api: OpenAIApi,
pub model_id: Option<String>,
pub max_tokens: Option<u64>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub context_window_limit: Option<u64>,
pub model_info: Option<ModelInfo>,
pub params: Option<JsonValue>,
pub cache_config: Option<CacheConfig>,
pub frequency_penalty: Option<f64>,
pub presence_penalty: Option<f64>,
pub stateful: Option<bool>,
pub api_key: Option<ApiKey>,
pub client_config: Option<OpenAIClientConfig>,
}Expand description
Options for OpenAIModel::new (OpenAIModelOptions): the API, the OpenAIModelConfig
fields and the client ones.
OpenAIModel::builder builds them and the model in one go; the options’ own builder ends
with build_options.
Fields§
§api: OpenAIApiThe API to stream from. Default OpenAIApi::Responses. Set at construction only.
model_id: Option<String>§max_tokens: Option<u64>§temperature: Option<f64>§top_p: Option<f64>§context_window_limit: Option<u64>§model_info: Option<ModelInfo>§params: Option<JsonValue>§cache_config: Option<CacheConfig>§frequency_penalty: Option<f64>§presence_penalty: Option<f64>§stateful: Option<bool>§api_key: Option<ApiKey>The API key, fixed or from a function called before each request. Defaults to
OPENAI_API_KEY.
client_config: Option<OpenAIClientConfig>How the client reaches the API.
Implementations§
Source§impl OpenAIModelOptions
impl OpenAIModelOptions
Sourcepub fn builder() -> OpenAIModelOptionsBuilder
pub fn builder() -> OpenAIModelOptionsBuilder
Create an instance of OpenAIModelOptions using the builder syntax
Trait Implementations§
Source§impl Clone for OpenAIModelOptions
impl Clone for OpenAIModelOptions
Source§impl Debug for OpenAIModelOptions
impl Debug for OpenAIModelOptions
Source§impl Default for OpenAIModelOptions
impl Default for OpenAIModelOptions
Source§impl From<OpenAIModelConfig> for OpenAIModelOptions
impl From<OpenAIModelConfig> for OpenAIModelOptions
Source§fn from(config: OpenAIModelConfig) -> Self
fn from(config: OpenAIModelConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAIModelOptions
impl !UnwindSafe for OpenAIModelOptions
impl Freeze for OpenAIModelOptions
impl Send for OpenAIModelOptions
impl Sync for OpenAIModelOptions
impl Unpin for OpenAIModelOptions
impl UnsafeUnpin for OpenAIModelOptions
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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.