openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
api.md
409lines · modecode
| 1 | # Shared Types |
| 2 | |
| 3 | ```python |
| 4 | from openai.types import ErrorObject, FunctionDefinition, FunctionParameters |
| 5 | ``` |
| 6 | |
| 7 | # Completions |
| 8 | |
| 9 | Types: |
| 10 | |
| 11 | ```python |
| 12 | from openai.types import Completion, CompletionChoice, CompletionUsage |
| 13 | ``` |
| 14 | |
| 15 | Methods: |
| 16 | |
| 17 | - <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> |
| 18 | |
| 19 | # Chat |
| 20 | |
| 21 | Types: |
| 22 | |
| 23 | ```python |
| 24 | from openai.types import ChatModel |
| 25 | ``` |
| 26 | |
| 27 | ## Completions |
| 28 | |
| 29 | Types: |
| 30 | |
| 31 | ```python |
| 32 | from openai.types.chat import ( |
| 33 | ChatCompletion, |
| 34 | ChatCompletionAssistantMessageParam, |
| 35 | ChatCompletionChunk, |
| 36 | ChatCompletionContentPart, |
| 37 | ChatCompletionContentPartImage, |
| 38 | ChatCompletionContentPartText, |
| 39 | ChatCompletionFunctionCallOption, |
| 40 | ChatCompletionFunctionMessageParam, |
| 41 | ChatCompletionMessage, |
| 42 | ChatCompletionMessageParam, |
| 43 | ChatCompletionMessageToolCall, |
| 44 | ChatCompletionNamedToolChoice, |
| 45 | ChatCompletionRole, |
| 46 | ChatCompletionSystemMessageParam, |
| 47 | ChatCompletionTokenLogprob, |
| 48 | ChatCompletionTool, |
| 49 | ChatCompletionToolChoiceOption, |
| 50 | ChatCompletionToolMessageParam, |
| 51 | ChatCompletionUserMessageParam, |
| 52 | ) |
| 53 | ``` |
| 54 | |
| 55 | Methods: |
| 56 | |
| 57 | - <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> |
| 58 | |
| 59 | # Embeddings |
| 60 | |
| 61 | Types: |
| 62 | |
| 63 | ```python |
| 64 | from openai.types import CreateEmbeddingResponse, Embedding |
| 65 | ``` |
| 66 | |
| 67 | Methods: |
| 68 | |
| 69 | - <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> |
| 70 | |
| 71 | # Files |
| 72 | |
| 73 | Types: |
| 74 | |
| 75 | ```python |
| 76 | from openai.types import FileContent, FileDeleted, FileObject |
| 77 | ``` |
| 78 | |
| 79 | Methods: |
| 80 | |
| 81 | - <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> |
| 82 | - <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> |
| 83 | - <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> |
| 84 | - <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> |
| 85 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">content</a>(file_id) -> HttpxBinaryResponseContent</code> |
| 86 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">retrieve_content</a>(file_id) -> str</code> |
| 87 | - <code>client.files.<a href="./src/openai/resources/files.py">wait_for_processing</a>(\*args) -> FileObject</code> |
| 88 | |
| 89 | # Images |
| 90 | |
| 91 | Types: |
| 92 | |
| 93 | ```python |
| 94 | from openai.types import Image, ImagesResponse |
| 95 | ``` |
| 96 | |
| 97 | Methods: |
| 98 | |
| 99 | - <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> |
| 100 | - <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> |
| 101 | - <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> |
| 102 | |
| 103 | # Audio |
| 104 | |
| 105 | ## Transcriptions |
| 106 | |
| 107 | Types: |
| 108 | |
| 109 | ```python |
| 110 | from openai.types.audio import Transcription |
| 111 | ``` |
| 112 | |
| 113 | Methods: |
| 114 | |
| 115 | - <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> |
| 116 | |
| 117 | ## Translations |
| 118 | |
| 119 | Types: |
| 120 | |
| 121 | ```python |
| 122 | from openai.types.audio import Translation |
| 123 | ``` |
| 124 | |
| 125 | Methods: |
| 126 | |
| 127 | - <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> |
| 128 | |
| 129 | ## Speech |
| 130 | |
| 131 | Methods: |
| 132 | |
| 133 | - <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> |
| 134 | |
| 135 | # Moderations |
| 136 | |
| 137 | Types: |
| 138 | |
| 139 | ```python |
| 140 | from openai.types import Moderation, ModerationCreateResponse |
| 141 | ``` |
| 142 | |
| 143 | Methods: |
| 144 | |
| 145 | - <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> |
| 146 | |
| 147 | # Models |
| 148 | |
| 149 | Types: |
| 150 | |
| 151 | ```python |
| 152 | from openai.types import Model, ModelDeleted |
| 153 | ``` |
| 154 | |
| 155 | Methods: |
| 156 | |
| 157 | - <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> |
| 158 | - <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> |
| 159 | - <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> |
| 160 | |
| 161 | # FineTuning |
| 162 | |
| 163 | ## Jobs |
| 164 | |
| 165 | Types: |
| 166 | |
| 167 | ```python |
| 168 | from openai.types.fine_tuning import ( |
| 169 | FineTuningJob, |
| 170 | FineTuningJobEvent, |
| 171 | FineTuningJobIntegration, |
| 172 | FineTuningJobWandbIntegration, |
| 173 | FineTuningJobWandbIntegrationObject, |
| 174 | ) |
| 175 | ``` |
| 176 | |
| 177 | Methods: |
| 178 | |
| 179 | - <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> |
| 180 | - <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> |
| 181 | - <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> |
| 182 | - <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> |
| 183 | - <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> |
| 184 | |
| 185 | ### Checkpoints |
| 186 | |
| 187 | Types: |
| 188 | |
| 189 | ```python |
| 190 | from openai.types.fine_tuning.jobs import FineTuningJobCheckpoint |
| 191 | ``` |
| 192 | |
| 193 | Methods: |
| 194 | |
| 195 | - <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> |
| 196 | |
| 197 | # Beta |
| 198 | |
| 199 | ## VectorStores |
| 200 | |
| 201 | Types: |
| 202 | |
| 203 | ```python |
| 204 | from openai.types.beta import VectorStore, VectorStoreDeleted |
| 205 | ``` |
| 206 | |
| 207 | Methods: |
| 208 | |
| 209 | - <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> |
| 210 | - <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> |
| 211 | - <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> |
| 212 | - <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> |
| 213 | - <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> |
| 214 | |
| 215 | ### Files |
| 216 | |
| 217 | Types: |
| 218 | |
| 219 | ```python |
| 220 | from openai.types.beta.vector_stores import VectorStoreFile, VectorStoreFileDeleted |
| 221 | ``` |
| 222 | |
| 223 | Methods: |
| 224 | |
| 225 | - <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> |
| 226 | - <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> |
| 227 | - <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> |
| 228 | - <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> |
| 229 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">create_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 230 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">poll</a>(\*args) -> VectorStoreFile</code> |
| 231 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload</a>(\*args) -> VectorStoreFile</code> |
| 232 | - <code>client.beta.vector_stores.files.<a href="./src/openai/resources/beta/vector_stores/files.py">upload_and_poll</a>(\*args) -> VectorStoreFile</code> |
| 233 | |
| 234 | ### FileBatches |
| 235 | |
| 236 | Types: |
| 237 | |
| 238 | ```python |
| 239 | from openai.types.beta.vector_stores import VectorStoreFileBatch |
| 240 | ``` |
| 241 | |
| 242 | Methods: |
| 243 | |
| 244 | - <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> |
| 245 | - <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> |
| 246 | - <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> |
| 247 | - <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> |
| 248 | - <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> |
| 249 | - <code>client.beta.vector_stores.file_batches.<a href="./src/openai/resources/beta/vector_stores/file_batches.py">poll</a>(\*args) -> VectorStoreFileBatch</code> |
| 250 | - <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> |
| 251 | |
| 252 | ## Assistants |
| 253 | |
| 254 | Types: |
| 255 | |
| 256 | ```python |
| 257 | from openai.types.beta import ( |
| 258 | Assistant, |
| 259 | AssistantDeleted, |
| 260 | AssistantStreamEvent, |
| 261 | AssistantTool, |
| 262 | CodeInterpreterTool, |
| 263 | FileSearchTool, |
| 264 | FunctionTool, |
| 265 | MessageStreamEvent, |
| 266 | RunStepStreamEvent, |
| 267 | RunStreamEvent, |
| 268 | ThreadStreamEvent, |
| 269 | ) |
| 270 | ``` |
| 271 | |
| 272 | Methods: |
| 273 | |
| 274 | - <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> |
| 275 | - <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> |
| 276 | - <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> |
| 277 | - <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> |
| 278 | - <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> |
| 279 | |
| 280 | ## Threads |
| 281 | |
| 282 | Types: |
| 283 | |
| 284 | ```python |
| 285 | from openai.types.beta import ( |
| 286 | AssistantResponseFormat, |
| 287 | AssistantResponseFormatOption, |
| 288 | AssistantToolChoice, |
| 289 | AssistantToolChoiceFunction, |
| 290 | AssistantToolChoiceOption, |
| 291 | Thread, |
| 292 | ThreadDeleted, |
| 293 | ) |
| 294 | ``` |
| 295 | |
| 296 | Methods: |
| 297 | |
| 298 | - <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> |
| 299 | - <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> |
| 300 | - <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> |
| 301 | - <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> |
| 302 | - <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> |
| 303 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_poll</a>(\*args) -> Run</code> |
| 304 | - <code>client.beta.threads.<a href="./src/openai/resources/beta/threads/threads.py">create_and_run_stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 305 | |
| 306 | ### Runs |
| 307 | |
| 308 | Types: |
| 309 | |
| 310 | ```python |
| 311 | from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus |
| 312 | ``` |
| 313 | |
| 314 | Methods: |
| 315 | |
| 316 | - <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> |
| 317 | - <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> |
| 318 | - <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> |
| 319 | - <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> |
| 320 | - <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> |
| 321 | - <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> |
| 322 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">create_and_poll</a>(\*args) -> Run</code> |
| 323 | - <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> |
| 324 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">poll</a>(\*args) -> Run</code> |
| 325 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> |
| 326 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">submit_tool_outputs_and_poll</a>(\*args) -> Run</code> |
| 327 | - <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> |
| 328 | |
| 329 | #### Steps |
| 330 | |
| 331 | Types: |
| 332 | |
| 333 | ```python |
| 334 | from openai.types.beta.threads.runs import ( |
| 335 | CodeInterpreterLogs, |
| 336 | CodeInterpreterOutputImage, |
| 337 | CodeInterpreterToolCall, |
| 338 | CodeInterpreterToolCallDelta, |
| 339 | FileSearchToolCall, |
| 340 | FileSearchToolCallDelta, |
| 341 | FunctionToolCall, |
| 342 | FunctionToolCallDelta, |
| 343 | MessageCreationStepDetails, |
| 344 | RunStep, |
| 345 | RunStepDelta, |
| 346 | RunStepDeltaEvent, |
| 347 | RunStepDeltaMessageDelta, |
| 348 | ToolCall, |
| 349 | ToolCallDelta, |
| 350 | ToolCallDeltaObject, |
| 351 | ToolCallsStepDetails, |
| 352 | ) |
| 353 | ``` |
| 354 | |
| 355 | Methods: |
| 356 | |
| 357 | - <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/run_step.py">RunStep</a></code> |
| 358 | - <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> |
| 359 | |
| 360 | ### Messages |
| 361 | |
| 362 | Types: |
| 363 | |
| 364 | ```python |
| 365 | from openai.types.beta.threads import ( |
| 366 | Annotation, |
| 367 | AnnotationDelta, |
| 368 | FileCitationAnnotation, |
| 369 | FileCitationDeltaAnnotation, |
| 370 | FilePathAnnotation, |
| 371 | FilePathDeltaAnnotation, |
| 372 | ImageFile, |
| 373 | ImageFileContentBlock, |
| 374 | ImageFileDelta, |
| 375 | ImageFileDeltaBlock, |
| 376 | Message, |
| 377 | MessageContent, |
| 378 | MessageContentDelta, |
| 379 | MessageDeleted, |
| 380 | MessageDelta, |
| 381 | MessageDeltaEvent, |
| 382 | Text, |
| 383 | TextContentBlock, |
| 384 | TextDelta, |
| 385 | TextDeltaBlock, |
| 386 | ) |
| 387 | ``` |
| 388 | |
| 389 | Methods: |
| 390 | |
| 391 | - <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> |
| 392 | - <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> |
| 393 | - <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> |
| 394 | - <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> |
| 395 | |
| 396 | # Batches |
| 397 | |
| 398 | Types: |
| 399 | |
| 400 | ```python |
| 401 | from openai.types import Batch, BatchError, BatchRequestCounts |
| 402 | ``` |
| 403 | |
| 404 | Methods: |
| 405 | |
| 406 | - <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> |
| 407 | - <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> |
| 408 | - <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> |
| 409 | - <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> |
| 410 | |