from openai.types import FunctionDefinition, FunctionParameters
Types:
from openai.types import Completion, CompletionChoice, CompletionUsage
Methods:
client.completions.create(**params) -> Completion
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:
client.chat.completions.create(**params) -> ChatCompletion
Types:
from openai.types import Edit
Methods:
Types:
from openai.types import CreateEmbeddingResponse, Embedding
Methods:
client.embeddings.create(**params) -> CreateEmbeddingResponse
Types:
from openai.types import FileContent, FileDeleted, FileObject
Methods:
client.files.create(**params) -> FileObject
client.files.retrieve(file_id) -> FileObject
client.files.list(**params) -> SyncPage[FileObject]
client.files.delete(file_id) -> FileDeleted
client.files.content(file_id) -> HttpxBinaryResponseContent
client.files.retrieve_content(file_id) -> str
client.files.wait_for_processing(*args) -> FileObject
Types:
from openai.types import Image, ImagesResponse
Methods:
client.images.create_variation(**params) -> ImagesResponse
client.images.edit(**params) -> ImagesResponse
client.images.generate(**params) -> ImagesResponse
Types:
from openai.types.audio import Transcription
Methods:
client.audio.transcriptions.create(**params) -> Transcription
Types:
from openai.types.audio import Translation
Methods:
client.audio.translations.create(**params) -> Translation
Methods:
Types:
from openai.types import Moderation, ModerationCreateResponse
Methods:
client.moderations.create(**params) -> ModerationCreateResponse
Types:
from openai.types import Model, ModelDeleted
Methods:
client.models.retrieve(model) -> Model
client.models.list() -> SyncPage[Model]
client.models.delete(model) -> ModelDeleted
Types:
from openai.types.fine_tuning import FineTuningJob, FineTuningJobEvent
Methods:
client.fine_tuning.jobs.create(**params) -> FineTuningJob
client.fine_tuning.jobs.retrieve(fine_tuning_job_id) -> FineTuningJob
client.fine_tuning.jobs.list(**params) -> SyncCursorPage[FineTuningJob]
client.fine_tuning.jobs.cancel(fine_tuning_job_id) -> FineTuningJob
client.fine_tuning.jobs.list_events(fine_tuning_job_id, **params) -> SyncCursorPage[FineTuningJobEvent]
Types:
from openai.types import FineTune, FineTuneEvent, FineTuneEventsListResponse
Methods:
client.fine_tunes.create(**params) -> FineTune
client.fine_tunes.retrieve(fine_tune_id) -> FineTune
client.fine_tunes.list() -> SyncPage[FineTune]
client.fine_tunes.cancel(fine_tune_id) -> FineTune
client.fine_tunes.list_events(fine_tune_id, **params) -> FineTuneEventsListResponse
Types:
from openai.types.beta import Assistant, AssistantDeleted
Methods:
client.beta.assistants.create(**params) -> Assistant
client.beta.assistants.retrieve(assistant_id) -> Assistant
client.beta.assistants.update(assistant_id, **params) -> Assistant
client.beta.assistants.list(**params) -> SyncCursorPage[Assistant]
client.beta.assistants.delete(assistant_id) -> AssistantDeleted
Types:
from openai.types.beta.assistants import AssistantFile, FileDeleteResponse
Methods:
client.beta.assistants.files.create(assistant_id, **params) -> AssistantFile
client.beta.assistants.files.retrieve(file_id, *, assistant_id) -> AssistantFile
client.beta.assistants.files.list(assistant_id, **params) -> SyncCursorPage[AssistantFile]
client.beta.assistants.files.delete(file_id, *, assistant_id) -> FileDeleteResponse
Types:
from openai.types.beta import Thread, ThreadDeleted
Methods:
client.beta.threads.create(**params) -> Thread
client.beta.threads.retrieve(thread_id) -> Thread
client.beta.threads.update(thread_id, **params) -> Thread
client.beta.threads.delete(thread_id) -> ThreadDeleted
client.beta.threads.create_and_run(**params) -> Run
Types:
from openai.types.beta.threads import RequiredActionFunctionToolCall, Run
Methods:
client.beta.threads.runs.create(thread_id, **params) -> Run
client.beta.threads.runs.retrieve(run_id, *, thread_id) -> Run
client.beta.threads.runs.update(run_id, *, thread_id, **params) -> Run
client.beta.threads.runs.list(thread_id, **params) -> SyncCursorPage[Run]
client.beta.threads.runs.cancel(run_id, *, thread_id) -> Run
client.beta.threads.runs.submit_tool_outputs(run_id, *, thread_id, **params) -> Run
Types:
from openai.types.beta.threads.runs import (
CodeToolCall,
FunctionToolCall,
MessageCreationStepDetails,
RetrievalToolCall,
RunStep,
ToolCallsStepDetails,
)
Methods:
client.beta.threads.runs.steps.retrieve(step_id, *, thread_id, run_id) -> RunStep
client.beta.threads.runs.steps.list(run_id, *, thread_id, **params) -> SyncCursorPage[RunStep]
Types:
from openai.types.beta.threads import (
MessageContentImageFile,
MessageContentText,
ThreadMessage,
ThreadMessageDeleted,
)
Methods:
client.beta.threads.messages.create(thread_id, **params) -> ThreadMessage
client.beta.threads.messages.retrieve(message_id, *, thread_id) -> ThreadMessage
client.beta.threads.messages.update(message_id, *, thread_id, **params) -> ThreadMessage
client.beta.threads.messages.list(thread_id, **params) -> SyncCursorPage[ThreadMessage]
Types:
from openai.types.beta.threads.messages import MessageFile
Methods:
client.beta.threads.messages.files.retrieve(file_id, *, thread_id, message_id) -> MessageFile
client.beta.threads.messages.files.list(message_id, *, thread_id, **params) -> SyncCursorPage[MessageFile]