openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
api.md
337lines · 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 | | |
| 21 | ## Completions | |
| 22 | | |
| 23 | Types: | |
| 24 | | |
| 25 | ```python | |
| 26 | from openai.types.chat import ( | |
| 27 | ChatCompletion, | |
baa9f07fRobert Craigie2 years ago | 28 | ChatCompletionAssistantMessageParam, |
08b8179aDavid Schnurr2 years ago | 29 | ChatCompletionChunk, |
baa9f07fRobert Craigie2 years ago | 30 | ChatCompletionContentPart, |
| 31 | ChatCompletionContentPartImage, | |
| 32 | ChatCompletionContentPartText, | |
| 33 | ChatCompletionFunctionCallOption, | |
| 34 | ChatCompletionFunctionMessageParam, | |
08b8179aDavid Schnurr2 years ago | 35 | ChatCompletionMessage, |
| 36 | ChatCompletionMessageParam, | |
baa9f07fRobert Craigie2 years ago | 37 | ChatCompletionMessageToolCall, |
| 38 | ChatCompletionNamedToolChoice, | |
08b8179aDavid Schnurr2 years ago | 39 | ChatCompletionRole, |
baa9f07fRobert Craigie2 years ago | 40 | ChatCompletionSystemMessageParam, |
ccae821bStainless Bot2 years ago | 41 | ChatCompletionTokenLogprob, |
baa9f07fRobert Craigie2 years ago | 42 | ChatCompletionTool, |
| 43 | ChatCompletionToolChoiceOption, | |
| 44 | ChatCompletionToolMessageParam, | |
| 45 | ChatCompletionUserMessageParam, | |
08b8179aDavid Schnurr2 years ago | 46 | ) |
| 47 | ``` | |
| 48 | | |
| 49 | Methods: | |
| 50 | | |
| 51 | - <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> | |
| 52 | | |
| 53 | # Embeddings | |
| 54 | | |
| 55 | Types: | |
| 56 | | |
| 57 | ```python | |
| 58 | from openai.types import CreateEmbeddingResponse, Embedding | |
| 59 | ``` | |
| 60 | | |
| 61 | Methods: | |
| 62 | | |
| 63 | - <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> | |
| 64 | | |
| 65 | # Files | |
| 66 | | |
| 67 | Types: | |
| 68 | | |
| 69 | ```python | |
| 70 | from openai.types import FileContent, FileDeleted, FileObject | |
| 71 | ``` | |
| 72 | | |
| 73 | Methods: | |
| 74 | | |
| 75 | - <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> | |
| 76 | - <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 | 77 | - <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 | 78 | - <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 | 79 | - <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 | 80 | - <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">retrieve_content</a>(file_id) -> str</code> |
| 81 | - <code>client.files.<a href="./src/openai/resources/files.py">wait_for_processing</a>(\*args) -> FileObject</code> | |
| 82 | | |
| 83 | # Images | |
| 84 | | |
| 85 | Types: | |
| 86 | | |
| 87 | ```python | |
| 88 | from openai.types import Image, ImagesResponse | |
| 89 | ``` | |
| 90 | | |
| 91 | Methods: | |
| 92 | | |
| 93 | - <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> | |
| 94 | - <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> | |
| 95 | - <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> | |
| 96 | | |
| 97 | # Audio | |
| 98 | | |
| 99 | ## Transcriptions | |
| 100 | | |
| 101 | Types: | |
| 102 | | |
| 103 | ```python | |
| 104 | from openai.types.audio import Transcription | |
| 105 | ``` | |
| 106 | | |
| 107 | Methods: | |
| 108 | | |
| 109 | - <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> | |
| 110 | | |
| 111 | ## Translations | |
| 112 | | |
| 113 | Types: | |
| 114 | | |
| 115 | ```python | |
| 116 | from openai.types.audio import Translation | |
| 117 | ``` | |
| 118 | | |
| 119 | Methods: | |
| 120 | | |
| 121 | - <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> | |
| 122 | | |
baa9f07fRobert Craigie2 years ago | 123 | ## Speech |
| 124 | | |
| 125 | Methods: | |
| 126 | | |
| 127 | - <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> | |
| 128 | | |
08b8179aDavid Schnurr2 years ago | 129 | # Moderations |
| 130 | | |
| 131 | Types: | |
| 132 | | |
| 133 | ```python | |
| 134 | from openai.types import Moderation, ModerationCreateResponse | |
| 135 | ``` | |
| 136 | | |
| 137 | Methods: | |
| 138 | | |
| 139 | - <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> | |
| 140 | | |
| 141 | # Models | |
| 142 | | |
| 143 | Types: | |
| 144 | | |
| 145 | ```python | |
| 146 | from openai.types import Model, ModelDeleted | |
| 147 | ``` | |
| 148 | | |
| 149 | Methods: | |
| 150 | | |
| 151 | - <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> | |
| 152 | - <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> | |
| 153 | - <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> | |
| 154 | | |
| 155 | # FineTuning | |
| 156 | | |
| 157 | ## Jobs | |
| 158 | | |
| 159 | Types: | |
| 160 | | |
| 161 | ```python | |
| 162 | from openai.types.fine_tuning import FineTuningJob, FineTuningJobEvent | |
| 163 | ``` | |
| 164 | | |
| 165 | Methods: | |
| 166 | | |
| 167 | - <code title="post /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/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> | |
| 168 | - <code title="get /fine_tuning/jobs/{fine_tuning_job_id}">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">retrieve</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code> | |
| 169 | - <code title="get /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/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> | |
| 170 | - <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">cancel</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code> | |
| 171 | - <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/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> | |
| 172 | | |
baa9f07fRobert Craigie2 years ago | 173 | # Beta |
| 174 | | |
| 175 | ## Assistants | |
| 176 | | |
| 177 | Types: | |
| 178 | | |
| 179 | ```python | |
5429f696Stainless Bot2 years ago | 180 | from openai.types.beta import ( |
| 181 | Assistant, | |
| 182 | AssistantDeleted, | |
| 183 | AssistantStreamEvent, | |
| 184 | AssistantTool, | |
| 185 | CodeInterpreterTool, | |
| 186 | FunctionTool, | |
| 187 | MessageStreamEvent, | |
| 188 | RetrievalTool, | |
| 189 | RunStepStreamEvent, | |
| 190 | RunStreamEvent, | |
| 191 | ThreadStreamEvent, | |
| 192 | ) | |
baa9f07fRobert Craigie2 years ago | 193 | ``` |
| 194 | | |
| 195 | Methods: | |
| 196 | | |
| 197 | - <code title="post /assistants">client.beta.assistants.<a href="./src/openai/resources/beta/assistants/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> | |
| 198 | - <code title="get /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants/assistants.py">retrieve</a>(assistant_id) -> <a href="./src/openai/types/beta/assistant.py">Assistant</a></code> | |
| 199 | - <code title="post /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants/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> | |
| 200 | - <code title="get /assistants">client.beta.assistants.<a href="./src/openai/resources/beta/assistants/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> | |
f5ef2b3aStainless Bot2 years ago | 201 | - <code title="delete /assistants/{assistant_id}">client.beta.assistants.<a href="./src/openai/resources/beta/assistants/assistants.py">delete</a>(assistant_id) -> <a href="./src/openai/types/beta/assistant_deleted.py">AssistantDeleted</a></code> |
baa9f07fRobert Craigie2 years ago | 202 | |
| 203 | ### Files | |
| 204 | | |
| 205 | Types: | |
| 206 | | |
| 207 | ```python | |
| 208 | from openai.types.beta.assistants import AssistantFile, FileDeleteResponse | |
| 209 | ``` | |
| 210 | | |
| 211 | Methods: | |
| 212 | | |
| 213 | - <code title="post /assistants/{assistant_id}/files">client.beta.assistants.files.<a href="./src/openai/resources/beta/assistants/files.py">create</a>(assistant_id, \*\*<a href="src/openai/types/beta/assistants/file_create_params.py">params</a>) -> <a href="./src/openai/types/beta/assistants/assistant_file.py">AssistantFile</a></code> | |
| 214 | - <code title="get /assistants/{assistant_id}/files/{file_id}">client.beta.assistants.files.<a href="./src/openai/resources/beta/assistants/files.py">retrieve</a>(file_id, \*, assistant_id) -> <a href="./src/openai/types/beta/assistants/assistant_file.py">AssistantFile</a></code> | |
| 215 | - <code title="get /assistants/{assistant_id}/files">client.beta.assistants.files.<a href="./src/openai/resources/beta/assistants/files.py">list</a>(assistant_id, \*\*<a href="src/openai/types/beta/assistants/file_list_params.py">params</a>) -> <a href="./src/openai/types/beta/assistants/assistant_file.py">SyncCursorPage[AssistantFile]</a></code> | |
| 216 | - <code title="delete /assistants/{assistant_id}/files/{file_id}">client.beta.assistants.files.<a href="./src/openai/resources/beta/assistants/files.py">delete</a>(file_id, \*, assistant_id) -> <a href="./src/openai/types/beta/assistants/file_delete_response.py">FileDeleteResponse</a></code> | |
| 217 | | |
| 218 | ## Threads | |
| 219 | | |
| 220 | Types: | |
| 221 | | |
| 222 | ```python | |
| 223 | from openai.types.beta import Thread, ThreadDeleted | |
| 224 | ``` | |
| 225 | | |
| 226 | Methods: | |
| 227 | | |
| 228 | - <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> | |
| 229 | - <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> | |
| 230 | - <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> | |
| 231 | - <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> | |
| 232 | - <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 | 233 | - <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 | 234 | - <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 | 235 | |
| 236 | ### Runs | |
| 237 | | |
| 238 | Types: | |
| 239 | | |
| 240 | ```python | |
f0b18239Stainless Bot2 years ago | 241 | from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus |
baa9f07fRobert Craigie2 years ago | 242 | ``` |
| 243 | | |
| 244 | Methods: | |
| 245 | | |
| 246 | - <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> | |
| 247 | - <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> | |
| 248 | - <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> | |
| 249 | - <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> | |
| 250 | - <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> | |
| 251 | - <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 | 252 | - <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 | 253 | - <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 | 254 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">poll</a>(\*args) -> Run</code> |
| 255 | - <code>client.beta.threads.runs.<a href="./src/openai/resources/beta/threads/runs/runs.py">stream</a>(\*args) -> AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]</code> | |
| 256 | - <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 | 257 | - <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 | 258 | |
| 259 | #### Steps | |
| 260 | | |
| 261 | Types: | |
| 262 | | |
| 263 | ```python | |
| 264 | from openai.types.beta.threads.runs import ( | |
5429f696Stainless Bot2 years ago | 265 | CodeInterpreterLogs, |
| 266 | CodeInterpreterOutputImage, | |
| 267 | CodeInterpreterToolCall, | |
| 268 | CodeInterpreterToolCallDelta, | |
baa9f07fRobert Craigie2 years ago | 269 | FunctionToolCall, |
5429f696Stainless Bot2 years ago | 270 | FunctionToolCallDelta, |
baa9f07fRobert Craigie2 years ago | 271 | MessageCreationStepDetails, |
| 272 | RetrievalToolCall, | |
5429f696Stainless Bot2 years ago | 273 | RetrievalToolCallDelta, |
baa9f07fRobert Craigie2 years ago | 274 | RunStep, |
5429f696Stainless Bot2 years ago | 275 | RunStepDelta, |
| 276 | RunStepDeltaEvent, | |
| 277 | RunStepDeltaMessageDelta, | |
| 278 | ToolCall, | |
| 279 | ToolCallDelta, | |
| 280 | ToolCallDeltaObject, | |
baa9f07fRobert Craigie2 years ago | 281 | ToolCallsStepDetails, |
| 282 | ) | |
| 283 | ``` | |
| 284 | | |
| 285 | Methods: | |
| 286 | | |
| 287 | - <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> | |
| 288 | - <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> | |
| 289 | | |
| 290 | ### Messages | |
| 291 | | |
| 292 | Types: | |
| 293 | | |
| 294 | ```python | |
| 295 | from openai.types.beta.threads import ( | |
5429f696Stainless Bot2 years ago | 296 | Annotation, |
| 297 | AnnotationDelta, | |
| 298 | FileCitationAnnotation, | |
| 299 | FileCitationDeltaAnnotation, | |
| 300 | FilePathAnnotation, | |
| 301 | FilePathDeltaAnnotation, | |
| 302 | ImageFile, | |
| 303 | ImageFileContentBlock, | |
| 304 | ImageFileDelta, | |
| 305 | ImageFileDeltaBlock, | |
| 306 | Message, | |
| 307 | MessageContent, | |
| 308 | MessageContentDelta, | |
| 309 | MessageDeleted, | |
| 310 | MessageDelta, | |
| 311 | MessageDeltaEvent, | |
| 312 | Text, | |
| 313 | TextContentBlock, | |
| 314 | TextDelta, | |
| 315 | TextDeltaBlock, | |
baa9f07fRobert Craigie2 years ago | 316 | ) |
| 317 | ``` | |
| 318 | | |
| 319 | Methods: | |
| 320 | | |
5429f696Stainless Bot2 years ago | 321 | - <code title="post /threads/{thread_id}/messages">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages/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> |
| 322 | - <code title="get /threads/{thread_id}/messages/{message_id}">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages/messages.py">retrieve</a>(message_id, \*, thread_id) -> <a href="./src/openai/types/beta/threads/message.py">Message</a></code> | |
| 323 | - <code title="post /threads/{thread_id}/messages/{message_id}">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages/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> | |
| 324 | - <code title="get /threads/{thread_id}/messages">client.beta.threads.messages.<a href="./src/openai/resources/beta/threads/messages/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> | |
baa9f07fRobert Craigie2 years ago | 325 | |
| 326 | #### Files | |
| 327 | | |
| 328 | Types: | |
| 329 | | |
| 330 | ```python | |
| 331 | from openai.types.beta.threads.messages import MessageFile | |
| 332 | ``` | |
| 333 | | |
| 334 | Methods: | |
| 335 | | |
| 336 | - <code title="get /threads/{thread_id}/messages/{message_id}/files/{file_id}">client.beta.threads.messages.files.<a href="./src/openai/resources/beta/threads/messages/files.py">retrieve</a>(file_id, \*, thread_id, message_id) -> <a href="./src/openai/types/beta/threads/messages/message_file.py">MessageFile</a></code> | |
| 337 | - <code title="get /threads/{thread_id}/messages/{message_id}/files">client.beta.threads.messages.files.<a href="./src/openai/resources/beta/threads/messages/files.py">list</a>(message_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/messages/file_list_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/messages/message_file.py">SyncCursorPage[MessageFile]</a></code> |