Struct RequestBodyBuilder

Source
pub struct RequestBodyBuilder { /* private fields */ }

Implementations§

Source§

impl RequestBodyBuilder

Source

pub fn new() -> Self

Source

pub fn model(self, model: impl Into<String>) -> Self

Source

pub fn messages(self, messages: Vec<Message>) -> Self

Source

pub fn push_user_message(self, message: impl Into<String>) -> Self

Source

pub fn push_system_message(self, message: impl Into<String>) -> Self

Source

pub fn prepend_system_message(self, message: impl Into<String>) -> Self

Source

pub fn frequency_penalty(self, frequency_penalty: f32) -> Self

Source

pub fn logit_bias(self, logit_bias: HashMap<String, Value>) -> Self

Source

pub fn logprobs(self, logprobs: bool) -> Self

Source

pub fn top_logprobs(self, top_logprobs: u8) -> Self

Source

pub fn max_completion_tokens(self, max_completion_tokens: u32) -> Self

Source

pub fn reasoning_effort(self, reasoning_effort: ReasoningEffort) -> Self

Source

pub fn n(self, n: u8) -> Self

Source

pub fn presence_penalty(self, presence_penalty: f32) -> Self

Source

pub fn response_format(self, response_format: ResponseFormat) -> Self

Source

pub fn seed(self, seed: i64) -> Self

Source

pub fn stop(self, stop: Stop) -> Self

Source

pub fn stream(self, stream: bool) -> Self

Source

pub fn temperature(self, temperature: f32) -> Self

Source

pub fn top_p(self, top_p: f32) -> Self

Source

pub fn tools(self, tools: Vec<Tool>) -> Self

Source

pub fn tool_choice(self, tool_choice: ToolChoice) -> Self

Source

pub fn user(self, user: impl Into<String>) -> Self

Source

pub fn store(self, store: bool) -> Self

Source

pub fn metadata(self, metadata: HashMap<String, Value>) -> Self

Source

pub fn parallel_tool_calls(self, parallel_tool_calls: bool) -> Self

Source

pub fn modalities(self, modalities: Vec<String>) -> Self

Source

pub fn prediction(self, prediction: PredictionConfig) -> Self

Source

pub fn audio(self, audio: AudioConfig) -> Self

Source

pub fn service_tier(self, service_tier: String) -> Self

Source

pub fn stream_options(self, stream_options: StreamOptions) -> Self

Source

pub fn web_search_options(self, web_search_options: WebSearchOptions) -> Self

Source

pub fn build(self) -> RequestBody

Trait Implementations§

Source§

impl Default for RequestBodyBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.