Skip to content

Latest commit

 

History

History
290 lines (197 loc) · 16.6 KB

api.md

File metadata and controls

290 lines (197 loc) · 16.6 KB

Shared Types

from openai.types import FunctionDefinition, FunctionParameters

Completions

Types:

from openai.types import Completion, CompletionChoice, CompletionUsage

Methods:

Chat

Completions

Types:

from openai.types.chat import (
    ChatCompletion,
    ChatCompletionAssistantMessageParam,
    ChatCompletionChunk,
    ChatCompletionContentPart,
    ChatCompletionContentPartImage,
    ChatCompletionContentPartText,
    ChatCompletionFunctionCallOption,
    ChatCompletionFunctionMessageParam,
    ChatCompletionMessage,
    ChatCompletionMessageParam,
    ChatCompletionMessageToolCall,
    ChatCompletionNamedToolChoice,
    ChatCompletionRole,
    ChatCompletionSystemMessageParam,
    ChatCompletionTokenLogprob,
    ChatCompletionTool,
    ChatCompletionToolChoiceOption,
    ChatCompletionToolMessageParam,
    ChatCompletionUserMessageParam,
)

Methods:

Embeddings

Types:

from openai.types import CreateEmbeddingResponse, Embedding

Methods:

Files

Types:

from openai.types import FileContent, FileDeleted, FileObject

Methods:

Images

Types:

from openai.types import Image, ImagesResponse

Methods:

Audio

Transcriptions

Types:

from openai.types.audio import Transcription

Methods:

Translations

Types:

from openai.types.audio import Translation

Methods:

Speech

Methods:

  • client.audio.speech.create(**params) -> HttpxBinaryResponseContent

Moderations

Types:

from openai.types import Moderation, ModerationCreateResponse

Methods:

Models

Types:

from openai.types import Model, ModelDeleted

Methods:

FineTuning

Jobs

Types:

from openai.types.fine_tuning import FineTuningJob, FineTuningJobEvent

Methods:

Beta

Assistants

Types:

from openai.types.beta import Assistant, AssistantDeleted

Methods:

Files

Types:

from openai.types.beta.assistants import AssistantFile, FileDeleteResponse

Methods:

Threads

Types:

from openai.types.beta import Thread, ThreadDeleted

Methods:

Runs

Types:

from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus

Methods:

Steps

Types:

from openai.types.beta.threads.runs import (
    CodeToolCall,
    FunctionToolCall,
    MessageCreationStepDetails,
    RetrievalToolCall,
    RunStep,
    ToolCallsStepDetails,
)

Methods:

Messages

Types:

from openai.types.beta.threads import (
    MessageContentImageFile,
    MessageContentText,
    ThreadMessage,
    ThreadMessageDeleted,
)

Methods:

Files

Types:

from openai.types.beta.threads.messages import MessageFile

Methods: