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