Struct OpenAI

Source
pub struct OpenAI {
    pub completion_body: ChatCompletionRequestBody,
    /* private fields */
}

Fields§

§completion_body: ChatCompletionRequestBody

Implementations§

Source§

impl OpenAI

Source

pub fn new() -> Self

Source

pub fn model_id(&mut self, model_id: String) -> &mut Self

Source

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

Source

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

Source

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

Source

pub fn logit_bias(&mut self, logit_bias: FxHashMap<String, i32>) -> &mut Self

Source

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

Source

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

Source

pub fn max_completion_tokens(&mut self, max_completion_tokens: u64) -> &mut Self

Source

pub fn n(&mut self, n: u32) -> &mut Self

Source

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

Source

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

Source

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

Source

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

Source

pub fn chat(&mut self) -> Result<Response>

Auto Trait Implementations§

§

impl Freeze for OpenAI

§

impl RefUnwindSafe for OpenAI

§

impl Send for OpenAI

§

impl Sync for OpenAI

§

impl Unpin for OpenAI

§

impl UnwindSafe for OpenAI

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.