func assistantCreate(query: AssistantsQuery, completion: @escaping (Result<AssistantResult, Error>) -> Void) -> CancellableRequest
This function sends an assistants query to the OpenAI API and creates an assistant.
func assistantModify(query: AssistantsQuery, assistantId: String, completion: @escaping (Result<AssistantResult, Error>) -> Void) -> CancellableRequest
This function sends a assistants query to the OpenAI API and modifies an assistant. The Assistants API in this usage enables you to modify an assistant.
func assistants(after: String?, completion: @escaping (Result<AssistantsResult, Error>) -> Void) -> CancellableRequest
This function sends a assistants query to the OpenAI API to list assistants that have been created.
func audioCreateSpeech(query: AudioSpeechQuery, completion: @escaping (Result<AudioSpeechResult, Error>) -> Void) -> CancellableRequest
This function sends an AudioSpeechQuery
to the OpenAI API to create audio speech from text using a specific voice and format.
func audioTranscriptions(query: AudioTranscriptionQuery, completion: @escaping (Result<AudioTranscriptionResult, Error>) -> Void) -> CancellableRequest
Transcribes audio data using OpenAI’s audio transcription API and completes the operation asynchronously.
func audioTranslations(query: AudioTranslationQuery, completion: @escaping (Result<AudioTranslationResult, Error>) -> Void) -> CancellableRequest
Translates audio data using OpenAI’s audio translation API and completes the operation asynchronously.
func chats(query: ChatQuery, completion: @escaping (Result<ChatResult, Error>) -> Void) -> CancellableRequest
This function sends a chat query to the OpenAI API and retrieves chat conversation responses. The Chat API enables you to build chatbots or conversational applications using OpenAI’s powerful natural language models, like GPT-3.
func chatsStream(query: ChatQuery, onResult: @escaping (Result<ChatStreamResult, Error>) -> Void, completion: ((Error?) -> Void)?) -> CancellableRequest
This function sends a chat query to the OpenAI API and retrieves chat stream conversation responses. The Chat API enables you to build chatbots or conversational applications using OpenAI’s powerful natural language models, like GPT-3. The result is returned by chunks.
func embeddings(query: EmbeddingsQuery, completion: @escaping (Result<EmbeddingsResult, Error>) -> Void) -> CancellableRequest
This function sends an embeddings query to the OpenAI API and retrieves embeddings in response. The Embeddings API enables you to generate high-dimensional vector representations of texts, which can be used for various natural language processing tasks such as semantic similarity, clustering, and classification.
func files(query: FilesQuery, completion: @escaping (Result<FilesResult, Error>) -> Void) -> CancellableRequest
This function sends a purpose string, file contents, and fileName contents to the OpenAI API and returns a file id result.
func imageEdits(query: ImageEditsQuery, completion: @escaping (Result<ImagesResult, Error>) -> Void) -> CancellableRequest
This function sends an image edit query to the OpenAI API and retrieves generated images in response. The Images Edit API enables you to edit images or graphics using OpenAI’s powerful deep learning models.
func imageVariations(query: ImageVariationsQuery, completion: @escaping (Result<ImagesResult, Error>) -> Void) -> CancellableRequest
This function sends an image variation query to the OpenAI API and retrieves generated images in response. The Images Variations API enables you to create a variation of a given image using OpenAI’s powerful deep learning models.
func images(query: ImagesQuery, completion: @escaping (Result<ImagesResult, Error>) -> Void) -> CancellableRequest
This function sends an images query to the OpenAI API and retrieves generated images in response. The Images Generation API enables you to create various images or graphics using OpenAI’s powerful deep learning models.
func model(query: ModelQuery, completion: @escaping (Result<ModelResult, Error>) -> Void) -> CancellableRequest
This function sends a model query to the OpenAI API and retrieves a model instance, providing owner information. The Models API in this usage enables you to gather detailed information on the model in question, like GPT-3.
func models(completion: @escaping (Result<ModelsResult, Error>) -> Void) -> CancellableRequest
This function sends a models query to the OpenAI API and retrieves a list of models. The Models API in this usage enables you to list all the available models.
func moderations(query: ModerationsQuery, completion: @escaping (Result<ModerationsResult, Error>) -> Void) -> CancellableRequest
This function sends a moderations query to the OpenAI API and retrieves a list of category results to classify how text may violate OpenAI’s Content Policy.
func runRetrieve(threadId: String, runId: String, completion: @escaping (Result<RunResult, Error>) -> Void) -> CancellableRequest
This function sends a thread id and run id to the OpenAI API and retrieves a run. The Runs API in this usage enables you to retrieve a run.
func runRetrieveSteps(threadId: String, runId: String, before: String?, completion: @escaping (Result<RunRetrieveStepsResult, Error>) -> Void) -> CancellableRequest
This function sends a thread id and run id to the OpenAI API and retrieves a list of run steps. The Runs API in this usage enables you to retrieve a runs run steps.
func runSubmitToolOutputs(threadId: String, runId: String, query: RunToolOutputsQuery, completion: @escaping (Result<RunResult, Error>) -> Void) -> CancellableRequest
This function submits tool outputs for a run to the OpenAI API. It should be submitted when a run is in status required_action
and required_action.type
is submit_tool_outputs
func runs(threadId: String, query: RunsQuery, completion: @escaping (Result<RunResult, Error>) -> Void) -> CancellableRequest
This function sends a runs query to the OpenAI API and creates a run. The Runs API in this usage enables you to create a run.
func threadRun(query: ThreadRunQuery, completion: @escaping (Result<RunResult, Error>) -> Void) -> CancellableRequest
This function sends a threads query to the OpenAI API that creates and runs a thread in a single request.
func threads(query: ThreadsQuery, completion: @escaping (Result<ThreadsResult, Error>) -> Void) -> CancellableRequest
This function sends a threads query to the OpenAI API and creates a thread. The Threads API in this usage enables you to create a thread.
func threadsAddMessage(threadId: String, query: MessageQuery, completion: @escaping (Result<ThreadAddMessageResult, Error>) -> Void) -> CancellableRequest
This function sends a thread id and message contents to the OpenAI API and returns a run.
func threadsMessages(threadId: String, before: String?, completion: @escaping (Result<ThreadsMessagesResult, Error>) -> Void) -> CancellableRequest
This function sends a thread id and run id to the OpenAI API and retrieves a threads messages. The Thread API in this usage enables you to retrieve a threads messages.