Module openai

Source
Expand description

OpenAI API client and Rig integration

§Example

use rig::providers::openai;

let client = openai::Client::new("YOUR_API_KEY");

let gpt4o = client.completion_model(openai::GPT_4O);

Structs§

Choice
Client
CompletionModel
CompletionResponse
EmbeddingData
EmbeddingModel
EmbeddingResponse
Function
Message
ToolCall
ToolDefinition
Usage

Constants§

GPT_4
gpt-4 completion model
GPT_4O
gpt-4o completion model
GPT_4O_2024_05_13
gpt-4o-2024-05-13 completion model
GPT_4O_MINI
gpt-4o-mini completion model
GPT_4_0125_PREVIEW
gpt-4-0125-preview completion model
GPT_4_0613
gpt-4-0613 completion model
GPT_4_32K
gpt-4-32k completion model
GPT_4_32K_0613
gpt-4-32k-0613 completion model
GPT_4_1106_PREVIEW
gpt-4-1106-preview completion model
GPT_4_1106_VISION_PREVIEW
gpt-4-1106-vision-preview completion model
GPT_4_TURBO
gpt-4-turbo completion model
GPT_4_TURBO_2024_04_09
gpt-4-turbo-2024-04-09 completion model
GPT_4_TURBO_PREVIEW
gpt-4-turbo-preview completion model
GPT_4_VISION_PREVIEW
gpt-4-vision-preview completion model
GPT_35_TURBO
gpt-3.5-turbo completion model
GPT_35_TURBO_0125
gpt-3.5-turbo-0125 completion model
GPT_35_TURBO_1106
gpt-3.5-turbo-1106 completion model
GPT_35_TURBO_INSTRUCT
gpt-3.5-turbo-instruct completion model
O1_MINI
`o1-mini completion model
O1_MINI_2024_09_12
o1-mini-2024-09-12 completion model
O1_PREVIEW
o1-preview completion model
O1_PREVIEW_2024_09_12
o1-preview-2024-09-12 completion model
TEXT_EMBEDDING_3_LARGE
text-embedding-3-large embedding model
TEXT_EMBEDDING_3_SMALL
text-embedding-3-small embedding model
TEXT_EMBEDDING_ADA_002
text-embedding-ada-002 embedding model