pub struct OpenAI {
    pub auth: Auth,
    pub api_url: String,
    /* private fields */
}

Fields§

§auth: Auth§api_url: String

Implementations§

source§

impl OpenAI

source

pub fn new(auth: Auth, api_url: &str) -> OpenAI

source

pub fn set_proxy(self, proxy: &str) -> OpenAI

source

pub fn use_env_proxy(self) -> OpenAI

Trait Implementations§

source§

impl AudioApi for OpenAI

source§

fn audio_transcription_create(&self, audio_body: AudioBody) -> ApiResult<Audio>

Transcribes audio into the input language.
source§

fn audio_translation_create(&self, audio_body: AudioBody) -> ApiResult<Audio>

Translates audio into into English.
source§

impl ChatApi for OpenAI

source§

fn chat_completion_create(&self, chat_body: &ChatBody) -> ApiResult<Completion>

Creates a completion for the chat message
source§

impl Clone for OpenAI

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CompletionsApi for OpenAI

source§

fn completion_create( &self, completions_body: &CompletionsBody ) -> ApiResult<Completion>

Creates a completion for the provided prompt and parameters
source§

impl Debug for OpenAI

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EditsApi for OpenAI

source§

fn edit_create(&self, chat_body: &EditsBody) -> ApiResult<Completion>

Creates a new edit for the provided input, instruction, and parameters.
source§

impl EmbeddingsApi for OpenAI

source§

fn embeddings_create( &self, embeddings_body: &EmbeddingsBody ) -> ApiResult<Embeddings>

Creates an embedding vector representing the input text.
source§

impl ImagesApi for OpenAI

source§

fn image_create(&self, images_body: &ImagesBody) -> ApiResult<Images>

Given a prompt and/or an input image, the model will generate a new image.
source§

fn image_edit(&self, images_edit_body: ImagesEditBody) -> ApiResult<Images>

Creates an edited or extended image given an original image and a prompt.
source§

fn image_variation(&self, images_edit_body: ImagesEditBody) -> ApiResult<Images>

Creates a variation of a given image.
source§

impl ModelsApi for OpenAI

source§

fn models_list(&self) -> ApiResult<Vec<Model>>

Lists the currently available models, and provides basic information about each one such as the owner and availability.
source§

fn models_retrieve(&self, model_id: &str) -> ApiResult<Model>

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for Twhere T: Any + Clone,

§

fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global>where T: Send,

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global>where T: Sync,

§

fn clone_any_send_sync( &self ) -> Box<dyn CloneAny + Send + Sync + 'static, Global>where T: Send + Sync,

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<T> Typeable for Twhere T: Any,

§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> DebugAny for Twhere T: Any + Debug,

§

impl<T> UnsafeAny for Twhere T: Any,