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