pub struct CompletionRequestBuilder { /* private fields */ }
Implementations§
Source§impl CompletionRequestBuilder
impl CompletionRequestBuilder
pub fn new() -> Self
Sourcepub fn model(self, value: impl Into<String>) -> Self
pub fn model(self, value: impl Into<String>) -> Self
Sets the model
field with automatic conversion using Into<String>
.
Sourcepub fn prompt(self, value: impl Into<String>) -> Self
pub fn prompt(self, value: impl Into<String>) -> Self
Sets the prompt
field with automatic conversion using Into<String>
.
Sourcepub fn max_tokens(self, value: u32) -> Self
pub fn max_tokens(self, value: u32) -> Self
Sets the max_tokens
field directly.
Sourcepub fn temperature(self, value: f64) -> Self
pub fn temperature(self, value: f64) -> Self
Sets the temperature
field directly.
Sourcepub fn frequency_penalty(self, value: f64) -> Self
pub fn frequency_penalty(self, value: f64) -> Self
Sets the frequency_penalty
field directly.
Sourcepub fn presence_penalty(self, value: f64) -> Self
pub fn presence_penalty(self, value: f64) -> Self
Sets the presence_penalty
field directly.
Sourcepub fn repetition_penalty(self, value: f64) -> Self
pub fn repetition_penalty(self, value: f64) -> Self
Sets the repetition_penalty
field directly.
Sourcepub fn logit_bias(self, value: HashMap<String, f64>) -> Self
pub fn logit_bias(self, value: HashMap<String, f64>) -> Self
Sets the logit_bias
field directly.
Sourcepub fn top_logprobs(self, value: u32) -> Self
pub fn top_logprobs(self, value: u32) -> Self
Sets the top_logprobs
field directly.
Sourcepub fn transforms(self, value: Vec<String>) -> Self
pub fn transforms(self, value: Vec<String>) -> Self
Sets the transforms
field directly.
Sourcepub fn provider(self, value: ProviderPreferences) -> Self
pub fn provider(self, value: ProviderPreferences) -> Self
Sets the provider
field directly.
Sourcepub fn reasoning(self, value: ReasoningConfig) -> Self
pub fn reasoning(self, value: ReasoningConfig) -> Self
Sets the reasoning
field directly.
pub fn build(self) -> Result<CompletionRequest, OpenRouterError>
Trait Implementations§
Source§impl Default for CompletionRequestBuilder
impl Default for CompletionRequestBuilder
Source§fn default() -> CompletionRequestBuilder
fn default() -> CompletionRequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompletionRequestBuilder
impl RefUnwindSafe for CompletionRequestBuilder
impl Send for CompletionRequestBuilder
impl Sync for CompletionRequestBuilder
impl Unpin for CompletionRequestBuilder
impl UnwindSafe for CompletionRequestBuilder
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