openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
api.md
482lines · 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 | ChatCompletionChunk, |
| 43 | ChatCompletionContentPart, |
| 44 | ChatCompletionContentPartImage, |
| 45 | ChatCompletionContentPartRefusal, |
| 46 | ChatCompletionContentPartText, |
| 47 | ChatCompletionFunctionCallOption, |
| 48 | ChatCompletionFunctionMessageParam, |
| 49 | ChatCompletionMessage, |
| 50 | ChatCompletionMessageParam, |
| 51 | ChatCompletionMessageToolCall, |
| 52 | ChatCompletionNamedToolChoice, |
| 53 | ChatCompletionRole, |
| 54 | ChatCompletionStreamOptions, |
| 55 | ChatCompletionSystemMessageParam, |
| 56 | ChatCompletionTokenLogprob, |
| 57 | ChatCompletionTool, |
| 58 | ChatCompletionToolChoiceOption, |
| 59 | ChatCompletionToolMessageParam, |
| 60 | ChatCompletionUserMessageParam, |
| 61 | ) |
| 62 | ``` |
| 63 | |
| 64 | Methods: |
| 65 | |
| 66 | - <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> |
| 67 | |
| 68 | # Embeddings |
| 69 | |
| 70 | Types: |
| 71 | |
| 72 | ```python |
| 73 | from openai.types import CreateEmbeddingResponse, Embedding, EmbeddingModel |
| 74 | ``` |
| 75 | |
| 76 | Methods: |
| 77 | |
| 78 | - <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> |
| 79 | |
| 80 | # Files |
| 81 | |
| 82 | Types: |
| 83 | |
| 84 | ```python |
| 85 | from openai.types import FileContent, FileDeleted, FileObject, FilePurpose |
| 86 | ``` |
| 87 | |
| 88 | Methods: |
| 89 | |
| 90 | - <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> |
| 91 | - <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> |
| 92 | - <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">SyncPage[FileObject]</a></code> |
| 93 | - <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> |
| 94 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">content</a>(file_id) -> HttpxBinaryResponseContent</code> |
| 95 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">retrieve_content</a>(file_id) -> str</code> |
| 96 | - <code>client.files.<a href="./src/openai/resources/files.py">wait_for_processing</a>(\*args) -> FileObject</code> |
| 97 | |
| 98 | # Images |
| 99 | |
| 100 | Types: |
| 101 | |
| 102 | ```python |
| 103 | from openai.types import Image, ImageModel, ImagesResponse |
| 104 | ``` |
| 105 | |
| 106 | Methods: |
| 107 | |
| 108 | - <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> |
| 109 | - <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> |
| 110 | - <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> |
| 111 | |
| 112 | # Audio |
| 113 | |
| 114 | Types: |
| 115 | |
| 116 | ```python |
| 117 | from openai.types import AudioModel, AudioResponseFormat |
| 118 | ``` |
| 119 | |
| 120 | ## Transcriptions |
| 121 | |
| 122 | Types: |
| 123 | |
| 124 | ```python |
| 125 | from openai.types.audio import Transcription |
| 126 | ``` |
| 127 | |
| 128 | Methods: |
| 129 | |
| 130 | - <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.py">Transcription</a></code> |
| 131 | |
| 132 | ## Translations |
| 133 | |
| 134 | Types: |
| 135 | |
| 136 | ```python |
| 137 | from openai.types.audio import Translation |
| 138 | ``` |
| 139 | |
| 140 | Methods: |
| 141 | |
| 142 | - <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.py">Translation</a></code> |
| 143 | |
| 144 | ## Speech |
| 145 | |
| 146 | Types: |
| 147 | |
| 148 | ```python |
| 149 | from openai.types.audio import SpeechModel |
| 150 | ``` |
| 151 | |
| 152 | Methods: |
| 153 | |
| 154 | - <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> |
| 155 | |
| 156 | # Moderations |
| 157 | |
| 158 | Types: |
| 159 | |
| 160 | ```python |
| 161 | from openai.types import ( |
| 162 | Moderation, |
| 163 | ModerationImageURLInput, |
| 164 | ModerationModel, |
| 165 | ModerationMultiModalInput, |
| 166 | ModerationTextInput, |
| 167 | ModerationCreateResponse, |
| 168 | ) |
| 169 | ``` |
| 170 | |
| 171 | Methods: |
| 172 | |
| 173 | - <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> |
| 174 | |
| 175 | # Models |
| 176 | |
| 177 | Types: |
| 178 | |
| 179 | ```python |
| 180 | from openai.types import Model, ModelDeleted |
| 181 | ``` |
| 182 | |
| 183 | Methods: |
| 184 | |
| 185 | - <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> |
| 186 | - <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> |
| 187 | - <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> |
| 188 | |
| 189 | # FineTuning |
| 190 | |
| 191 | ## Jobs |
| 192 | |
| 193 | Types: |
| 194 | |
| 195 | ```python |
| 196 | from openai.types.fine_tuning import ( |
| 197 | FineTuningJob, |
| 198 | FineTuningJobEvent, |
| 199 | FineTuningJobIntegration, |
| 200 | FineTuningJobWandbIntegration, |
| 201 | FineTuningJobWandbIntegrationObject, |
| 202 | ) |
| 203 | ``` |
| 204 | |
| 205 | Methods: |
| 206 | |
| 207 | - <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> |
| 208 | - <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> |
| 209 | - <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> |
| 210 | - <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> |
| 211 | - <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> |
| 212 | |
| 213 | ### Checkpoints |
| 214 | |
| 215 | Types: |
| 216 | |
| 217 | ```python |
| 218 | from openai.types.fine_tuning.jobs import FineTuningJobCheckpoint |
| 219 | ``` |
| 220 | |
| 221 | Methods: |
| 222 | |
| 223 | - <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> |
| 224 | |
| 225 | # Beta |
| 226 | |
| 227 | ## VectorStores |
| 228 | |
| 229 | Types: |
| 230 | |
| 231 | ```python |
| 232 | from openai.types.beta import ( |
| 233 | AutoFileChunkingStrategyParam, |
| 234 | FileChunkingStrategy, |
| 235 | FileChunkingStrategyParam, |
| 236 | OtherFileChunkingStrategyObject, |
| 237 | StaticFileChunkingStrategy, |
| 238 | StaticFileChunkingStrategyObject, |
| 239 | StaticFileChunkingStrategyParam, |
| 240 | VectorStore, |
| 241 | VectorStoreDeleted, |
| 242 | ) |
| 243 | ``` |
| 244 | |
| 245 | Methods: |
| 246 | |
| 247 | - <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> |
| 248 | - <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> |
| 249 | - <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> |
| 250 | - <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> |
| 251 | - <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> |
| 252 | |
| 253 | ### Files |
| 254 | |
| 255 | Types: |
| 256 | |
| 257 | ```python |
| 258 | from openai.types.beta.vector_stores import VectorStoreFile, VectorStoreFileDeleted |
| 259 | ``` |
| 260 | |
| 261 | Methods: |
| 262 | |
| 263 | - <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> |
| 264 | - <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> |
| 265 | - <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> |
| 266 | - <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> |
| 267 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">create_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 268 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">poll</a>(\*args) -> VectorStoreFile</code> |
| 269 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload</a>(\*args) -> VectorStoreFile</code> |
| 270 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 271 | |
| 272 | ### FileBatches |
| 273 | |
| 274 | Types: |
| 275 | |
| 276 | ```python |
| 277 | from openai.types.beta.vector_stores import VectorStoreFileBatch |
| 278 | ``` |
| 279 | |
| 280 | Methods: |
| 281 | |
| 282 | - <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> |
| 283 | - <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> |
| 284 | - <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> |
| 285 | - <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> |
| 286 | - <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> |
| 287 | - <code>client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">poll</a>(\*args) -> VectorStoreFileBatch</code> |
| 288 | - <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> |
| 289 | |
| 290 | ## Assistants |
| 291 | |
| 292 | Types: |
| 293 | |
| 294 | ```python |
| 295 | from openai.types.beta import ( |
| 296 | Assistant, |
| 297 | AssistantDeleted, |
| 298 | AssistantStreamEvent, |
| 299 | AssistantTool, |
| 300 | CodeInterpreterTool, |
| 301 | FileSearchTool, |
| 302 | FunctionTool, |
| 303 | MessageStreamEvent, |
| 304 | RunStepStreamEvent, |
| 305 | RunStreamEvent, |
| 306 | ThreadStreamEvent, |
| 307 | ) |
| 308 | ``` |
| 309 | |
| 310 | Methods: |
| 311 | |
| 312 | - <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> |
| 313 | - <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> |
| 314 | - <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> |
| 315 | - <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> |
| 316 | - <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> |
| 317 | |
| 318 | ## Threads |
| 319 | |
| 320 | Types: |
| 321 | |
| 322 | ```python |
| 323 | from openai.types.beta import ( |
| 324 | AssistantResponseFormatOption, |
| 325 | AssistantToolChoice, |
| 326 | AssistantToolChoiceFunction, |
| 327 | AssistantToolChoiceOption, |
| 328 | Thread, |
| 329 | ThreadDeleted, |
| 330 | ) |
| 331 | ``` |
| 332 | |
| 333 | Methods: |
| 334 | |
| 335 | - <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> |
| 336 | - <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> |
| 337 | - <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> |
| 338 | - <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> |
| 339 | - <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> |
| 340 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_poll</a>(\*args) -> Run</code> |
| 341 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 342 | |
| 343 | ### Runs |
| 344 | |
| 345 | Types: |
| 346 | |
| 347 | ```python |
| 348 | from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus |
| 349 | ``` |
| 350 | |
| 351 | Methods: |
| 352 | |
| 353 | - <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> |
| 354 | - <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> |
| 355 | - <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> |
| 356 | - <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> |
| 357 | - <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> |
| 358 | - <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> |
| 359 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">create_and_poll</a>(\*args) -> Run</code> |
| 360 | - <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> |
| 361 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">poll</a>(\*args) -> Run</code> |
| 362 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 363 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">submit_tool_outputs_and_poll</a>(\*args) -> Run</code> |
| 364 | - <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> |
| 365 | |
| 366 | #### Steps |
| 367 | |
| 368 | Types: |
| 369 | |
| 370 | ```python |
| 371 | from openai.types.beta.threads.runs import ( |
| 372 | CodeInterpreterLogs, |
| 373 | CodeInterpreterOutputImage, |
| 374 | CodeInterpreterToolCall, |
| 375 | CodeInterpreterToolCallDelta, |
| 376 | FileSearchToolCall, |
| 377 | FileSearchToolCallDelta, |
| 378 | FunctionToolCall, |
| 379 | FunctionToolCallDelta, |
| 380 | MessageCreationStepDetails, |
| 381 | RunStep, |
| 382 | RunStepDelta, |
| 383 | RunStepDeltaEvent, |
| 384 | RunStepDeltaMessageDelta, |
| 385 | RunStepInclude, |
| 386 | ToolCall, |
| 387 | ToolCallDelta, |
| 388 | ToolCallDeltaObject, |
| 389 | ToolCallsStepDetails, |
| 390 | ) |
| 391 | ``` |
| 392 | |
| 393 | Methods: |
| 394 | |
| 395 | - <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> |
| 396 | - <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> |
| 397 | |
| 398 | ### Messages |
| 399 | |
| 400 | Types: |
| 401 | |
| 402 | ```python |
| 403 | from openai.types.beta.threads import ( |
| 404 | Annotation, |
| 405 | AnnotationDelta, |
| 406 | FileCitationAnnotation, |
| 407 | FileCitationDeltaAnnotation, |
| 408 | FilePathAnnotation, |
| 409 | FilePathDeltaAnnotation, |
| 410 | ImageFile, |
| 411 | ImageFileContentBlock, |
| 412 | ImageFileDelta, |
| 413 | ImageFileDeltaBlock, |
| 414 | ImageURL, |
| 415 | ImageURLContentBlock, |
| 416 | ImageURLDelta, |
| 417 | ImageURLDeltaBlock, |
| 418 | Message, |
| 419 | MessageContent, |
| 420 | MessageContentDelta, |
| 421 | MessageContentPartParam, |
| 422 | MessageDeleted, |
| 423 | MessageDelta, |
| 424 | MessageDeltaEvent, |
| 425 | RefusalContentBlock, |
| 426 | RefusalDeltaBlock, |
| 427 | Text, |
| 428 | TextContentBlock, |
| 429 | TextContentBlockParam, |
| 430 | TextDelta, |
| 431 | TextDeltaBlock, |
| 432 | ) |
| 433 | ``` |
| 434 | |
| 435 | Methods: |
| 436 | |
| 437 | - <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> |
| 438 | - <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> |
| 439 | - <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> |
| 440 | - <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> |
| 441 | - <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> |
| 442 | |
| 443 | # Batches |
| 444 | |
| 445 | Types: |
| 446 | |
| 447 | ```python |
| 448 | from openai.types import Batch, BatchError, BatchRequestCounts |
| 449 | ``` |
| 450 | |
| 451 | Methods: |
| 452 | |
| 453 | - <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> |
| 454 | - <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> |
| 455 | - <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> |
| 456 | - <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> |
| 457 | |
| 458 | # Uploads |
| 459 | |
| 460 | Types: |
| 461 | |
| 462 | ```python |
| 463 | from openai.types import Upload |
| 464 | ``` |
| 465 | |
| 466 | Methods: |
| 467 | |
| 468 | - <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> |
| 469 | - <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> |
| 470 | - <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> |
| 471 | |
| 472 | ## Parts |
| 473 | |
| 474 | Types: |
| 475 | |
| 476 | ```python |
| 477 | from openai.types.uploads import UploadPart |
| 478 | ``` |
| 479 | |
| 480 | Methods: |
| 481 | |
| 482 | - <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> |
| 483 | |