Crate openai_rst

Source
Expand description

This library provides a comprehensive set of modules for interacting with various AI models and services. It includes functionality for handling assistants, audio processing, chat completions, and more. Each submodule is designed to encapsulate specific features and operations, making it easy to integrate and use in different applications.

Modules§

assistant
Module for managing assistants and related operations. This module defines the structures and methods for handling assistant-related requests and responses. It includes the AssistantRequest, AssistantObject, DeletionStatus, ListAssistant, AssistantFileRequest, AssistantFileObject, and ListAssistantFile structs along with their associated methods.
audio
Module for audio processing, including transcription, translation, and speech synthesis. This module defines the structures and methods for handling audio-based requests and responses. It includes functionality for audio transcription, translation, and speech synthesis. The module facilitates the creation, serialization, and deserialization of requests and responses related to these audio operations.
chat_completion
Module for handling chat completion requests and responses. This module defines the structures and methods for handling chat completion requests and responses. It includes the ChatCompletionRequest, ChatCompletionResponse, ChatCompletionMessage, ChatCompletionChoice, Function, FunctionParameters, JSONSchemaType, JSONSchemaDefine, FinishReason, FinishDetails, ToolCall, ToolCallFunction, and Tool structs along with their associated methods. These structures facilitate the creation, serialization, and deserialization of chat completion requests and responses in various formats, allowing for customizable and extensible interactions with chat models.
client
Module for the main client interface to interact with the services. This module defines the Client struct for interacting with the OpenAI API. It includes methods for handling various types of requests such as text completion, image generation, file management, and more. The Client struct encapsulates the logic for making HTTP requests to the API endpoints.
common
Common utilities and types used across multiple modules. This module defines enums, structs, and macros for handling message roles and usage metrics. It includes:
completion
Module for handling text completion requests and responses. This module defines the structures and methods for handling text completion requests and responses. It includes:
edit
Module for editing operations. This module defines the structures and methods for handling edit requests and responses. It includes:
embedding
Module for generating text embeddings. This module defines the structures and methods for handling text embeddings. It includes:
error
Module for error handling. This module defines custom error types for handling API-related errors. The APIError enum provides variants for different kinds of errors that may occur when interacting with APIs, including network errors, serialization errors, and more.
file
Module for managing files and related operations. This module defines the structures and methods for managing files, including uploading, deleting, retrieving, and listing files. It includes:
fine_tuning
Module for fine-tuning models. This module defines the structures and methods for managing fine-tuning jobs. It includes:
image
Module for image generation and processing. This module defines the structures and methods for image generation, editing, and variations. It includes:
message
Module for creating, modifying, and managing messages. This module defines the structures and methods for creating, modifying, and managing messages and their related content. It includes:
models
Module defining various AI models. This module defines various enums and structs representing different AI models, such as GPT-4, GPT-3, Dalle, Whisper, Clip, and Embeddings models. Each enum variant corresponds to a specific model version or type, providing detailed information about the available models.
moderation
Module for moderation checks and responses. This module defines the structures and methods for creating and handling moderation requests and responses. It includes:
run
Module for creating and managing runs. This module defines the structures and methods for creating and modifying runs, as well as handling run-related requests and responses. It includes:
thread
Module for creating and managing threads. This module defines the structures and methods for creating and modifying threads, as well as the message format used within threads. It includes:

Macros§

impl_builder_methods
Macro for generating builder methods for a struct.