openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
api.md
561lines · modecode
| 1 | # Shared Types |
| 2 | |
| 3 | ```python |
| 4 | from openai.types import ( |
| 5 | ErrorObject, |
| 6 | FunctionDefinition, |
| 7 | FunctionParameters, |
| 8 | Metadata, |
| 9 | ResponseFormatJSONObject, |
| 10 | ResponseFormatJSONSchema, |
| 11 | ResponseFormatText, |
| 12 | ) |
| 13 | ``` |
| 14 | |
| 15 | # Completions |
| 16 | |
| 17 | Types: |
| 18 | |
| 19 | ```python |
| 20 | from openai.types import Completion, CompletionChoice, CompletionUsage |
| 21 | ``` |
| 22 | |
| 23 | Methods: |
| 24 | |
| 25 | - <code title="post /completions">client.completions.<a href="./src/openai/resources/completions.py">create</a>(\*\*<a href="src/openai/types/completion_create_params.py">params</a>) -> <a href="./src/openai/types/completion.py">Completion</a></code> |
| 26 | |
| 27 | # Chat |
| 28 | |
| 29 | Types: |
| 30 | |
| 31 | ```python |
| 32 | from openai.types import ChatModel |
| 33 | ``` |
| 34 | |
| 35 | ## Completions |
| 36 | |
| 37 | Types: |
| 38 | |
| 39 | ```python |
| 40 | from openai.types.chat import ( |
| 41 | ChatCompletion, |
| 42 | ChatCompletionAssistantMessageParam, |
| 43 | ChatCompletionAudio, |
| 44 | ChatCompletionAudioParam, |
| 45 | ChatCompletionChunk, |
| 46 | ChatCompletionContentPart, |
| 47 | ChatCompletionContentPartImage, |
| 48 | ChatCompletionContentPartInputAudio, |
| 49 | ChatCompletionContentPartRefusal, |
| 50 | ChatCompletionContentPartText, |
| 51 | ChatCompletionDeveloperMessageParam, |
| 52 | ChatCompletionFunctionCallOption, |
| 53 | ChatCompletionFunctionMessageParam, |
| 54 | ChatCompletionMessage, |
| 55 | ChatCompletionMessageParam, |
| 56 | ChatCompletionMessageToolCall, |
| 57 | ChatCompletionModality, |
| 58 | ChatCompletionNamedToolChoice, |
| 59 | ChatCompletionPredictionContent, |
| 60 | ChatCompletionReasoningEffort, |
| 61 | ChatCompletionRole, |
| 62 | ChatCompletionStreamOptions, |
| 63 | ChatCompletionSystemMessageParam, |
| 64 | ChatCompletionTokenLogprob, |
| 65 | ChatCompletionTool, |
| 66 | ChatCompletionToolChoiceOption, |
| 67 | ChatCompletionToolMessageParam, |
| 68 | ChatCompletionUserMessageParam, |
| 69 | ) |
| 70 | ``` |
| 71 | |
| 72 | Methods: |
| 73 | |
| 74 | - <code title="post /chat/completions">client.chat.completions.<a href="./src/openai/resources/chat/completions.py">create</a>(\*\*<a href="src/openai/types/chat/completion_create_params.py">params</a>) -> <a href="./src/openai/types/chat/chat_completion.py">ChatCompletion</a></code> |
| 75 | |
| 76 | # Embeddings |
| 77 | |
| 78 | Types: |
| 79 | |
| 80 | ```python |
| 81 | from openai.types import CreateEmbeddingResponse, Embedding, EmbeddingModel |
| 82 | ``` |
| 83 | |
| 84 | Methods: |
| 85 | |
| 86 | - <code title="post /embeddings">client.embeddings.<a href="./src/openai/resources/embeddings.py">create</a>(\*\*<a href="src/openai/types/embedding_create_params.py">params</a>) -> <a href="./src/openai/types/create_embedding_response.py">CreateEmbeddingResponse</a></code> |
| 87 | |
| 88 | # Files |
| 89 | |
| 90 | Types: |
| 91 | |
| 92 | ```python |
| 93 | from openai.types import FileContent, FileDeleted, FileObject, FilePurpose |
| 94 | ``` |
| 95 | |
| 96 | Methods: |
| 97 | |
| 98 | - <code title="post /files">client.files.<a href="./src/openai/resources/files.py">create</a>(\*\*<a href="src/openai/types/file_create_params.py">params</a>) -> <a href="./src/openai/types/file_object.py">FileObject</a></code> |
| 99 | - <code title="get /files/{file_id}">client.files.<a href="./src/openai/resources/files.py">retrieve</a>(file_id) -> <a href="./src/openai/types/file_object.py">FileObject</a></code> |
| 100 | - <code title="get /files">client.files.<a href="./src/openai/resources/files.py">list</a>(\*\*<a href="src/openai/types/file_list_params.py">params</a>) -> <a href="./src/openai/types/file_object.py">SyncCursorPage[FileObject]</a></code> |
| 101 | - <code title="delete /files/{file_id}">client.files.<a href="./src/openai/resources/files.py">delete</a>(file_id) -> <a href="./src/openai/types/file_deleted.py">FileDeleted</a></code> |
| 102 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">content</a>(file_id) -> HttpxBinaryResponseContent</code> |
| 103 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">retrieve_content</a>(file_id) -> <a href="./src/openai/types/file_content.py">str</a></code> |
| 104 | - <code>client.files.<a href="./src/openai/resources/files.py">wait_for_processing</a>(\*args) -> FileObject</code> |
| 105 | |
| 106 | # Images |
| 107 | |
| 108 | Types: |
| 109 | |
| 110 | ```python |
| 111 | from openai.types import Image, ImageModel, ImagesResponse |
| 112 | ``` |
| 113 | |
| 114 | Methods: |
| 115 | |
| 116 | - <code title="post /images/variations">client.images.<a href="./src/openai/resources/images.py">create_variation</a>(\*\*<a href="src/openai/types/image_create_variation_params.py">params</a>) -> <a href="./src/openai/types/images_response.py">ImagesResponse</a></code> |
| 117 | - <code title="post /images/edits">client.images.<a href="./src/openai/resources/images.py">edit</a>(\*\*<a href="src/openai/types/image_edit_params.py">params</a>) -> <a href="./src/openai/types/images_response.py">ImagesResponse</a></code> |
| 118 | - <code title="post /images/generations">client.images.<a href="./src/openai/resources/images.py">generate</a>(\*\*<a href="src/openai/types/image_generate_params.py">params</a>) -> <a href="./src/openai/types/images_response.py">ImagesResponse</a></code> |
| 119 | |
| 120 | # Audio |
| 121 | |
| 122 | Types: |
| 123 | |
| 124 | ```python |
| 125 | from openai.types import AudioModel, AudioResponseFormat |
| 126 | ``` |
| 127 | |
| 128 | ## Transcriptions |
| 129 | |
| 130 | Types: |
| 131 | |
| 132 | ```python |
| 133 | from openai.types.audio import ( |
| 134 | Transcription, |
| 135 | TranscriptionSegment, |
| 136 | TranscriptionVerbose, |
| 137 | TranscriptionWord, |
| 138 | TranscriptionCreateResponse, |
| 139 | ) |
| 140 | ``` |
| 141 | |
| 142 | Methods: |
| 143 | |
| 144 | - <code title="post /audio/transcriptions">client.audio.transcriptions.<a href="./src/openai/resources/audio/transcriptions.py">create</a>(\*\*<a href="src/openai/types/audio/transcription_create_params.py">params</a>) -> <a href="./src/openai/types/audio/transcription_create_response.py">TranscriptionCreateResponse</a></code> |
| 145 | |
| 146 | ## Translations |
| 147 | |
| 148 | Types: |
| 149 | |
| 150 | ```python |
| 151 | from openai.types.audio import Translation, TranslationVerbose, TranslationCreateResponse |
| 152 | ``` |
| 153 | |
| 154 | Methods: |
| 155 | |
| 156 | - <code title="post /audio/translations">client.audio.translations.<a href="./src/openai/resources/audio/translations.py">create</a>(\*\*<a href="src/openai/types/audio/translation_create_params.py">params</a>) -> <a href="./src/openai/types/audio/translation_create_response.py">TranslationCreateResponse</a></code> |
| 157 | |
| 158 | ## Speech |
| 159 | |
| 160 | Types: |
| 161 | |
| 162 | ```python |
| 163 | from openai.types.audio import SpeechModel |
| 164 | ``` |
| 165 | |
| 166 | Methods: |
| 167 | |
| 168 | - <code title="post /audio/speech">client.audio.speech.<a href="./src/openai/resources/audio/speech.py">create</a>(\*\*<a href="src/openai/types/audio/speech_create_params.py">params</a>) -> HttpxBinaryResponseContent</code> |
| 169 | |
| 170 | # Moderations |
| 171 | |
| 172 | Types: |
| 173 | |
| 174 | ```python |
| 175 | from openai.types import ( |
| 176 | Moderation, |
| 177 | ModerationImageURLInput, |
| 178 | ModerationModel, |
| 179 | ModerationMultiModalInput, |
| 180 | ModerationTextInput, |
| 181 | ModerationCreateResponse, |
| 182 | ) |
| 183 | ``` |
| 184 | |
| 185 | Methods: |
| 186 | |
| 187 | - <code title="post /moderations">client.moderations.<a href="./src/openai/resources/moderations.py">create</a>(\*\*<a href="src/openai/types/moderation_create_params.py">params</a>) -> <a href="./src/openai/types/moderation_create_response.py">ModerationCreateResponse</a></code> |
| 188 | |
| 189 | # Models |
| 190 | |
| 191 | Types: |
| 192 | |
| 193 | ```python |
| 194 | from openai.types import Model, ModelDeleted |
| 195 | ``` |
| 196 | |
| 197 | Methods: |
| 198 | |
| 199 | - <code title="get /models/{model}">client.models.<a href="./src/openai/resources/models.py">retrieve</a>(model) -> <a href="./src/openai/types/model.py">Model</a></code> |
| 200 | - <code title="get /models">client.models.<a href="./src/openai/resources/models.py">list</a>() -> <a href="./src/openai/types/model.py">SyncPage[Model]</a></code> |
| 201 | - <code title="delete /models/{model}">client.models.<a href="./src/openai/resources/models.py">delete</a>(model) -> <a href="./src/openai/types/model_deleted.py">ModelDeleted</a></code> |
| 202 | |
| 203 | # FineTuning |
| 204 | |
| 205 | ## Jobs |
| 206 | |
| 207 | Types: |
| 208 | |
| 209 | ```python |
| 210 | from openai.types.fine_tuning import ( |
| 211 | FineTuningJob, |
| 212 | FineTuningJobEvent, |
| 213 | FineTuningJobIntegration, |
| 214 | FineTuningJobWandbIntegration, |
| 215 | FineTuningJobWandbIntegrationObject, |
| 216 | ) |
| 217 | ``` |
| 218 | |
| 219 | Methods: |
| 220 | |
| 221 | - <code title="post /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">create</a>(\*\*<a href="src/openai/types/fine_tuning/job_create_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code> |
| 222 | - <code title="get /fine_tuning/jobs/{fine_tuning_job_id}">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">retrieve</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code> |
| 223 | - <code title="get /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list</a>(\*\*<a href="src/openai/types/fine_tuning/job_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">SyncCursorPage[FineTuningJob]</a></code> |
| 224 | - <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">cancel</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code> |
| 225 | - <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list_events</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/job_list_events_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job_event.py">SyncCursorPage[FineTuningJobEvent]</a></code> |
| 226 | |
| 227 | ### Checkpoints |
| 228 | |
| 229 | Types: |
| 230 | |
| 231 | ```python |
| 232 | from openai.types.fine_tuning.jobs import FineTuningJobCheckpoint |
| 233 | ``` |
| 234 | |
| 235 | Methods: |
| 236 | |
| 237 | - <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints">client.fine_tuning.jobs.checkpoints.<a href="./src/openai/resources/fine_tuning/jobs/checkpoints.py">list</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/jobs/checkpoint_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/jobs/fine_tuning_job_checkpoint.py">SyncCursorPage[FineTuningJobCheckpoint]</a></code> |
| 238 | |
| 239 | # Beta |
| 240 | |
| 241 | ## Realtime |
| 242 | |
| 243 | Types: |
| 244 | |
| 245 | ```python |
| 246 | from openai.types.beta.realtime import ( |
| 247 | ConversationCreatedEvent, |
| 248 | ConversationItem, |
| 249 | ConversationItemContent, |
| 250 | ConversationItemCreateEvent, |
| 251 | ConversationItemCreatedEvent, |
| 252 | ConversationItemDeleteEvent, |
| 253 | ConversationItemDeletedEvent, |
| 254 | ConversationItemInputAudioTranscriptionCompletedEvent, |
| 255 | ConversationItemInputAudioTranscriptionFailedEvent, |
| 256 | ConversationItemTruncateEvent, |
| 257 | ConversationItemTruncatedEvent, |
| 258 | ErrorEvent, |
| 259 | InputAudioBufferAppendEvent, |
| 260 | InputAudioBufferClearEvent, |
| 261 | InputAudioBufferClearedEvent, |
| 262 | InputAudioBufferCommitEvent, |
| 263 | InputAudioBufferCommittedEvent, |
| 264 | InputAudioBufferSpeechStartedEvent, |
| 265 | InputAudioBufferSpeechStoppedEvent, |
| 266 | RateLimitsUpdatedEvent, |
| 267 | RealtimeClientEvent, |
| 268 | RealtimeResponse, |
| 269 | RealtimeResponseStatus, |
| 270 | RealtimeResponseUsage, |
| 271 | RealtimeServerEvent, |
| 272 | ResponseAudioDeltaEvent, |
| 273 | ResponseAudioDoneEvent, |
| 274 | ResponseAudioTranscriptDeltaEvent, |
| 275 | ResponseAudioTranscriptDoneEvent, |
| 276 | ResponseCancelEvent, |
| 277 | ResponseContentPartAddedEvent, |
| 278 | ResponseContentPartDoneEvent, |
| 279 | ResponseCreateEvent, |
| 280 | ResponseCreatedEvent, |
| 281 | ResponseDoneEvent, |
| 282 | ResponseFunctionCallArgumentsDeltaEvent, |
| 283 | ResponseFunctionCallArgumentsDoneEvent, |
| 284 | ResponseOutputItemAddedEvent, |
| 285 | ResponseOutputItemDoneEvent, |
| 286 | ResponseTextDeltaEvent, |
| 287 | ResponseTextDoneEvent, |
| 288 | SessionCreatedEvent, |
| 289 | SessionUpdateEvent, |
| 290 | SessionUpdatedEvent, |
| 291 | ) |
| 292 | ``` |
| 293 | |
| 294 | ### Sessions |
| 295 | |
| 296 | Types: |
| 297 | |
| 298 | ```python |
| 299 | from openai.types.beta.realtime import Session, SessionCreateResponse |
| 300 | ``` |
| 301 | |
| 302 | Methods: |
| 303 | |
| 304 | - <code title="post /realtime/sessions">client.beta.realtime.sessions.<a href="./src/openai/resources/beta/realtime/sessions.py">create</a>(\*\*<a href="src/openai/types/beta/realtime/session_create_params.py">params</a>) -> <a href="./src/openai/types/beta/realtime/session_create_response.py">SessionCreateResponse</a></code> |
| 305 | |
| 306 | ## VectorStores |
| 307 | |
| 308 | Types: |
| 309 | |
| 310 | ```python |
| 311 | from openai.types.beta import ( |
| 312 | AutoFileChunkingStrategyParam, |
| 313 | FileChunkingStrategy, |
| 314 | FileChunkingStrategyParam, |
| 315 | OtherFileChunkingStrategyObject, |
| 316 | StaticFileChunkingStrategy, |
| 317 | StaticFileChunkingStrategyObject, |
| 318 | StaticFileChunkingStrategyObjectParam, |
| 319 | VectorStore, |
| 320 | VectorStoreDeleted, |
| 321 | ) |
| 322 | ``` |
| 323 | |
| 324 | Methods: |
| 325 | |
| 326 | - <code title="post /vector_stores">client.beta.vector_stores.<a href="./src/openai/resources/beta/vector_stores/vector_stores.py">create</a>(\*\*<a href="src/openai/types/beta/vector_store_create_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_store.py">VectorStore</a></code> |
| 327 | - <code title="get /vector_stores/{vector_store_id}">client.beta.vector_stores.<a href="./src/openai/resources/beta/vector_stores/vector_stores.py">retrieve</a>(vector_store_id) -> <a href="./src/openai/types/beta/vector_store.py">VectorStore</a></code> |
| 328 | - <code title="post /vector_stores/{vector_store_id}">client.beta.vector_stores.<a href="./src/openai/resources/beta/vector_stores/vector_stores.py">update</a>(vector_store_id, \*\*<a href="src/openai/types/beta/vector_store_update_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_store.py">VectorStore</a></code> |
| 329 | - <code title="get /vector_stores">client.beta.vector_stores.<a href="./src/openai/resources/beta/vector_stores/vector_stores.py">list</a>(\*\*<a href="src/openai/types/beta/vector_store_list_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_store.py">SyncCursorPage[VectorStore]</a></code> |
| 330 | - <code title="delete /vector_stores/{vector_store_id}">client.beta.vector_stores.<a href="./src/openai/resources/beta/vector_stores/vector_stores.py">delete</a>(vector_store_id) -> <a href="./src/openai/types/beta/vector_store_deleted.py">VectorStoreDeleted</a></code> |
| 331 | |
| 332 | ### Files |
| 333 | |
| 334 | Types: |
| 335 | |
| 336 | ```python |
| 337 | from openai.types.beta.vector_stores import VectorStoreFile, VectorStoreFileDeleted |
| 338 | ``` |
| 339 | |
| 340 | Methods: |
| 341 | |
| 342 | - <code title="post /vector_stores/{vector_store_id}/files">client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">create</a>(vector_store_id, \*\*<a href="src/openai/types/beta/vector_stores/file_create_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file.py">VectorStoreFile</a></code> |
| 343 | - <code title="get /vector_stores/{vector_store_id}/files/{file_id}">client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_id) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file.py">VectorStoreFile</a></code> |
| 344 | - <code title="get /vector_stores/{vector_store_id}/files">client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">list</a>(vector_store_id, \*\*<a href="src/openai/types/beta/vector_stores/file_list_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file.py">SyncCursorPage[VectorStoreFile]</a></code> |
| 345 | - <code title="delete /vector_stores/{vector_store_id}/files/{file_id}">client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">delete</a>(file_id, \*, vector_store_id) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file_deleted.py">VectorStoreFileDeleted</a></code> |
| 346 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">create_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 347 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">poll</a>(\*args) -> VectorStoreFile</code> |
| 348 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload</a>(\*args) -> VectorStoreFile</code> |
| 349 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 350 | |
| 351 | ### FileBatches |
| 352 | |
| 353 | Types: |
| 354 | |
| 355 | ```python |
| 356 | from openai.types.beta.vector_stores import VectorStoreFileBatch |
| 357 | ``` |
| 358 | |
| 359 | Methods: |
| 360 | |
| 361 | - <code title="post /vector_stores/{vector_store_id}/file_batches">client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">create</a>(vector_store_id, \*\*<a href="src/openai/types/beta/vector_stores/file_batch_create_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file_batch.py">VectorStoreFileBatch</a></code> |
| 362 | - <code title="get /vector_stores/{vector_store_id}/file_batches/{batch_id}">client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">retrieve</a>(batch_id, \*, vector_store_id) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file_batch.py">VectorStoreFileBatch</a></code> |
| 363 | - <code title="post /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel">client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">cancel</a>(batch_id, \*, vector_store_id) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file_batch.py">VectorStoreFileBatch</a></code> |
| 364 | - <code title="get /vector_stores/{vector_store_id}/file_batches/{batch_id}/files">client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">list_files</a>(batch_id, \*, vector_store_id, \*\*<a href="src/openai/types/beta/vector_stores/file_batch_list_files_params.py">params</a>) -> <a href="./src/openai/types/beta/vector_stores/vector_store_file.py">SyncCursorPage[VectorStoreFile]</a></code> |
| 365 | - <code>client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">create_and_poll</a>(\*args) -> VectorStoreFileBatch</code> |
| 366 | - <code>client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">poll</a>(\*args) -> VectorStoreFileBatch</code> |
| 367 | - <code>client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">upload_and_poll</a>(\*args) -> VectorStoreFileBatch</code> |
| 368 | |
| 369 | ## Assistants |
| 370 | |
| 371 | Types: |
| 372 | |
| 373 | ```python |
| 374 | from openai.types.beta import ( |
| 375 | Assistant, |
| 376 | AssistantDeleted, |
| 377 | AssistantStreamEvent, |
| 378 | AssistantTool, |
| 379 | CodeInterpreterTool, |
| 380 | FileSearchTool, |
| 381 | FunctionTool, |
| 382 | MessageStreamEvent, |
| 383 | RunStepStreamEvent, |
| 384 | RunStreamEvent, |
| 385 | ThreadStreamEvent, |
| 386 | ) |
| 387 | ``` |
| 388 | |
| 389 | Methods: |
| 390 | |
| 391 | - <code title="post /assistants">client.beta.assistants.<a href="./src/openai/resources/beta/assistants.py">create</a>(\*\*<a href="src/openai/types/beta/assistant_create_params.py">params</a>) -> <a href="./src/openai/types/beta/assistant.py">Assistant</a></code> |
| 392 | - <code title="get /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants.py">retrieve</a>(assistant_id) -> <a href="./src/openai/types/beta/assistant.py">Assistant</a></code> |
| 393 | - <code title="post /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants.py">update</a>(assistant_id, \*\*<a href="src/openai/types/beta/assistant_update_params.py">params</a>) -> <a href="./src/openai/types/beta/assistant.py">Assistant</a></code> |
| 394 | - <code title="get /assistants">client.beta.assistants.<a href="./src/openai/resources/beta/assistants.py">list</a>(\*\*<a href="src/openai/types/beta/assistant_list_params.py">params</a>) -> <a href="./src/openai/types/beta/assistant.py">SyncCursorPage[Assistant]</a></code> |
| 395 | - <code title="delete /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants.py">delete</a>(assistant_id) -> <a href="./src/openai/types/beta/assistant_deleted.py">AssistantDeleted</a></code> |
| 396 | |
| 397 | ## Threads |
| 398 | |
| 399 | Types: |
| 400 | |
| 401 | ```python |
| 402 | from openai.types.beta import ( |
| 403 | AssistantResponseFormatOption, |
| 404 | AssistantToolChoice, |
| 405 | AssistantToolChoiceFunction, |
| 406 | AssistantToolChoiceOption, |
| 407 | Thread, |
| 408 | ThreadDeleted, |
| 409 | ) |
| 410 | ``` |
| 411 | |
| 412 | Methods: |
| 413 | |
| 414 | - <code title="post /threads">client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create</a>(\*\*<a href="src/openai/types/beta/thread_create_params.py">params</a>) -> <a href="./src/openai/types/beta/thread.py">Thread</a></code> |
| 415 | - <code title="get /threads/{thread_id}">client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">retrieve</a>(thread_id) -> <a href="./src/openai/types/beta/thread.py">Thread</a></code> |
| 416 | - <code title="post /threads/{thread_id}">client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">update</a>(thread_id, \*\*<a href="src/openai/types/beta/thread_update_params.py">params</a>) -> <a href="./src/openai/types/beta/thread.py">Thread</a></code> |
| 417 | - <code title="delete /threads/{thread_id}">client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">delete</a>(thread_id) -> <a href="./src/openai/types/beta/thread_deleted.py">ThreadDeleted</a></code> |
| 418 | - <code title="post /threads/runs">client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run</a>(\*\*<a href="src/openai/types/beta/thread_create_and_run_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 419 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_poll</a>(\*args) -> Run</code> |
| 420 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 421 | |
| 422 | ### Runs |
| 423 | |
| 424 | Types: |
| 425 | |
| 426 | ```python |
| 427 | from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus |
| 428 | ``` |
| 429 | |
| 430 | Methods: |
| 431 | |
| 432 | - <code title="post /threads/{thread_id}/runs">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">create</a>(thread_id, \*\*<a href="src/openai/types/beta/threads/run_create_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 433 | - <code title="get /threads/{thread_id}/runs/{run_id}">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">retrieve</a>(run_id, \*, thread_id) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 434 | - <code title="post /threads/{thread_id}/runs/{run_id}">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">update</a>(run_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/run_update_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 435 | - <code title="get /threads/{thread_id}/runs">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">list</a>(thread_id, \*\*<a href="src/openai/types/beta/threads/run_list_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/run.py">SyncCursorPage[Run]</a></code> |
| 436 | - <code title="post /threads/{thread_id}/runs/{run_id}/cancel">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">cancel</a>(run_id, \*, thread_id) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 437 | - <code title="post /threads/{thread_id}/runs/{run_id}/submit_tool_outputs">client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">submit_tool_outputs</a>(run_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/run_submit_tool_outputs_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/run.py">Run</a></code> |
| 438 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">create_and_poll</a>(\*args) -> Run</code> |
| 439 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">create_and_stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 440 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">poll</a>(\*args) -> Run</code> |
| 441 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 442 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">submit_tool_outputs_and_poll</a>(\*args) -> Run</code> |
| 443 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">submit_tool_outputs_stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 444 | |
| 445 | #### Steps |
| 446 | |
| 447 | Types: |
| 448 | |
| 449 | ```python |
| 450 | from openai.types.beta.threads.runs import ( |
| 451 | CodeInterpreterLogs, |
| 452 | CodeInterpreterOutputImage, |
| 453 | CodeInterpreterToolCall, |
| 454 | CodeInterpreterToolCallDelta, |
| 455 | FileSearchToolCall, |
| 456 | FileSearchToolCallDelta, |
| 457 | FunctionToolCall, |
| 458 | FunctionToolCallDelta, |
| 459 | MessageCreationStepDetails, |
| 460 | RunStep, |
| 461 | RunStepDelta, |
| 462 | RunStepDeltaEvent, |
| 463 | RunStepDeltaMessageDelta, |
| 464 | RunStepInclude, |
| 465 | ToolCall, |
| 466 | ToolCallDelta, |
| 467 | ToolCallDeltaObject, |
| 468 | ToolCallsStepDetails, |
| 469 | ) |
| 470 | ``` |
| 471 | |
| 472 | Methods: |
| 473 | |
| 474 | - <code title="get /threads/{thread_id}/runs/{run_id}/steps/{step_id}">client.beta.threads.runs.steps.<a href="./src/openai/resources/beta/threads/runs/steps.py">retrieve</a>(step_id, \*, thread_id, run_id, \*\*<a href="src/openai/types/beta/threads/runs/step_retrieve_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/runs/run_step.py">RunStep</a></code> |
| 475 | - <code title="get /threads/{thread_id}/runs/{run_id}/steps">client.beta.threads.runs.steps.<a href="./src/openai/resources/beta/threads/runs/steps.py">list</a>(run_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/runs/step_list_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/runs/run_step.py">SyncCursorPage[RunStep]</a></code> |
| 476 | |
| 477 | ### Messages |
| 478 | |
| 479 | Types: |
| 480 | |
| 481 | ```python |
| 482 | from openai.types.beta.threads import ( |
| 483 | Annotation, |
| 484 | AnnotationDelta, |
| 485 | FileCitationAnnotation, |
| 486 | FileCitationDeltaAnnotation, |
| 487 | FilePathAnnotation, |
| 488 | FilePathDeltaAnnotation, |
| 489 | ImageFile, |
| 490 | ImageFileContentBlock, |
| 491 | ImageFileDelta, |
| 492 | ImageFileDeltaBlock, |
| 493 | ImageURL, |
| 494 | ImageURLContentBlock, |
| 495 | ImageURLDelta, |
| 496 | ImageURLDeltaBlock, |
| 497 | Message, |
| 498 | MessageContent, |
| 499 | MessageContentDelta, |
| 500 | MessageContentPartParam, |
| 501 | MessageDeleted, |
| 502 | MessageDelta, |
| 503 | MessageDeltaEvent, |
| 504 | RefusalContentBlock, |
| 505 | RefusalDeltaBlock, |
| 506 | Text, |
| 507 | TextContentBlock, |
| 508 | TextContentBlockParam, |
| 509 | TextDelta, |
| 510 | TextDeltaBlock, |
| 511 | ) |
| 512 | ``` |
| 513 | |
| 514 | Methods: |
| 515 | |
| 516 | - <code title="post /threads/{thread_id}/messages">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages.py">create</a>(thread_id, \*\*<a href="src/openai/types/beta/threads/message_create_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/message.py">Message</a></code> |
| 517 | - <code title="get /threads/{thread_id}/messages/{message_id}">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages.py">retrieve</a>(message_id, \*, thread_id) -> <a href="./src/openai/types/beta/threads/message.py">Message</a></code> |
| 518 | - <code title="post /threads/{thread_id}/messages/{message_id}">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages.py">update</a>(message_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/message_update_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/message.py">Message</a></code> |
| 519 | - <code title="get /threads/{thread_id}/messages">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages.py">list</a>(thread_id, \*\*<a href="src/openai/types/beta/threads/message_list_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/message.py">SyncCursorPage[Message]</a></code> |
| 520 | - <code title="delete /threads/{thread_id}/messages/{message_id}">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages.py">delete</a>(message_id, \*, thread_id) -> <a href="./src/openai/types/beta/threads/message_deleted.py">MessageDeleted</a></code> |
| 521 | |
| 522 | # Batches |
| 523 | |
| 524 | Types: |
| 525 | |
| 526 | ```python |
| 527 | from openai.types import Batch, BatchError, BatchRequestCounts |
| 528 | ``` |
| 529 | |
| 530 | Methods: |
| 531 | |
| 532 | - <code title="post /batches">client.batches.<a href="./src/openai/resources/batches.py">create</a>(\*\*<a href="src/openai/types/batch_create_params.py">params</a>) -> <a href="./src/openai/types/batch.py">Batch</a></code> |
| 533 | - <code title="get /batches/{batch_id}">client.batches.<a href="./src/openai/resources/batches.py">retrieve</a>(batch_id) -> <a href="./src/openai/types/batch.py">Batch</a></code> |
| 534 | - <code title="get /batches">client.batches.<a href="./src/openai/resources/batches.py">list</a>(\*\*<a href="src/openai/types/batch_list_params.py">params</a>) -> <a href="./src/openai/types/batch.py">SyncCursorPage[Batch]</a></code> |
| 535 | - <code title="post /batches/{batch_id}/cancel">client.batches.<a href="./src/openai/resources/batches.py">cancel</a>(batch_id) -> <a href="./src/openai/types/batch.py">Batch</a></code> |
| 536 | |
| 537 | # Uploads |
| 538 | |
| 539 | Types: |
| 540 | |
| 541 | ```python |
| 542 | from openai.types import Upload |
| 543 | ``` |
| 544 | |
| 545 | Methods: |
| 546 | |
| 547 | - <code title="post /uploads">client.uploads.<a href="./src/openai/resources/uploads/uploads.py">create</a>(\*\*<a href="src/openai/types/upload_create_params.py">params</a>) -> <a href="./src/openai/types/upload.py">Upload</a></code> |
| 548 | - <code title="post /uploads/{upload_id}/cancel">client.uploads.<a href="./src/openai/resources/uploads/uploads.py">cancel</a>(upload_id) -> <a href="./src/openai/types/upload.py">Upload</a></code> |
| 549 | - <code title="post /uploads/{upload_id}/complete">client.uploads.<a href="./src/openai/resources/uploads/uploads.py">complete</a>(upload_id, \*\*<a href="src/openai/types/upload_complete_params.py">params</a>) -> <a href="./src/openai/types/upload.py">Upload</a></code> |
| 550 | |
| 551 | ## Parts |
| 552 | |
| 553 | Types: |
| 554 | |
| 555 | ```python |
| 556 | from openai.types.uploads import UploadPart |
| 557 | ``` |
| 558 | |
| 559 | Methods: |
| 560 | |
| 561 | - <code title="post /uploads/{upload_id}/parts">client.uploads.parts.<a href="./src/openai/resources/uploads/parts.py">create</a>(upload_id, \*\*<a href="src/openai/types/uploads/part_create_params.py">params</a>) -> <a href="./src/openai/types/uploads/upload_part.py">UploadPart</a></code> |
| 562 | |