pub struct AzureOpenAiConfig {
pub api_key: String,
pub resource_name: String,
pub deployment_name: String,
pub api_version: String,
pub max_tokens: Option<u32>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub stop: Option<Vec<String>>,
}Expand description
Configuration for Azure OpenAI chat completions.
Fields§
§api_key: String§resource_name: String§deployment_name: String§api_version: String§max_tokens: Option<u32>§temperature: Option<f64>§top_p: Option<f64>§stop: Option<Vec<String>>Implementations§
Source§impl AzureOpenAiConfig
impl AzureOpenAiConfig
Sourcepub fn new(
api_key: impl Into<String>,
resource_name: impl Into<String>,
deployment_name: impl Into<String>,
) -> Self
pub fn new( api_key: impl Into<String>, resource_name: impl Into<String>, deployment_name: impl Into<String>, ) -> Self
Create a new Azure OpenAI config.
The deployment_name typically corresponds to the model you deployed
(e.g. "gpt-4", "gpt-4o").
pub fn with_api_version(self, version: impl Into<String>) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_temperature(self, temperature: f64) -> Self
pub fn with_top_p(self, top_p: f64) -> Self
pub fn with_stop(self, stop: Vec<String>) -> Self
Trait Implementations§
Source§impl Clone for AzureOpenAiConfig
impl Clone for AzureOpenAiConfig
Source§fn clone(&self) -> AzureOpenAiConfig
fn clone(&self) -> AzureOpenAiConfig
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 moreAuto Trait Implementations§
impl Freeze for AzureOpenAiConfig
impl RefUnwindSafe for AzureOpenAiConfig
impl Send for AzureOpenAiConfig
impl Sync for AzureOpenAiConfig
impl Unpin for AzureOpenAiConfig
impl UnsafeUnpin for AzureOpenAiConfig
impl UnwindSafe for AzureOpenAiConfig
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