Struct ru_openai::api::OpenAIApi

source ·
pub struct OpenAIApi { /* private fields */ }

Implementations§

source§

impl OpenAIApi

source

pub fn new(configuration: Configuration) -> Self

source

pub async fn list_models(self) -> Result<ListModelsResponse, Error>

source

pub async fn retrieve_model( self, model: String ) -> Result<RetrieveModelResponse, Error>

source

pub async fn create_completion( self, request: CreateCompletionRequest ) -> Result<CreateCompletionResponse, Error>

source

pub async fn create_chat_completion( self, request: CreateChatCompletionRequest ) -> Result<CreateChatCompletionResponse, Error>

source

pub async fn create_edit( self, request: CreateEditRequest ) -> Result<CreateEditResponse, Error>

source

pub async fn create_image( self, request: CreateImageRequest ) -> Result<CreateImageResponse, Error>

source

pub async fn create_image_edit( self, request: CreateImageEditRequest ) -> Result<CreateImageEditResponse, Error>

source

pub async fn create_image_variation( self, request: CreateImageVariationRequest ) -> Result<CreateImageVariationResponse, Error>

source

pub async fn create_embeddings( self, request: CreateEmbeddingsRequest ) -> Result<CreateEmbeddingsResponse, Error>

source

pub async fn create_transcription( self, request: CreateTranscriptionRequest ) -> Result<CreateTranscriptionResponse, Error>

source

pub async fn create_translation( self, request: CreateTranslationRequest ) -> Result<CreateTranslationResponse, Error>

source

pub async fn list_files(self) -> Result<ListFilesResponse, Error>

source

pub async fn upload_file( self, request: UploadFileRequest ) -> Result<UploadFileResponse, Error>

source

pub async fn delete_file( self, file_id: String ) -> Result<DeleteFileResponse, Error>

source

pub async fn retrieve_file( self, file_id: String ) -> Result<RetrieveFileResponse, Error>

source

pub async fn retrieve_file_content( self, file_id: String ) -> Result<String, Error>

source

pub async fn create_fine_tune( self, request: CreateFineTuneRequest ) -> Result<CreateFineTuneResponse, Error>

source

pub async fn list_fine_tunes(self) -> Result<ListFineTunesResponse, Error>

source

pub async fn retrieve_fine_tune( self, fine_tune_id: String ) -> Result<RetrieveFineTuneResponse, Error>

source

pub async fn cancel_fine_tune( self, fine_tune_id: String ) -> Result<CancelFineTuneResponse, Error>

source

pub async fn list_fine_tune_events( self, fine_tune_id: String ) -> Result<ListFineTuneEventsResponse, Error>

source

pub async fn delete_fine_tune_model( self, model: String ) -> Result<DeleteFineTuneModelResponse, Error>

source

pub async fn create_moderation( self, request: CreateModerationRequest ) -> Result<CreateModerationResponse, Error>

Auto Trait Implementations§

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
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more