diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/__init__.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..946e381f1b60ddc737dbc2254df66da649b62050 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/__init__.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e727ea8af489f1953b8338a13390c87dc6d5d620 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_response_format.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_response_format.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f598039bfcfc9c86af21afdddf6e243c5c7fae9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/audio_response_format.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/auto_file_chunking_strategy_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/auto_file_chunking_strategy_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b247b206c0f4a116447ece2c04486acaf4bc88b1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/auto_file_chunking_strategy_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8f3a63884c77e4151bb747c9e7dc7608b6c6457 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c889871ebc2928def31412360f53dad92d3dd516 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_error.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_error.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6a88d081ba7059c166e8f8387850d0f4951cae2 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_error.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b103b11f589c7bba7e149e6f9afef5cbc3e4c37 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_request_counts.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_request_counts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca1ef344ec1c1af4144f2270bb0d23ac58d6c710 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_request_counts.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_usage.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_usage.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b95e9c9e245593311632575d7b03906a7d2335f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/batch_usage.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/chat_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/chat_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf485b8d4e9b2077b381f49472465caa21443a38 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/chat_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f17f3996e0ae70db1d0fb4877e7220605a0daf8b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_choice.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_choice.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ed150196583e0dff8fe571b1a774bc297554ddc Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_choice.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6fdcb0e037d498b4af0509fe6db15495b67edbc Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_usage.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_usage.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1888f628586d62408a2393526077fdedf8b27962 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/completion_usage.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dc10da83b51bf2670b9f70c223ffbd5091f0396 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ecc4ed74c9869c1d1dc11cd2b51f2d4a032619e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_create_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..805d5cffb05468e5a25a68677270d98ad8ae2972 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..886dbb645147d5a466e88504e870ff077a7ca4d2 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_list_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_retrieve_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_retrieve_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82c730f12c96a1e4754496711d5ce896e085f697 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/container_retrieve_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/create_embedding_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/create_embedding_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe9c2df4fa580df173e348f265fc9b17bf64526a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/create_embedding_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c224e4be285d166f16742a1ea61c3ad11828c47f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..792524c9f2b4398bb3b7c20862ca55b1c7e5ead4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd46b83c360acd913e35777cc0dc1cf6f96b8c64 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/embedding_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35b9cdd1809e4b57c208f7f751151d8960d71bd9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d71e22a5bcfb74177fa8131903d719ac34f9c0d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_create_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_custom_data_source_config.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_custom_data_source_config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f2aede1c64c82b848caf41c740bf42772974402 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_custom_data_source_config.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_delete_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_delete_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c75ddc6d28a34f8643feb4e37821da2d33a2bc52 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_delete_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37fee5d15e5485e7601fe01cb8a9720db6848d82 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a8ad1196851f8c9822993c3c9691964e01bd857 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_list_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_retrieve_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_retrieve_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..742ae27416b823938eb6503409a2ea004341b117 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_retrieve_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_stored_completions_data_source_config.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_stored_completions_data_source_config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..646627ab79b21b3ee649072ee8c45aeba46ab805 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_stored_completions_data_source_config.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ca0d9159b2a15dd71607cdaddb7b13d5ae6be99 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce16ef5c79fb780fec6e8e948049ef80f34be46c Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/eval_update_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b75d709e7d3a05da6d8df2cc6c8f5c45c0e399b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9fe2ee4b67e35c75446f0bd38e62c6c34e35c95 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_chunking_strategy_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3337dd76d7ba38adadf965673e0fec3fb9b6b872 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db84e83da2de79a86c4ca0db8ebd8ce7d57102bb Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_deleted.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_deleted.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8a2fd18a8b56b5a36cd562fc395fdc686024140 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_deleted.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e372203051cc9ba890eac83ec7be0b7993386e58 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_object.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11212bf9453109790607af1b5527b8cd787928b8 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_object.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_purpose.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_purpose.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c14115bc1e80202c1a3c54be3d79704b37652764 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/file_purpose.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c0434d19fc73b22eb4858d987a9506371622c1b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_create_variation_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_create_variation_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..caba82ca1243746c74994afa169427c352491441 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_create_variation_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_completed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_completed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a0720e71fd9eafe2b3f541bdd75146ce76c04a3 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_completed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6a0bae265d8613cf2c650bf491f8cfa900eddd1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_partial_image_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_partial_image_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2739866a398f73e1edb09ccebb7c3e71c2004f13 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_partial_image_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_stream_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_stream_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0512525ee02c5b873a5e60b4a2e5bc75f8ab8cb6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_edit_stream_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_completed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_completed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6689789d51243c9c114847e4df70c5a42b5afa53 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_completed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_partial_image_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_partial_image_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9eec1a7b1fa6b3359e63b6832d78bce78eaa85d9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_partial_image_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_stream_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_stream_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d10520fe219446ae13db0971a587f0b2116d96cf Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_gen_stream_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_generate_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_generate_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72416e48088a339ee773f4f3175f370d9c0e8dfd Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_generate_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67711895e964ee93fddd73846c22577e1e7ed34c Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/image_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/images_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/images_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6273c6667aabe81ec6c598c713bb2a1b1d6aff63 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/images_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a5fac8542bbe434ba0bca76b0a7774388f09fce Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/model_deleted.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/model_deleted.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c30e043435f01eb9f56e60ee90f73442cca6bd48 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/model_deleted.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..151fb20198fa58cd191a22bdcb948a572feaf078 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44e65b512b7c105056ff9aa3cea646d2b656d562 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fb1044bebd002393a1be857b9edfb61e051a740 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_create_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_image_url_input_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_image_url_input_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66bff111f9a4a978bfa028cfb815fb22be245106 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_image_url_input_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92288e613f2dde69e55ca49810d2b6f26f96d374 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_multi_modal_input_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_multi_modal_input_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1e80dcbd45616afcbb688850bc20b6e51ce07b1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_multi_modal_input_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_text_input_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_text_input_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e742e8e0bf0786f14b24f0bbe31d57b3858bce30 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/moderation_text_input_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/other_file_chunking_strategy_object.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/other_file_chunking_strategy_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b7414326c4a5307585696d34c715cbdbadee97e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/other_file_chunking_strategy_object.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35e2e21c7a32d0e783320c627c591e0287a08be5 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fb568c47030fd5a8f21ca35fb0d4b90f178cc66 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a64a3d7158fe3521633c413427f758d001dd366 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_object_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aee9367d6f22e7aed7f42074e30d799b89b31908 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/static_file_chunking_strategy_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cc44e3619445277d4ed7ee980a09578b9e456ff Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_complete_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_complete_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a38d4399c221b7cb98a62aeb902e2d871e97c49e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_complete_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc4ad3737a0af143b8db2d550dbac79f7841f3d7 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/upload_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ef0639300eebab0babf9c25f4d73bf443034883 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d87412c73a04af54db9c9725d24ea5b7f66e5115 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_deleted.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_deleted.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc9b4e6e4c0a1effa7cd024388c8b7124c49fbad Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_deleted.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d73777dc64921e08db21b1761fc508930ff0d1e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42a82ca90a260010455860a74b131b06e59c8440 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..712ba1cc58c0a959058d175e8be45389c3fda040 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_search_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_update_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_update_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22ad659c2c4e37e0fb9192aa153b8462fb409232 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/vector_store_update_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6bcb22af177f87202595f67a28a3064b8f351a66 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_error.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_error.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fc3232725b7dddee29d087402213bbae2fb1852 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_error.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b30da84a6b0884d280c7ddeb52e174524e9f918 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_delete_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_delete_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d3011c5304a2e8b091f2b76cebb005862632b8c Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_delete_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_download_content_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_download_content_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a54fd539428250434b009bdc79094786f831d70 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_download_content_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_list_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d0b4edebf8ac0fc359fd561640e6ab1a343486b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_list_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b245f6ef4cb456e2f70032633c579fbef23f52af Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23ef6f1f7e3da27d4a37321f707ea98d3630f9a3 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_model_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_remix_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_remix_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efb8512bef6ec3f0ed3357f020e31d0628c9a8cf Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_remix_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_seconds.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_seconds.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b79a88513b5d68c1fe678664c4a133c366e8359 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_seconds.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_size.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_size.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b77a5bee344505c1b051e96e3c0530e9692131ae Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/video_size.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/__pycache__/websocket_connection_options.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/__pycache__/websocket_connection_options.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b22a8f559e52c8ccd15734c58132aad3db4318a1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/__pycache__/websocket_connection_options.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__init__.py b/py311/lib/python3.11/site-packages/openai/types/audio/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ff2b8185d661dea0e68639c2180a81ff4950e31 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/__init__.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .translation import Translation as Translation +from .speech_model import SpeechModel as SpeechModel +from .transcription import Transcription as Transcription +from .transcription_word import TranscriptionWord as TranscriptionWord +from .translation_verbose import TranslationVerbose as TranslationVerbose +from .speech_create_params import SpeechCreateParams as SpeechCreateParams +from .transcription_include import TranscriptionInclude as TranscriptionInclude +from .transcription_segment import TranscriptionSegment as TranscriptionSegment +from .transcription_verbose import TranscriptionVerbose as TranscriptionVerbose +from .transcription_diarized import TranscriptionDiarized as TranscriptionDiarized +from .translation_create_params import TranslationCreateParams as TranslationCreateParams +from .transcription_stream_event import TranscriptionStreamEvent as TranscriptionStreamEvent +from .transcription_create_params import TranscriptionCreateParams as TranscriptionCreateParams +from .translation_create_response import TranslationCreateResponse as TranslationCreateResponse +from .transcription_create_response import TranscriptionCreateResponse as TranscriptionCreateResponse +from .transcription_text_done_event import TranscriptionTextDoneEvent as TranscriptionTextDoneEvent +from .transcription_diarized_segment import TranscriptionDiarizedSegment as TranscriptionDiarizedSegment +from .transcription_text_delta_event import TranscriptionTextDeltaEvent as TranscriptionTextDeltaEvent +from .transcription_text_segment_event import TranscriptionTextSegmentEvent as TranscriptionTextSegmentEvent diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/__init__.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fcd80d14af36aa01ac4d1254d4ff6cead543090 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/__init__.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e01ef13996ceaa59bd6f0b6d3b111b0c651b3c11 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_model.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_model.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7515233be97af1f67b07ff003dfb8ba7880ceab8 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/speech_model.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c34d94355699aaf65c3c8242207654321062ff6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64a141347d62733d75c5287c9400d4d348dfdd6f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..448173f5efe114b6bbb3676ab9a3ab0d8c7ff164 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_create_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fa45984b55f3e026518eda0b69068233120a192 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized_segment.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized_segment.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff952163cb8071cd7550ceec95ef45ea756077c5 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_diarized_segment.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_include.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_include.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..308c8f3bcb1db746142fb886924cab73390ca299 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_include.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_segment.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_segment.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a8b59224f4aee34e658228a5c6e87f22c483a2b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_segment.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_stream_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_stream_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1deac9eb562e7074a1499f23c02ab042bc938a03 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_stream_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1dc0de141d172a5a3f00ad67c8dce3e264e56e2a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b0f317a0dcf147021c50caa2b28740cb2304eb6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_segment_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_segment_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cce751f213925ab4525a849cdfa5b467e84ff670 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_text_segment_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_verbose.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_verbose.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0eae73ce861e88984681d81827e45f351d2c98b6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_verbose.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_word.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_word.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a9665288e6e2d4a1b86149dc131afdf55b6f0fe Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/transcription_word.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6887c7b887e87a5874d4f5705c19eb56bd7d1c3f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c2629bddbdb72d21ff99827d01c235c93fb905a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74341df2a0acfacafc455cbc42743bb8f2d2425f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_create_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_verbose.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_verbose.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d948cef1d447108778767ea01ba8619636d42e0 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/audio/__pycache__/translation_verbose.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/speech_create_params.py b/py311/lib/python3.11/site-packages/openai/types/audio/speech_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..417df5b218851adc342e7a0b7138dd2645d4ba13 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/speech_create_params.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypedDict + +from .speech_model import SpeechModel + +__all__ = ["SpeechCreateParams"] + + +class SpeechCreateParams(TypedDict, total=False): + input: Required[str] + """The text to generate audio for. The maximum length is 4096 characters.""" + + model: Required[Union[str, SpeechModel]] + """ + One of the available [TTS models](https://platform.openai.com/docs/models#tts): + `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. + """ + + voice: Required[ + Union[str, Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"]] + ] + """The voice to use when generating the audio. + + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. + Previews of the voices are available in the + [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). + """ + + instructions: str + """Control the voice of your generated audio with additional instructions. + + Does not work with `tts-1` or `tts-1-hd`. + """ + + response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm"] + """The format to audio in. + + Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. + """ + + speed: float + """The speed of the generated audio. + + Select a value from `0.25` to `4.0`. `1.0` is the default. + """ + + stream_format: Literal["sse", "audio"] + """The format to stream the audio in. + + Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or + `tts-1-hd`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/speech_model.py b/py311/lib/python3.11/site-packages/openai/types/audio/speech_model.py new file mode 100644 index 0000000000000000000000000000000000000000..31294a05b6b82d54ddeb8aac4c32eaaba6b70412 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/speech_model.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SpeechModel"] + +SpeechModel: TypeAlias = Literal["tts-1", "tts-1-hd", "gpt-4o-mini-tts", "gpt-4o-mini-tts-2025-12-15"] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription.py new file mode 100644 index 0000000000000000000000000000000000000000..cbae8bf750a8cb3db56c3218c51e401a35fb90b2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription.py @@ -0,0 +1,81 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["Transcription", "Logprob", "Usage", "UsageTokens", "UsageTokensInputTokenDetails", "UsageDuration"] + + +class Logprob(BaseModel): + token: Optional[str] = None + """The token in the transcription.""" + + bytes: Optional[List[float]] = None + """The bytes of the token.""" + + logprob: Optional[float] = None + """The log probability of the token.""" + + +class UsageTokensInputTokenDetails(BaseModel): + """Details about the input tokens billed for this request.""" + + audio_tokens: Optional[int] = None + """Number of audio tokens billed for this request.""" + + text_tokens: Optional[int] = None + """Number of text tokens billed for this request.""" + + +class UsageTokens(BaseModel): + """Usage statistics for models billed by token usage.""" + + input_tokens: int + """Number of input tokens billed for this request.""" + + output_tokens: int + """Number of output tokens generated.""" + + total_tokens: int + """Total number of tokens used (input + output).""" + + type: Literal["tokens"] + """The type of the usage object. Always `tokens` for this variant.""" + + input_token_details: Optional[UsageTokensInputTokenDetails] = None + """Details about the input tokens billed for this request.""" + + +class UsageDuration(BaseModel): + """Usage statistics for models billed by audio input duration.""" + + seconds: float + """Duration of the input audio in seconds.""" + + type: Literal["duration"] + """The type of the usage object. Always `duration` for this variant.""" + + +Usage: TypeAlias = Annotated[Union[UsageTokens, UsageDuration], PropertyInfo(discriminator="type")] + + +class Transcription(BaseModel): + """ + Represents a transcription response returned by model, based on the provided input. + """ + + text: str + """The transcribed text.""" + + logprobs: Optional[List[Logprob]] = None + """The log probabilities of the tokens in the transcription. + + Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` + if `logprobs` is added to the `include` array. + """ + + usage: Optional[Usage] = None + """Token usage statistics for the request.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_params.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..15540fc73f16fa26917bee0c80e854cc77a788ab --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_params.py @@ -0,0 +1,172 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import FileTypes, SequenceNotStr +from ..audio_model import AudioModel +from .transcription_include import TranscriptionInclude +from ..audio_response_format import AudioResponseFormat + +__all__ = [ + "TranscriptionCreateParamsBase", + "ChunkingStrategy", + "ChunkingStrategyVadConfig", + "TranscriptionCreateParamsNonStreaming", + "TranscriptionCreateParamsStreaming", +] + + +class TranscriptionCreateParamsBase(TypedDict, total=False): + file: Required[FileTypes] + """ + The audio file object (not file name) to transcribe, in one of these formats: + flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + """ + + model: Required[Union[str, AudioModel]] + """ID of the model to use. + + The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, + `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open + source Whisper V2 model), and `gpt-4o-transcribe-diarize`. + """ + + chunking_strategy: Optional[ChunkingStrategy] + """Controls how the audio is cut into chunks. + + When set to `"auto"`, the server first normalizes loudness and then uses voice + activity detection (VAD) to choose boundaries. `server_vad` object can be + provided to tweak VAD detection parameters manually. If unset, the audio is + transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` + for inputs longer than 30 seconds. + """ + + include: List[TranscriptionInclude] + """ + Additional information to include in the transcription response. `logprobs` will + return the log probabilities of the tokens in the response to understand the + model's confidence in the transcription. `logprobs` only works with + response_format set to `json` and only with the models `gpt-4o-transcribe`, + `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is + not supported when using `gpt-4o-transcribe-diarize`. + """ + + known_speaker_names: SequenceNotStr[str] + """ + Optional list of speaker names that correspond to the audio samples provided in + `known_speaker_references[]`. Each entry should be a short identifier (for + example `customer` or `agent`). Up to 4 speakers are supported. + """ + + known_speaker_references: SequenceNotStr[str] + """ + Optional list of audio samples (as + [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) + that contain known speaker references matching `known_speaker_names[]`. Each + sample must be between 2 and 10 seconds, and can use any of the same input audio + formats supported by `file`. + """ + + language: str + """The language of the input audio. + + Supplying the input language in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) + format will improve accuracy and latency. + """ + + prompt: str + """An optional text to guide the model's style or continue a previous audio + segment. + + The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) + should match the audio language. This field is not supported when using + `gpt-4o-transcribe-diarize`. + """ + + response_format: AudioResponseFormat + """ + The format of the output, in one of these options: `json`, `text`, `srt`, + `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and + `gpt-4o-mini-transcribe`, the only supported format is `json`. For + `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and + `diarized_json`, with `diarized_json` required to receive speaker annotations. + """ + + temperature: float + """The sampling temperature, between 0 and 1. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. If set to 0, the model will use + [log probability](https://en.wikipedia.org/wiki/Log_probability) to + automatically increase the temperature until certain thresholds are hit. + """ + + timestamp_granularities: List[Literal["word", "segment"]] + """The timestamp granularities to populate for this transcription. + + `response_format` must be set `verbose_json` to use timestamp granularities. + Either or both of these options are supported: `word`, or `segment`. Note: There + is no additional latency for segment timestamps, but generating word timestamps + incurs additional latency. This option is not available for + `gpt-4o-transcribe-diarize`. + """ + + +class ChunkingStrategyVadConfig(TypedDict, total=False): + type: Required[Literal["server_vad"]] + """Must be set to `server_vad` to enable manual chunking using server side VAD.""" + + prefix_padding_ms: int + """Amount of audio to include before the VAD detected speech (in milliseconds).""" + + silence_duration_ms: int + """ + Duration of silence to detect speech stop (in milliseconds). With shorter values + the model will respond more quickly, but may jump in on short pauses from the + user. + """ + + threshold: float + """Sensitivity threshold (0.0 to 1.0) for voice activity detection. + + A higher threshold will require louder audio to activate the model, and thus + might perform better in noisy environments. + """ + + +ChunkingStrategy: TypeAlias = Union[Literal["auto"], ChunkingStrategyVadConfig] + + +class TranscriptionCreateParamsNonStreaming(TranscriptionCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) + for more information. + + Note: Streaming is not supported for the `whisper-1` model and will be ignored. + """ + + +class TranscriptionCreateParamsStreaming(TranscriptionCreateParamsBase): + stream: Required[Literal[True]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) + for more information. + + Note: Streaming is not supported for the `whisper-1` model and will be ignored. + """ + + +TranscriptionCreateParams = Union[TranscriptionCreateParamsNonStreaming, TranscriptionCreateParamsStreaming] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_response.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..5717a3e7017d1746cc1406b5b6a1f2227a374b63 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_create_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +from .transcription import Transcription +from .transcription_verbose import TranscriptionVerbose +from .transcription_diarized import TranscriptionDiarized + +__all__ = ["TranscriptionCreateResponse"] + +TranscriptionCreateResponse: TypeAlias = Union[Transcription, TranscriptionDiarized, TranscriptionVerbose] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized.py new file mode 100644 index 0000000000000000000000000000000000000000..07585fe2390395716b162a6f45c181b33f5ea851 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .transcription_diarized_segment import TranscriptionDiarizedSegment + +__all__ = ["TranscriptionDiarized", "Usage", "UsageTokens", "UsageTokensInputTokenDetails", "UsageDuration"] + + +class UsageTokensInputTokenDetails(BaseModel): + """Details about the input tokens billed for this request.""" + + audio_tokens: Optional[int] = None + """Number of audio tokens billed for this request.""" + + text_tokens: Optional[int] = None + """Number of text tokens billed for this request.""" + + +class UsageTokens(BaseModel): + """Usage statistics for models billed by token usage.""" + + input_tokens: int + """Number of input tokens billed for this request.""" + + output_tokens: int + """Number of output tokens generated.""" + + total_tokens: int + """Total number of tokens used (input + output).""" + + type: Literal["tokens"] + """The type of the usage object. Always `tokens` for this variant.""" + + input_token_details: Optional[UsageTokensInputTokenDetails] = None + """Details about the input tokens billed for this request.""" + + +class UsageDuration(BaseModel): + """Usage statistics for models billed by audio input duration.""" + + seconds: float + """Duration of the input audio in seconds.""" + + type: Literal["duration"] + """The type of the usage object. Always `duration` for this variant.""" + + +Usage: TypeAlias = Annotated[Union[UsageTokens, UsageDuration], PropertyInfo(discriminator="type")] + + +class TranscriptionDiarized(BaseModel): + """ + Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations. + """ + + duration: float + """Duration of the input audio in seconds.""" + + segments: List[TranscriptionDiarizedSegment] + """Segments of the transcript annotated with timestamps and speaker labels.""" + + task: Literal["transcribe"] + """The type of task that was run. Always `transcribe`.""" + + text: str + """The concatenated transcript text for the entire audio input.""" + + usage: Optional[Usage] = None + """Token or duration usage statistics for the request.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized_segment.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized_segment.py new file mode 100644 index 0000000000000000000000000000000000000000..fcfdb3634f17a04cd69c29b08c2e9ed551e8b484 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_diarized_segment.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TranscriptionDiarizedSegment"] + + +class TranscriptionDiarizedSegment(BaseModel): + """A segment of diarized transcript text with speaker metadata.""" + + id: str + """Unique identifier for the segment.""" + + end: float + """End timestamp of the segment in seconds.""" + + speaker: str + """Speaker label for this segment. + + When known speakers are provided, the label matches `known_speaker_names[]`. + Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, + ...). + """ + + start: float + """Start timestamp of the segment in seconds.""" + + text: str + """Transcript text for this segment.""" + + type: Literal["transcript.text.segment"] + """The type of the segment. Always `transcript.text.segment`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_include.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_include.py new file mode 100644 index 0000000000000000000000000000000000000000..0e464ac93422febca5c4a84bfd96f693ea02b59b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_include.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["TranscriptionInclude"] + +TranscriptionInclude: TypeAlias = Literal["logprobs"] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_segment.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_segment.py new file mode 100644 index 0000000000000000000000000000000000000000..522c401ebb6635012bb113b6f148f504872dfc27 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_segment.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel + +__all__ = ["TranscriptionSegment"] + + +class TranscriptionSegment(BaseModel): + id: int + """Unique identifier of the segment.""" + + avg_logprob: float + """Average logprob of the segment. + + If the value is lower than -1, consider the logprobs failed. + """ + + compression_ratio: float + """Compression ratio of the segment. + + If the value is greater than 2.4, consider the compression failed. + """ + + end: float + """End time of the segment in seconds.""" + + no_speech_prob: float + """Probability of no speech in the segment. + + If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this + segment silent. + """ + + seek: int + """Seek offset of the segment.""" + + start: float + """Start time of the segment in seconds.""" + + temperature: float + """Temperature parameter used for generating the segment.""" + + text: str + """Text content of the segment.""" + + tokens: List[int] + """Array of token IDs for the text content.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_stream_event.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_stream_event.py new file mode 100644 index 0000000000000000000000000000000000000000..77d3a3aeec7cce23bc535a4df6708ee8c5805a3b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_stream_event.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .transcription_text_done_event import TranscriptionTextDoneEvent +from .transcription_text_delta_event import TranscriptionTextDeltaEvent +from .transcription_text_segment_event import TranscriptionTextSegmentEvent + +__all__ = ["TranscriptionStreamEvent"] + +TranscriptionStreamEvent: TypeAlias = Annotated[ + Union[TranscriptionTextSegmentEvent, TranscriptionTextDeltaEvent, TranscriptionTextDoneEvent], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..a6e83133c8078a1daa31a10df4b3ae0c80034fff --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_delta_event.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TranscriptionTextDeltaEvent", "Logprob"] + + +class Logprob(BaseModel): + token: Optional[str] = None + """The token that was used to generate the log probability.""" + + bytes: Optional[List[int]] = None + """The bytes that were used to generate the log probability.""" + + logprob: Optional[float] = None + """The log probability of the token.""" + + +class TranscriptionTextDeltaEvent(BaseModel): + """Emitted when there is an additional text delta. + + This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. + """ + + delta: str + """The text delta that was additionally transcribed.""" + + type: Literal["transcript.text.delta"] + """The type of the event. Always `transcript.text.delta`.""" + + logprobs: Optional[List[Logprob]] = None + """The log probabilities of the delta. + + Only included if you + [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) + with the `include[]` parameter set to `logprobs`. + """ + + segment_id: Optional[str] = None + """Identifier of the diarized segment that this delta belongs to. + + Only present when using `gpt-4o-transcribe-diarize`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_done_event.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c8f7fc0769404787cfa5654e1c9649a90a4b383b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_done_event.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TranscriptionTextDoneEvent", "Logprob", "Usage", "UsageInputTokenDetails"] + + +class Logprob(BaseModel): + token: Optional[str] = None + """The token that was used to generate the log probability.""" + + bytes: Optional[List[int]] = None + """The bytes that were used to generate the log probability.""" + + logprob: Optional[float] = None + """The log probability of the token.""" + + +class UsageInputTokenDetails(BaseModel): + """Details about the input tokens billed for this request.""" + + audio_tokens: Optional[int] = None + """Number of audio tokens billed for this request.""" + + text_tokens: Optional[int] = None + """Number of text tokens billed for this request.""" + + +class Usage(BaseModel): + """Usage statistics for models billed by token usage.""" + + input_tokens: int + """Number of input tokens billed for this request.""" + + output_tokens: int + """Number of output tokens generated.""" + + total_tokens: int + """Total number of tokens used (input + output).""" + + type: Literal["tokens"] + """The type of the usage object. Always `tokens` for this variant.""" + + input_token_details: Optional[UsageInputTokenDetails] = None + """Details about the input tokens billed for this request.""" + + +class TranscriptionTextDoneEvent(BaseModel): + """Emitted when the transcription is complete. + + Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. + """ + + text: str + """The text that was transcribed.""" + + type: Literal["transcript.text.done"] + """The type of the event. Always `transcript.text.done`.""" + + logprobs: Optional[List[Logprob]] = None + """The log probabilities of the individual tokens in the transcription. + + Only included if you + [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) + with the `include[]` parameter set to `logprobs`. + """ + + usage: Optional[Usage] = None + """Usage statistics for models billed by token usage.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_segment_event.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_segment_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e95472e6c6dbf154da96db321fa172d9e5146d43 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_text_segment_event.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TranscriptionTextSegmentEvent"] + + +class TranscriptionTextSegmentEvent(BaseModel): + """ + Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`. + """ + + id: str + """Unique identifier for the segment.""" + + end: float + """End timestamp of the segment in seconds.""" + + speaker: str + """Speaker label for this segment.""" + + start: float + """Start timestamp of the segment in seconds.""" + + text: str + """Transcript text for this segment.""" + + type: Literal["transcript.text.segment"] + """The type of the event. Always `transcript.text.segment`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_verbose.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_verbose.py new file mode 100644 index 0000000000000000000000000000000000000000..b1a95e9c7285feda1cc29cc2e4ebec0f0252b13e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_verbose.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .transcription_word import TranscriptionWord +from .transcription_segment import TranscriptionSegment + +__all__ = ["TranscriptionVerbose", "Usage"] + + +class Usage(BaseModel): + """Usage statistics for models billed by audio input duration.""" + + seconds: float + """Duration of the input audio in seconds.""" + + type: Literal["duration"] + """The type of the usage object. Always `duration` for this variant.""" + + +class TranscriptionVerbose(BaseModel): + """ + Represents a verbose json transcription response returned by model, based on the provided input. + """ + + duration: float + """The duration of the input audio.""" + + language: str + """The language of the input audio.""" + + text: str + """The transcribed text.""" + + segments: Optional[List[TranscriptionSegment]] = None + """Segments of the transcribed text and their corresponding details.""" + + usage: Optional[Usage] = None + """Usage statistics for models billed by audio input duration.""" + + words: Optional[List[TranscriptionWord]] = None + """Extracted words and their corresponding timestamps.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/transcription_word.py b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_word.py new file mode 100644 index 0000000000000000000000000000000000000000..2ce682f957b493336359b2963e903b68ce4a4334 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/transcription_word.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["TranscriptionWord"] + + +class TranscriptionWord(BaseModel): + end: float + """End time of the word in seconds.""" + + start: float + """Start time of the word in seconds.""" + + word: str + """The text content of the word.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/translation.py b/py311/lib/python3.11/site-packages/openai/types/audio/translation.py new file mode 100644 index 0000000000000000000000000000000000000000..efc56f7f9b2303e3ce9f0c5075f1d7cf3bb8812c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/translation.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["Translation"] + + +class Translation(BaseModel): + text: str diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_params.py b/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b23a1853751fa3448b4788515805757a5208d118 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_params.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypedDict + +from ..._types import FileTypes +from ..audio_model import AudioModel + +__all__ = ["TranslationCreateParams"] + + +class TranslationCreateParams(TypedDict, total=False): + file: Required[FileTypes] + """ + The audio file object (not file name) translate, in one of these formats: flac, + mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + """ + + model: Required[Union[str, AudioModel]] + """ID of the model to use. + + Only `whisper-1` (which is powered by our open source Whisper V2 model) is + currently available. + """ + + prompt: str + """An optional text to guide the model's style or continue a previous audio + segment. + + The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) + should be in English. + """ + + response_format: Literal["json", "text", "srt", "verbose_json", "vtt"] + """ + The format of the output, in one of these options: `json`, `text`, `srt`, + `verbose_json`, or `vtt`. + """ + + temperature: float + """The sampling temperature, between 0 and 1. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. If set to 0, the model will use + [log probability](https://en.wikipedia.org/wiki/Log_probability) to + automatically increase the temperature until certain thresholds are hit. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_response.py b/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..9953813c08ef2559e154bfd2d375e0abd098e2b7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/translation_create_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +from .translation import Translation +from .translation_verbose import TranslationVerbose + +__all__ = ["TranslationCreateResponse"] + +TranslationCreateResponse: TypeAlias = Union[Translation, TranslationVerbose] diff --git a/py311/lib/python3.11/site-packages/openai/types/audio/translation_verbose.py b/py311/lib/python3.11/site-packages/openai/types/audio/translation_verbose.py new file mode 100644 index 0000000000000000000000000000000000000000..27cb02d64fffc978c2a792fa18875829f6c6908b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/audio/translation_verbose.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .transcription_segment import TranscriptionSegment + +__all__ = ["TranslationVerbose"] + + +class TranslationVerbose(BaseModel): + duration: float + """The duration of the input audio.""" + + language: str + """The language of the output translation (always `english`).""" + + text: str + """The translated text.""" + + segments: Optional[List[TranscriptionSegment]] = None + """Segments of the translated text and their corresponding details.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/__init__.py b/py311/lib/python3.11/site-packages/openai/types/beta/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..deb2369677800e3727f63bad9755495ef62d1d08 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/__init__.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .thread import Thread as Thread +from .assistant import Assistant as Assistant +from .function_tool import FunctionTool as FunctionTool +from .assistant_tool import AssistantTool as AssistantTool +from .thread_deleted import ThreadDeleted as ThreadDeleted +from .chatkit_workflow import ChatKitWorkflow as ChatKitWorkflow +from .file_search_tool import FileSearchTool as FileSearchTool +from .assistant_deleted import AssistantDeleted as AssistantDeleted +from .function_tool_param import FunctionToolParam as FunctionToolParam +from .assistant_tool_param import AssistantToolParam as AssistantToolParam +from .thread_create_params import ThreadCreateParams as ThreadCreateParams +from .thread_update_params import ThreadUpdateParams as ThreadUpdateParams +from .assistant_list_params import AssistantListParams as AssistantListParams +from .assistant_tool_choice import AssistantToolChoice as AssistantToolChoice +from .code_interpreter_tool import CodeInterpreterTool as CodeInterpreterTool +from .assistant_stream_event import AssistantStreamEvent as AssistantStreamEvent +from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam +from .assistant_create_params import AssistantCreateParams as AssistantCreateParams +from .assistant_update_params import AssistantUpdateParams as AssistantUpdateParams +from .assistant_tool_choice_param import AssistantToolChoiceParam as AssistantToolChoiceParam +from .code_interpreter_tool_param import CodeInterpreterToolParam as CodeInterpreterToolParam +from .assistant_tool_choice_option import AssistantToolChoiceOption as AssistantToolChoiceOption +from .thread_create_and_run_params import ThreadCreateAndRunParams as ThreadCreateAndRunParams +from .assistant_tool_choice_function import AssistantToolChoiceFunction as AssistantToolChoiceFunction +from .assistant_response_format_option import AssistantResponseFormatOption as AssistantResponseFormatOption +from .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam as AssistantToolChoiceOptionParam +from .assistant_tool_choice_function_param import AssistantToolChoiceFunctionParam as AssistantToolChoiceFunctionParam +from .assistant_response_format_option_param import ( + AssistantResponseFormatOptionParam as AssistantResponseFormatOptionParam, +) diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant.py new file mode 100644 index 0000000000000000000000000000000000000000..61344f85a128ac3ec8491b62db3510a575a21a52 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant.py @@ -0,0 +1,141 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .assistant_tool import AssistantTool +from ..shared.metadata import Metadata +from .assistant_response_format_option import AssistantResponseFormatOption + +__all__ = ["Assistant", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"] + + +class ToolResourcesCodeInterpreter(BaseModel): + file_ids: Optional[List[str]] = None + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter`` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearch(BaseModel): + vector_store_ids: Optional[List[str]] = None + """ + The ID of the + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this assistant. There can be a maximum of 1 vector store attached to + the assistant. + """ + + +class ToolResources(BaseModel): + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: Optional[ToolResourcesCodeInterpreter] = None + + file_search: Optional[ToolResourcesFileSearch] = None + + +class Assistant(BaseModel): + """Represents an `assistant` that can call the model and use tools.""" + + id: str + """The identifier, which can be referenced in API endpoints.""" + + created_at: int + """The Unix timestamp (in seconds) for when the assistant was created.""" + + description: Optional[str] = None + """The description of the assistant. The maximum length is 512 characters.""" + + instructions: Optional[str] = None + """The system instructions that the assistant uses. + + The maximum length is 256,000 characters. + """ + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: str + """ID of the model to use. + + You can use the + [List models](https://platform.openai.com/docs/api-reference/models/list) API to + see all of your available models, or see our + [Model overview](https://platform.openai.com/docs/models) for descriptions of + them. + """ + + name: Optional[str] = None + """The name of the assistant. The maximum length is 256 characters.""" + + object: Literal["assistant"] + """The object type, which is always `assistant`.""" + + tools: List[AssistantTool] + """A list of tool enabled on the assistant. + + There can be a maximum of 128 tools per assistant. Tools can be of types + `code_interpreter`, `file_search`, or `function`. + """ + + response_format: Optional[AssistantResponseFormatOption] = None + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] = None + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + tool_resources: Optional[ToolResources] = None + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + top_p: Optional[float] = None + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_create_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..461d871ab564e6df409df6213c006dbcf92c2033 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_create_params.py @@ -0,0 +1,231 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..shared.chat_model import ChatModel +from .assistant_tool_param import AssistantToolParam +from ..shared_params.metadata import Metadata +from ..shared.reasoning_effort import ReasoningEffort +from .assistant_response_format_option_param import AssistantResponseFormatOptionParam + +__all__ = [ + "AssistantCreateParams", + "ToolResources", + "ToolResourcesCodeInterpreter", + "ToolResourcesFileSearch", + "ToolResourcesFileSearchVectorStore", + "ToolResourcesFileSearchVectorStoreChunkingStrategy", + "ToolResourcesFileSearchVectorStoreChunkingStrategyAuto", + "ToolResourcesFileSearchVectorStoreChunkingStrategyStatic", + "ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic", +] + + +class AssistantCreateParams(TypedDict, total=False): + model: Required[Union[str, ChatModel]] + """ID of the model to use. + + You can use the + [List models](https://platform.openai.com/docs/api-reference/models/list) API to + see all of your available models, or see our + [Model overview](https://platform.openai.com/docs/models) for descriptions of + them. + """ + + description: Optional[str] + """The description of the assistant. The maximum length is 512 characters.""" + + instructions: Optional[str] + """The system instructions that the assistant uses. + + The maximum length is 256,000 characters. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + name: Optional[str] + """The name of the assistant. The maximum length is 256 characters.""" + + reasoning_effort: Optional[ReasoningEffort] + """ + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported + reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool + calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not + support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + """ + + response_format: Optional[AssistantResponseFormatOptionParam] + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + tool_resources: Optional[ToolResources] + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + tools: Iterable[AssistantToolParam] + """A list of tool enabled on the assistant. + + There can be a maximum of 128 tools per assistant. Tools can be of types + `code_interpreter`, `file_search`, or `function`. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ + + +class ToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False): + """The default strategy. + + This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + """ + + type: Required[Literal["auto"]] + """Always `auto`.""" + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False): + chunk_overlap_tokens: Required[int] + """The number of tokens that overlap between chunks. The default value is `400`. + + Note that the overlap must not exceed half of `max_chunk_size_tokens`. + """ + + max_chunk_size_tokens: Required[int] + """The maximum number of tokens in each chunk. + + The default value is `800`. The minimum value is `100` and the maximum value is + `4096`. + """ + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False): + static: Required[ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic] + + type: Required[Literal["static"]] + """Always `static`.""" + + +ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[ + ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic +] + + +class ToolResourcesFileSearchVectorStore(TypedDict, total=False): + chunking_strategy: ToolResourcesFileSearchVectorStoreChunkingStrategy + """The chunking strategy used to chunk the file(s). + + If not set, will use the `auto` strategy. + """ + + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + add to the vector store. There can be a maximum of 10000 files in a vector + store. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class ToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + The + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this assistant. There can be a maximum of 1 vector store attached to + the assistant. + """ + + vector_stores: Iterable[ToolResourcesFileSearchVectorStore] + """ + A helper to create a + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + with file_ids and attach it to this assistant. There can be a maximum of 1 + vector store attached to the assistant. + """ + + +class ToolResources(TypedDict, total=False): + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ToolResourcesCodeInterpreter + + file_search: ToolResourcesFileSearch diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_deleted.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_deleted.py new file mode 100644 index 0000000000000000000000000000000000000000..3be40cd6b8f088ff674c7f7d0f35995d1cab39eb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_deleted.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AssistantDeleted"] + + +class AssistantDeleted(BaseModel): + id: str + + deleted: bool + + object: Literal["assistant.deleted"] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_list_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..834ffbcaf8fd7ffa4b8f4edb3786711ce3ca6e28 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_list_params.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["AssistantListParams"] + + +class AssistantListParams(TypedDict, total=False): + after: str + """A cursor for use in pagination. + + `after` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the + list. + """ + + before: str + """A cursor for use in pagination. + + `before` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, starting with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page + of the list. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """Sort order by the `created_at` timestamp of the objects. + + `asc` for ascending order and `desc` for descending order. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option.py new file mode 100644 index 0000000000000000000000000000000000000000..6f06a3442fbd6294d1aca77800b009e627304b0c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..shared.response_format_text import ResponseFormatText +from ..shared.response_format_json_object import ResponseFormatJSONObject +from ..shared.response_format_json_schema import ResponseFormatJSONSchema + +__all__ = ["AssistantResponseFormatOption"] + +AssistantResponseFormatOption: TypeAlias = Union[ + Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema +] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option_param.py new file mode 100644 index 0000000000000000000000000000000000000000..5e724a4d9851c49e8b9cf0fd4ed1536a2f057698 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_response_format_option_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..shared_params.response_format_text import ResponseFormatText +from ..shared_params.response_format_json_object import ResponseFormatJSONObject +from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema + +__all__ = ["AssistantResponseFormatOptionParam"] + +AssistantResponseFormatOptionParam: TypeAlias = Union[ + Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema +] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_stream_event.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_stream_event.py new file mode 100644 index 0000000000000000000000000000000000000000..87620a11d08be6ac5e838129ef9b618ef9cd9175 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_stream_event.py @@ -0,0 +1,390 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from .thread import Thread +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .threads.run import Run +from .threads.message import Message +from ..shared.error_object import ErrorObject +from .threads.runs.run_step import RunStep +from .threads.message_delta_event import MessageDeltaEvent +from .threads.runs.run_step_delta_event import RunStepDeltaEvent + +__all__ = [ + "AssistantStreamEvent", + "ThreadCreated", + "ThreadRunCreated", + "ThreadRunQueued", + "ThreadRunInProgress", + "ThreadRunRequiresAction", + "ThreadRunCompleted", + "ThreadRunIncomplete", + "ThreadRunFailed", + "ThreadRunCancelling", + "ThreadRunCancelled", + "ThreadRunExpired", + "ThreadRunStepCreated", + "ThreadRunStepInProgress", + "ThreadRunStepDelta", + "ThreadRunStepCompleted", + "ThreadRunStepFailed", + "ThreadRunStepCancelled", + "ThreadRunStepExpired", + "ThreadMessageCreated", + "ThreadMessageInProgress", + "ThreadMessageDelta", + "ThreadMessageCompleted", + "ThreadMessageIncomplete", + "ErrorEvent", +] + + +class ThreadCreated(BaseModel): + """ + Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. + """ + + data: Thread + """ + Represents a thread that contains + [messages](https://platform.openai.com/docs/api-reference/messages). + """ + + event: Literal["thread.created"] + + enabled: Optional[bool] = None + """Whether to enable input audio transcription.""" + + +class ThreadRunCreated(BaseModel): + """ + Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is created. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.created"] + + +class ThreadRunQueued(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `queued` status. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.queued"] + + +class ThreadRunInProgress(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to an `in_progress` status. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.in_progress"] + + +class ThreadRunRequiresAction(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `requires_action` status. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.requires_action"] + + +class ThreadRunCompleted(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is completed. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.completed"] + + +class ThreadRunIncomplete(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with status `incomplete`. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.incomplete"] + + +class ThreadRunFailed(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.failed"] + + +class ThreadRunCancelling(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `cancelling` status. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.cancelling"] + + +class ThreadRunCancelled(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is cancelled. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.cancelled"] + + +class ThreadRunExpired(BaseModel): + """ + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires. + """ + + data: Run + """ + Represents an execution run on a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.run.expired"] + + +class ThreadRunStepCreated(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is created. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.created"] + + +class ThreadRunStepInProgress(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.in_progress"] + + +class ThreadRunStepDelta(BaseModel): + """ + Occurs when parts of a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are being streamed. + """ + + data: RunStepDeltaEvent + """Represents a run step delta i.e. + + any changed fields on a run step during streaming. + """ + + event: Literal["thread.run.step.delta"] + + +class ThreadRunStepCompleted(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is completed. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.completed"] + + +class ThreadRunStepFailed(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.failed"] + + +class ThreadRunStepCancelled(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is cancelled. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.cancelled"] + + +class ThreadRunStepExpired(BaseModel): + """ + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires. + """ + + data: RunStep + """Represents a step in execution of a run.""" + + event: Literal["thread.run.step.expired"] + + +class ThreadMessageCreated(BaseModel): + """ + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is created. + """ + + data: Message + """ + Represents a message within a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.message.created"] + + +class ThreadMessageInProgress(BaseModel): + """ + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state. + """ + + data: Message + """ + Represents a message within a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.message.in_progress"] + + +class ThreadMessageDelta(BaseModel): + """ + Occurs when parts of a [Message](https://platform.openai.com/docs/api-reference/messages/object) are being streamed. + """ + + data: MessageDeltaEvent + """Represents a message delta i.e. + + any changed fields on a message during streaming. + """ + + event: Literal["thread.message.delta"] + + +class ThreadMessageCompleted(BaseModel): + """ + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is completed. + """ + + data: Message + """ + Represents a message within a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.message.completed"] + + +class ThreadMessageIncomplete(BaseModel): + """ + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) ends before it is completed. + """ + + data: Message + """ + Represents a message within a + [thread](https://platform.openai.com/docs/api-reference/threads). + """ + + event: Literal["thread.message.incomplete"] + + +class ErrorEvent(BaseModel): + """ + Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. + """ + + data: ErrorObject + + event: Literal["error"] + + +AssistantStreamEvent: TypeAlias = Annotated[ + Union[ + ThreadCreated, + ThreadRunCreated, + ThreadRunQueued, + ThreadRunInProgress, + ThreadRunRequiresAction, + ThreadRunCompleted, + ThreadRunIncomplete, + ThreadRunFailed, + ThreadRunCancelling, + ThreadRunCancelled, + ThreadRunExpired, + ThreadRunStepCreated, + ThreadRunStepInProgress, + ThreadRunStepDelta, + ThreadRunStepCompleted, + ThreadRunStepFailed, + ThreadRunStepCancelled, + ThreadRunStepExpired, + ThreadMessageCreated, + ThreadMessageInProgress, + ThreadMessageDelta, + ThreadMessageCompleted, + ThreadMessageIncomplete, + ErrorEvent, + ], + PropertyInfo(discriminator="event"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..1bde6858b1a6d401297ab8f5c19ea0343fb34332 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .function_tool import FunctionTool +from .file_search_tool import FileSearchTool +from .code_interpreter_tool import CodeInterpreterTool + +__all__ = ["AssistantTool"] + +AssistantTool: TypeAlias = Annotated[ + Union[CodeInterpreterTool, FileSearchTool, FunctionTool], PropertyInfo(discriminator="type") +] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice.py new file mode 100644 index 0000000000000000000000000000000000000000..cabded0b3c0f460202cefddf2527a45e2ffa7042 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .assistant_tool_choice_function import AssistantToolChoiceFunction + +__all__ = ["AssistantToolChoice"] + + +class AssistantToolChoice(BaseModel): + """Specifies a tool the model should use. + + Use to force the model to call a specific tool. + """ + + type: Literal["function", "code_interpreter", "file_search"] + """The type of the tool. If type is `function`, the function name must be set""" + + function: Optional[AssistantToolChoiceFunction] = None diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function.py new file mode 100644 index 0000000000000000000000000000000000000000..87f38310ca57d47a9f6d79ca63a0e4b6f254beea --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["AssistantToolChoiceFunction"] + + +class AssistantToolChoiceFunction(BaseModel): + name: str + """The name of the function to call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function_param.py new file mode 100644 index 0000000000000000000000000000000000000000..428857de91543e81ed4f62bffefd3b9fc6dca057 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_function_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AssistantToolChoiceFunctionParam"] + + +class AssistantToolChoiceFunctionParam(TypedDict, total=False): + name: Required[str] + """The name of the function to call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option.py new file mode 100644 index 0000000000000000000000000000000000000000..e57c3278fb5ec720e27dc7da84b44892404790db --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from .assistant_tool_choice import AssistantToolChoice + +__all__ = ["AssistantToolChoiceOption"] + +AssistantToolChoiceOption: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoice] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cc0053d37e9b1159844c22767d7d780e02ef58b0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_option_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from .assistant_tool_choice_param import AssistantToolChoiceParam + +__all__ = ["AssistantToolChoiceOptionParam"] + +AssistantToolChoiceOptionParam: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoiceParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_param.py new file mode 100644 index 0000000000000000000000000000000000000000..05916bb6689b2441417d371d759bcece14896d98 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_choice_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from .assistant_tool_choice_function_param import AssistantToolChoiceFunctionParam + +__all__ = ["AssistantToolChoiceParam"] + + +class AssistantToolChoiceParam(TypedDict, total=False): + """Specifies a tool the model should use. + + Use to force the model to call a specific tool. + """ + + type: Required[Literal["function", "code_interpreter", "file_search"]] + """The type of the tool. If type is `function`, the function name must be set""" + + function: AssistantToolChoiceFunctionParam diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..321c4b1ddbe9b11232ba3ec88ace26644fd1b0e4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_tool_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .function_tool_param import FunctionToolParam +from .file_search_tool_param import FileSearchToolParam +from .code_interpreter_tool_param import CodeInterpreterToolParam + +__all__ = ["AssistantToolParam"] + +AssistantToolParam: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/assistant_update_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..7896fcd9c69a7102761f81ba24034de1ddc4f051 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/assistant_update_params.py @@ -0,0 +1,197 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, TypedDict + +from ..._types import SequenceNotStr +from .assistant_tool_param import AssistantToolParam +from ..shared_params.metadata import Metadata +from ..shared.reasoning_effort import ReasoningEffort +from .assistant_response_format_option_param import AssistantResponseFormatOptionParam + +__all__ = ["AssistantUpdateParams", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"] + + +class AssistantUpdateParams(TypedDict, total=False): + description: Optional[str] + """The description of the assistant. The maximum length is 512 characters.""" + + instructions: Optional[str] + """The system instructions that the assistant uses. + + The maximum length is 256,000 characters. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: Union[ + str, + Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", + "gpt-5-2025-08-07", + "gpt-5-mini-2025-08-07", + "gpt-5-nano-2025-08-07", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "o3-mini", + "o3-mini-2025-01-31", + "o1", + "o1-2024-12-17", + "gpt-4o", + "gpt-4o-2024-11-20", + "gpt-4o-2024-08-06", + "gpt-4o-2024-05-13", + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4.5-preview", + "gpt-4.5-preview-2025-02-27", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-turbo-preview", + "gpt-4-1106-preview", + "gpt-4-vision-preview", + "gpt-4", + "gpt-4-0314", + "gpt-4-0613", + "gpt-4-32k", + "gpt-4-32k-0314", + "gpt-4-32k-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-16k-0613", + ], + ] + """ID of the model to use. + + You can use the + [List models](https://platform.openai.com/docs/api-reference/models/list) API to + see all of your available models, or see our + [Model overview](https://platform.openai.com/docs/models) for descriptions of + them. + """ + + name: Optional[str] + """The name of the assistant. The maximum length is 256 characters.""" + + reasoning_effort: Optional[ReasoningEffort] + """ + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported + reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool + calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not + support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + """ + + response_format: Optional[AssistantResponseFormatOptionParam] + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + tool_resources: Optional[ToolResources] + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + tools: Iterable[AssistantToolParam] + """A list of tool enabled on the assistant. + + There can be a maximum of 128 tools per assistant. Tools can be of types + `code_interpreter`, `file_search`, or `function`. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ + + +class ToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + Overrides the list of + [file](https://platform.openai.com/docs/api-reference/files) IDs made available + to the `code_interpreter` tool. There can be a maximum of 20 files associated + with the tool. + """ + + +class ToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + Overrides the + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this assistant. There can be a maximum of 1 vector store attached to + the assistant. + """ + + +class ToolResources(TypedDict, total=False): + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ToolResourcesCodeInterpreter + + file_search: ToolResourcesFileSearch diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/chatkit_workflow.py b/py311/lib/python3.11/site-packages/openai/types/beta/chatkit_workflow.py new file mode 100644 index 0000000000000000000000000000000000000000..b6f5b55b4a6288885251e5e628e03fbca9c3512f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/chatkit_workflow.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional + +from ..._models import BaseModel + +__all__ = ["ChatKitWorkflow", "Tracing"] + + +class Tracing(BaseModel): + """Tracing settings applied to the workflow.""" + + enabled: bool + """Indicates whether tracing is enabled.""" + + +class ChatKitWorkflow(BaseModel): + """Workflow metadata and state returned for the session.""" + + id: str + """Identifier of the workflow backing the session.""" + + state_variables: Optional[Dict[str, Union[str, bool, float]]] = None + """State variable key-value pairs applied when invoking the workflow. + + Defaults to null when no overrides were provided. + """ + + tracing: Tracing + """Tracing settings applied to the workflow.""" + + version: Optional[str] = None + """Specific workflow version used for the session. + + Defaults to null when using the latest deployment. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool.py b/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..17ab3de629fd2ffe2f638338a0d8a5bc66a8b561 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["CodeInterpreterTool"] + + +class CodeInterpreterTool(BaseModel): + type: Literal["code_interpreter"] + """The type of tool being defined: `code_interpreter`""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6916d7565f2066c75004f59058799f6fef49b6 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/code_interpreter_tool_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["CodeInterpreterToolParam"] + + +class CodeInterpreterToolParam(TypedDict, total=False): + type: Required[Literal["code_interpreter"]] + """The type of tool being defined: `code_interpreter`""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool.py b/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..9e33249e0b85a0729c6fb4b3f562477a7c6eb488 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool.py @@ -0,0 +1,64 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FileSearchTool", "FileSearch", "FileSearchRankingOptions"] + + +class FileSearchRankingOptions(BaseModel): + """The ranking options for the file search. + + If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. + + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + """ + + score_threshold: float + """The score threshold for the file search. + + All values must be a floating point number between 0 and 1. + """ + + ranker: Optional[Literal["auto", "default_2024_08_21"]] = None + """The ranker to use for the file search. + + If not specified will use the `auto` ranker. + """ + + +class FileSearch(BaseModel): + """Overrides for the file search tool.""" + + max_num_results: Optional[int] = None + """The maximum number of results the file search tool should output. + + The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number + should be between 1 and 50 inclusive. + + Note that the file search tool may output fewer than `max_num_results` results. + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + ranking_options: Optional[FileSearchRankingOptions] = None + """The ranking options for the file search. + + If not specified, the file search tool will use the `auto` ranker and a + score_threshold of 0. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + +class FileSearchTool(BaseModel): + type: Literal["file_search"] + """The type of tool being defined: `file_search`""" + + file_search: Optional[FileSearch] = None + """Overrides for the file search tool.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9906b4b2a4ab7c43b6dfda264bee7a594c7333f7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/file_search_tool_param.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["FileSearchToolParam", "FileSearch", "FileSearchRankingOptions"] + + +class FileSearchRankingOptions(TypedDict, total=False): + """The ranking options for the file search. + + If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. + + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + """ + + score_threshold: Required[float] + """The score threshold for the file search. + + All values must be a floating point number between 0 and 1. + """ + + ranker: Literal["auto", "default_2024_08_21"] + """The ranker to use for the file search. + + If not specified will use the `auto` ranker. + """ + + +class FileSearch(TypedDict, total=False): + """Overrides for the file search tool.""" + + max_num_results: int + """The maximum number of results the file search tool should output. + + The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number + should be between 1 and 50 inclusive. + + Note that the file search tool may output fewer than `max_num_results` results. + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + ranking_options: FileSearchRankingOptions + """The ranking options for the file search. + + If not specified, the file search tool will use the `auto` ranker and a + score_threshold of 0. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + +class FileSearchToolParam(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + file_search: FileSearch + """Overrides for the file search tool.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/function_tool.py b/py311/lib/python3.11/site-packages/openai/types/beta/function_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..f9227678dfd94a29988a3c4cda66e85c0cdc356a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/function_tool.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from ..shared.function_definition import FunctionDefinition + +__all__ = ["FunctionTool"] + + +class FunctionTool(BaseModel): + function: FunctionDefinition + + type: Literal["function"] + """The type of tool being defined: `function`""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/function_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/function_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..d906e02b8851941ff4ea38943a2c6ba7d3f228af --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/function_tool_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from ..shared_params.function_definition import FunctionDefinition + +__all__ = ["FunctionToolParam"] + + +class FunctionToolParam(TypedDict, total=False): + function: Required[FunctionDefinition] + + type: Required[Literal["function"]] + """The type of tool being defined: `function`""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/thread.py b/py311/lib/python3.11/site-packages/openai/types/beta/thread.py new file mode 100644 index 0000000000000000000000000000000000000000..83d90551944bbba8044415613722342c559fd172 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/thread.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from ..shared.metadata import Metadata + +__all__ = ["Thread", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"] + + +class ToolResourcesCodeInterpreter(BaseModel): + file_ids: Optional[List[str]] = None + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearch(BaseModel): + vector_store_ids: Optional[List[str]] = None + """ + The + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this thread. There can be a maximum of 1 vector store attached to + the thread. + """ + + +class ToolResources(BaseModel): + """ + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: Optional[ToolResourcesCodeInterpreter] = None + + file_search: Optional[ToolResourcesFileSearch] = None + + +class Thread(BaseModel): + """ + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + """ + + id: str + """The identifier, which can be referenced in API endpoints.""" + + created_at: int + """The Unix timestamp (in seconds) for when the thread was created.""" + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + object: Literal["thread"] + """The object type, which is always `thread`.""" + + tool_resources: Optional[ToolResources] = None + """ + A set of resources that are made available to the assistant's tools in this + thread. The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_and_run_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_and_run_params.py new file mode 100644 index 0000000000000000000000000000000000000000..c0aee3e9f87feda7e0274cd7b42a2287b76d237e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_and_run_params.py @@ -0,0 +1,422 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..shared.chat_model import ChatModel +from .assistant_tool_param import AssistantToolParam +from ..shared_params.metadata import Metadata +from .code_interpreter_tool_param import CodeInterpreterToolParam +from .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam +from .threads.message_content_part_param import MessageContentPartParam +from .assistant_response_format_option_param import AssistantResponseFormatOptionParam + +__all__ = [ + "ThreadCreateAndRunParamsBase", + "Thread", + "ThreadMessage", + "ThreadMessageAttachment", + "ThreadMessageAttachmentTool", + "ThreadMessageAttachmentToolFileSearch", + "ThreadToolResources", + "ThreadToolResourcesCodeInterpreter", + "ThreadToolResourcesFileSearch", + "ThreadToolResourcesFileSearchVectorStore", + "ThreadToolResourcesFileSearchVectorStoreChunkingStrategy", + "ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto", + "ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic", + "ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic", + "ToolResources", + "ToolResourcesCodeInterpreter", + "ToolResourcesFileSearch", + "TruncationStrategy", + "ThreadCreateAndRunParamsNonStreaming", + "ThreadCreateAndRunParamsStreaming", +] + + +class ThreadCreateAndRunParamsBase(TypedDict, total=False): + assistant_id: Required[str] + """ + The ID of the + [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + execute this run. + """ + + instructions: Optional[str] + """Override the default system message of the assistant. + + This is useful for modifying the behavior on a per-run basis. + """ + + max_completion_tokens: Optional[int] + """ + The maximum number of completion tokens that may be used over the course of the + run. The run will make a best effort to use only the number of completion tokens + specified, across multiple turns of the run. If the run exceeds the number of + completion tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + max_prompt_tokens: Optional[int] + """The maximum number of prompt tokens that may be used over the course of the run. + + The run will make a best effort to use only the number of prompt tokens + specified, across multiple turns of the run. If the run exceeds the number of + prompt tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: Union[str, ChatModel, None] + """ + The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + be used to execute this run. If a value is provided here, it will override the + model associated with the assistant. If not, the model associated with the + assistant will be used. + """ + + parallel_tool_calls: bool + """ + Whether to enable + [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + during tool use. + """ + + response_format: Optional[AssistantResponseFormatOptionParam] + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + thread: Thread + """Options to create a new thread. + + If no thread is provided when running a request, an empty thread will be + created. + """ + + tool_choice: Optional[AssistantToolChoiceOptionParam] + """ + Controls which (if any) tool is called by the model. `none` means the model will + not call any tools and instead generates a message. `auto` is the default value + and means the model can pick between generating a message or calling one or more + tools. `required` means the model must call one or more tools before responding + to the user. Specifying a particular tool like `{"type": "file_search"}` or + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + """ + + tool_resources: Optional[ToolResources] + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + tools: Optional[Iterable[AssistantToolParam]] + """Override the tools the assistant can use for this run. + + This is useful for modifying the behavior on a per-run basis. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ + + truncation_strategy: Optional[TruncationStrategy] + """Controls for how a thread will be truncated prior to the run. + + Use this to control the initial context window of the run. + """ + + +class ThreadMessageAttachmentToolFileSearch(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + +ThreadMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, ThreadMessageAttachmentToolFileSearch] + + +class ThreadMessageAttachment(TypedDict, total=False): + file_id: str + """The ID of the file to attach to the message.""" + + tools: Iterable[ThreadMessageAttachmentTool] + """The tools to add this file to.""" + + +class ThreadMessage(TypedDict, total=False): + content: Required[Union[str, Iterable[MessageContentPartParam]]] + """The text contents of the message.""" + + role: Required[Literal["user", "assistant"]] + """The role of the entity that is creating the message. Allowed values include: + + - `user`: Indicates the message is sent by an actual user and should be used in + most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this + value to insert messages from the assistant into the conversation. + """ + + attachments: Optional[Iterable[ThreadMessageAttachment]] + """A list of files attached to the message, and the tools they should be added to.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class ThreadToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False): + """The default strategy. + + This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + """ + + type: Required[Literal["auto"]] + """Always `auto`.""" + + +class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False): + chunk_overlap_tokens: Required[int] + """The number of tokens that overlap between chunks. The default value is `400`. + + Note that the overlap must not exceed half of `max_chunk_size_tokens`. + """ + + max_chunk_size_tokens: Required[int] + """The maximum number of tokens in each chunk. + + The default value is `800`. The minimum value is `100` and the maximum value is + `4096`. + """ + + +class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False): + static: Required[ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic] + + type: Required[Literal["static"]] + """Always `static`.""" + + +ThreadToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[ + ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto, + ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic, +] + + +class ThreadToolResourcesFileSearchVectorStore(TypedDict, total=False): + chunking_strategy: ThreadToolResourcesFileSearchVectorStoreChunkingStrategy + """The chunking strategy used to chunk the file(s). + + If not set, will use the `auto` strategy. + """ + + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + add to the vector store. There can be a maximum of 10000 files in a vector + store. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class ThreadToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + The + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this thread. There can be a maximum of 1 vector store attached to + the thread. + """ + + vector_stores: Iterable[ThreadToolResourcesFileSearchVectorStore] + """ + A helper to create a + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + with file_ids and attach it to this thread. There can be a maximum of 1 vector + store attached to the thread. + """ + + +class ThreadToolResources(TypedDict, total=False): + """ + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ThreadToolResourcesCodeInterpreter + + file_search: ThreadToolResourcesFileSearch + + +class Thread(TypedDict, total=False): + """Options to create a new thread. + + If no thread is provided when running a + request, an empty thread will be created. + """ + + messages: Iterable[ThreadMessage] + """ + A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + start the thread with. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + tool_resources: Optional[ThreadToolResources] + """ + A set of resources that are made available to the assistant's tools in this + thread. The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + +class ToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + The ID of the + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this assistant. There can be a maximum of 1 vector store attached to + the assistant. + """ + + +class ToolResources(TypedDict, total=False): + """A set of resources that are used by the assistant's tools. + + The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ToolResourcesCodeInterpreter + + file_search: ToolResourcesFileSearch + + +class TruncationStrategy(TypedDict, total=False): + """Controls for how a thread will be truncated prior to the run. + + Use this to control the initial context window of the run. + """ + + type: Required[Literal["auto", "last_messages"]] + """The truncation strategy to use for the thread. + + The default is `auto`. If set to `last_messages`, the thread will be truncated + to the n most recent messages in the thread. When set to `auto`, messages in the + middle of the thread will be dropped to fit the context length of the model, + `max_prompt_tokens`. + """ + + last_messages: Optional[int] + """ + The number of most recent messages from the thread when constructing the context + for the run. + """ + + +class ThreadCreateAndRunParamsNonStreaming(ThreadCreateAndRunParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +class ThreadCreateAndRunParamsStreaming(ThreadCreateAndRunParamsBase): + stream: Required[Literal[True]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +ThreadCreateAndRunParams = Union[ThreadCreateAndRunParamsNonStreaming, ThreadCreateAndRunParamsStreaming] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..ef83e3d4659bd61e64ec1eab33bc58a3cfae13da --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/thread_create_params.py @@ -0,0 +1,195 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..shared_params.metadata import Metadata +from .code_interpreter_tool_param import CodeInterpreterToolParam +from .threads.message_content_part_param import MessageContentPartParam + +__all__ = [ + "ThreadCreateParams", + "Message", + "MessageAttachment", + "MessageAttachmentTool", + "MessageAttachmentToolFileSearch", + "ToolResources", + "ToolResourcesCodeInterpreter", + "ToolResourcesFileSearch", + "ToolResourcesFileSearchVectorStore", + "ToolResourcesFileSearchVectorStoreChunkingStrategy", + "ToolResourcesFileSearchVectorStoreChunkingStrategyAuto", + "ToolResourcesFileSearchVectorStoreChunkingStrategyStatic", + "ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic", +] + + +class ThreadCreateParams(TypedDict, total=False): + messages: Iterable[Message] + """ + A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + start the thread with. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + tool_resources: Optional[ToolResources] + """ + A set of resources that are made available to the assistant's tools in this + thread. The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + +class MessageAttachmentToolFileSearch(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + +MessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, MessageAttachmentToolFileSearch] + + +class MessageAttachment(TypedDict, total=False): + file_id: str + """The ID of the file to attach to the message.""" + + tools: Iterable[MessageAttachmentTool] + """The tools to add this file to.""" + + +class Message(TypedDict, total=False): + content: Required[Union[str, Iterable[MessageContentPartParam]]] + """The text contents of the message.""" + + role: Required[Literal["user", "assistant"]] + """The role of the entity that is creating the message. Allowed values include: + + - `user`: Indicates the message is sent by an actual user and should be used in + most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this + value to insert messages from the assistant into the conversation. + """ + + attachments: Optional[Iterable[MessageAttachment]] + """A list of files attached to the message, and the tools they should be added to.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class ToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False): + """The default strategy. + + This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + """ + + type: Required[Literal["auto"]] + """Always `auto`.""" + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False): + chunk_overlap_tokens: Required[int] + """The number of tokens that overlap between chunks. The default value is `400`. + + Note that the overlap must not exceed half of `max_chunk_size_tokens`. + """ + + max_chunk_size_tokens: Required[int] + """The maximum number of tokens in each chunk. + + The default value is `800`. The minimum value is `100` and the maximum value is + `4096`. + """ + + +class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False): + static: Required[ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic] + + type: Required[Literal["static"]] + """Always `static`.""" + + +ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[ + ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic +] + + +class ToolResourcesFileSearchVectorStore(TypedDict, total=False): + chunking_strategy: ToolResourcesFileSearchVectorStoreChunkingStrategy + """The chunking strategy used to chunk the file(s). + + If not set, will use the `auto` strategy. + """ + + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + add to the vector store. There can be a maximum of 10000 files in a vector + store. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class ToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + The + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this thread. There can be a maximum of 1 vector store attached to + the thread. + """ + + vector_stores: Iterable[ToolResourcesFileSearchVectorStore] + """ + A helper to create a + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + with file_ids and attach it to this thread. There can be a maximum of 1 vector + store attached to the thread. + """ + + +class ToolResources(TypedDict, total=False): + """ + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ToolResourcesCodeInterpreter + + file_search: ToolResourcesFileSearch diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/thread_deleted.py b/py311/lib/python3.11/site-packages/openai/types/beta/thread_deleted.py new file mode 100644 index 0000000000000000000000000000000000000000..d385626319659d2cb2cf8e8428e94d40f5d764d0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/thread_deleted.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ThreadDeleted"] + + +class ThreadDeleted(BaseModel): + id: str + + deleted: bool + + object: Literal["thread.deleted"] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/thread_update_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/thread_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..e000edc05f7b0f93db7764b218656c5243085080 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/thread_update_params.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from ..._types import SequenceNotStr +from ..shared_params.metadata import Metadata + +__all__ = ["ThreadUpdateParams", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"] + + +class ThreadUpdateParams(TypedDict, total=False): + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + tool_resources: Optional[ToolResources] + """ + A set of resources that are made available to the assistant's tools in this + thread. The resources are specific to the type of tool. For example, the + `code_interpreter` tool requires a list of file IDs, while the `file_search` + tool requires a list of vector store IDs. + """ + + +class ToolResourcesCodeInterpreter(TypedDict, total=False): + file_ids: SequenceNotStr[str] + """ + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + """ + + +class ToolResourcesFileSearch(TypedDict, total=False): + vector_store_ids: SequenceNotStr[str] + """ + The + [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + attached to this thread. There can be a maximum of 1 vector store attached to + the thread. + """ + + +class ToolResources(TypedDict, total=False): + """ + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + """ + + code_interpreter: ToolResourcesCodeInterpreter + + file_search: ToolResourcesFileSearch diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70853177bd6d0899ec330b087307432a43c10f15 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .run import Run as Run +from .text import Text as Text +from .message import Message as Message +from .image_url import ImageURL as ImageURL +from .annotation import Annotation as Annotation +from .image_file import ImageFile as ImageFile +from .run_status import RunStatus as RunStatus +from .text_delta import TextDelta as TextDelta +from .message_delta import MessageDelta as MessageDelta +from .image_url_delta import ImageURLDelta as ImageURLDelta +from .image_url_param import ImageURLParam as ImageURLParam +from .message_content import MessageContent as MessageContent +from .message_deleted import MessageDeleted as MessageDeleted +from .run_list_params import RunListParams as RunListParams +from .annotation_delta import AnnotationDelta as AnnotationDelta +from .image_file_delta import ImageFileDelta as ImageFileDelta +from .image_file_param import ImageFileParam as ImageFileParam +from .text_delta_block import TextDeltaBlock as TextDeltaBlock +from .run_create_params import RunCreateParams as RunCreateParams +from .run_update_params import RunUpdateParams as RunUpdateParams +from .text_content_block import TextContentBlock as TextContentBlock +from .message_delta_event import MessageDeltaEvent as MessageDeltaEvent +from .message_list_params import MessageListParams as MessageListParams +from .refusal_delta_block import RefusalDeltaBlock as RefusalDeltaBlock +from .file_path_annotation import FilePathAnnotation as FilePathAnnotation +from .image_url_delta_block import ImageURLDeltaBlock as ImageURLDeltaBlock +from .message_content_delta import MessageContentDelta as MessageContentDelta +from .message_create_params import MessageCreateParams as MessageCreateParams +from .message_update_params import MessageUpdateParams as MessageUpdateParams +from .refusal_content_block import RefusalContentBlock as RefusalContentBlock +from .image_file_delta_block import ImageFileDeltaBlock as ImageFileDeltaBlock +from .image_url_content_block import ImageURLContentBlock as ImageURLContentBlock +from .file_citation_annotation import FileCitationAnnotation as FileCitationAnnotation +from .image_file_content_block import ImageFileContentBlock as ImageFileContentBlock +from .text_content_block_param import TextContentBlockParam as TextContentBlockParam +from .file_path_delta_annotation import FilePathDeltaAnnotation as FilePathDeltaAnnotation +from .message_content_part_param import MessageContentPartParam as MessageContentPartParam +from .image_url_content_block_param import ImageURLContentBlockParam as ImageURLContentBlockParam +from .file_citation_delta_annotation import FileCitationDeltaAnnotation as FileCitationDeltaAnnotation +from .image_file_content_block_param import ImageFileContentBlockParam as ImageFileContentBlockParam +from .run_submit_tool_outputs_params import RunSubmitToolOutputsParams as RunSubmitToolOutputsParams +from .required_action_function_tool_call import RequiredActionFunctionToolCall as RequiredActionFunctionToolCall diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/file_path_annotation.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/file_path_annotation.py new file mode 100644 index 0000000000000000000000000000000000000000..d3c144c2fc3bf4c4f0a54c52be51f6772f872f17 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/file_path_annotation.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["FilePathAnnotation", "FilePath"] + + +class FilePath(BaseModel): + file_id: str + """The ID of the file that was generated.""" + + +class FilePathAnnotation(BaseModel): + """ + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + """ + + end_index: int + + file_path: FilePath + + start_index: int + + text: str + """The text in the message content that needs to be replaced.""" + + type: Literal["file_path"] + """Always `file_path`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py new file mode 100644 index 0000000000000000000000000000000000000000..5a082cd488c3e7f3e476e8770bd50187ef28dc81 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel +from .image_file import ImageFile + +__all__ = ["ImageFileContentBlock"] + + +class ImageFileContentBlock(BaseModel): + """ + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + """ + + image_file: ImageFile + + type: Literal["image_file"] + """Always `image_file`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..4581184c7ae8df83168ea67bed1ff41e93d54f35 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["ImageFileDelta"] + + +class ImageFileDelta(BaseModel): + detail: Optional[Literal["auto", "low", "high"]] = None + """Specifies the detail level of the image if specified by the user. + + `low` uses fewer tokens, you can opt in to high resolution using `high`. + """ + + file_id: Optional[str] = None + """ + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + in the message content. Set `purpose="vision"` when uploading the File if you + need to later display the file content. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta_block.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta_block.py new file mode 100644 index 0000000000000000000000000000000000000000..ed17f7ff3b8bdc5d05b1543b86bc4e3083bd0f85 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta_block.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .image_file_delta import ImageFileDelta + +__all__ = ["ImageFileDeltaBlock"] + + +class ImageFileDeltaBlock(BaseModel): + """ + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + """ + + index: int + """The index of the content part in the message.""" + + type: Literal["image_file"] + """Always `image_file`.""" + + image_file: Optional[ImageFileDelta] = None diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_param.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_param.py new file mode 100644 index 0000000000000000000000000000000000000000..e4a85358b992ce142009ca8d4816d240cb5c442e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_file_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ImageFileParam"] + + +class ImageFileParam(TypedDict, total=False): + file_id: Required[str] + """ + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + in the message content. Set `purpose="vision"` when uploading the File if you + need to later display the file content. + """ + + detail: Literal["auto", "low", "high"] + """Specifies the detail level of the image if specified by the user. + + `low` uses fewer tokens, you can opt in to high resolution using `high`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block.py new file mode 100644 index 0000000000000000000000000000000000000000..8dc1f16a7a7cfd4d39a66f0259626b025712ee58 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .image_url import ImageURL +from ...._models import BaseModel + +__all__ = ["ImageURLContentBlock"] + + +class ImageURLContentBlock(BaseModel): + """References an image URL in the content of a message.""" + + image_url: ImageURL + + type: Literal["image_url"] + """The type of the content part.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_delta.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..e402671908d507e41bbc5efcad785f9db75b61ec --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/image_url_delta.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["ImageURLDelta"] + + +class ImageURLDelta(BaseModel): + detail: Optional[Literal["auto", "low", "high"]] = None + """Specifies the detail level of the image. + + `low` uses fewer tokens, you can opt in to high resolution using `high`. + """ + + url: Optional[str] = None + """ + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, + webp. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..3cec8514caca64adca2c1088d70d81a80054c93c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RequiredActionFunctionToolCall", "Function"] + + +class Function(BaseModel): + """The function definition.""" + + arguments: str + """The arguments that the model expects you to pass to the function.""" + + name: str + """The name of the function.""" + + +class RequiredActionFunctionToolCall(BaseModel): + """Tool call objects""" + + id: str + """The ID of the tool call. + + This ID must be referenced when you submit the tool outputs in using the + [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + endpoint. + """ + + function: Function + """The function definition.""" + + type: Literal["function"] + """The type of tool call the output is required for. + + For now, this is always `function`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..376afc9aad73ccbb25e692c773936414e42afc91 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py @@ -0,0 +1,274 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ...shared.chat_model import ChatModel +from ..assistant_tool_param import AssistantToolParam +from .runs.run_step_include import RunStepInclude +from ...shared_params.metadata import Metadata +from ...shared.reasoning_effort import ReasoningEffort +from .message_content_part_param import MessageContentPartParam +from ..code_interpreter_tool_param import CodeInterpreterToolParam +from ..assistant_tool_choice_option_param import AssistantToolChoiceOptionParam +from ..assistant_response_format_option_param import AssistantResponseFormatOptionParam + +__all__ = [ + "RunCreateParamsBase", + "AdditionalMessage", + "AdditionalMessageAttachment", + "AdditionalMessageAttachmentTool", + "AdditionalMessageAttachmentToolFileSearch", + "TruncationStrategy", + "RunCreateParamsNonStreaming", + "RunCreateParamsStreaming", +] + + +class RunCreateParamsBase(TypedDict, total=False): + assistant_id: Required[str] + """ + The ID of the + [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + execute this run. + """ + + include: List[RunStepInclude] + """A list of additional fields to include in the response. + + Currently the only supported value is + `step_details.tool_calls[*].file_search.results[*].content` to fetch the file + search result content. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + additional_instructions: Optional[str] + """Appends additional instructions at the end of the instructions for the run. + + This is useful for modifying the behavior on a per-run basis without overriding + other instructions. + """ + + additional_messages: Optional[Iterable[AdditionalMessage]] + """Adds additional messages to the thread before creating the run.""" + + instructions: Optional[str] + """ + Overrides the + [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) + of the assistant. This is useful for modifying the behavior on a per-run basis. + """ + + max_completion_tokens: Optional[int] + """ + The maximum number of completion tokens that may be used over the course of the + run. The run will make a best effort to use only the number of completion tokens + specified, across multiple turns of the run. If the run exceeds the number of + completion tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + max_prompt_tokens: Optional[int] + """The maximum number of prompt tokens that may be used over the course of the run. + + The run will make a best effort to use only the number of prompt tokens + specified, across multiple turns of the run. If the run exceeds the number of + prompt tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: Union[str, ChatModel, None] + """ + The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + be used to execute this run. If a value is provided here, it will override the + model associated with the assistant. If not, the model associated with the + assistant will be used. + """ + + parallel_tool_calls: bool + """ + Whether to enable + [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + during tool use. + """ + + reasoning_effort: Optional[ReasoningEffort] + """ + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported + reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool + calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not + support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + """ + + response_format: Optional[AssistantResponseFormatOptionParam] + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + tool_choice: Optional[AssistantToolChoiceOptionParam] + """ + Controls which (if any) tool is called by the model. `none` means the model will + not call any tools and instead generates a message. `auto` is the default value + and means the model can pick between generating a message or calling one or more + tools. `required` means the model must call one or more tools before responding + to the user. Specifying a particular tool like `{"type": "file_search"}` or + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + """ + + tools: Optional[Iterable[AssistantToolParam]] + """Override the tools the assistant can use for this run. + + This is useful for modifying the behavior on a per-run basis. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ + + truncation_strategy: Optional[TruncationStrategy] + """Controls for how a thread will be truncated prior to the run. + + Use this to control the initial context window of the run. + """ + + +class AdditionalMessageAttachmentToolFileSearch(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + +AdditionalMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, AdditionalMessageAttachmentToolFileSearch] + + +class AdditionalMessageAttachment(TypedDict, total=False): + file_id: str + """The ID of the file to attach to the message.""" + + tools: Iterable[AdditionalMessageAttachmentTool] + """The tools to add this file to.""" + + +class AdditionalMessage(TypedDict, total=False): + content: Required[Union[str, Iterable[MessageContentPartParam]]] + """The text contents of the message.""" + + role: Required[Literal["user", "assistant"]] + """The role of the entity that is creating the message. Allowed values include: + + - `user`: Indicates the message is sent by an actual user and should be used in + most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this + value to insert messages from the assistant into the conversation. + """ + + attachments: Optional[Iterable[AdditionalMessageAttachment]] + """A list of files attached to the message, and the tools they should be added to.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class TruncationStrategy(TypedDict, total=False): + """Controls for how a thread will be truncated prior to the run. + + Use this to control the initial context window of the run. + """ + + type: Required[Literal["auto", "last_messages"]] + """The truncation strategy to use for the thread. + + The default is `auto`. If set to `last_messages`, the thread will be truncated + to the n most recent messages in the thread. When set to `auto`, messages in the + middle of the thread will be dropped to fit the context length of the model, + `max_prompt_tokens`. + """ + + last_messages: Optional[int] + """ + The number of most recent messages from the thread when constructing the context + for the run. + """ + + +class RunCreateParamsNonStreaming(RunCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +class RunCreateParamsStreaming(RunCreateParamsBase): + stream: Required[Literal[True]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +RunCreateParams = Union[RunCreateParamsNonStreaming, RunCreateParamsStreaming] diff --git a/py311/lib/python3.11/site-packages/openai/types/beta/threads/text_content_block.py b/py311/lib/python3.11/site-packages/openai/types/beta/threads/text_content_block.py new file mode 100644 index 0000000000000000000000000000000000000000..b9b1368a175ff08326f653f3b3a4a50808604926 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/beta/threads/text_content_block.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .text import Text +from ...._models import BaseModel + +__all__ = ["TextContentBlock"] + + +class TextContentBlock(BaseModel): + """The text content that is part of a message.""" + + text: Text + + type: Literal["text"] + """Always `text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/__init__.py b/py311/lib/python3.11/site-packages/openai/types/containers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d555ad3a4da9128ac9ee0a8f0c07faa22415faa --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/__init__.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .file_list_params import FileListParams as FileListParams +from .file_create_params import FileCreateParams as FileCreateParams +from .file_list_response import FileListResponse as FileListResponse +from .file_create_response import FileCreateResponse as FileCreateResponse +from .file_retrieve_response import FileRetrieveResponse as FileRetrieveResponse diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/file_create_params.py b/py311/lib/python3.11/site-packages/openai/types/containers/file_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..1e41330017c271df68a8029a5c30c2de7db13777 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/file_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from ..._types import FileTypes + +__all__ = ["FileCreateParams"] + + +class FileCreateParams(TypedDict, total=False): + file: FileTypes + """The File object (not file name) to be uploaded.""" + + file_id: str + """Name of the file to create.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/file_create_response.py b/py311/lib/python3.11/site-packages/openai/types/containers/file_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..4a652483fc3c16a06bce1060147ddd5a8f652d11 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/file_create_response.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FileCreateResponse"] + + +class FileCreateResponse(BaseModel): + id: str + """Unique identifier for the file.""" + + bytes: int + """Size of the file in bytes.""" + + container_id: str + """The container this file belongs to.""" + + created_at: int + """Unix timestamp (in seconds) when the file was created.""" + + object: Literal["container.file"] + """The type of this object (`container.file`).""" + + path: str + """Path of the file in the container.""" + + source: str + """Source of the file (e.g., `user`, `assistant`).""" diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/file_list_params.py b/py311/lib/python3.11/site-packages/openai/types/containers/file_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..3565acaf360dc9e76e24a90d2dcdb79e79cb5636 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/file_list_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["FileListParams"] + + +class FileListParams(TypedDict, total=False): + after: str + """A cursor for use in pagination. + + `after` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the + list. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """Sort order by the `created_at` timestamp of the objects. + + `asc` for ascending order and `desc` for descending order. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/file_list_response.py b/py311/lib/python3.11/site-packages/openai/types/containers/file_list_response.py new file mode 100644 index 0000000000000000000000000000000000000000..e5eee38d999a8b6294704af2e51762e4d990d1e9 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/file_list_response.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FileListResponse"] + + +class FileListResponse(BaseModel): + id: str + """Unique identifier for the file.""" + + bytes: int + """Size of the file in bytes.""" + + container_id: str + """The container this file belongs to.""" + + created_at: int + """Unix timestamp (in seconds) when the file was created.""" + + object: Literal["container.file"] + """The type of this object (`container.file`).""" + + path: str + """Path of the file in the container.""" + + source: str + """Source of the file (e.g., `user`, `assistant`).""" diff --git a/py311/lib/python3.11/site-packages/openai/types/containers/file_retrieve_response.py b/py311/lib/python3.11/site-packages/openai/types/containers/file_retrieve_response.py new file mode 100644 index 0000000000000000000000000000000000000000..37fb0e43ddd70b9fa67880a8729ec6276bfe1764 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/containers/file_retrieve_response.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FileRetrieveResponse"] + + +class FileRetrieveResponse(BaseModel): + id: str + """Unique identifier for the file.""" + + bytes: int + """Size of the file in bytes.""" + + container_id: str + """The container this file belongs to.""" + + created_at: int + """Unix timestamp (in seconds) when the file was created.""" + + object: Literal["container.file"] + """The type of this object (`container.file`).""" + + path: str + """Path of the file in the container.""" + + source: str + """Source of the file (e.g., `user`, `assistant`).""" diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/__init__.py b/py311/lib/python3.11/site-packages/openai/types/conversations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dec84873797df77490dcb65bb39738cf92a7e23 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/__init__.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .message import Message as Message +from .conversation import Conversation as Conversation +from .text_content import TextContent as TextContent +from .refusal_content import RefusalContent as RefusalContent +from .item_list_params import ItemListParams as ItemListParams +from .conversation_item import ConversationItem as ConversationItem +from .input_file_content import InputFileContent as InputFileContent +from .input_text_content import InputTextContent as InputTextContent +from .item_create_params import ItemCreateParams as ItemCreateParams +from .input_image_content import InputImageContent as InputImageContent +from .output_text_content import OutputTextContent as OutputTextContent +from .item_retrieve_params import ItemRetrieveParams as ItemRetrieveParams +from .summary_text_content import SummaryTextContent as SummaryTextContent +from .refusal_content_param import RefusalContentParam as RefusalContentParam +from .conversation_item_list import ConversationItemList as ConversationItemList +from .input_file_content_param import InputFileContentParam as InputFileContentParam +from .input_text_content_param import InputTextContentParam as InputTextContentParam +from .input_image_content_param import InputImageContentParam as InputImageContentParam +from .output_text_content_param import OutputTextContentParam as OutputTextContentParam +from .conversation_create_params import ConversationCreateParams as ConversationCreateParams +from .conversation_update_params import ConversationUpdateParams as ConversationUpdateParams +from .computer_screenshot_content import ComputerScreenshotContent as ComputerScreenshotContent +from .conversation_deleted_resource import ConversationDeletedResource as ConversationDeletedResource diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/computer_screenshot_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/computer_screenshot_content.py new file mode 100644 index 0000000000000000000000000000000000000000..e42096eba2b926b7424518bf7982214d50751858 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/computer_screenshot_content.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ComputerScreenshotContent"] + + +class ComputerScreenshotContent(BaseModel): + """A screenshot of a computer.""" + + file_id: Optional[str] = None + """The identifier of an uploaded file that contains the screenshot.""" + + image_url: Optional[str] = None + """The URL of the screenshot image.""" + + type: Literal["computer_screenshot"] + """Specifies the event type. + + For a computer screenshot, this property is always set to `computer_screenshot`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation.py new file mode 100644 index 0000000000000000000000000000000000000000..ed63d40355d811e89dba38e2d788ef5d5f2124ce --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Conversation"] + + +class Conversation(BaseModel): + id: str + """The unique ID of the conversation.""" + + created_at: int + """ + The time at which the conversation was created, measured in seconds since the + Unix epoch. + """ + + metadata: object + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. Keys are + strings with a maximum length of 64 characters. Values are strings with a + maximum length of 512 characters. + """ + + object: Literal["conversation"] + """The object type, which is always `conversation`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_create_params.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..5f38d2aca7c5f060f122a7f902ee0966b1e48e65 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_create_params.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import TypedDict + +from ..shared_params.metadata import Metadata +from ..responses.response_input_item_param import ResponseInputItemParam + +__all__ = ["ConversationCreateParams"] + + +class ConversationCreateParams(TypedDict, total=False): + items: Optional[Iterable[ResponseInputItemParam]] + """Initial items to include in the conversation context. + + You may add up to 20 items at a time. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_deleted_resource.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_deleted_resource.py new file mode 100644 index 0000000000000000000000000000000000000000..7abcb2448ea44554a29d52481a7a367e25d24f06 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_deleted_resource.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ConversationDeletedResource"] + + +class ConversationDeletedResource(BaseModel): + id: str + + deleted: bool + + object: Literal["conversation.deleted"] diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item.py new file mode 100644 index 0000000000000000000000000000000000000000..46268d381c027c65d9b72ac71b081f3ddbb3c40a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item.py @@ -0,0 +1,248 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from .message import Message +from ..._utils import PropertyInfo +from ..._models import BaseModel +from ..responses.response_reasoning_item import ResponseReasoningItem +from ..responses.response_custom_tool_call import ResponseCustomToolCall +from ..responses.response_computer_tool_call import ResponseComputerToolCall +from ..responses.response_function_web_search import ResponseFunctionWebSearch +from ..responses.response_apply_patch_tool_call import ResponseApplyPatchToolCall +from ..responses.response_file_search_tool_call import ResponseFileSearchToolCall +from ..responses.response_custom_tool_call_output import ResponseCustomToolCallOutput +from ..responses.response_function_tool_call_item import ResponseFunctionToolCallItem +from ..responses.response_function_shell_tool_call import ResponseFunctionShellToolCall +from ..responses.response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall +from ..responses.response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput +from ..responses.response_computer_tool_call_output_item import ResponseComputerToolCallOutputItem +from ..responses.response_function_tool_call_output_item import ResponseFunctionToolCallOutputItem +from ..responses.response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput + +__all__ = [ + "ConversationItem", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "LocalShellCallOutput", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", + "McpApprovalResponse", + "McpCall", +] + + +class ImageGenerationCall(BaseModel): + """An image generation request made by the model.""" + + id: str + """The unique ID of the image generation call.""" + + result: Optional[str] = None + """The generated image encoded in base64.""" + + status: Literal["in_progress", "completed", "generating", "failed"] + """The status of the image generation call.""" + + type: Literal["image_generation_call"] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(BaseModel): + """Execute a shell command on the server.""" + + command: List[str] + """The command to run.""" + + env: Dict[str, str] + """Environment variables to set for the command.""" + + type: Literal["exec"] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] = None + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] = None + """Optional user to run the command as.""" + + working_directory: Optional[str] = None + """Optional working directory to run the command in.""" + + +class LocalShellCall(BaseModel): + """A tool call to run a command on the local shell.""" + + id: str + """The unique ID of the local shell call.""" + + action: LocalShellCallAction + """Execute a shell command on the server.""" + + call_id: str + """The unique ID of the local shell tool call generated by the model.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the local shell call.""" + + type: Literal["local_shell_call"] + """The type of the local shell call. Always `local_shell_call`.""" + + +class LocalShellCallOutput(BaseModel): + """The output of a local shell tool call.""" + + id: str + """The unique ID of the local shell tool call generated by the model.""" + + output: str + """A JSON string of the output of the local shell tool call.""" + + type: Literal["local_shell_call_output"] + """The type of the local shell tool call output. Always `local_shell_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. One of `in_progress`, `completed`, or `incomplete`.""" + + +class McpListToolsTool(BaseModel): + """A tool available on an MCP server.""" + + input_schema: object + """The JSON schema describing the tool's input.""" + + name: str + """The name of the tool.""" + + annotations: Optional[object] = None + """Additional annotations about the tool.""" + + description: Optional[str] = None + """The description of the tool.""" + + +class McpListTools(BaseModel): + """A list of tools available on an MCP server.""" + + id: str + """The unique ID of the list.""" + + server_label: str + """The label of the MCP server.""" + + tools: List[McpListToolsTool] + """The tools available on the server.""" + + type: Literal["mcp_list_tools"] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] = None + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(BaseModel): + """A request for human approval of a tool invocation.""" + + id: str + """The unique ID of the approval request.""" + + arguments: str + """A JSON string of arguments for the tool.""" + + name: str + """The name of the tool to run.""" + + server_label: str + """The label of the MCP server making the request.""" + + type: Literal["mcp_approval_request"] + """The type of the item. Always `mcp_approval_request`.""" + + +class McpApprovalResponse(BaseModel): + """A response to an MCP approval request.""" + + id: str + """The unique ID of the approval response""" + + approval_request_id: str + """The ID of the approval request being answered.""" + + approve: bool + """Whether the request was approved.""" + + type: Literal["mcp_approval_response"] + """The type of the item. Always `mcp_approval_response`.""" + + reason: Optional[str] = None + """Optional reason for the decision.""" + + +class McpCall(BaseModel): + """An invocation of a tool on an MCP server.""" + + id: str + """The unique ID of the tool call.""" + + arguments: str + """A JSON string of the arguments passed to the tool.""" + + name: str + """The name of the tool that was run.""" + + server_label: str + """The label of the MCP server running the tool.""" + + type: Literal["mcp_call"] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] = None + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] = None + """The error from the tool call, if any.""" + + output: Optional[str] = None + """The output from the tool call.""" + + status: Optional[Literal["in_progress", "completed", "incomplete", "calling", "failed"]] = None + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +ConversationItem: TypeAlias = Annotated[ + Union[ + Message, + ResponseFunctionToolCallItem, + ResponseFunctionToolCallOutputItem, + ResponseFileSearchToolCall, + ResponseFunctionWebSearch, + ImageGenerationCall, + ResponseComputerToolCall, + ResponseComputerToolCallOutputItem, + ResponseReasoningItem, + ResponseCodeInterpreterToolCall, + LocalShellCall, + LocalShellCallOutput, + ResponseFunctionShellToolCall, + ResponseFunctionShellToolCallOutput, + ResponseApplyPatchToolCall, + ResponseApplyPatchToolCallOutput, + McpListTools, + McpApprovalRequest, + McpApprovalResponse, + McpCall, + ResponseCustomToolCall, + ResponseCustomToolCallOutput, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item_list.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item_list.py new file mode 100644 index 0000000000000000000000000000000000000000..74d945d864d88c08825fbc04bde36e891de7bae0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_item_list.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .conversation_item import ConversationItem + +__all__ = ["ConversationItemList"] + + +class ConversationItemList(BaseModel): + """A list of Conversation items.""" + + data: List[ConversationItem] + """A list of conversation items.""" + + first_id: str + """The ID of the first item in the list.""" + + has_more: bool + """Whether there are more items available.""" + + last_id: str + """The ID of the last item in the list.""" + + object: Literal["list"] + """The type of object returned, must be `list`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_update_params.py b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..1f0dd09e50903cbaf5807b678adcd8233b939202 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/conversation_update_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from ..shared_params.metadata import Metadata + +__all__ = ["ConversationUpdateParams"] + + +class ConversationUpdateParams(TypedDict, total=False): + metadata: Required[Optional[Metadata]] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content.py new file mode 100644 index 0000000000000000000000000000000000000000..ca555d85fc14b0f2cba0095cefbbb1c244da71b4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..responses.response_input_file import ResponseInputFile + +__all__ = ["InputFileContent"] + +InputFileContent = ResponseInputFile diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content_param.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..1ed8b8b9d14f5408f22a7544ff069fec84ebcd2d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_file_content_param.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..responses.response_input_file_param import ResponseInputFileParam + +InputFileContentParam = ResponseInputFileParam diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content.py new file mode 100644 index 0000000000000000000000000000000000000000..4304323c3a692664b25b278b7986ccdf17987c1d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..responses.response_input_image import ResponseInputImage + +__all__ = ["InputImageContent"] + +InputImageContent = ResponseInputImage diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content_param.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a0ef9f545c6d998e7d00e54e6c56a575aea81b1c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_image_content_param.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..responses.response_input_image_param import ResponseInputImageParam + +InputImageContentParam = ResponseInputImageParam diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content.py new file mode 100644 index 0000000000000000000000000000000000000000..cab8b26cb116809e5968cc67a4011be9c4fc03a8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..responses.response_input_text import ResponseInputText + +__all__ = ["InputTextContent"] + +InputTextContent = ResponseInputText diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content_param.py b/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..b1fd9a5f1c2f87599134b40d6068443edfc5db65 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/input_text_content_param.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..responses.response_input_text_param import ResponseInputTextParam + +InputTextContentParam = ResponseInputTextParam diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/item_create_params.py b/py311/lib/python3.11/site-packages/openai/types/conversations/item_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..9158b7167f2b140ee3513b43a2399b3c2b55f7c0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/item_create_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, TypedDict + +from ..responses.response_includable import ResponseIncludable +from ..responses.response_input_item_param import ResponseInputItemParam + +__all__ = ["ItemCreateParams"] + + +class ItemCreateParams(TypedDict, total=False): + items: Required[Iterable[ResponseInputItemParam]] + """The items to add to the conversation. You may add up to 20 items at a time.""" + + include: List[ResponseIncludable] + """Additional fields to include in the response. + + See the `include` parameter for + [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include) + for more information. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/item_list_params.py b/py311/lib/python3.11/site-packages/openai/types/conversations/item_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a4dd61f399d63a9697c40af18b6901e54b75b13e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/item_list_params.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, TypedDict + +from ..responses.response_includable import ResponseIncludable + +__all__ = ["ItemListParams"] + + +class ItemListParams(TypedDict, total=False): + after: str + """An item ID to list items after, used in pagination.""" + + include: List[ResponseIncludable] + """Specify additional output data to include in the model response. + + Currently supported values are: + + - `web_search_call.action.sources`: Include the sources of the web search tool + call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution + in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer + call output. + - `file_search_call.results`: Include the search results of the file search tool + call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning + tokens in reasoning item outputs. This enables reasoning items to be used in + multi-turn conversations when using the Responses API statelessly (like when + the `store` parameter is set to `false`, or when an organization is enrolled + in the zero data retention program). + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """The order to return the input items in. Default is `desc`. + + - `asc`: Return the input items in ascending order. + - `desc`: Return the input items in descending order. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/item_retrieve_params.py b/py311/lib/python3.11/site-packages/openai/types/conversations/item_retrieve_params.py new file mode 100644 index 0000000000000000000000000000000000000000..8c5db1e533f63728667b0f8bf55d9bcc23ddd7d0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/item_retrieve_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ..responses.response_includable import ResponseIncludable + +__all__ = ["ItemRetrieveParams"] + + +class ItemRetrieveParams(TypedDict, total=False): + conversation_id: Required[str] + + include: List[ResponseIncludable] + """Additional fields to include in the response. + + See the `include` parameter for + [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include) + for more information. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/message.py b/py311/lib/python3.11/site-packages/openai/types/conversations/message.py new file mode 100644 index 0000000000000000000000000000000000000000..86c8860da89e1155a700fd496715e40f8b97ea96 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/message.py @@ -0,0 +1,70 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .text_content import TextContent +from .summary_text_content import SummaryTextContent +from .computer_screenshot_content import ComputerScreenshotContent +from ..responses.response_input_file import ResponseInputFile +from ..responses.response_input_text import ResponseInputText +from ..responses.response_input_image import ResponseInputImage +from ..responses.response_output_text import ResponseOutputText +from ..responses.response_output_refusal import ResponseOutputRefusal + +__all__ = ["Message", "Content", "ContentReasoningText"] + + +class ContentReasoningText(BaseModel): + """Reasoning text from the model.""" + + text: str + """The reasoning text from the model.""" + + type: Literal["reasoning_text"] + """The type of the reasoning text. Always `reasoning_text`.""" + + +Content: TypeAlias = Annotated[ + Union[ + ResponseInputText, + ResponseOutputText, + TextContent, + SummaryTextContent, + ContentReasoningText, + ResponseOutputRefusal, + ResponseInputImage, + ComputerScreenshotContent, + ResponseInputFile, + ], + PropertyInfo(discriminator="type"), +] + + +class Message(BaseModel): + """A message to or from the model.""" + + id: str + """The unique ID of the message.""" + + content: List[Content] + """The content of the message""" + + role: Literal["unknown", "user", "assistant", "system", "critic", "discriminator", "developer", "tool"] + """The role of the message. + + One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, + `developer`, or `tool`. + """ + + status: Literal["in_progress", "completed", "incomplete"] + """The status of item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Literal["message"] + """The type of the message. Always set to `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content.py new file mode 100644 index 0000000000000000000000000000000000000000..cfe9307d749392af90d57eacca4ce58376335c4a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..responses.response_output_text import ResponseOutputText + +__all__ = ["OutputTextContent"] + +OutputTextContent = ResponseOutputText diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content_param.py b/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..dc3e2026f6896bb88f3fb57bab8343bae42c10b1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/output_text_content_param.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..responses.response_output_text_param import ResponseOutputTextParam + +OutputTextContentParam = ResponseOutputTextParam diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content.py new file mode 100644 index 0000000000000000000000000000000000000000..6206c267dc9f46db58ed66a1d5e54bc58204ac0e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..responses.response_output_refusal import ResponseOutputRefusal + +__all__ = ["RefusalContent"] + +RefusalContent = ResponseOutputRefusal diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content_param.py b/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9b83da5f2db3b667fd67e92452eab0d6dbf73ee8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/refusal_content_param.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..responses.response_output_refusal_param import ResponseOutputRefusalParam + +RefusalContentParam = ResponseOutputRefusalParam diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/summary_text_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/summary_text_content.py new file mode 100644 index 0000000000000000000000000000000000000000..6464a3659902ab30f3233a5c4c85153f0fe4aa1b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/summary_text_content.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["SummaryTextContent"] + + +class SummaryTextContent(BaseModel): + """A summary text from the model.""" + + text: str + """A summary of the reasoning output from the model so far.""" + + type: Literal["summary_text"] + """The type of the object. Always `summary_text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/conversations/text_content.py b/py311/lib/python3.11/site-packages/openai/types/conversations/text_content.py new file mode 100644 index 0000000000000000000000000000000000000000..e602466c47bb7e7360b64502a076d488a526612d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/conversations/text_content.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TextContent"] + + +class TextContent(BaseModel): + """A text content.""" + + text: str + + type: Literal["text"] diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/__init__.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cc664eacea86c98ea283d54a1fd2bc91c2e0f644 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/__init__.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .dpo_method import DpoMethod as DpoMethod +from .fine_tuning_job import FineTuningJob as FineTuningJob +from .job_list_params import JobListParams as JobListParams +from .dpo_method_param import DpoMethodParam as DpoMethodParam +from .job_create_params import JobCreateParams as JobCreateParams +from .supervised_method import SupervisedMethod as SupervisedMethod +from .dpo_hyperparameters import DpoHyperparameters as DpoHyperparameters +from .reinforcement_method import ReinforcementMethod as ReinforcementMethod +from .fine_tuning_job_event import FineTuningJobEvent as FineTuningJobEvent +from .job_list_events_params import JobListEventsParams as JobListEventsParams +from .supervised_method_param import SupervisedMethodParam as SupervisedMethodParam +from .dpo_hyperparameters_param import DpoHyperparametersParam as DpoHyperparametersParam +from .reinforcement_method_param import ReinforcementMethodParam as ReinforcementMethodParam +from .supervised_hyperparameters import SupervisedHyperparameters as SupervisedHyperparameters +from .fine_tuning_job_integration import FineTuningJobIntegration as FineTuningJobIntegration +from .reinforcement_hyperparameters import ReinforcementHyperparameters as ReinforcementHyperparameters +from .supervised_hyperparameters_param import SupervisedHyperparametersParam as SupervisedHyperparametersParam +from .fine_tuning_job_wandb_integration import FineTuningJobWandbIntegration as FineTuningJobWandbIntegration +from .reinforcement_hyperparameters_param import ReinforcementHyperparametersParam as ReinforcementHyperparametersParam +from .fine_tuning_job_wandb_integration_object import ( + FineTuningJobWandbIntegrationObject as FineTuningJobWandbIntegrationObject, +) diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters.py new file mode 100644 index 0000000000000000000000000000000000000000..cd39f308a4ef70be01ca34f2f470d7da36ef6e4a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DpoHyperparameters"] + + +class DpoHyperparameters(BaseModel): + """The hyperparameters used for the DPO fine-tuning job.""" + + batch_size: Union[Literal["auto"], int, None] = None + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + beta: Union[Literal["auto"], float, None] = None + """The beta value for the DPO method. + + A higher beta value will increase the weight of the penalty between the policy + and reference model. + """ + + learning_rate_multiplier: Union[Literal["auto"], float, None] = None + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int, None] = None + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters_param.py new file mode 100644 index 0000000000000000000000000000000000000000..12b2c41ca860673b159d714eda412de6a622f6b4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_hyperparameters_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypedDict + +__all__ = ["DpoHyperparametersParam"] + + +class DpoHyperparametersParam(TypedDict, total=False): + """The hyperparameters used for the DPO fine-tuning job.""" + + batch_size: Union[Literal["auto"], int] + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + beta: Union[Literal["auto"], float] + """The beta value for the DPO method. + + A higher beta value will increase the weight of the penalty between the policy + and reference model. + """ + + learning_rate_multiplier: Union[Literal["auto"], float] + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int] + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method.py new file mode 100644 index 0000000000000000000000000000000000000000..452c182016c8b6793248ca07fd55b65ff39f7e9a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .dpo_hyperparameters import DpoHyperparameters + +__all__ = ["DpoMethod"] + + +class DpoMethod(BaseModel): + """Configuration for the DPO fine-tuning method.""" + + hyperparameters: Optional[DpoHyperparameters] = None + """The hyperparameters used for the DPO fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method_param.py new file mode 100644 index 0000000000000000000000000000000000000000..6bd74d97606c7409667bc24c0c9a118be85eef1d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/dpo_method_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .dpo_hyperparameters_param import DpoHyperparametersParam + +__all__ = ["DpoMethodParam"] + + +class DpoMethodParam(TypedDict, total=False): + """Configuration for the DPO fine-tuning method.""" + + hyperparameters: DpoHyperparametersParam + """The hyperparameters used for the DPO fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job.py new file mode 100644 index 0000000000000000000000000000000000000000..bb8a4d597bad6eba0a34d7c1b7e4aa0c97df2f1b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job.py @@ -0,0 +1,176 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .dpo_method import DpoMethod +from ..shared.metadata import Metadata +from .supervised_method import SupervisedMethod +from .reinforcement_method import ReinforcementMethod +from .fine_tuning_job_wandb_integration_object import FineTuningJobWandbIntegrationObject + +__all__ = ["FineTuningJob", "Error", "Hyperparameters", "Method"] + + +class Error(BaseModel): + """ + For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. + """ + + code: str + """A machine-readable error code.""" + + message: str + """A human-readable error message.""" + + param: Optional[str] = None + """The parameter that was invalid, usually `training_file` or `validation_file`. + + This field will be null if the failure was not parameter-specific. + """ + + +class Hyperparameters(BaseModel): + """The hyperparameters used for the fine-tuning job. + + This value will only be returned when running `supervised` jobs. + """ + + batch_size: Union[Literal["auto"], int, None] = None + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + learning_rate_multiplier: Union[Literal["auto"], float, None] = None + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int, None] = None + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ + + +class Method(BaseModel): + """The method used for fine-tuning.""" + + type: Literal["supervised", "dpo", "reinforcement"] + """The type of method. Is either `supervised`, `dpo`, or `reinforcement`.""" + + dpo: Optional[DpoMethod] = None + """Configuration for the DPO fine-tuning method.""" + + reinforcement: Optional[ReinforcementMethod] = None + """Configuration for the reinforcement fine-tuning method.""" + + supervised: Optional[SupervisedMethod] = None + """Configuration for the supervised fine-tuning method.""" + + +class FineTuningJob(BaseModel): + """ + The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + """ + + id: str + """The object identifier, which can be referenced in the API endpoints.""" + + created_at: int + """The Unix timestamp (in seconds) for when the fine-tuning job was created.""" + + error: Optional[Error] = None + """ + For fine-tuning jobs that have `failed`, this will contain more information on + the cause of the failure. + """ + + fine_tuned_model: Optional[str] = None + """The name of the fine-tuned model that is being created. + + The value will be null if the fine-tuning job is still running. + """ + + finished_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the fine-tuning job was finished. + + The value will be null if the fine-tuning job is still running. + """ + + hyperparameters: Hyperparameters + """The hyperparameters used for the fine-tuning job. + + This value will only be returned when running `supervised` jobs. + """ + + model: str + """The base model that is being fine-tuned.""" + + object: Literal["fine_tuning.job"] + """The object type, which is always "fine_tuning.job".""" + + organization_id: str + """The organization that owns the fine-tuning job.""" + + result_files: List[str] + """The compiled results file ID(s) for the fine-tuning job. + + You can retrieve the results with the + [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + """ + + seed: int + """The seed used for the fine-tuning job.""" + + status: Literal["validating_files", "queued", "running", "succeeded", "failed", "cancelled"] + """ + The current status of the fine-tuning job, which can be either + `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + """ + + trained_tokens: Optional[int] = None + """The total number of billable tokens processed by this fine-tuning job. + + The value will be null if the fine-tuning job is still running. + """ + + training_file: str + """The file ID used for training. + + You can retrieve the training data with the + [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + """ + + validation_file: Optional[str] = None + """The file ID used for validation. + + You can retrieve the validation results with the + [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + """ + + estimated_finish: Optional[int] = None + """ + The Unix timestamp (in seconds) for when the fine-tuning job is estimated to + finish. The value will be null if the fine-tuning job is not running. + """ + + integrations: Optional[List[FineTuningJobWandbIntegrationObject]] = None + """A list of integrations to enable for this fine-tuning job.""" + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + method: Optional[Method] = None + """The method used for fine-tuning.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_event.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_event.py new file mode 100644 index 0000000000000000000000000000000000000000..7452b818c644239badd8c7bb20d363cb394d762d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_event.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import builtins +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FineTuningJobEvent"] + + +class FineTuningJobEvent(BaseModel): + """Fine-tuning job event object""" + + id: str + """The object identifier.""" + + created_at: int + """The Unix timestamp (in seconds) for when the fine-tuning job was created.""" + + level: Literal["info", "warn", "error"] + """The log level of the event.""" + + message: str + """The message of the event.""" + + object: Literal["fine_tuning.job.event"] + """The object type, which is always "fine_tuning.job.event".""" + + data: Optional[builtins.object] = None + """The data associated with the event.""" + + type: Optional[Literal["message", "metrics"]] = None + """The type of event.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_integration.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_integration.py new file mode 100644 index 0000000000000000000000000000000000000000..2af73fbffb3bfddecffb3eea40ed642330d3c627 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_integration.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .fine_tuning_job_wandb_integration_object import FineTuningJobWandbIntegrationObject + +FineTuningJobIntegration = FineTuningJobWandbIntegrationObject diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration.py new file mode 100644 index 0000000000000000000000000000000000000000..0e33aa84c8e27e263e0fdca40e0bdd5dd97e5a4b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["FineTuningJobWandbIntegration"] + + +class FineTuningJobWandbIntegration(BaseModel): + """The settings for your integration with Weights and Biases. + + This payload specifies the project that + metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags + to your run, and set a default entity (team, username, etc) to be associated with your run. + """ + + project: str + """The name of the project that the new run will be created under.""" + + entity: Optional[str] = None + """The entity to use for the run. + + This allows you to set the team or username of the WandB user that you would + like associated with the run. If not set, the default entity for the registered + WandB API key is used. + """ + + name: Optional[str] = None + """A display name to set for the run. + + If not set, we will use the Job ID as the name. + """ + + tags: Optional[List[str]] = None + """A list of tags to be attached to the newly created run. + + These tags are passed through directly to WandB. Some default tags are generated + by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration_object.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration_object.py new file mode 100644 index 0000000000000000000000000000000000000000..5b94354d505ca790cc96a9c9b461bfae0672ea34 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/fine_tuning_job_wandb_integration_object.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .fine_tuning_job_wandb_integration import FineTuningJobWandbIntegration + +__all__ = ["FineTuningJobWandbIntegrationObject"] + + +class FineTuningJobWandbIntegrationObject(BaseModel): + type: Literal["wandb"] + """The type of the integration being enabled for the fine-tuning job""" + + wandb: FineTuningJobWandbIntegration + """The settings for your integration with Weights and Biases. + + This payload specifies the project that metrics will be sent to. Optionally, you + can set an explicit display name for your run, add tags to your run, and set a + default entity (team, username, etc) to be associated with your run. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_create_params.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..181bede2d972c72da8f14f6d427eea2ba96d1867 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_create_params.py @@ -0,0 +1,190 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .dpo_method_param import DpoMethodParam +from ..shared_params.metadata import Metadata +from .supervised_method_param import SupervisedMethodParam +from .reinforcement_method_param import ReinforcementMethodParam + +__all__ = ["JobCreateParams", "Hyperparameters", "Integration", "IntegrationWandb", "Method"] + + +class JobCreateParams(TypedDict, total=False): + model: Required[Union[str, Literal["babbage-002", "davinci-002", "gpt-3.5-turbo", "gpt-4o-mini"]]] + """The name of the model to fine-tune. + + You can select one of the + [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). + """ + + training_file: Required[str] + """The ID of an uploaded file that contains training data. + + See [upload file](https://platform.openai.com/docs/api-reference/files/create) + for how to upload a file. + + Your dataset must be formatted as a JSONL file. Additionally, you must upload + your file with the purpose `fine-tune`. + + The contents of the file should differ depending on if the model uses the + [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), + [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) + format, or if the fine-tuning method uses the + [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) + format. + + See the + [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) + for more details. + """ + + hyperparameters: Hyperparameters + """ + The hyperparameters used for the fine-tuning job. This value is now deprecated + in favor of `method`, and should be passed in under the `method` parameter. + """ + + integrations: Optional[Iterable[Integration]] + """A list of integrations to enable for your fine-tuning job.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + method: Method + """The method used for fine-tuning.""" + + seed: Optional[int] + """The seed controls the reproducibility of the job. + + Passing in the same seed and job parameters should produce the same results, but + may differ in rare cases. If a seed is not specified, one will be generated for + you. + """ + + suffix: Optional[str] + """ + A string of up to 64 characters that will be added to your fine-tuned model + name. + + For example, a `suffix` of "custom-model-name" would produce a model name like + `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. + """ + + validation_file: Optional[str] + """The ID of an uploaded file that contains validation data. + + If you provide this file, the data is used to generate validation metrics + periodically during fine-tuning. These metrics can be viewed in the fine-tuning + results file. The same data should not be present in both train and validation + files. + + Your dataset must be formatted as a JSONL file. You must upload your file with + the purpose `fine-tune`. + + See the + [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) + for more details. + """ + + +class Hyperparameters(TypedDict, total=False): + """ + The hyperparameters used for the fine-tuning job. + This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. + """ + + batch_size: Union[Literal["auto"], int] + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + learning_rate_multiplier: Union[Literal["auto"], float] + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int] + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ + + +class IntegrationWandb(TypedDict, total=False): + """The settings for your integration with Weights and Biases. + + This payload specifies the project that + metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags + to your run, and set a default entity (team, username, etc) to be associated with your run. + """ + + project: Required[str] + """The name of the project that the new run will be created under.""" + + entity: Optional[str] + """The entity to use for the run. + + This allows you to set the team or username of the WandB user that you would + like associated with the run. If not set, the default entity for the registered + WandB API key is used. + """ + + name: Optional[str] + """A display name to set for the run. + + If not set, we will use the Job ID as the name. + """ + + tags: SequenceNotStr[str] + """A list of tags to be attached to the newly created run. + + These tags are passed through directly to WandB. Some default tags are generated + by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". + """ + + +class Integration(TypedDict, total=False): + type: Required[Literal["wandb"]] + """The type of integration to enable. + + Currently, only "wandb" (Weights and Biases) is supported. + """ + + wandb: Required[IntegrationWandb] + """The settings for your integration with Weights and Biases. + + This payload specifies the project that metrics will be sent to. Optionally, you + can set an explicit display name for your run, add tags to your run, and set a + default entity (team, username, etc) to be associated with your run. + """ + + +class Method(TypedDict, total=False): + """The method used for fine-tuning.""" + + type: Required[Literal["supervised", "dpo", "reinforcement"]] + """The type of method. Is either `supervised`, `dpo`, or `reinforcement`.""" + + dpo: DpoMethodParam + """Configuration for the DPO fine-tuning method.""" + + reinforcement: ReinforcementMethodParam + """Configuration for the reinforcement fine-tuning method.""" + + supervised: SupervisedMethodParam + """Configuration for the supervised fine-tuning method.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_events_params.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_events_params.py new file mode 100644 index 0000000000000000000000000000000000000000..e1c9a64dc85b994ac92deb3fa5fa216c13bd16c4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_events_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["JobListEventsParams"] + + +class JobListEventsParams(TypedDict, total=False): + after: str + """Identifier for the last event from the previous pagination request.""" + + limit: int + """Number of events to retrieve.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_params.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b79f3ce86ad106d9d9424d37df9860b96c67cae5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/job_list_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import TypedDict + +__all__ = ["JobListParams"] + + +class JobListParams(TypedDict, total=False): + after: str + """Identifier for the last job from the previous pagination request.""" + + limit: int + """Number of fine-tuning jobs to retrieve.""" + + metadata: Optional[Dict[str, str]] + """Optional metadata filter. + + To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to + indicate no metadata. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters.py new file mode 100644 index 0000000000000000000000000000000000000000..4c289fd65996d110e22e7ccd40d81d894c4e5cce --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ReinforcementHyperparameters"] + + +class ReinforcementHyperparameters(BaseModel): + """The hyperparameters used for the reinforcement fine-tuning job.""" + + batch_size: Union[Literal["auto"], int, None] = None + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + compute_multiplier: Union[Literal["auto"], float, None] = None + """ + Multiplier on amount of compute used for exploring search space during training. + """ + + eval_interval: Union[Literal["auto"], int, None] = None + """The number of training steps between evaluation runs.""" + + eval_samples: Union[Literal["auto"], int, None] = None + """Number of evaluation samples to generate per training step.""" + + learning_rate_multiplier: Union[Literal["auto"], float, None] = None + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int, None] = None + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ + + reasoning_effort: Optional[Literal["default", "low", "medium", "high"]] = None + """Level of reasoning effort.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7be716f143964025b3c66c5abdcdc55dfe46b563 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_hyperparameters_param.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypedDict + +__all__ = ["ReinforcementHyperparametersParam"] + + +class ReinforcementHyperparametersParam(TypedDict, total=False): + """The hyperparameters used for the reinforcement fine-tuning job.""" + + batch_size: Union[Literal["auto"], int] + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + compute_multiplier: Union[Literal["auto"], float] + """ + Multiplier on amount of compute used for exploring search space during training. + """ + + eval_interval: Union[Literal["auto"], int] + """The number of training steps between evaluation runs.""" + + eval_samples: Union[Literal["auto"], int] + """Number of evaluation samples to generate per training step.""" + + learning_rate_multiplier: Union[Literal["auto"], float] + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int] + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ + + reasoning_effort: Literal["default", "low", "medium", "high"] + """Level of reasoning effort.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method.py new file mode 100644 index 0000000000000000000000000000000000000000..a8a3685148cf5df0e04210759c297d19782225a3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from ..graders.multi_grader import MultiGrader +from ..graders.python_grader import PythonGrader +from ..graders.score_model_grader import ScoreModelGrader +from ..graders.string_check_grader import StringCheckGrader +from .reinforcement_hyperparameters import ReinforcementHyperparameters +from ..graders.text_similarity_grader import TextSimilarityGrader + +__all__ = ["ReinforcementMethod", "Grader"] + +Grader: TypeAlias = Union[StringCheckGrader, TextSimilarityGrader, PythonGrader, ScoreModelGrader, MultiGrader] + + +class ReinforcementMethod(BaseModel): + """Configuration for the reinforcement fine-tuning method.""" + + grader: Grader + """The grader used for the fine-tuning job.""" + + hyperparameters: Optional[ReinforcementHyperparameters] = None + """The hyperparameters used for the reinforcement fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method_param.py new file mode 100644 index 0000000000000000000000000000000000000000..ea75bfeb69fcbb71c45d8054f7b4d17b1ae11a64 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/reinforcement_method_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypeAlias, TypedDict + +from ..graders.multi_grader_param import MultiGraderParam +from ..graders.python_grader_param import PythonGraderParam +from ..graders.score_model_grader_param import ScoreModelGraderParam +from ..graders.string_check_grader_param import StringCheckGraderParam +from .reinforcement_hyperparameters_param import ReinforcementHyperparametersParam +from ..graders.text_similarity_grader_param import TextSimilarityGraderParam + +__all__ = ["ReinforcementMethodParam", "Grader"] + +Grader: TypeAlias = Union[ + StringCheckGraderParam, TextSimilarityGraderParam, PythonGraderParam, ScoreModelGraderParam, MultiGraderParam +] + + +class ReinforcementMethodParam(TypedDict, total=False): + """Configuration for the reinforcement fine-tuning method.""" + + grader: Required[Grader] + """The grader used for the fine-tuning job.""" + + hyperparameters: ReinforcementHyperparametersParam + """The hyperparameters used for the reinforcement fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters.py new file mode 100644 index 0000000000000000000000000000000000000000..1231bbdd80739b4507457af378aefa6b62c03da7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["SupervisedHyperparameters"] + + +class SupervisedHyperparameters(BaseModel): + """The hyperparameters used for the fine-tuning job.""" + + batch_size: Union[Literal["auto"], int, None] = None + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + learning_rate_multiplier: Union[Literal["auto"], float, None] = None + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int, None] = None + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters_param.py new file mode 100644 index 0000000000000000000000000000000000000000..de0e021dea718d42f1e53eeed93c4677ee088c25 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_hyperparameters_param.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypedDict + +__all__ = ["SupervisedHyperparametersParam"] + + +class SupervisedHyperparametersParam(TypedDict, total=False): + """The hyperparameters used for the fine-tuning job.""" + + batch_size: Union[Literal["auto"], int] + """Number of examples in each batch. + + A larger batch size means that model parameters are updated less frequently, but + with lower variance. + """ + + learning_rate_multiplier: Union[Literal["auto"], float] + """Scaling factor for the learning rate. + + A smaller learning rate may be useful to avoid overfitting. + """ + + n_epochs: Union[Literal["auto"], int] + """The number of epochs to train the model for. + + An epoch refers to one full cycle through the training dataset. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method.py new file mode 100644 index 0000000000000000000000000000000000000000..96e102582dfea2d492f43a09cf054f301b14cf1f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .supervised_hyperparameters import SupervisedHyperparameters + +__all__ = ["SupervisedMethod"] + + +class SupervisedMethod(BaseModel): + """Configuration for the supervised fine-tuning method.""" + + hyperparameters: Optional[SupervisedHyperparameters] = None + """The hyperparameters used for the fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method_param.py b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4381cd184b791e19e8178f7ee71423922ce83d04 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/fine_tuning/supervised_method_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .supervised_hyperparameters_param import SupervisedHyperparametersParam + +__all__ = ["SupervisedMethodParam"] + + +class SupervisedMethodParam(TypedDict, total=False): + """Configuration for the supervised fine-tuning method.""" + + hyperparameters: SupervisedHyperparametersParam + """The hyperparameters used for the fine-tuning job.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription.py b/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription.py new file mode 100644 index 0000000000000000000000000000000000000000..0a8c1371e0155ec810df5b99fed8e79e195df653 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AudioTranscription"] + + +class AudioTranscription(BaseModel): + language: Optional[str] = None + """The language of the input audio. + + Supplying the input language in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) + format will improve accuracy and latency. + """ + + model: Union[ + str, + Literal[ + "whisper-1", + "gpt-4o-mini-transcribe", + "gpt-4o-mini-transcribe-2025-12-15", + "gpt-4o-transcribe", + "gpt-4o-transcribe-diarize", + ], + None, + ] = None + """The model to use for transcription. + + Current options are `whisper-1`, `gpt-4o-mini-transcribe`, + `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and + `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need + diarization with speaker labels. + """ + + prompt: Optional[str] = None + """ + An optional text to guide the model's style or continue a previous audio + segment. For `whisper-1`, the + [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the + prompt is a free text string, for example "expect words related to technology". + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7e60a003ce2f14449ea2d1ed38d3e646ef15fdc5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/audio_transcription_param.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypedDict + +__all__ = ["AudioTranscriptionParam"] + + +class AudioTranscriptionParam(TypedDict, total=False): + language: str + """The language of the input audio. + + Supplying the input language in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) + format will improve accuracy and latency. + """ + + model: Union[ + str, + Literal[ + "whisper-1", + "gpt-4o-mini-transcribe", + "gpt-4o-mini-transcribe-2025-12-15", + "gpt-4o-transcribe", + "gpt-4o-transcribe-diarize", + ], + ] + """The model to use for transcription. + + Current options are `whisper-1`, `gpt-4o-mini-transcribe`, + `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and + `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need + diarization with speaker labels. + """ + + prompt: str + """ + An optional text to guide the model's style or continue a previous audio + segment. For `whisper-1`, the + [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the + prompt is a free text string, for example "expect words related to technology". + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/call_reject_params.py b/py311/lib/python3.11/site-packages/openai/types/realtime/call_reject_params.py new file mode 100644 index 0000000000000000000000000000000000000000..f12222cded1c73f9fe293622d55fc49a5f2826dc --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/call_reject_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["CallRejectParams"] + + +class CallRejectParams(TypedDict, total=False): + status_code: int + """SIP response code to send back to the caller. + + Defaults to `603` (Decline) when omitted. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/client_secret_create_response.py b/py311/lib/python3.11/site-packages/openai/types/realtime/client_secret_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..3a30b10544f85f83cf32a3783db97f9a907fee7e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/client_secret_create_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .realtime_session_create_response import RealtimeSessionCreateResponse +from .realtime_transcription_session_create_response import RealtimeTranscriptionSessionCreateResponse + +__all__ = ["ClientSecretCreateResponse", "Session"] + +Session: TypeAlias = Annotated[ + Union[RealtimeSessionCreateResponse, RealtimeTranscriptionSessionCreateResponse], PropertyInfo(discriminator="type") +] + + +class ClientSecretCreateResponse(BaseModel): + """Response from creating a session and client secret for the Realtime API.""" + + expires_at: int + """Expiration timestamp for the client secret, in seconds since epoch.""" + + session: Session + """The session configuration for either a realtime or transcription session.""" + + value: str + """The generated client secret value.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_created_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_created_event.py new file mode 100644 index 0000000000000000000000000000000000000000..3026322e863b1d8d9a95253ae891e2a2aa116b3f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_created_event.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ConversationCreatedEvent", "Conversation"] + + +class Conversation(BaseModel): + """The conversation resource.""" + + id: Optional[str] = None + """The unique ID of the conversation.""" + + object: Optional[Literal["realtime.conversation"]] = None + """The object type, must be `realtime.conversation`.""" + + +class ConversationCreatedEvent(BaseModel): + """Returned when a conversation is created. Emitted right after session creation.""" + + conversation: Conversation + """The conversation resource.""" + + event_id: str + """The unique ID of the server event.""" + + type: Literal["conversation.created"] + """The event type, must be `conversation.created`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item.py new file mode 100644 index 0000000000000000000000000000000000000000..be021520a2e881b5ec4bc46b72fefb6865d6a078 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .realtime_mcp_tool_call import RealtimeMcpToolCall +from .realtime_mcp_list_tools import RealtimeMcpListTools +from .realtime_mcp_approval_request import RealtimeMcpApprovalRequest +from .realtime_mcp_approval_response import RealtimeMcpApprovalResponse +from .realtime_conversation_item_user_message import RealtimeConversationItemUserMessage +from .realtime_conversation_item_function_call import RealtimeConversationItemFunctionCall +from .realtime_conversation_item_system_message import RealtimeConversationItemSystemMessage +from .realtime_conversation_item_assistant_message import RealtimeConversationItemAssistantMessage +from .realtime_conversation_item_function_call_output import RealtimeConversationItemFunctionCallOutput + +__all__ = ["ConversationItem"] + +ConversationItem: TypeAlias = Annotated[ + Union[ + RealtimeConversationItemSystemMessage, + RealtimeConversationItemUserMessage, + RealtimeConversationItemAssistantMessage, + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeMcpApprovalResponse, + RealtimeMcpListTools, + RealtimeMcpToolCall, + RealtimeMcpApprovalRequest, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_added.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_added.py new file mode 100644 index 0000000000000000000000000000000000000000..0e336a9261b62cdecfc4697c959af159b44fa6b2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_added.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .conversation_item import ConversationItem + +__all__ = ["ConversationItemAdded"] + + +class ConversationItemAdded(BaseModel): + """Sent by the server when an Item is added to the default Conversation. + + This can happen in several cases: + - When the client sends a `conversation.item.create` event. + - When the input audio buffer is committed. In this case the item will be a user message containing the audio from the buffer. + - When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the model starts generating a specific Item, and thus it will not yet have any content (and `status` will be `in_progress`). + + The event will include the full content of the Item (except when model is generating a Response) except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. + """ + + event_id: str + """The unique ID of the server event.""" + + item: ConversationItem + """A single item within a Realtime conversation.""" + + type: Literal["conversation.item.added"] + """The event type, must be `conversation.item.added`.""" + + previous_item_id: Optional[str] = None + """The ID of the item that precedes this one, if any. + + This is used to maintain ordering when items are inserted. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_create_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_create_event.py new file mode 100644 index 0000000000000000000000000000000000000000..bf2d129744a8aa27b836d9c6cccac934336d0fa7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_create_event.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .conversation_item import ConversationItem + +__all__ = ["ConversationItemCreateEvent"] + + +class ConversationItemCreateEvent(BaseModel): + """ + Add a new Item to the Conversation's context, including messages, function + calls, and function call responses. This event can be used both to populate a + "history" of the conversation and to add new items mid-stream, but has the + current limitation that it cannot populate assistant audio messages. + + If successful, the server will respond with a `conversation.item.created` + event, otherwise an `error` event will be sent. + """ + + item: ConversationItem + """A single item within a Realtime conversation.""" + + type: Literal["conversation.item.create"] + """The event type, must be `conversation.item.create`.""" + + event_id: Optional[str] = None + """Optional client-generated ID used to identify this event.""" + + previous_item_id: Optional[str] = None + """The ID of the preceding item after which the new item will be inserted. + + If not set, the new item will be appended to the end of the conversation. If set + to `root`, the new item will be added to the beginning of the conversation. If + set to an existing ID, it allows an item to be inserted mid-conversation. If the + ID cannot be found, an error will be returned and the item will not be added. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_created_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_created_event.py new file mode 100644 index 0000000000000000000000000000000000000000..6ae6f05ffe893e94dc06cf83325051a51865c311 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_created_event.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .conversation_item import ConversationItem + +__all__ = ["ConversationItemCreatedEvent"] + + +class ConversationItemCreatedEvent(BaseModel): + """Returned when a conversation item is created. + + There are several scenarios that produce this event: + - The server is generating a Response, which if successful will produce + either one or two Items, which will be of type `message` + (role `assistant`) or type `function_call`. + - The input audio buffer has been committed, either by the client or the + server (in `server_vad` mode). The server will take the content of the + input audio buffer and add it to a new user message Item. + - The client has sent a `conversation.item.create` event to add a new Item + to the Conversation. + """ + + event_id: str + """The unique ID of the server event.""" + + item: ConversationItem + """A single item within a Realtime conversation.""" + + type: Literal["conversation.item.created"] + """The event type, must be `conversation.item.created`.""" + + previous_item_id: Optional[str] = None + """ + The ID of the preceding item in the Conversation context, allows the client to + understand the order of the conversation. Can be `null` if the item has no + predecessor. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_deleted_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_deleted_event.py new file mode 100644 index 0000000000000000000000000000000000000000..9826289ebf0afaaf974db487b084c75bb93540db --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_deleted_event.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ConversationItemDeletedEvent"] + + +class ConversationItemDeletedEvent(BaseModel): + """ + Returned when an item in the conversation is deleted by the client with a + `conversation.item.delete` event. This event is used to synchronize the + server's understanding of the conversation history with the client's view. + """ + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item that was deleted.""" + + type: Literal["conversation.item.deleted"] + """The event type, must be `conversation.item.deleted`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..3304233f8fc9d1da8d8c66dd95d25679cbc902b1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from .log_prob_properties import LogProbProperties + +__all__ = [ + "ConversationItemInputAudioTranscriptionCompletedEvent", + "Usage", + "UsageTranscriptTextUsageTokens", + "UsageTranscriptTextUsageTokensInputTokenDetails", + "UsageTranscriptTextUsageDuration", +] + + +class UsageTranscriptTextUsageTokensInputTokenDetails(BaseModel): + """Details about the input tokens billed for this request.""" + + audio_tokens: Optional[int] = None + """Number of audio tokens billed for this request.""" + + text_tokens: Optional[int] = None + """Number of text tokens billed for this request.""" + + +class UsageTranscriptTextUsageTokens(BaseModel): + """Usage statistics for models billed by token usage.""" + + input_tokens: int + """Number of input tokens billed for this request.""" + + output_tokens: int + """Number of output tokens generated.""" + + total_tokens: int + """Total number of tokens used (input + output).""" + + type: Literal["tokens"] + """The type of the usage object. Always `tokens` for this variant.""" + + input_token_details: Optional[UsageTranscriptTextUsageTokensInputTokenDetails] = None + """Details about the input tokens billed for this request.""" + + +class UsageTranscriptTextUsageDuration(BaseModel): + """Usage statistics for models billed by audio input duration.""" + + seconds: float + """Duration of the input audio in seconds.""" + + type: Literal["duration"] + """The type of the usage object. Always `duration` for this variant.""" + + +Usage: TypeAlias = Union[UsageTranscriptTextUsageTokens, UsageTranscriptTextUsageDuration] + + +class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel): + """ + This event is the output of audio transcription for user audio written to the + user audio buffer. Transcription begins when the input audio buffer is + committed by the client or server (when VAD is enabled). Transcription runs + asynchronously with Response creation, so this event may come before or after + the Response events. + + Realtime API models accept audio natively, and thus input transcription is a + separate process run on a separate ASR (Automatic Speech Recognition) model. + The transcript may diverge somewhat from the model's interpretation, and + should be treated as a rough guide. + """ + + content_index: int + """The index of the content part containing the audio.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item containing the audio that is being transcribed.""" + + transcript: str + """The transcribed text.""" + + type: Literal["conversation.item.input_audio_transcription.completed"] + """ + The event type, must be `conversation.item.input_audio_transcription.completed`. + """ + + usage: Usage + """ + Usage statistics for the transcription, this is billed according to the ASR + model's pricing rather than the realtime model's pricing. + """ + + logprobs: Optional[List[LogProbProperties]] = None + """The log probabilities of the transcription.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_failed_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_failed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e8ad05e43c1ae15694cf03746e1e2fe3c7e94be2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_failed_event.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ConversationItemInputAudioTranscriptionFailedEvent", "Error"] + + +class Error(BaseModel): + """Details of the transcription error.""" + + code: Optional[str] = None + """Error code, if any.""" + + message: Optional[str] = None + """A human-readable error message.""" + + param: Optional[str] = None + """Parameter related to the error, if any.""" + + type: Optional[str] = None + """The type of error.""" + + +class ConversationItemInputAudioTranscriptionFailedEvent(BaseModel): + """ + Returned when input audio transcription is configured, and a transcription + request for a user message failed. These events are separate from other + `error` events so that the client can identify the related Item. + """ + + content_index: int + """The index of the content part containing the audio.""" + + error: Error + """Details of the transcription error.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the user message item.""" + + type: Literal["conversation.item.input_audio_transcription.failed"] + """The event type, must be `conversation.item.input_audio_transcription.failed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_segment.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_segment.py new file mode 100644 index 0000000000000000000000000000000000000000..dcc4916580d5b38b0d9f864645c71e3bda57b9ec --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_input_audio_transcription_segment.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ConversationItemInputAudioTranscriptionSegment"] + + +class ConversationItemInputAudioTranscriptionSegment(BaseModel): + """Returned when an input audio transcription segment is identified for an item.""" + + id: str + """The segment identifier.""" + + content_index: int + """The index of the input audio content part within the item.""" + + end: float + """End time of the segment in seconds.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item containing the input audio content.""" + + speaker: str + """The detected speaker label for this segment.""" + + start: float + """Start time of the segment in seconds.""" + + text: str + """The text for this segment.""" + + type: Literal["conversation.item.input_audio_transcription.segment"] + """The event type, must be `conversation.item.input_audio_transcription.segment`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_truncate_event_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_truncate_event_param.py new file mode 100644 index 0000000000000000000000000000000000000000..e9b41fc980852f82103330569bac233d220df72d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/conversation_item_truncate_event_param.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ConversationItemTruncateEventParam"] + + +class ConversationItemTruncateEventParam(TypedDict, total=False): + """Send this event to truncate a previous assistant message’s audio. + + The server + will produce audio faster than realtime, so this event is useful when the user + interrupts to truncate audio that has already been sent to the client but not + yet played. This will synchronize the server's understanding of the audio with + the client's playback. + + Truncating audio will delete the server-side text transcript to ensure there + is not text in the context that hasn't been heard by the user. + + If successful, the server will respond with a `conversation.item.truncated` + event. + """ + + audio_end_ms: Required[int] + """Inclusive duration up to which audio is truncated, in milliseconds. + + If the audio_end_ms is greater than the actual audio duration, the server will + respond with an error. + """ + + content_index: Required[int] + """The index of the content part to truncate. Set this to `0`.""" + + item_id: Required[str] + """The ID of the assistant message item to truncate. + + Only assistant message items can be truncated. + """ + + type: Required[Literal["conversation.item.truncate"]] + """The event type, must be `conversation.item.truncate`.""" + + event_id: str + """Optional client-generated ID used to identify this event.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event.py new file mode 100644 index 0000000000000000000000000000000000000000..5526bcbfa9f10570733083fcf971b9c462922d63 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputAudioBufferClearEvent"] + + +class InputAudioBufferClearEvent(BaseModel): + """Send this event to clear the audio bytes in the buffer. + + The server will + respond with an `input_audio_buffer.cleared` event. + """ + + type: Literal["input_audio_buffer.clear"] + """The event type, must be `input_audio_buffer.clear`.""" + + event_id: Optional[str] = None + """Optional client-generated ID used to identify this event.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8e0e9c55faad7eb8681b5dd942da11064da6f9ee --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_clear_event_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["InputAudioBufferClearEventParam"] + + +class InputAudioBufferClearEventParam(TypedDict, total=False): + """Send this event to clear the audio bytes in the buffer. + + The server will + respond with an `input_audio_buffer.cleared` event. + """ + + type: Required[Literal["input_audio_buffer.clear"]] + """The event type, must be `input_audio_buffer.clear`.""" + + event_id: str + """Optional client-generated ID used to identify this event.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_cleared_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_cleared_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e4775567dc154d6f30a45d6b351d5a4cc26f7380 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_cleared_event.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputAudioBufferClearedEvent"] + + +class InputAudioBufferClearedEvent(BaseModel): + """ + Returned when the input audio buffer is cleared by the client with a + `input_audio_buffer.clear` event. + """ + + event_id: str + """The unique ID of the server event.""" + + type: Literal["input_audio_buffer.cleared"] + """The event type, must be `input_audio_buffer.cleared`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_commit_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_commit_event.py new file mode 100644 index 0000000000000000000000000000000000000000..fe2ec0178322a6636333f08ff7bf5844ee2d19ee --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_commit_event.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputAudioBufferCommitEvent"] + + +class InputAudioBufferCommitEvent(BaseModel): + """ + Send this event to commit the user input audio buffer, which will create a new user message item in the conversation. This event will produce an error if the input audio buffer is empty. When in Server VAD mode, the client does not need to send this event, the server will commit the audio buffer automatically. + + Committing the input audio buffer will trigger input audio transcription (if enabled in session configuration), but it will not create a response from the model. The server will respond with an `input_audio_buffer.committed` event. + """ + + type: Literal["input_audio_buffer.commit"] + """The event type, must be `input_audio_buffer.commit`.""" + + event_id: Optional[str] = None + """Optional client-generated ID used to identify this event.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_committed_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_committed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..15dc8254f3d41554b626549f11fd24b2c33ea8fb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_committed_event.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputAudioBufferCommittedEvent"] + + +class InputAudioBufferCommittedEvent(BaseModel): + """ + Returned when an input audio buffer is committed, either by the client or + automatically in server VAD mode. The `item_id` property is the ID of the user + message item that will be created, thus a `conversation.item.created` event + will also be sent to the client. + """ + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the user message item that will be created.""" + + type: Literal["input_audio_buffer.committed"] + """The event type, must be `input_audio_buffer.committed`.""" + + previous_item_id: Optional[str] = None + """ + The ID of the preceding item after which the new item will be inserted. Can be + `null` if the item has no predecessor. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_timeout_triggered.py b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_timeout_triggered.py new file mode 100644 index 0000000000000000000000000000000000000000..72b107d56e079059a48d0fda361a229e18da92be --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/input_audio_buffer_timeout_triggered.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputAudioBufferTimeoutTriggered"] + + +class InputAudioBufferTimeoutTriggered(BaseModel): + """Returned when the Server VAD timeout is triggered for the input audio buffer. + + This is configured + with `idle_timeout_ms` in the `turn_detection` settings of the session, and it indicates that + there hasn't been any speech detected for the configured duration. + + The `audio_start_ms` and `audio_end_ms` fields indicate the segment of audio after the last + model response up to the triggering time, as an offset from the beginning of audio written + to the input audio buffer. This means it demarcates the segment of audio that was silent and + the difference between the start and end values will roughly match the configured timeout. + + The empty audio will be committed to the conversation as an `input_audio` item (there will be a + `input_audio_buffer.committed` event) and a model response will be generated. There may be speech + that didn't trigger VAD but is still detected by the model, so the model may respond with + something relevant to the conversation or a prompt to continue speaking. + """ + + audio_end_ms: int + """ + Millisecond offset of audio written to the input audio buffer at the time the + timeout was triggered. + """ + + audio_start_ms: int + """ + Millisecond offset of audio written to the input audio buffer that was after the + playback time of the last model response. + """ + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item associated with this segment.""" + + type: Literal["input_audio_buffer.timeout_triggered"] + """The event type, must be `input_audio_buffer.timeout_triggered`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/mcp_list_tools_completed.py b/py311/lib/python3.11/site-packages/openai/types/realtime/mcp_list_tools_completed.py new file mode 100644 index 0000000000000000000000000000000000000000..2fe64147d612986c7a1fec57d57bf99cc4e5fd26 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/mcp_list_tools_completed.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["McpListToolsCompleted"] + + +class McpListToolsCompleted(BaseModel): + """Returned when listing MCP tools has completed for an item.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the MCP list tools item.""" + + type: Literal["mcp_list_tools.completed"] + """The event type, must be `mcp_list_tools.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/noise_reduction_type.py b/py311/lib/python3.11/site-packages/openai/types/realtime/noise_reduction_type.py new file mode 100644 index 0000000000000000000000000000000000000000..f4338991bbc38b2a50744673da2f0e238c7d5472 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/noise_reduction_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["NoiseReductionType"] + +NoiseReductionType: TypeAlias = Literal["near_field", "far_field"] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/output_audio_buffer_clear_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/output_audio_buffer_clear_event.py new file mode 100644 index 0000000000000000000000000000000000000000..b3fa7620ac4ab2ae635ecd5ec645dada5a877ad9 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/output_audio_buffer_clear_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["OutputAudioBufferClearEvent"] + + +class OutputAudioBufferClearEvent(BaseModel): + """**WebRTC/SIP Only:** Emit to cut off the current audio response. + + This will trigger the server to + stop generating audio and emit a `output_audio_buffer.cleared` event. This + event should be preceded by a `response.cancel` client event to stop the + generation of the current response. + [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc). + """ + + type: Literal["output_audio_buffer.clear"] + """The event type, must be `output_audio_buffer.clear`.""" + + event_id: Optional[str] = None + """The unique ID of the client event used for error handling.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/rate_limits_updated_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/rate_limits_updated_event.py new file mode 100644 index 0000000000000000000000000000000000000000..951de103af67e6cebbeaffb94031c98beaaec016 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/rate_limits_updated_event.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RateLimitsUpdatedEvent", "RateLimit"] + + +class RateLimit(BaseModel): + limit: Optional[int] = None + """The maximum allowed value for the rate limit.""" + + name: Optional[Literal["requests", "tokens"]] = None + """The name of the rate limit (`requests`, `tokens`).""" + + remaining: Optional[int] = None + """The remaining value before the limit is reached.""" + + reset_seconds: Optional[float] = None + """Seconds until the rate limit resets.""" + + +class RateLimitsUpdatedEvent(BaseModel): + """Emitted at the beginning of a Response to indicate the updated rate limits. + + + When a Response is created some tokens will be "reserved" for the output + tokens, the rate limits shown here reflect that reservation, which is then + adjusted accordingly once the Response is completed. + """ + + event_id: str + """The unique ID of the server event.""" + + rate_limits: List[RateLimit] + """List of rate limit information.""" + + type: Literal["rate_limits.updated"] + """The event type, must be `rate_limits.updated`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_config_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7899fe359bc6f6e75461d26e5b9a5071effad35c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_config_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .realtime_audio_config_input_param import RealtimeAudioConfigInputParam +from .realtime_audio_config_output_param import RealtimeAudioConfigOutputParam + +__all__ = ["RealtimeAudioConfigParam"] + + +class RealtimeAudioConfigParam(TypedDict, total=False): + """Configuration for input and output audio.""" + + input: RealtimeAudioConfigInputParam + + output: RealtimeAudioConfigOutputParam diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_formats.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_formats.py new file mode 100644 index 0000000000000000000000000000000000000000..fa10c9a7a43f9b9c64342ed3df86737488e900cb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_audio_formats.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["RealtimeAudioFormats", "AudioPCM", "AudioPCMU", "AudioPCMA"] + + +class AudioPCM(BaseModel): + """The PCM audio format. Only a 24kHz sample rate is supported.""" + + rate: Optional[Literal[24000]] = None + """The sample rate of the audio. Always `24000`.""" + + type: Optional[Literal["audio/pcm"]] = None + """The audio format. Always `audio/pcm`.""" + + +class AudioPCMU(BaseModel): + """The G.711 μ-law format.""" + + type: Optional[Literal["audio/pcmu"]] = None + """The audio format. Always `audio/pcmu`.""" + + +class AudioPCMA(BaseModel): + """The G.711 A-law format.""" + + type: Optional[Literal["audio/pcma"]] = None + """The audio format. Always `audio/pcma`.""" + + +RealtimeAudioFormats: TypeAlias = Annotated[Union[AudioPCM, AudioPCMU, AudioPCMA], PropertyInfo(discriminator="type")] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event.py new file mode 100644 index 0000000000000000000000000000000000000000..3b1c348daa213a3664d00d651c30457402f17591 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .session_update_event import SessionUpdateEvent +from .response_cancel_event import ResponseCancelEvent +from .response_create_event import ResponseCreateEvent +from .conversation_item_create_event import ConversationItemCreateEvent +from .conversation_item_delete_event import ConversationItemDeleteEvent +from .input_audio_buffer_clear_event import InputAudioBufferClearEvent +from .input_audio_buffer_append_event import InputAudioBufferAppendEvent +from .input_audio_buffer_commit_event import InputAudioBufferCommitEvent +from .output_audio_buffer_clear_event import OutputAudioBufferClearEvent +from .conversation_item_retrieve_event import ConversationItemRetrieveEvent +from .conversation_item_truncate_event import ConversationItemTruncateEvent + +__all__ = ["RealtimeClientEvent"] + +RealtimeClientEvent: TypeAlias = Annotated[ + Union[ + ConversationItemCreateEvent, + ConversationItemDeleteEvent, + ConversationItemRetrieveEvent, + ConversationItemTruncateEvent, + InputAudioBufferAppendEvent, + InputAudioBufferClearEvent, + OutputAudioBufferClearEvent, + InputAudioBufferCommitEvent, + ResponseCancelEvent, + ResponseCreateEvent, + SessionUpdateEvent, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cda5766e2a443f1308cdb2b791ab4f6cea94ef94 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_client_event_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .session_update_event_param import SessionUpdateEventParam +from .response_cancel_event_param import ResponseCancelEventParam +from .response_create_event_param import ResponseCreateEventParam +from .conversation_item_create_event_param import ConversationItemCreateEventParam +from .conversation_item_delete_event_param import ConversationItemDeleteEventParam +from .input_audio_buffer_clear_event_param import InputAudioBufferClearEventParam +from .input_audio_buffer_append_event_param import InputAudioBufferAppendEventParam +from .input_audio_buffer_commit_event_param import InputAudioBufferCommitEventParam +from .output_audio_buffer_clear_event_param import OutputAudioBufferClearEventParam +from .conversation_item_retrieve_event_param import ConversationItemRetrieveEventParam +from .conversation_item_truncate_event_param import ConversationItemTruncateEventParam + +__all__ = ["RealtimeClientEventParam"] + +RealtimeClientEventParam: TypeAlias = Union[ + ConversationItemCreateEventParam, + ConversationItemDeleteEventParam, + ConversationItemRetrieveEventParam, + ConversationItemTruncateEventParam, + InputAudioBufferAppendEventParam, + InputAudioBufferClearEventParam, + OutputAudioBufferClearEventParam, + InputAudioBufferCommitEventParam, + ResponseCancelEventParam, + ResponseCreateEventParam, + SessionUpdateEventParam, +] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_connect_params.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_connect_params.py new file mode 100644 index 0000000000000000000000000000000000000000..950f36212fb7fc040ef36c651bed8db700a20b9c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_connect_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RealtimeConnectParams"] + + +class RealtimeConnectParams(TypedDict, total=False): + call_id: str + + model: str diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message.py new file mode 100644 index 0000000000000000000000000000000000000000..207831a3c8fbe165b24e48ead330e0cef610bd9c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeConversationItemAssistantMessage", "Content"] + + +class Content(BaseModel): + audio: Optional[str] = None + """ + Base64-encoded audio bytes, these will be parsed as the format specified in the + session output audio type configuration. This defaults to PCM 16-bit 24kHz mono + if not specified. + """ + + text: Optional[str] = None + """The text content.""" + + transcript: Optional[str] = None + """ + The transcript of the audio content, this will always be present if the output + type is `audio`. + """ + + type: Optional[Literal["output_text", "output_audio"]] = None + """ + The content type, `output_text` or `output_audio` depending on the session + `output_modalities` configuration. + """ + + +class RealtimeConversationItemAssistantMessage(BaseModel): + """An assistant message item in a Realtime conversation.""" + + content: List[Content] + """The content of the message.""" + + role: Literal["assistant"] + """The role of the message sender. Always `assistant`.""" + + type: Literal["message"] + """The type of the item. Always `message`.""" + + id: Optional[str] = None + """The unique ID of the item. + + This may be provided by the client or generated by the server. + """ + + object: Optional[Literal["realtime.item"]] = None + """Identifier for the API object being returned - always `realtime.item`. + + Optional when creating a new item. + """ + + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None + """The status of the item. Has no effect on the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message_param.py new file mode 100644 index 0000000000000000000000000000000000000000..abc78e7d3fd52edaa9195eb4e8d4dd62362529c3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_assistant_message_param.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RealtimeConversationItemAssistantMessageParam", "Content"] + + +class Content(TypedDict, total=False): + audio: str + """ + Base64-encoded audio bytes, these will be parsed as the format specified in the + session output audio type configuration. This defaults to PCM 16-bit 24kHz mono + if not specified. + """ + + text: str + """The text content.""" + + transcript: str + """ + The transcript of the audio content, this will always be present if the output + type is `audio`. + """ + + type: Literal["output_text", "output_audio"] + """ + The content type, `output_text` or `output_audio` depending on the session + `output_modalities` configuration. + """ + + +class RealtimeConversationItemAssistantMessageParam(TypedDict, total=False): + """An assistant message item in a Realtime conversation.""" + + content: Required[Iterable[Content]] + """The content of the message.""" + + role: Required[Literal["assistant"]] + """The role of the message sender. Always `assistant`.""" + + type: Required[Literal["message"]] + """The type of the item. Always `message`.""" + + id: str + """The unique ID of the item. + + This may be provided by the client or generated by the server. + """ + + object: Literal["realtime.item"] + """Identifier for the API object being returned - always `realtime.item`. + + Optional when creating a new item. + """ + + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output.py new file mode 100644 index 0000000000000000000000000000000000000000..cdbc352d85854e1b0994d74dd3924c8a4422899e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeConversationItemFunctionCallOutput"] + + +class RealtimeConversationItemFunctionCallOutput(BaseModel): + """A function call output item in a Realtime conversation.""" + + call_id: str + """The ID of the function call this output is for.""" + + output: str + """ + The output of the function call, this is free text and can contain any + information or simply be empty. + """ + + type: Literal["function_call_output"] + """The type of the item. Always `function_call_output`.""" + + id: Optional[str] = None + """The unique ID of the item. + + This may be provided by the client or generated by the server. + """ + + object: Optional[Literal["realtime.item"]] = None + """Identifier for the API object being returned - always `realtime.item`. + + Optional when creating a new item. + """ + + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None + """The status of the item. Has no effect on the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2e56a81dc35e082df3dfec31e731f0694b9bb014 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_function_call_output_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RealtimeConversationItemFunctionCallOutputParam"] + + +class RealtimeConversationItemFunctionCallOutputParam(TypedDict, total=False): + """A function call output item in a Realtime conversation.""" + + call_id: Required[str] + """The ID of the function call this output is for.""" + + output: Required[str] + """ + The output of the function call, this is free text and can contain any + information or simply be empty. + """ + + type: Required[Literal["function_call_output"]] + """The type of the item. Always `function_call_output`.""" + + id: str + """The unique ID of the item. + + This may be provided by the client or generated by the server. + """ + + object: Literal["realtime.item"] + """Identifier for the API object being returned - always `realtime.item`. + + Optional when creating a new item. + """ + + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_system_message_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_system_message_param.py new file mode 100644 index 0000000000000000000000000000000000000000..93880198fa401bdcb41e75aabc3ce421e1cdb8ef --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_conversation_item_system_message_param.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RealtimeConversationItemSystemMessageParam", "Content"] + + +class Content(TypedDict, total=False): + text: str + """The text content.""" + + type: Literal["input_text"] + """The content type. Always `input_text` for system messages.""" + + +class RealtimeConversationItemSystemMessageParam(TypedDict, total=False): + """ + A system message in a Realtime conversation can be used to provide additional context or instructions to the model. This is similar but distinct from the instruction prompt provided at the start of a conversation, as system messages can be added at any point in the conversation. For major changes to the conversation's behavior, use instructions, but for smaller updates (e.g. "the user is now asking about a different topic"), use system messages. + """ + + content: Required[Iterable[Content]] + """The content of the message.""" + + role: Required[Literal["system"]] + """The role of the message sender. Always `system`.""" + + type: Required[Literal["message"]] + """The type of the item. Always `message`.""" + + id: str + """The unique ID of the item. + + This may be provided by the client or generated by the server. + """ + + object: Literal["realtime.item"] + """Identifier for the API object being returned - always `realtime.item`. + + Optional when creating a new item. + """ + + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_function_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_function_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..f42e3e497c16b12050834fe79bd67c3ce7fae738 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_function_tool_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["RealtimeFunctionToolParam"] + + +class RealtimeFunctionToolParam(TypedDict, total=False): + description: str + """ + The description of the function, including guidance on when and how to call it, + and guidance about what to tell the user when calling (if anything). + """ + + name: str + """The name of the function.""" + + parameters: object + """Parameters of the function in JSON Schema.""" + + type: Literal["function"] + """The type of the tool, i.e. `function`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_approval_request.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_approval_request.py new file mode 100644 index 0000000000000000000000000000000000000000..1744c90070fd3e6778a644b1899ba7ca4e4466d4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_approval_request.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeMcpApprovalRequest"] + + +class RealtimeMcpApprovalRequest(BaseModel): + """A Realtime item requesting human approval of a tool invocation.""" + + id: str + """The unique ID of the approval request.""" + + arguments: str + """A JSON string of arguments for the tool.""" + + name: str + """The name of the tool to run.""" + + server_label: str + """The label of the MCP server making the request.""" + + type: Literal["mcp_approval_request"] + """The type of the item. Always `mcp_approval_request`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_protocol_error.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_protocol_error.py new file mode 100644 index 0000000000000000000000000000000000000000..2e7cfdffa36e4ebc083a1b1202b8b695d1cfc5ed --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_protocol_error.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeMcpProtocolError"] + + +class RealtimeMcpProtocolError(BaseModel): + code: int + + message: str + + type: Literal["protocol_error"] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..f53ad0eaa9ade9f32e2882873ff4375d75420a16 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .realtime_mcphttp_error import RealtimeMcphttpError +from .realtime_mcp_protocol_error import RealtimeMcpProtocolError +from .realtime_mcp_tool_execution_error import RealtimeMcpToolExecutionError + +__all__ = ["RealtimeMcpToolCall", "Error"] + +Error: TypeAlias = Annotated[ + Union[RealtimeMcpProtocolError, RealtimeMcpToolExecutionError, RealtimeMcphttpError, None], + PropertyInfo(discriminator="type"), +] + + +class RealtimeMcpToolCall(BaseModel): + """A Realtime item representing an invocation of a tool on an MCP server.""" + + id: str + """The unique ID of the tool call.""" + + arguments: str + """A JSON string of the arguments passed to the tool.""" + + name: str + """The name of the tool that was run.""" + + server_label: str + """The label of the MCP server running the tool.""" + + type: Literal["mcp_call"] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] = None + """The ID of an associated approval request, if any.""" + + error: Optional[Error] = None + """The error from the tool call, if any.""" + + output: Optional[str] = None + """The output from the tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8ccb5efc8a56eaffa7038db69ed0b16ea20a7dbb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_call_param.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .realtime_mcphttp_error_param import RealtimeMcphttpErrorParam +from .realtime_mcp_protocol_error_param import RealtimeMcpProtocolErrorParam +from .realtime_mcp_tool_execution_error_param import RealtimeMcpToolExecutionErrorParam + +__all__ = ["RealtimeMcpToolCallParam", "Error"] + +Error: TypeAlias = Union[RealtimeMcpProtocolErrorParam, RealtimeMcpToolExecutionErrorParam, RealtimeMcphttpErrorParam] + + +class RealtimeMcpToolCallParam(TypedDict, total=False): + """A Realtime item representing an invocation of a tool on an MCP server.""" + + id: Required[str] + """The unique ID of the tool call.""" + + arguments: Required[str] + """A JSON string of the arguments passed to the tool.""" + + name: Required[str] + """The name of the tool that was run.""" + + server_label: Required[str] + """The label of the MCP server running the tool.""" + + type: Required[Literal["mcp_call"]] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] + """The ID of an associated approval request, if any.""" + + error: Optional[Error] + """The error from the tool call, if any.""" + + output: Optional[str] + """The output from the tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_execution_error.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_execution_error.py new file mode 100644 index 0000000000000000000000000000000000000000..a2ed06312925606dd57e820fb4ff575f5b0f5d98 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcp_tool_execution_error.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeMcpToolExecutionError"] + + +class RealtimeMcpToolExecutionError(BaseModel): + message: str + + type: Literal["tool_execution_error"] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcphttp_error_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcphttp_error_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2b80a6f0a4c29c18dfa4e6d27be21d887aac73e8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_mcphttp_error_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RealtimeMcphttpErrorParam"] + + +class RealtimeMcphttpErrorParam(TypedDict, total=False): + code: Required[int] + + message: Required[str] + + type: Required[Literal["http_error"]] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_audio_output.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_audio_output.py new file mode 100644 index 0000000000000000000000000000000000000000..db02511ab1773c87459b921d71077fafd8453524 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_audio_output.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .realtime_audio_formats import RealtimeAudioFormats + +__all__ = ["RealtimeResponseCreateAudioOutput", "Output"] + + +class Output(BaseModel): + format: Optional[RealtimeAudioFormats] = None + """The format of the output audio.""" + + voice: Union[ + str, Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"], None + ] = None + """The voice the model uses to respond. + + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the + session once the model has responded with audio at least once. + """ + + +class RealtimeResponseCreateAudioOutput(BaseModel): + """Configuration for audio input and output.""" + + output: Optional[Output] = None diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..72189e10e674c03ec4535d2a780b0631956d1548 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool.py @@ -0,0 +1,153 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "RealtimeResponseCreateMcpTool", + "AllowedTools", + "AllowedToolsMcpToolFilter", + "RequireApproval", + "RequireApprovalMcpToolApprovalFilter", + "RequireApprovalMcpToolApprovalFilterAlways", + "RequireApprovalMcpToolApprovalFilterNever", +] + + +class AllowedToolsMcpToolFilter(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +AllowedTools: TypeAlias = Union[List[str], AllowedToolsMcpToolFilter, None] + + +class RequireApprovalMcpToolApprovalFilterAlways(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class RequireApprovalMcpToolApprovalFilterNever(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class RequireApprovalMcpToolApprovalFilter(BaseModel): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: Optional[RequireApprovalMcpToolApprovalFilterAlways] = None + """A filter object to specify which tools are allowed.""" + + never: Optional[RequireApprovalMcpToolApprovalFilterNever] = None + """A filter object to specify which tools are allowed.""" + + +RequireApproval: TypeAlias = Union[RequireApprovalMcpToolApprovalFilter, Literal["always", "never"], None] + + +class RealtimeResponseCreateMcpTool(BaseModel): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: str + """A label for this MCP server, used to identify it in tool calls.""" + + type: Literal["mcp"] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[AllowedTools] = None + """List of allowed tool names or a filter object.""" + + authorization: Optional[str] = None + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] = None + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[RequireApproval] = None + """Specify which of the MCP server's tools require approval.""" + + server_description: Optional[str] = None + """Optional description of the MCP server, used to provide more context.""" + + server_url: Optional[str] = None + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..68dd6bdb5c12613032d4ce2eaba3289a1f60e12c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_mcp_tool_param.py @@ -0,0 +1,153 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr + +__all__ = [ + "RealtimeResponseCreateMcpToolParam", + "AllowedTools", + "AllowedToolsMcpToolFilter", + "RequireApproval", + "RequireApprovalMcpToolApprovalFilter", + "RequireApprovalMcpToolApprovalFilterAlways", + "RequireApprovalMcpToolApprovalFilterNever", +] + + +class AllowedToolsMcpToolFilter(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +AllowedTools: TypeAlias = Union[SequenceNotStr[str], AllowedToolsMcpToolFilter] + + +class RequireApprovalMcpToolApprovalFilterAlways(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class RequireApprovalMcpToolApprovalFilterNever(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class RequireApprovalMcpToolApprovalFilter(TypedDict, total=False): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: RequireApprovalMcpToolApprovalFilterAlways + """A filter object to specify which tools are allowed.""" + + never: RequireApprovalMcpToolApprovalFilterNever + """A filter object to specify which tools are allowed.""" + + +RequireApproval: TypeAlias = Union[RequireApprovalMcpToolApprovalFilter, Literal["always", "never"]] + + +class RealtimeResponseCreateMcpToolParam(TypedDict, total=False): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls.""" + + type: Required[Literal["mcp"]] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[AllowedTools] + """List of allowed tool names or a filter object.""" + + authorization: str + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[RequireApproval] + """Specify which of the MCP server's tools require approval.""" + + server_description: str + """Optional description of the MCP server, used to provide more context.""" + + server_url: str + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_params.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..deec8c9280b245522109399bae3d483aa37dbb0d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_create_params.py @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from ..shared.metadata import Metadata +from .conversation_item import ConversationItem +from .realtime_function_tool import RealtimeFunctionTool +from ..responses.response_prompt import ResponsePrompt +from ..responses.tool_choice_mcp import ToolChoiceMcp +from ..responses.tool_choice_options import ToolChoiceOptions +from ..responses.tool_choice_function import ToolChoiceFunction +from .realtime_response_create_mcp_tool import RealtimeResponseCreateMcpTool +from .realtime_response_create_audio_output import RealtimeResponseCreateAudioOutput + +__all__ = ["RealtimeResponseCreateParams", "ToolChoice", "Tool"] + +ToolChoice: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMcp] + +Tool: TypeAlias = Union[RealtimeFunctionTool, RealtimeResponseCreateMcpTool] + + +class RealtimeResponseCreateParams(BaseModel): + """Create a new Realtime response with these parameters""" + + audio: Optional[RealtimeResponseCreateAudioOutput] = None + """Configuration for audio input and output.""" + + conversation: Union[str, Literal["auto", "none"], None] = None + """Controls which conversation the response is added to. + + Currently supports `auto` and `none`, with `auto` as the default value. The + `auto` value means that the contents of the response will be added to the + default conversation. Set this to `none` to create an out-of-band response which + will not add items to default conversation. + """ + + input: Optional[List[ConversationItem]] = None + """Input items to include in the prompt for the model. + + Using this field creates a new context for this Response instead of using the + default conversation. An empty array `[]` will clear the context for this + Response. Note that this can include references to items that previously + appeared in the session using their id. + """ + + instructions: Optional[str] = None + """The default system instructions (i.e. + + system message) prepended to model calls. This field allows the client to guide + the model on desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here are examples of + good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be + followed by the model, but they provide guidance to the model on the desired + behavior. Note that the server sets default instructions which will be used if + this field is not set and are visible in the `session.created` event at the + start of the session. + """ + + max_output_tokens: Union[int, Literal["inf"], None] = None + """ + Maximum number of output tokens for a single assistant response, inclusive of + tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + `inf` for the maximum available tokens for a given model. Defaults to `inf`. + """ + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + output_modalities: Optional[List[Literal["text", "audio"]]] = None + """ + The set of modalities the model used to respond, currently the only possible + values are `[\"audio\"]`, `[\"text\"]`. Audio output always include a text + transcript. Setting the output to mode `text` will disable audio output from the + model. + """ + + prompt: Optional[ResponsePrompt] = None + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + tool_choice: Optional[ToolChoice] = None + """How the model chooses tools. + + Provide one of the string modes or force a specific function/MCP tool. + """ + + tools: Optional[List[Tool]] = None + """Tools available to the model.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_status.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_status.py new file mode 100644 index 0000000000000000000000000000000000000000..26b272ae5ad9f200de2c7649411f779c6d2092b1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_status.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeResponseStatus", "Error"] + + +class Error(BaseModel): + """ + A description of the error that caused the response to fail, + populated when the `status` is `failed`. + """ + + code: Optional[str] = None + """Error code, if any.""" + + type: Optional[str] = None + """The type of error.""" + + +class RealtimeResponseStatus(BaseModel): + """Additional details about the status.""" + + error: Optional[Error] = None + """ + A description of the error that caused the response to fail, populated when the + `status` is `failed`. + """ + + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None + """The reason the Response did not complete. + + For a `cancelled` Response, one of `turn_detected` (the server VAD detected a + new start of speech) or `client_cancelled` (the client sent a cancel event). For + an `incomplete` Response, one of `max_output_tokens` or `content_filter` (the + server-side safety filter activated and cut off the response). + """ + + type: Optional[Literal["completed", "cancelled", "incomplete", "failed"]] = None + """ + The type of error that caused the response to fail, corresponding with the + `status` field (`completed`, `cancelled`, `incomplete`, `failed`). + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_usage_output_token_details.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_usage_output_token_details.py new file mode 100644 index 0000000000000000000000000000000000000000..2154c77d5d3d6b2ee110a6e07c86a01ab28410fd --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_response_usage_output_token_details.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["RealtimeResponseUsageOutputTokenDetails"] + + +class RealtimeResponseUsageOutputTokenDetails(BaseModel): + """Details about the output tokens used in the Response.""" + + audio_tokens: Optional[int] = None + """The number of audio tokens used in the Response.""" + + text_tokens: Optional[int] = None + """The number of text tokens used in the Response.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request.py new file mode 100644 index 0000000000000000000000000000000000000000..4a93c91c7df5651b5c03830312ae2d1cd695c759 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .realtime_truncation import RealtimeTruncation +from .realtime_audio_config import RealtimeAudioConfig +from .realtime_tools_config import RealtimeToolsConfig +from .realtime_tracing_config import RealtimeTracingConfig +from ..responses.response_prompt import ResponsePrompt +from .realtime_tool_choice_config import RealtimeToolChoiceConfig + +__all__ = ["RealtimeSessionCreateRequest"] + + +class RealtimeSessionCreateRequest(BaseModel): + """Realtime session object configuration.""" + + type: Literal["realtime"] + """The type of session to create. Always `realtime` for the Realtime API.""" + + audio: Optional[RealtimeAudioConfig] = None + """Configuration for input and output audio.""" + + include: Optional[List[Literal["item.input_audio_transcription.logprobs"]]] = None + """Additional fields to include in server outputs. + + `item.input_audio_transcription.logprobs`: Include logprobs for input audio + transcription. + """ + + instructions: Optional[str] = None + """The default system instructions (i.e. + + system message) prepended to model calls. This field allows the client to guide + the model on desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here are examples of + good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be + followed by the model, but they provide guidance to the model on the desired + behavior. + + Note that the server sets default instructions which will be used if this field + is not set and are visible in the `session.created` event at the start of the + session. + """ + + max_output_tokens: Union[int, Literal["inf"], None] = None + """ + Maximum number of output tokens for a single assistant response, inclusive of + tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + `inf` for the maximum available tokens for a given model. Defaults to `inf`. + """ + + model: Union[ + str, + Literal[ + "gpt-realtime", + "gpt-realtime-2025-08-28", + "gpt-4o-realtime-preview", + "gpt-4o-realtime-preview-2024-10-01", + "gpt-4o-realtime-preview-2024-12-17", + "gpt-4o-realtime-preview-2025-06-03", + "gpt-4o-mini-realtime-preview", + "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-mini", + "gpt-realtime-mini-2025-10-06", + "gpt-realtime-mini-2025-12-15", + "gpt-audio-mini", + "gpt-audio-mini-2025-10-06", + "gpt-audio-mini-2025-12-15", + ], + None, + ] = None + """The Realtime model used for this session.""" + + output_modalities: Optional[List[Literal["text", "audio"]]] = None + """The set of modalities the model can respond with. + + It defaults to `["audio"]`, indicating that the model will respond with audio + plus a transcript. `["text"]` can be used to make the model respond with text + only. It is not possible to request both `text` and `audio` at the same time. + """ + + prompt: Optional[ResponsePrompt] = None + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + tool_choice: Optional[RealtimeToolChoiceConfig] = None + """How the model chooses tools. + + Provide one of the string modes or force a specific function/MCP tool. + """ + + tools: Optional[RealtimeToolsConfig] = None + """Tools available to the model.""" + + tracing: Optional[RealtimeTracingConfig] = None + """ + Realtime API can write session traces to the + [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + + `auto` will create a trace for the session with default values for the workflow + name, group id, and metadata. + """ + + truncation: Optional[RealtimeTruncation] = None + """ + When the number of tokens in a conversation exceeds the model's input token + limit, the conversation be truncated, meaning messages (starting from the + oldest) will not be included in the model's context. A 32k context model with + 4,096 max output tokens can only include 28,224 tokens in the context before + truncation occurs. + + Clients can configure truncation behavior to truncate with a lower max token + limit, which is an effective way to control token usage and cost. + + Truncation will reduce the number of cached tokens on the next turn (busting the + cache), since messages are dropped from the beginning of the context. However, + clients can also configure truncation to retain messages up to a fraction of the + maximum context size, which will reduce the need for future truncations and thus + improve the cache rate. + + Truncation can be disabled entirely, which means the server will never truncate + but would instead return an error if the conversation exceeds the model's input + token limit. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request_param.py new file mode 100644 index 0000000000000000000000000000000000000000..dee63d0967a02b8cb7522dc656e20ea7f71a26fd --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_request_param.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Optional +from typing_extensions import Literal, Required, TypedDict + +from .realtime_truncation_param import RealtimeTruncationParam +from .realtime_audio_config_param import RealtimeAudioConfigParam +from .realtime_tools_config_param import RealtimeToolsConfigParam +from .realtime_tracing_config_param import RealtimeTracingConfigParam +from ..responses.response_prompt_param import ResponsePromptParam +from .realtime_tool_choice_config_param import RealtimeToolChoiceConfigParam + +__all__ = ["RealtimeSessionCreateRequestParam"] + + +class RealtimeSessionCreateRequestParam(TypedDict, total=False): + """Realtime session object configuration.""" + + type: Required[Literal["realtime"]] + """The type of session to create. Always `realtime` for the Realtime API.""" + + audio: RealtimeAudioConfigParam + """Configuration for input and output audio.""" + + include: List[Literal["item.input_audio_transcription.logprobs"]] + """Additional fields to include in server outputs. + + `item.input_audio_transcription.logprobs`: Include logprobs for input audio + transcription. + """ + + instructions: str + """The default system instructions (i.e. + + system message) prepended to model calls. This field allows the client to guide + the model on desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here are examples of + good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be + followed by the model, but they provide guidance to the model on the desired + behavior. + + Note that the server sets default instructions which will be used if this field + is not set and are visible in the `session.created` event at the start of the + session. + """ + + max_output_tokens: Union[int, Literal["inf"]] + """ + Maximum number of output tokens for a single assistant response, inclusive of + tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + `inf` for the maximum available tokens for a given model. Defaults to `inf`. + """ + + model: Union[ + str, + Literal[ + "gpt-realtime", + "gpt-realtime-2025-08-28", + "gpt-4o-realtime-preview", + "gpt-4o-realtime-preview-2024-10-01", + "gpt-4o-realtime-preview-2024-12-17", + "gpt-4o-realtime-preview-2025-06-03", + "gpt-4o-mini-realtime-preview", + "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-mini", + "gpt-realtime-mini-2025-10-06", + "gpt-realtime-mini-2025-12-15", + "gpt-audio-mini", + "gpt-audio-mini-2025-10-06", + "gpt-audio-mini-2025-12-15", + ], + ] + """The Realtime model used for this session.""" + + output_modalities: List[Literal["text", "audio"]] + """The set of modalities the model can respond with. + + It defaults to `["audio"]`, indicating that the model will respond with audio + plus a transcript. `["text"]` can be used to make the model respond with text + only. It is not possible to request both `text` and `audio` at the same time. + """ + + prompt: Optional[ResponsePromptParam] + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + tool_choice: RealtimeToolChoiceConfigParam + """How the model chooses tools. + + Provide one of the string modes or force a specific function/MCP tool. + """ + + tools: RealtimeToolsConfigParam + """Tools available to the model.""" + + tracing: Optional[RealtimeTracingConfigParam] + """ + Realtime API can write session traces to the + [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + + `auto` will create a trace for the session with default values for the workflow + name, group id, and metadata. + """ + + truncation: RealtimeTruncationParam + """ + When the number of tokens in a conversation exceeds the model's input token + limit, the conversation be truncated, meaning messages (starting from the + oldest) will not be included in the model's context. A 32k context model with + 4,096 max output tokens can only include 28,224 tokens in the context before + truncation occurs. + + Clients can configure truncation behavior to truncate with a lower max token + limit, which is an effective way to control token usage and cost. + + Truncation will reduce the number of cached tokens on the next turn (busting the + cache), since messages are dropped from the beginning of the context. However, + clients can also configure truncation to retain messages up to a fraction of the + maximum context size, which will reduce the need for future truncations and thus + improve the cache rate. + + Truncation can be disabled entirely, which means the server will never truncate + but would instead return an error if the conversation exceeds the model's input + token limit. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_response.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..15a200ca173370ea86dfb6a07ffa258ad0589e5a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_session_create_response.py @@ -0,0 +1,534 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .audio_transcription import AudioTranscription +from .realtime_truncation import RealtimeTruncation +from .noise_reduction_type import NoiseReductionType +from .realtime_audio_formats import RealtimeAudioFormats +from .realtime_function_tool import RealtimeFunctionTool +from ..responses.response_prompt import ResponsePrompt +from ..responses.tool_choice_mcp import ToolChoiceMcp +from ..responses.tool_choice_options import ToolChoiceOptions +from .realtime_session_client_secret import RealtimeSessionClientSecret +from ..responses.tool_choice_function import ToolChoiceFunction + +__all__ = [ + "RealtimeSessionCreateResponse", + "Audio", + "AudioInput", + "AudioInputNoiseReduction", + "AudioInputTurnDetection", + "AudioInputTurnDetectionServerVad", + "AudioInputTurnDetectionSemanticVad", + "AudioOutput", + "ToolChoice", + "Tool", + "ToolMcpTool", + "ToolMcpToolAllowedTools", + "ToolMcpToolAllowedToolsMcpToolFilter", + "ToolMcpToolRequireApproval", + "ToolMcpToolRequireApprovalMcpToolApprovalFilter", + "ToolMcpToolRequireApprovalMcpToolApprovalFilterAlways", + "ToolMcpToolRequireApprovalMcpToolApprovalFilterNever", + "Tracing", + "TracingTracingConfiguration", +] + + +class AudioInputNoiseReduction(BaseModel): + """Configuration for input audio noise reduction. + + This can be set to `null` to turn off. + Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + """ + + type: Optional[NoiseReductionType] = None + """Type of noise reduction. + + `near_field` is for close-talking microphones such as headphones, `far_field` is + for far-field microphones such as laptop or conference room microphones. + """ + + +class AudioInputTurnDetectionServerVad(BaseModel): + """ + Server-side voice activity detection (VAD) which flips on when user speech is detected and off after a period of silence. + """ + + type: Literal["server_vad"] + """Type of turn detection, `server_vad` to turn on simple Server VAD.""" + + create_response: Optional[bool] = None + """Whether or not to automatically generate a response when a VAD stop event + occurs. + + If `interrupt_response` is set to `false` this may fail to create a response if + the model is already responding. + + If both `create_response` and `interrupt_response` are set to `false`, the model + will never respond automatically but VAD events will still be emitted. + """ + + idle_timeout_ms: Optional[int] = None + """Optional timeout after which a model response will be triggered automatically. + + This is useful for situations in which a long pause from the user is unexpected, + such as a phone call. The model will effectively prompt the user to continue the + conversation based on the current context. + + The timeout value will be applied after the last model response's audio has + finished playing, i.e. it's set to the `response.done` time plus audio playback + duration. + + An `input_audio_buffer.timeout_triggered` event (plus events associated with the + Response) will be emitted when the timeout is reached. Idle timeout is currently + only supported for `server_vad` mode. + """ + + interrupt_response: Optional[bool] = None + """ + Whether or not to automatically interrupt (cancel) any ongoing response with + output to the default conversation (i.e. `conversation` of `auto`) when a VAD + start event occurs. If `true` then the response will be cancelled, otherwise it + will continue until complete. + + If both `create_response` and `interrupt_response` are set to `false`, the model + will never respond automatically but VAD events will still be emitted. + """ + + prefix_padding_ms: Optional[int] = None + """Used only for `server_vad` mode. + + Amount of audio to include before the VAD detected speech (in milliseconds). + Defaults to 300ms. + """ + + silence_duration_ms: Optional[int] = None + """Used only for `server_vad` mode. + + Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms. + With shorter values the model will respond more quickly, but may jump in on + short pauses from the user. + """ + + threshold: Optional[float] = None + """Used only for `server_vad` mode. + + Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher + threshold will require louder audio to activate the model, and thus might + perform better in noisy environments. + """ + + +class AudioInputTurnDetectionSemanticVad(BaseModel): + """ + Server-side semantic turn detection which uses a model to determine when the user has finished speaking. + """ + + type: Literal["semantic_vad"] + """Type of turn detection, `semantic_vad` to turn on Semantic VAD.""" + + create_response: Optional[bool] = None + """ + Whether or not to automatically generate a response when a VAD stop event + occurs. + """ + + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None + """Used only for `semantic_vad` mode. + + The eagerness of the model to respond. `low` will wait longer for the user to + continue speaking, `high` will respond more quickly. `auto` is the default and + is equivalent to `medium`. `low`, `medium`, and `high` have max timeouts of 8s, + 4s, and 2s respectively. + """ + + interrupt_response: Optional[bool] = None + """ + Whether or not to automatically interrupt any ongoing response with output to + the default conversation (i.e. `conversation` of `auto`) when a VAD start event + occurs. + """ + + +AudioInputTurnDetection: TypeAlias = Annotated[ + Union[AudioInputTurnDetectionServerVad, AudioInputTurnDetectionSemanticVad, None], + PropertyInfo(discriminator="type"), +] + + +class AudioInput(BaseModel): + format: Optional[RealtimeAudioFormats] = None + """The format of the input audio.""" + + noise_reduction: Optional[AudioInputNoiseReduction] = None + """Configuration for input audio noise reduction. + + This can be set to `null` to turn off. Noise reduction filters audio added to + the input audio buffer before it is sent to VAD and the model. Filtering the + audio can improve VAD and turn detection accuracy (reducing false positives) and + model performance by improving perception of the input audio. + """ + + transcription: Optional[AudioTranscription] = None + """ + Configuration for input audio transcription, defaults to off and can be set to + `null` to turn off once on. Input audio transcription is not native to the + model, since the model consumes audio directly. Transcription runs + asynchronously through + [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) + and should be treated as guidance of input audio content rather than precisely + what the model heard. The client can optionally set the language and prompt for + transcription, these offer additional guidance to the transcription service. + """ + + turn_detection: Optional[AudioInputTurnDetection] = None + """Configuration for turn detection, ether Server VAD or Semantic VAD. + + This can be set to `null` to turn off, in which case the client must manually + trigger model response. + + Server VAD means that the model will detect the start and end of speech based on + audio volume and respond at the end of user speech. + + Semantic VAD is more advanced and uses a turn detection model (in conjunction + with VAD) to semantically estimate whether the user has finished speaking, then + dynamically sets a timeout based on this probability. For example, if user audio + trails off with "uhhm", the model will score a low probability of turn end and + wait longer for the user to continue speaking. This can be useful for more + natural conversations, but may have a higher latency. + """ + + +class AudioOutput(BaseModel): + format: Optional[RealtimeAudioFormats] = None + """The format of the output audio.""" + + speed: Optional[float] = None + """ + The speed of the model's spoken response as a multiple of the original speed. + 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed. + This value can only be changed in between model turns, not while a response is + in progress. + + This parameter is a post-processing adjustment to the audio after it is + generated, it's also possible to prompt the model to speak faster or slower. + """ + + voice: Union[ + str, Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"], None + ] = None + """The voice the model uses to respond. + + Voice cannot be changed during the session once the model has responded with + audio at least once. Current voice options are `alloy`, `ash`, `ballad`, + `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. We recommend + `marin` and `cedar` for best quality. + """ + + +class Audio(BaseModel): + """Configuration for input and output audio.""" + + input: Optional[AudioInput] = None + + output: Optional[AudioOutput] = None + + +ToolChoice: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMcp] + + +class ToolMcpToolAllowedToolsMcpToolFilter(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +ToolMcpToolAllowedTools: TypeAlias = Union[List[str], ToolMcpToolAllowedToolsMcpToolFilter, None] + + +class ToolMcpToolRequireApprovalMcpToolApprovalFilterAlways(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class ToolMcpToolRequireApprovalMcpToolApprovalFilterNever(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class ToolMcpToolRequireApprovalMcpToolApprovalFilter(BaseModel): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: Optional[ToolMcpToolRequireApprovalMcpToolApprovalFilterAlways] = None + """A filter object to specify which tools are allowed.""" + + never: Optional[ToolMcpToolRequireApprovalMcpToolApprovalFilterNever] = None + """A filter object to specify which tools are allowed.""" + + +ToolMcpToolRequireApproval: TypeAlias = Union[ + ToolMcpToolRequireApprovalMcpToolApprovalFilter, Literal["always", "never"], None +] + + +class ToolMcpTool(BaseModel): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: str + """A label for this MCP server, used to identify it in tool calls.""" + + type: Literal["mcp"] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[ToolMcpToolAllowedTools] = None + """List of allowed tool names or a filter object.""" + + authorization: Optional[str] = None + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] = None + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[ToolMcpToolRequireApproval] = None + """Specify which of the MCP server's tools require approval.""" + + server_description: Optional[str] = None + """Optional description of the MCP server, used to provide more context.""" + + server_url: Optional[str] = None + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ + + +Tool: TypeAlias = Union[RealtimeFunctionTool, ToolMcpTool] + + +class TracingTracingConfiguration(BaseModel): + """Granular configuration for tracing.""" + + group_id: Optional[str] = None + """ + The group id to attach to this trace to enable filtering and grouping in the + Traces Dashboard. + """ + + metadata: Optional[object] = None + """ + The arbitrary metadata to attach to this trace to enable filtering in the Traces + Dashboard. + """ + + workflow_name: Optional[str] = None + """The name of the workflow to attach to this trace. + + This is used to name the trace in the Traces Dashboard. + """ + + +Tracing: TypeAlias = Union[Literal["auto"], TracingTracingConfiguration, None] + + +class RealtimeSessionCreateResponse(BaseModel): + """A new Realtime session configuration, with an ephemeral key. + + Default TTL + for keys is one minute. + """ + + client_secret: RealtimeSessionClientSecret + """Ephemeral key returned by the API.""" + + type: Literal["realtime"] + """The type of session to create. Always `realtime` for the Realtime API.""" + + audio: Optional[Audio] = None + """Configuration for input and output audio.""" + + include: Optional[List[Literal["item.input_audio_transcription.logprobs"]]] = None + """Additional fields to include in server outputs. + + `item.input_audio_transcription.logprobs`: Include logprobs for input audio + transcription. + """ + + instructions: Optional[str] = None + """The default system instructions (i.e. + + system message) prepended to model calls. This field allows the client to guide + the model on desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here are examples of + good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be + followed by the model, but they provide guidance to the model on the desired + behavior. + + Note that the server sets default instructions which will be used if this field + is not set and are visible in the `session.created` event at the start of the + session. + """ + + max_output_tokens: Union[int, Literal["inf"], None] = None + """ + Maximum number of output tokens for a single assistant response, inclusive of + tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + `inf` for the maximum available tokens for a given model. Defaults to `inf`. + """ + + model: Union[ + str, + Literal[ + "gpt-realtime", + "gpt-realtime-2025-08-28", + "gpt-4o-realtime-preview", + "gpt-4o-realtime-preview-2024-10-01", + "gpt-4o-realtime-preview-2024-12-17", + "gpt-4o-realtime-preview-2025-06-03", + "gpt-4o-mini-realtime-preview", + "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-mini", + "gpt-realtime-mini-2025-10-06", + "gpt-realtime-mini-2025-12-15", + "gpt-audio-mini", + "gpt-audio-mini-2025-10-06", + "gpt-audio-mini-2025-12-15", + ], + None, + ] = None + """The Realtime model used for this session.""" + + output_modalities: Optional[List[Literal["text", "audio"]]] = None + """The set of modalities the model can respond with. + + It defaults to `["audio"]`, indicating that the model will respond with audio + plus a transcript. `["text"]` can be used to make the model respond with text + only. It is not possible to request both `text` and `audio` at the same time. + """ + + prompt: Optional[ResponsePrompt] = None + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + tool_choice: Optional[ToolChoice] = None + """How the model chooses tools. + + Provide one of the string modes or force a specific function/MCP tool. + """ + + tools: Optional[List[Tool]] = None + """Tools available to the model.""" + + tracing: Optional[Tracing] = None + """ + Realtime API can write session traces to the + [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + + `auto` will create a trace for the session with default values for the workflow + name, group id, and metadata. + """ + + truncation: Optional[RealtimeTruncation] = None + """ + When the number of tokens in a conversation exceeds the model's input token + limit, the conversation be truncated, meaning messages (starting from the + oldest) will not be included in the model's context. A 32k context model with + 4,096 max output tokens can only include 28,224 tokens in the context before + truncation occurs. + + Clients can configure truncation behavior to truncate with a lower max token + limit, which is an effective way to control token usage and cost. + + Truncation will reduce the number of cached tokens on the next turn (busting the + cache), since messages are dropped from the beginning of the context. However, + clients can also configure truncation to retain messages up to a fraction of the + maximum context size, which will reduce the need for future truncations and thus + improve the cache rate. + + Truncation can be disabled entirely, which means the server will never truncate + but would instead return an error if the conversation exceeds the model's input + token limit. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config.py new file mode 100644 index 0000000000000000000000000000000000000000..f93c49000460dcef4ae8760b2b6ce7f423f9ad9b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +from ..responses.tool_choice_mcp import ToolChoiceMcp +from ..responses.tool_choice_options import ToolChoiceOptions +from ..responses.tool_choice_function import ToolChoiceFunction + +__all__ = ["RealtimeToolChoiceConfig"] + +RealtimeToolChoiceConfig: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMcp] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..af92f243b06f0d4c492dc18797bcafc34d17d195 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tool_choice_config_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from ..responses.tool_choice_options import ToolChoiceOptions +from ..responses.tool_choice_mcp_param import ToolChoiceMcpParam +from ..responses.tool_choice_function_param import ToolChoiceFunctionParam + +__all__ = ["RealtimeToolChoiceConfigParam"] + +RealtimeToolChoiceConfigParam: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunctionParam, ToolChoiceMcpParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config.py new file mode 100644 index 0000000000000000000000000000000000000000..b97599ab42244cd3009ac4cb18249195c8fefd08 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .realtime_tools_config_union import RealtimeToolsConfigUnion + +__all__ = ["RealtimeToolsConfig"] + +RealtimeToolsConfig: TypeAlias = List[RealtimeToolsConfigUnion] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union.py new file mode 100644 index 0000000000000000000000000000000000000000..92aaee7f263a0d48f504805925063345f94ac0d8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union.py @@ -0,0 +1,159 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .realtime_function_tool import RealtimeFunctionTool + +__all__ = [ + "RealtimeToolsConfigUnion", + "Mcp", + "McpAllowedTools", + "McpAllowedToolsMcpToolFilter", + "McpRequireApproval", + "McpRequireApprovalMcpToolApprovalFilter", + "McpRequireApprovalMcpToolApprovalFilterAlways", + "McpRequireApprovalMcpToolApprovalFilterNever", +] + + +class McpAllowedToolsMcpToolFilter(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +McpAllowedTools: TypeAlias = Union[List[str], McpAllowedToolsMcpToolFilter, None] + + +class McpRequireApprovalMcpToolApprovalFilterAlways(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilterNever(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilter(BaseModel): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: Optional[McpRequireApprovalMcpToolApprovalFilterAlways] = None + """A filter object to specify which tools are allowed.""" + + never: Optional[McpRequireApprovalMcpToolApprovalFilterNever] = None + """A filter object to specify which tools are allowed.""" + + +McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"], None] + + +class Mcp(BaseModel): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: str + """A label for this MCP server, used to identify it in tool calls.""" + + type: Literal["mcp"] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[McpAllowedTools] = None + """List of allowed tool names or a filter object.""" + + authorization: Optional[str] = None + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] = None + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[McpRequireApproval] = None + """Specify which of the MCP server's tools require approval.""" + + server_description: Optional[str] = None + """Optional description of the MCP server, used to provide more context.""" + + server_url: Optional[str] = None + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ + + +RealtimeToolsConfigUnion: TypeAlias = Annotated[Union[RealtimeFunctionTool, Mcp], PropertyInfo(discriminator="type")] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union_param.py new file mode 100644 index 0000000000000000000000000000000000000000..6889b4c3042c8ea04d8dd030d154195f5f8d1428 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tools_config_union_param.py @@ -0,0 +1,158 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from .realtime_function_tool_param import RealtimeFunctionToolParam + +__all__ = [ + "RealtimeToolsConfigUnionParam", + "Mcp", + "McpAllowedTools", + "McpAllowedToolsMcpToolFilter", + "McpRequireApproval", + "McpRequireApprovalMcpToolApprovalFilter", + "McpRequireApprovalMcpToolApprovalFilterAlways", + "McpRequireApprovalMcpToolApprovalFilterNever", +] + + +class McpAllowedToolsMcpToolFilter(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +McpAllowedTools: TypeAlias = Union[SequenceNotStr[str], McpAllowedToolsMcpToolFilter] + + +class McpRequireApprovalMcpToolApprovalFilterAlways(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilterNever(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilter(TypedDict, total=False): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: McpRequireApprovalMcpToolApprovalFilterAlways + """A filter object to specify which tools are allowed.""" + + never: McpRequireApprovalMcpToolApprovalFilterNever + """A filter object to specify which tools are allowed.""" + + +McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"]] + + +class Mcp(TypedDict, total=False): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls.""" + + type: Required[Literal["mcp"]] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[McpAllowedTools] + """List of allowed tool names or a filter object.""" + + authorization: str + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[McpRequireApproval] + """Specify which of the MCP server's tools require approval.""" + + server_description: str + """Optional description of the MCP server, used to provide more context.""" + + server_url: str + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ + + +RealtimeToolsConfigUnionParam: TypeAlias = Union[RealtimeFunctionToolParam, Mcp] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tracing_config_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tracing_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..742412897f6b8f837f99ac775e72f639a8c8175a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_tracing_config_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypeAlias, TypedDict + +__all__ = ["RealtimeTracingConfigParam", "TracingConfiguration"] + + +class TracingConfiguration(TypedDict, total=False): + """Granular configuration for tracing.""" + + group_id: str + """ + The group id to attach to this trace to enable filtering and grouping in the + Traces Dashboard. + """ + + metadata: object + """ + The arbitrary metadata to attach to this trace to enable filtering in the Traces + Dashboard. + """ + + workflow_name: str + """The name of the workflow to attach to this trace. + + This is used to name the trace in the Traces Dashboard. + """ + + +RealtimeTracingConfigParam: TypeAlias = Union[Literal["auto"], TracingConfiguration] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio.py new file mode 100644 index 0000000000000000000000000000000000000000..7ec29afb79602c2248e4ebb3aed01917d78765d6 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .realtime_transcription_session_audio_input import RealtimeTranscriptionSessionAudioInput + +__all__ = ["RealtimeTranscriptionSessionAudio"] + + +class RealtimeTranscriptionSessionAudio(BaseModel): + """Configuration for input and output audio.""" + + input: Optional[RealtimeTranscriptionSessionAudioInput] = None diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio_input.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio_input.py new file mode 100644 index 0000000000000000000000000000000000000000..80ff223590405bdbc15b61868e3e571417c5cbb1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_audio_input.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .audio_transcription import AudioTranscription +from .noise_reduction_type import NoiseReductionType +from .realtime_audio_formats import RealtimeAudioFormats +from .realtime_transcription_session_audio_input_turn_detection import ( + RealtimeTranscriptionSessionAudioInputTurnDetection, +) + +__all__ = ["RealtimeTranscriptionSessionAudioInput", "NoiseReduction"] + + +class NoiseReduction(BaseModel): + """Configuration for input audio noise reduction. + + This can be set to `null` to turn off. + Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + """ + + type: Optional[NoiseReductionType] = None + """Type of noise reduction. + + `near_field` is for close-talking microphones such as headphones, `far_field` is + for far-field microphones such as laptop or conference room microphones. + """ + + +class RealtimeTranscriptionSessionAudioInput(BaseModel): + format: Optional[RealtimeAudioFormats] = None + """The PCM audio format. Only a 24kHz sample rate is supported.""" + + noise_reduction: Optional[NoiseReduction] = None + """Configuration for input audio noise reduction. + + This can be set to `null` to turn off. Noise reduction filters audio added to + the input audio buffer before it is sent to VAD and the model. Filtering the + audio can improve VAD and turn detection accuracy (reducing false positives) and + model performance by improving perception of the input audio. + """ + + transcription: Optional[AudioTranscription] = None + """ + Configuration for input audio transcription, defaults to off and can be set to + `null` to turn off once on. Input audio transcription is not native to the + model, since the model consumes audio directly. Transcription runs + asynchronously through + [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) + and should be treated as guidance of input audio content rather than precisely + what the model heard. The client can optionally set the language and prompt for + transcription, these offer additional guidance to the transcription service. + """ + + turn_detection: Optional[RealtimeTranscriptionSessionAudioInputTurnDetection] = None + """Configuration for turn detection, ether Server VAD or Semantic VAD. + + This can be set to `null` to turn off, in which case the client must manually + trigger model response. + + Server VAD means that the model will detect the start and end of speech based on + audio volume and respond at the end of user speech. + + Semantic VAD is more advanced and uses a turn detection model (in conjunction + with VAD) to semantically estimate whether the user has finished speaking, then + dynamically sets a timeout based on this probability. For example, if user audio + trails off with "uhhm", the model will score a low probability of turn end and + wait longer for the user to continue speaking. This can be useful for more + natural conversations, but may have a higher latency. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_create_response.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_create_response.py new file mode 100644 index 0000000000000000000000000000000000000000..6ca6c3808bf6a63fccf5c6e4877cb0298a7b7322 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_transcription_session_create_response.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .audio_transcription import AudioTranscription +from .noise_reduction_type import NoiseReductionType +from .realtime_audio_formats import RealtimeAudioFormats +from .realtime_transcription_session_turn_detection import RealtimeTranscriptionSessionTurnDetection + +__all__ = ["RealtimeTranscriptionSessionCreateResponse", "Audio", "AudioInput", "AudioInputNoiseReduction"] + + +class AudioInputNoiseReduction(BaseModel): + """Configuration for input audio noise reduction.""" + + type: Optional[NoiseReductionType] = None + """Type of noise reduction. + + `near_field` is for close-talking microphones such as headphones, `far_field` is + for far-field microphones such as laptop or conference room microphones. + """ + + +class AudioInput(BaseModel): + format: Optional[RealtimeAudioFormats] = None + """The PCM audio format. Only a 24kHz sample rate is supported.""" + + noise_reduction: Optional[AudioInputNoiseReduction] = None + """Configuration for input audio noise reduction.""" + + transcription: Optional[AudioTranscription] = None + """Configuration of the transcription model.""" + + turn_detection: Optional[RealtimeTranscriptionSessionTurnDetection] = None + """Configuration for turn detection. + + Can be set to `null` to turn off. Server VAD means that the model will detect + the start and end of speech based on audio volume and respond at the end of user + speech. + """ + + +class Audio(BaseModel): + """Configuration for input audio for the session.""" + + input: Optional[AudioInput] = None + + +class RealtimeTranscriptionSessionCreateResponse(BaseModel): + """A Realtime transcription session configuration object.""" + + id: str + """Unique identifier for the session that looks like `sess_1234567890abcdef`.""" + + object: str + """The object type. Always `realtime.transcription_session`.""" + + type: Literal["transcription"] + """The type of session. Always `transcription` for transcription sessions.""" + + audio: Optional[Audio] = None + """Configuration for input audio for the session.""" + + expires_at: Optional[int] = None + """Expiration timestamp for the session, in seconds since epoch.""" + + include: Optional[List[Literal["item.input_audio_transcription.logprobs"]]] = None + """Additional fields to include in server outputs. + + - `item.input_audio_transcription.logprobs`: Include logprobs for input audio + transcription. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_param.py new file mode 100644 index 0000000000000000000000000000000000000000..5e42b27418dd3c2b960888333c999dc4a943be4a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from .realtime_truncation_retention_ratio_param import RealtimeTruncationRetentionRatioParam + +__all__ = ["RealtimeTruncationParam"] + +RealtimeTruncationParam: TypeAlias = Union[Literal["auto", "disabled"], RealtimeTruncationRetentionRatioParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio.py new file mode 100644 index 0000000000000000000000000000000000000000..72a93a565414d5b3cb9d55c7b106ce698785967f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RealtimeTruncationRetentionRatio", "TokenLimits"] + + +class TokenLimits(BaseModel): + """Optional custom token limits for this truncation strategy. + + If not provided, the model's default token limits will be used. + """ + + post_instructions: Optional[int] = None + """ + Maximum tokens allowed in the conversation after instructions (which including + tool definitions). For example, setting this to 5,000 would mean that truncation + would occur when the conversation exceeds 5,000 tokens after instructions. This + cannot be higher than the model's context window size minus the maximum output + tokens. + """ + + +class RealtimeTruncationRetentionRatio(BaseModel): + """ + Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage. + """ + + retention_ratio: float + """ + Fraction of post-instruction conversation tokens to retain (`0.0` - `1.0`) when + the conversation exceeds the input token limit. Setting this to `0.8` means that + messages will be dropped until 80% of the maximum allowed tokens are used. This + helps reduce the frequency of truncations and improve cache rates. + """ + + type: Literal["retention_ratio"] + """Use retention ratio truncation.""" + + token_limits: Optional[TokenLimits] = None + """Optional custom token limits for this truncation strategy. + + If not provided, the model's default token limits will be used. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4648fa66b08653b0e088afd09424a844b06d8546 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/realtime_truncation_retention_ratio_param.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RealtimeTruncationRetentionRatioParam", "TokenLimits"] + + +class TokenLimits(TypedDict, total=False): + """Optional custom token limits for this truncation strategy. + + If not provided, the model's default token limits will be used. + """ + + post_instructions: int + """ + Maximum tokens allowed in the conversation after instructions (which including + tool definitions). For example, setting this to 5,000 would mean that truncation + would occur when the conversation exceeds 5,000 tokens after instructions. This + cannot be higher than the model's context window size minus the maximum output + tokens. + """ + + +class RealtimeTruncationRetentionRatioParam(TypedDict, total=False): + """ + Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage. + """ + + retention_ratio: Required[float] + """ + Fraction of post-instruction conversation tokens to retain (`0.0` - `1.0`) when + the conversation exceeds the input token limit. Setting this to `0.8` means that + messages will be dropped until 80% of the maximum allowed tokens are used. This + helps reduce the frequency of truncations and improve cache rates. + """ + + type: Required[Literal["retention_ratio"]] + """Use retention ratio truncation.""" + + token_limits: TokenLimits + """Optional custom token limits for this truncation strategy. + + If not provided, the model's default token limits will be used. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..ae87014053aafee0ae9c710c48c28c82225221b5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_delta_event.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioDeltaEvent"] + + +class ResponseAudioDeltaEvent(BaseModel): + """Returned when the model-generated audio is updated.""" + + content_index: int + """The index of the content part in the item's content array.""" + + delta: str + """Base64-encoded audio data delta.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item.""" + + output_index: int + """The index of the output item in the response.""" + + response_id: str + """The ID of the response.""" + + type: Literal["response.output_audio.delta"] + """The event type, must be `response.output_audio.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_transcript_done_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_transcript_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c2a24163553c2047b49f7f7ea4145df4aec59442 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_audio_transcript_done_event.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioTranscriptDoneEvent"] + + +class ResponseAudioTranscriptDoneEvent(BaseModel): + """ + Returned when the model-generated transcription of audio output is done + streaming. Also emitted when a Response is interrupted, incomplete, or + cancelled. + """ + + content_index: int + """The index of the content part in the item's content array.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item.""" + + output_index: int + """The index of the output item in the response.""" + + response_id: str + """The ID of the response.""" + + transcript: str + """The final transcript of the audio.""" + + type: Literal["response.output_audio_transcript.done"] + """The event type, must be `response.output_audio_transcript.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_cancel_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_cancel_event.py new file mode 100644 index 0000000000000000000000000000000000000000..9c6113998f597ba11530722a9d7aa5fdfa2baca0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_cancel_event.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCancelEvent"] + + +class ResponseCancelEvent(BaseModel): + """Send this event to cancel an in-progress response. + + The server will respond + with a `response.done` event with a status of `response.status=cancelled`. If + there is no response to cancel, the server will respond with an error. It's safe + to call `response.cancel` even if no response is in progress, an error will be + returned the session will remain unaffected. + """ + + type: Literal["response.cancel"] + """The event type, must be `response.cancel`.""" + + event_id: Optional[str] = None + """Optional client-generated ID used to identify this event.""" + + response_id: Optional[str] = None + """ + A specific response ID to cancel - if not provided, will cancel an in-progress + response in the default conversation. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_content_part_done_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_content_part_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..a6cb8559b937db54f43349de23f41525809e8881 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_content_part_done_event.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseContentPartDoneEvent", "Part"] + + +class Part(BaseModel): + """The content part that is done.""" + + audio: Optional[str] = None + """Base64-encoded audio data (if type is "audio").""" + + text: Optional[str] = None + """The text content (if type is "text").""" + + transcript: Optional[str] = None + """The transcript of the audio (if type is "audio").""" + + type: Optional[Literal["text", "audio"]] = None + """The content type ("text", "audio").""" + + +class ResponseContentPartDoneEvent(BaseModel): + """ + Returned when a content part is done streaming in an assistant message item. + Also emitted when a Response is interrupted, incomplete, or cancelled. + """ + + content_index: int + """The index of the content part in the item's content array.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the item.""" + + output_index: int + """The index of the output item in the response.""" + + part: Part + """The content part that is done.""" + + response_id: str + """The ID of the response.""" + + type: Literal["response.content_part.done"] + """The event type, must be `response.content_part.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_create_event_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_create_event_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9da89e14ee85b26c08cb6ac08d5cba8c7c074e1e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_create_event_param.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from .realtime_response_create_params_param import RealtimeResponseCreateParamsParam + +__all__ = ["ResponseCreateEventParam"] + + +class ResponseCreateEventParam(TypedDict, total=False): + """ + This event instructs the server to create a Response, which means triggering + model inference. When in Server VAD mode, the server will create Responses + automatically. + + A Response will include at least one Item, and may have two, in which case + the second will be a function call. These Items will be appended to the + conversation history by default. + + The server will respond with a `response.created` event, events for Items + and content created, and finally a `response.done` event to indicate the + Response is complete. + + The `response.create` event includes inference configuration like + `instructions` and `tools`. If these are set, they will override the Session's + configuration for this Response only. + + Responses can be created out-of-band of the default Conversation, meaning that they can + have arbitrary input, and it's possible to disable writing the output to the Conversation. + Only one Response can write to the default Conversation at a time, but otherwise multiple + Responses can be created in parallel. The `metadata` field is a good way to disambiguate + multiple simultaneous Responses. + + Clients can set `conversation` to `none` to create a Response that does not write to the default + Conversation. Arbitrary input can be provided with the `input` field, which is an array accepting + raw Items and references to existing Items. + """ + + type: Required[Literal["response.create"]] + """The event type, must be `response.create`.""" + + event_id: str + """Optional client-generated ID used to identify this event.""" + + response: RealtimeResponseCreateParamsParam + """Create a new Realtime response with these parameters""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_created_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_created_event.py new file mode 100644 index 0000000000000000000000000000000000000000..dc5941262d401e45c74f1cda68544fa0bba68c68 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_created_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .realtime_response import RealtimeResponse + +__all__ = ["ResponseCreatedEvent"] + + +class ResponseCreatedEvent(BaseModel): + """Returned when a new Response is created. + + The first event of response creation, + where the response is in an initial state of `in_progress`. + """ + + event_id: str + """The unique ID of the server event.""" + + response: RealtimeResponse + """The response resource.""" + + type: Literal["response.created"] + """The event type, must be `response.created`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_arguments_delta.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_arguments_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..d890de05753a6578fc8633391b8e4b0139ba2183 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_arguments_delta.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallArgumentsDelta"] + + +class ResponseMcpCallArgumentsDelta(BaseModel): + """Returned when MCP tool call arguments are updated during response generation.""" + + delta: str + """The JSON-encoded arguments delta.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the MCP tool call item.""" + + output_index: int + """The index of the output item in the response.""" + + response_id: str + """The ID of the response.""" + + type: Literal["response.mcp_call_arguments.delta"] + """The event type, must be `response.mcp_call_arguments.delta`.""" + + obfuscation: Optional[str] = None + """If present, indicates the delta text was obfuscated.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_completed.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_completed.py new file mode 100644 index 0000000000000000000000000000000000000000..130260539a04eb004925df1df7094220358afdb4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_mcp_call_completed.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallCompleted"] + + +class ResponseMcpCallCompleted(BaseModel): + """Returned when an MCP tool call has completed successfully.""" + + event_id: str + """The unique ID of the server event.""" + + item_id: str + """The ID of the MCP tool call item.""" + + output_index: int + """The index of the output item in the response.""" + + type: Literal["response.mcp_call.completed"] + """The event type, must be `response.mcp_call.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/response_output_item_added_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/response_output_item_added_event.py new file mode 100644 index 0000000000000000000000000000000000000000..abec0d18f1768b85d9a643d51941942ebea4e68d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/response_output_item_added_event.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .conversation_item import ConversationItem + +__all__ = ["ResponseOutputItemAddedEvent"] + + +class ResponseOutputItemAddedEvent(BaseModel): + """Returned when a new Item is created during Response generation.""" + + event_id: str + """The unique ID of the server event.""" + + item: ConversationItem + """A single item within a Realtime conversation.""" + + output_index: int + """The index of the output item in the Response.""" + + response_id: str + """The ID of the Response to which the item belongs.""" + + type: Literal["response.output_item.added"] + """The event type, must be `response.output_item.added`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/session_created_event.py b/py311/lib/python3.11/site-packages/openai/types/realtime/session_created_event.py new file mode 100644 index 0000000000000000000000000000000000000000..1b8d4a4d812de13335d41a097fa19b6f6d5e562a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/session_created_event.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from .realtime_session_create_request import RealtimeSessionCreateRequest +from .realtime_transcription_session_create_request import RealtimeTranscriptionSessionCreateRequest + +__all__ = ["SessionCreatedEvent", "Session"] + +Session: TypeAlias = Union[RealtimeSessionCreateRequest, RealtimeTranscriptionSessionCreateRequest] + + +class SessionCreatedEvent(BaseModel): + """Returned when a Session is created. + + Emitted automatically when a new + connection is established as the first server event. This event will contain + the default Session configuration. + """ + + event_id: str + """The unique ID of the server event.""" + + session: Session + """The session configuration.""" + + type: Literal["session.created"] + """The event type, must be `session.created`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/realtime/session_update_event_param.py b/py311/lib/python3.11/site-packages/openai/types/realtime/session_update_event_param.py new file mode 100644 index 0000000000000000000000000000000000000000..910e89ca34f2260989c482b6808b5ff8e9997ad3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/realtime/session_update_event_param.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .realtime_session_create_request_param import RealtimeSessionCreateRequestParam +from .realtime_transcription_session_create_request_param import RealtimeTranscriptionSessionCreateRequestParam + +__all__ = ["SessionUpdateEventParam", "Session"] + +Session: TypeAlias = Union[RealtimeSessionCreateRequestParam, RealtimeTranscriptionSessionCreateRequestParam] + + +class SessionUpdateEventParam(TypedDict, total=False): + """ + Send this event to update the session’s configuration. + The client may send this event at any time to update any field + except for `voice` and `model`. `voice` can be updated only if there have been no other audio outputs yet. + + When the server receives a `session.update`, it will respond + with a `session.updated` event showing the full, effective configuration. + Only the fields that are present in the `session.update` are updated. To clear a field like + `instructions`, pass an empty string. To clear a field like `tools`, pass an empty array. + To clear a field like `turn_detection`, pass `null`. + """ + + session: Required[Session] + """Update the Realtime session. + + Choose either a realtime session or a transcription session. + """ + + type: Required[Literal["session.update"]] + """The event type, must be `session.update`.""" + + event_id: str + """Optional client-generated ID used to identify this event. + + This is an arbitrary string that a client may assign. It will be passed back if + there is an error with the event, but the corresponding `session.updated` event + will not include it. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__init__.py b/py311/lib/python3.11/site-packages/openai/types/responses/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a4d939d9ff6d9280b6e2f52e97bebf29c59f3a65 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/__init__.py @@ -0,0 +1,275 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .tool import Tool as Tool +from .response import Response as Response +from .tool_param import ToolParam as ToolParam +from .custom_tool import CustomTool as CustomTool +from .computer_tool import ComputerTool as ComputerTool +from .function_tool import FunctionTool as FunctionTool +from .response_item import ResponseItem as ResponseItem +from .response_error import ResponseError as ResponseError +from .response_usage import ResponseUsage as ResponseUsage +from .parsed_response import ( + ParsedContent as ParsedContent, + ParsedResponse as ParsedResponse, + ParsedResponseOutputItem as ParsedResponseOutputItem, + ParsedResponseOutputText as ParsedResponseOutputText, + ParsedResponseOutputMessage as ParsedResponseOutputMessage, + ParsedResponseFunctionToolCall as ParsedResponseFunctionToolCall, +) +from .response_prompt import ResponsePrompt as ResponsePrompt +from .response_status import ResponseStatus as ResponseStatus +from .tool_choice_mcp import ToolChoiceMcp as ToolChoiceMcp +from .web_search_tool import WebSearchTool as WebSearchTool +from .apply_patch_tool import ApplyPatchTool as ApplyPatchTool +from .file_search_tool import FileSearchTool as FileSearchTool +from .custom_tool_param import CustomToolParam as CustomToolParam +from .tool_choice_shell import ToolChoiceShell as ToolChoiceShell +from .tool_choice_types import ToolChoiceTypes as ToolChoiceTypes +from .compacted_response import CompactedResponse as CompactedResponse +from .easy_input_message import EasyInputMessage as EasyInputMessage +from .response_item_list import ResponseItemList as ResponseItemList +from .tool_choice_custom import ToolChoiceCustom as ToolChoiceCustom +from .computer_tool_param import ComputerToolParam as ComputerToolParam +from .function_shell_tool import FunctionShellTool as FunctionShellTool +from .function_tool_param import FunctionToolParam as FunctionToolParam +from .response_includable import ResponseIncludable as ResponseIncludable +from .response_input_file import ResponseInputFile as ResponseInputFile +from .response_input_item import ResponseInputItem as ResponseInputItem +from .response_input_text import ResponseInputText as ResponseInputText +from .tool_choice_allowed import ToolChoiceAllowed as ToolChoiceAllowed +from .tool_choice_options import ToolChoiceOptions as ToolChoiceOptions +from .response_error_event import ResponseErrorEvent as ResponseErrorEvent +from .response_input_audio import ResponseInputAudio as ResponseInputAudio +from .response_input_image import ResponseInputImage as ResponseInputImage +from .response_input_param import ResponseInputParam as ResponseInputParam +from .response_output_item import ResponseOutputItem as ResponseOutputItem +from .response_output_text import ResponseOutputText as ResponseOutputText +from .response_text_config import ResponseTextConfig as ResponseTextConfig +from .tool_choice_function import ToolChoiceFunction as ToolChoiceFunction +from .response_failed_event import ResponseFailedEvent as ResponseFailedEvent +from .response_prompt_param import ResponsePromptParam as ResponsePromptParam +from .response_queued_event import ResponseQueuedEvent as ResponseQueuedEvent +from .response_stream_event import ResponseStreamEvent as ResponseStreamEvent +from .tool_choice_mcp_param import ToolChoiceMcpParam as ToolChoiceMcpParam +from .web_search_tool_param import WebSearchToolParam as WebSearchToolParam +from .apply_patch_tool_param import ApplyPatchToolParam as ApplyPatchToolParam +from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam +from .input_item_list_params import InputItemListParams as InputItemListParams +from .response_create_params import ResponseCreateParams as ResponseCreateParams +from .response_created_event import ResponseCreatedEvent as ResponseCreatedEvent +from .response_input_content import ResponseInputContent as ResponseInputContent +from .response_compact_params import ResponseCompactParams as ResponseCompactParams +from .response_output_message import ResponseOutputMessage as ResponseOutputMessage +from .response_output_refusal import ResponseOutputRefusal as ResponseOutputRefusal +from .response_reasoning_item import ResponseReasoningItem as ResponseReasoningItem +from .tool_choice_apply_patch import ToolChoiceApplyPatch as ToolChoiceApplyPatch +from .tool_choice_shell_param import ToolChoiceShellParam as ToolChoiceShellParam +from .tool_choice_types_param import ToolChoiceTypesParam as ToolChoiceTypesParam +from .web_search_preview_tool import WebSearchPreviewTool as WebSearchPreviewTool +from .easy_input_message_param import EasyInputMessageParam as EasyInputMessageParam +from .input_token_count_params import InputTokenCountParams as InputTokenCountParams +from .response_compaction_item import ResponseCompactionItem as ResponseCompactionItem +from .response_completed_event import ResponseCompletedEvent as ResponseCompletedEvent +from .response_retrieve_params import ResponseRetrieveParams as ResponseRetrieveParams +from .response_text_done_event import ResponseTextDoneEvent as ResponseTextDoneEvent +from .tool_choice_custom_param import ToolChoiceCustomParam as ToolChoiceCustomParam +from .function_shell_tool_param import FunctionShellToolParam as FunctionShellToolParam +from .response_audio_done_event import ResponseAudioDoneEvent as ResponseAudioDoneEvent +from .response_custom_tool_call import ResponseCustomToolCall as ResponseCustomToolCall +from .response_incomplete_event import ResponseIncompleteEvent as ResponseIncompleteEvent +from .response_input_file_param import ResponseInputFileParam as ResponseInputFileParam +from .response_input_item_param import ResponseInputItemParam as ResponseInputItemParam +from .response_input_text_param import ResponseInputTextParam as ResponseInputTextParam +from .response_text_delta_event import ResponseTextDeltaEvent as ResponseTextDeltaEvent +from .tool_choice_allowed_param import ToolChoiceAllowedParam as ToolChoiceAllowedParam +from .input_token_count_response import InputTokenCountResponse as InputTokenCountResponse +from .response_audio_delta_event import ResponseAudioDeltaEvent as ResponseAudioDeltaEvent +from .response_in_progress_event import ResponseInProgressEvent as ResponseInProgressEvent +from .response_input_audio_param import ResponseInputAudioParam as ResponseInputAudioParam +from .response_input_image_param import ResponseInputImageParam as ResponseInputImageParam +from .response_output_text_param import ResponseOutputTextParam as ResponseOutputTextParam +from .response_text_config_param import ResponseTextConfigParam as ResponseTextConfigParam +from .tool_choice_function_param import ToolChoiceFunctionParam as ToolChoiceFunctionParam +from .response_computer_tool_call import ResponseComputerToolCall as ResponseComputerToolCall +from .response_conversation_param import ResponseConversationParam as ResponseConversationParam +from .response_format_text_config import ResponseFormatTextConfig as ResponseFormatTextConfig +from .response_function_tool_call import ResponseFunctionToolCall as ResponseFunctionToolCall +from .response_input_file_content import ResponseInputFileContent as ResponseInputFileContent +from .response_input_message_item import ResponseInputMessageItem as ResponseInputMessageItem +from .response_input_text_content import ResponseInputTextContent as ResponseInputTextContent +from .response_refusal_done_event import ResponseRefusalDoneEvent as ResponseRefusalDoneEvent +from .response_function_web_search import ResponseFunctionWebSearch as ResponseFunctionWebSearch +from .response_input_content_param import ResponseInputContentParam as ResponseInputContentParam +from .response_input_image_content import ResponseInputImageContent as ResponseInputImageContent +from .response_refusal_delta_event import ResponseRefusalDeltaEvent as ResponseRefusalDeltaEvent +from .response_output_message_param import ResponseOutputMessageParam as ResponseOutputMessageParam +from .response_output_refusal_param import ResponseOutputRefusalParam as ResponseOutputRefusalParam +from .response_reasoning_item_param import ResponseReasoningItemParam as ResponseReasoningItemParam +from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam as ToolChoiceApplyPatchParam +from .web_search_preview_tool_param import WebSearchPreviewToolParam as WebSearchPreviewToolParam +from .response_apply_patch_tool_call import ResponseApplyPatchToolCall as ResponseApplyPatchToolCall +from .response_compaction_item_param import ResponseCompactionItemParam as ResponseCompactionItemParam +from .response_file_search_tool_call import ResponseFileSearchToolCall as ResponseFileSearchToolCall +from .response_mcp_call_failed_event import ResponseMcpCallFailedEvent as ResponseMcpCallFailedEvent +from .response_custom_tool_call_param import ResponseCustomToolCallParam as ResponseCustomToolCallParam +from .response_output_item_done_event import ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent +from .response_content_part_done_event import ResponseContentPartDoneEvent as ResponseContentPartDoneEvent +from .response_custom_tool_call_output import ResponseCustomToolCallOutput as ResponseCustomToolCallOutput +from .response_function_tool_call_item import ResponseFunctionToolCallItem as ResponseFunctionToolCallItem +from .response_output_item_added_event import ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent +from .response_computer_tool_call_param import ResponseComputerToolCallParam as ResponseComputerToolCallParam +from .response_content_part_added_event import ResponseContentPartAddedEvent as ResponseContentPartAddedEvent +from .response_format_text_config_param import ResponseFormatTextConfigParam as ResponseFormatTextConfigParam +from .response_function_shell_tool_call import ResponseFunctionShellToolCall as ResponseFunctionShellToolCall +from .response_function_tool_call_param import ResponseFunctionToolCallParam as ResponseFunctionToolCallParam +from .response_input_file_content_param import ResponseInputFileContentParam as ResponseInputFileContentParam +from .response_input_text_content_param import ResponseInputTextContentParam as ResponseInputTextContentParam +from .response_mcp_call_completed_event import ResponseMcpCallCompletedEvent as ResponseMcpCallCompletedEvent +from .response_function_call_output_item import ResponseFunctionCallOutputItem as ResponseFunctionCallOutputItem +from .response_function_web_search_param import ResponseFunctionWebSearchParam as ResponseFunctionWebSearchParam +from .response_input_image_content_param import ResponseInputImageContentParam as ResponseInputImageContentParam +from .response_reasoning_text_done_event import ResponseReasoningTextDoneEvent as ResponseReasoningTextDoneEvent +from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall as ResponseCodeInterpreterToolCall +from .response_input_message_content_list import ResponseInputMessageContentList as ResponseInputMessageContentList +from .response_mcp_call_in_progress_event import ResponseMcpCallInProgressEvent as ResponseMcpCallInProgressEvent +from .response_reasoning_text_delta_event import ResponseReasoningTextDeltaEvent as ResponseReasoningTextDeltaEvent +from .response_audio_transcript_done_event import ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent +from .response_compaction_item_param_param import ResponseCompactionItemParamParam as ResponseCompactionItemParamParam +from .response_file_search_tool_call_param import ResponseFileSearchToolCallParam as ResponseFileSearchToolCallParam +from .response_mcp_list_tools_failed_event import ResponseMcpListToolsFailedEvent as ResponseMcpListToolsFailedEvent +from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput as ResponseApplyPatchToolCallOutput +from .response_audio_transcript_delta_event import ( + ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent, +) +from .response_custom_tool_call_output_param import ( + ResponseCustomToolCallOutputParam as ResponseCustomToolCallOutputParam, +) +from .response_mcp_call_arguments_done_event import ( + ResponseMcpCallArgumentsDoneEvent as ResponseMcpCallArgumentsDoneEvent, +) +from .response_computer_tool_call_output_item import ( + ResponseComputerToolCallOutputItem as ResponseComputerToolCallOutputItem, +) +from .response_format_text_json_schema_config import ( + ResponseFormatTextJSONSchemaConfig as ResponseFormatTextJSONSchemaConfig, +) +from .response_function_call_output_item_list import ( + ResponseFunctionCallOutputItemList as ResponseFunctionCallOutputItemList, +) +from .response_function_tool_call_output_item import ( + ResponseFunctionToolCallOutputItem as ResponseFunctionToolCallOutputItem, +) +from .response_image_gen_call_completed_event import ( + ResponseImageGenCallCompletedEvent as ResponseImageGenCallCompletedEvent, +) +from .response_mcp_call_arguments_delta_event import ( + ResponseMcpCallArgumentsDeltaEvent as ResponseMcpCallArgumentsDeltaEvent, +) +from .response_mcp_list_tools_completed_event import ( + ResponseMcpListToolsCompletedEvent as ResponseMcpListToolsCompletedEvent, +) +from .response_function_call_output_item_param import ( + ResponseFunctionCallOutputItemParam as ResponseFunctionCallOutputItemParam, +) +from .response_function_shell_tool_call_output import ( + ResponseFunctionShellToolCallOutput as ResponseFunctionShellToolCallOutput, +) +from .response_image_gen_call_generating_event import ( + ResponseImageGenCallGeneratingEvent as ResponseImageGenCallGeneratingEvent, +) +from .response_web_search_call_completed_event import ( + ResponseWebSearchCallCompletedEvent as ResponseWebSearchCallCompletedEvent, +) +from .response_web_search_call_searching_event import ( + ResponseWebSearchCallSearchingEvent as ResponseWebSearchCallSearchingEvent, +) +from .response_code_interpreter_tool_call_param import ( + ResponseCodeInterpreterToolCallParam as ResponseCodeInterpreterToolCallParam, +) +from .response_file_search_call_completed_event import ( + ResponseFileSearchCallCompletedEvent as ResponseFileSearchCallCompletedEvent, +) +from .response_file_search_call_searching_event import ( + ResponseFileSearchCallSearchingEvent as ResponseFileSearchCallSearchingEvent, +) +from .response_image_gen_call_in_progress_event import ( + ResponseImageGenCallInProgressEvent as ResponseImageGenCallInProgressEvent, +) +from .response_input_message_content_list_param import ( + ResponseInputMessageContentListParam as ResponseInputMessageContentListParam, +) +from .response_mcp_list_tools_in_progress_event import ( + ResponseMcpListToolsInProgressEvent as ResponseMcpListToolsInProgressEvent, +) +from .response_custom_tool_call_input_done_event import ( + ResponseCustomToolCallInputDoneEvent as ResponseCustomToolCallInputDoneEvent, +) +from .response_reasoning_summary_part_done_event import ( + ResponseReasoningSummaryPartDoneEvent as ResponseReasoningSummaryPartDoneEvent, +) +from .response_reasoning_summary_text_done_event import ( + ResponseReasoningSummaryTextDoneEvent as ResponseReasoningSummaryTextDoneEvent, +) +from .response_web_search_call_in_progress_event import ( + ResponseWebSearchCallInProgressEvent as ResponseWebSearchCallInProgressEvent, +) +from .response_custom_tool_call_input_delta_event import ( + ResponseCustomToolCallInputDeltaEvent as ResponseCustomToolCallInputDeltaEvent, +) +from .response_file_search_call_in_progress_event import ( + ResponseFileSearchCallInProgressEvent as ResponseFileSearchCallInProgressEvent, +) +from .response_function_call_arguments_done_event import ( + ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent, +) +from .response_function_shell_call_output_content import ( + ResponseFunctionShellCallOutputContent as ResponseFunctionShellCallOutputContent, +) +from .response_image_gen_call_partial_image_event import ( + ResponseImageGenCallPartialImageEvent as ResponseImageGenCallPartialImageEvent, +) +from .response_output_text_annotation_added_event import ( + ResponseOutputTextAnnotationAddedEvent as ResponseOutputTextAnnotationAddedEvent, +) +from .response_reasoning_summary_part_added_event import ( + ResponseReasoningSummaryPartAddedEvent as ResponseReasoningSummaryPartAddedEvent, +) +from .response_reasoning_summary_text_delta_event import ( + ResponseReasoningSummaryTextDeltaEvent as ResponseReasoningSummaryTextDeltaEvent, +) +from .response_function_call_arguments_delta_event import ( + ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent, +) +from .response_computer_tool_call_output_screenshot import ( + ResponseComputerToolCallOutputScreenshot as ResponseComputerToolCallOutputScreenshot, +) +from .response_format_text_json_schema_config_param import ( + ResponseFormatTextJSONSchemaConfigParam as ResponseFormatTextJSONSchemaConfigParam, +) +from .response_function_call_output_item_list_param import ( + ResponseFunctionCallOutputItemListParam as ResponseFunctionCallOutputItemListParam, +) +from .response_code_interpreter_call_code_done_event import ( + ResponseCodeInterpreterCallCodeDoneEvent as ResponseCodeInterpreterCallCodeDoneEvent, +) +from .response_code_interpreter_call_completed_event import ( + ResponseCodeInterpreterCallCompletedEvent as ResponseCodeInterpreterCallCompletedEvent, +) +from .response_code_interpreter_call_code_delta_event import ( + ResponseCodeInterpreterCallCodeDeltaEvent as ResponseCodeInterpreterCallCodeDeltaEvent, +) +from .response_code_interpreter_call_in_progress_event import ( + ResponseCodeInterpreterCallInProgressEvent as ResponseCodeInterpreterCallInProgressEvent, +) +from .response_code_interpreter_call_interpreting_event import ( + ResponseCodeInterpreterCallInterpretingEvent as ResponseCodeInterpreterCallInterpretingEvent, +) +from .response_function_shell_call_output_content_param import ( + ResponseFunctionShellCallOutputContentParam as ResponseFunctionShellCallOutputContentParam, +) +from .response_computer_tool_call_output_screenshot_param import ( + ResponseComputerToolCallOutputScreenshotParam as ResponseComputerToolCallOutputScreenshotParam, +) diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e56e75b8b8b1152094536202ff58f32fcee027d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..416403fbc3073f7b200261d9a59c1c51b4834fdb Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/apply_patch_tool_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/compacted_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/compacted_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3423dab3d5341f16ad3884e2d5f9ab77c1befd02 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/compacted_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/computer_tool_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/computer_tool_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06980cb0b6e8a8e1ffb64e07123a603e5e76585f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/computer_tool_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/custom_tool_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/custom_tool_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57c33c697af444adf14b8c4c55302205c6c8f39f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/custom_tool_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11e9aea52c8d3090325822c26c19eb4691ce3027 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dab3ca9f2a3c8cf5ea464c49de399ecbf9e229c1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/easy_input_message_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/file_search_tool.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/file_search_tool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..980f5437f77e22ea6b57f885bd0ab4f5eb788af9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/file_search_tool.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/function_tool.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/function_tool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e28c8191ef9055a1a93ebeab6846df647ba3f266 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/function_tool.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/input_token_count_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/input_token_count_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3404e35602baa8a24878a08dc8838938f2dbc25 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/input_token_count_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/parsed_response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/parsed_response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec57eb59d7eba599d7e8cb299cb3a73dcffc97da Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/parsed_response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efcb7e5c4550b1755d15accc31b7fff652149918 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_apply_patch_tool_call.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_apply_patch_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b05aa7cb4e4739718feeb4805c80d769750cddd2 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_apply_patch_tool_call.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16bddfe1ed42b7160519e07b6a6d867c386393de Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e340a1af6b507438c3ea1536fd4065d2ea8690be Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_transcript_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_transcript_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e763282450a5df2c67da53882f75ec46f0d58e1 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_audio_transcript_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_code_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_code_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2573df94d4373072d2bf940506ac742b076234fa Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_code_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_interpreting_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_interpreting_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4547a8a3b5bcaec28ec3cac27da233c9a84578fe Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_code_interpreter_call_interpreting_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_compaction_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_compaction_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..71ee0f7041fed6d8c720ceb09289d09e5e83fd03 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_compaction_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12f9bace20c12b36ae68feb27d4e7a38e8d7bc1e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call_output_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call_output_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..255d1d6bbd3397dd30993e1f107a48abb831985a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_computer_tool_call_output_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_content_part_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_content_part_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fb14c892e5eb14c24376be985460c570db46ab3 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_content_part_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2da63427f1faa0f96b53a74581c2963366870303 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_created_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_created_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2f07b6ae752fa73680689479d21fedbd8397c1a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_created_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..274da8d3cdc24e59ef7fba6cd4f0058eb26eafc9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_input_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_input_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a032185b00ca3711880a09706c87f953b60a61e6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_input_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_output_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_output_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..543e985126fa21ab7f819989d9d39e2632cb54d7 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_custom_tool_call_output_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_error.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_error.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba2d7b0fd0b396f20a5bcd0ca9156c781150abe4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_error.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_file_search_call_searching_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_file_search_call_searching_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0141a95ec983fbac306dbad81fb38af95e19694 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_file_search_call_searching_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59bc856b67bedffdc2c2ef0a85fafcfdd5c2f249 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db49c29c6a61cd81cdab5479ab6902d911979ff4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_config_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_json_schema_config_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_json_schema_config_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28ff748ba8d0f47daeefe49e264e376e2cf7b488 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_format_text_json_schema_config_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_arguments_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_arguments_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22dbd3c611c6efbbda7624b887f82799c11b548f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_arguments_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_output_item_list_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_output_item_list_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5586d78049a3262f5da18016be186f9fee6510a4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_call_output_item_list_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_shell_call_output_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_shell_call_output_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be9b7fd10402e38e6705332dd9af30040a719a45 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_shell_call_output_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13785616e6bbf25873eb1259d254884d2791b61e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3592bbee0a44890aed5ed1024a61458dcdca889 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c03ddd09e6872d25295e6e4a9c4fffc30a8f567f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_function_tool_call_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_completed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_completed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91562c3abade7361036b178c53aad313df6bf92e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_completed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_generating_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_generating_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12d11e8e52a5a6f450b1d28543e2063a668ec448 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_generating_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_in_progress_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_in_progress_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c885b4fafacc1c9464bde8d6057e851cc170eac Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_in_progress_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_partial_image_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_partial_image_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1700652e941965add177de0bf75bb47cb31baf2 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_image_gen_call_partial_image_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_includable.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_includable.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a858f312522cfa8b1191e08d5c2a4d6b17632e52 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_includable.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_incomplete_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_incomplete_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88e6f042e7b06d62775878e4ea6f602594558d82 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_incomplete_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f0e66cfc86363a781b12701b609f533039a8527 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f9d444ed591e7803e6a9945a39df1eb8de0ec2c Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_audio_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a1fb0aa38cd02b5866737d916a0694e5e0ae195 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa55676e2350f1913db0e412ac1e7f9308b255b0 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16cbe057a6ec970a05b439c9386b1ce38515d86f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_file_content_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27540ef29ba06bf51bada8bf6d2c6a335cc17554 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41b260d876436441d3693a3be2fbf95897f31023 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_image_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93270101906646c8ce6e82cb5e1c18aa667bde32 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e1e1e5442f95b0aa10e1842695e3e6575215f0d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_item_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_message_content_list.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_message_content_list.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58c89829e3f8661331bf5864767c3cf76bcb0c1e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_message_content_list.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ed20b7524b34ceec54e789667424318360a7cd4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbcebd74481f7d5e1f292e85782f4656f07427e8 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6fff7c62d33775b856a9979701852c0baed6ffe Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_input_text_content_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..287a4f94921826878b0c80713b7c661175d453b4 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_completed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_completed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68caa3ea6b3974fa475a9a00f822434cd9f21dd3 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_completed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_failed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_failed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbfe72c21999782deaa9616311fcfac86eee35cc Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_failed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_in_progress_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_in_progress_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1eac662e7a5be41dde34afcdf8d0780ab70df2c6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_call_in_progress_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_list_tools_failed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_list_tools_failed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c49de7f6fe0d2d85da2a8fe96b06d07c8a2fbd8f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_mcp_list_tools_failed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30ba928d7515427d0fbb0a0eaee7a692bb402faa Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_added_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_added_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f621152f368a6cac5aa282e502c9b3a009be4df Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_added_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e19b7d97cfa86e1c363cb7c091e4d4515ffae615 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_item_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_message_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_message_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1394650e76efd4ce4eddceef10f1bcf7ee260905 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_message_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6880da9f555150f947d5f8831b8bcd319239b588 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd09ca3ddd0a88c5f7a3c3f3789d7ae26ef70028 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_refusal_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73b3c8505cda6896da3b3b95256a0b9cc9a9f067 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85d480e38fb4379d75e78d783541d2cd7d21c1e0 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_output_text_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_queued_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_queued_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3792b6339e87f7964c53f0c08524522f45c22c6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_queued_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d31ec139470fa75e27c0bf1f7fe42d16d06b008b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7a146b4c84bb1df28462b4f95ac76e555db0085 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_item_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_summary_text_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_summary_text_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b939b97ba4dc1b3eae6d45de72f3be333aeba7cb Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_summary_text_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_text_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_text_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e7c6e65c99bfbdc24ca75c2a7abb75a05ee8132 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_reasoning_text_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_delta_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..005e44a58362840da66f835d904f1eab6e198c25 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_delta_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f01a7724929dbe242ca43169e8b9cbc09c4bff3 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_refusal_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_status.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_status.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f25a1b543ec8255386189e456c50e6ba7270ae63 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_status.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_stream_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_stream_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c762a51def91140194e923097b4c7003450db50d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_stream_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_config_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_config_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f2e065e21d2d5320a2aa7935c2971513e81e17b Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_config_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_done_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_done_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c263f6087f8e22359ca5307e433d57d789f71715 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_text_done_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_usage.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_usage.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..919cf9cba7b859c768377d13f50bddf04d8a85a7 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_usage.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_completed_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_completed_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e88c516c57bfb37ea75e97fc6bad4b73eb69577d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_completed_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_searching_event.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_searching_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c457aeab645dadf7268e68b2473cfbd4b78900e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/response_web_search_call_searching_event.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_function.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_function.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09817bf5f671434dcf35c0c8fb6d580f5b7fb234 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_function.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bcdd1eb290d122400587f6a3302d467e982bce3c Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp_param.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a658bdb1ba491b258f9d35bb19cf5f3f21e13b2d Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_mcp_param.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_options.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_options.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0716c6d54564abbdf5c698f287f770728144877a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_options.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_types.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_types.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c15bf15e5e69930a5cd8fc1e2b1717dccab1dbe Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/tool_choice_types.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/web_search_tool.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/web_search_tool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c38957fc19dd2d238df94417dc6cf4a2517f630e Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/responses/__pycache__/web_search_tool.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..f2ed245d100e484e611086e384eb178acc46261f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ApplyPatchTool"] + + +class ApplyPatchTool(BaseModel): + """Allows the assistant to create, delete, or update files using unified diffs.""" + + type: Literal["apply_patch"] + """The type of the tool. Always `apply_patch`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2e0a809099734c5274d1fd09a577adb0e0dfc6b4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/apply_patch_tool_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ApplyPatchToolParam"] + + +class ApplyPatchToolParam(TypedDict, total=False): + """Allows the assistant to create, delete, or update files using unified diffs.""" + + type: Required[Literal["apply_patch"]] + """The type of the tool. Always `apply_patch`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/compacted_response.py b/py311/lib/python3.11/site-packages/openai/types/responses/compacted_response.py new file mode 100644 index 0000000000000000000000000000000000000000..5b333b83c0cb64bf65cdd974a21be54d1e718223 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/compacted_response.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_usage import ResponseUsage +from .response_output_item import ResponseOutputItem + +__all__ = ["CompactedResponse"] + + +class CompactedResponse(BaseModel): + id: str + """The unique identifier for the compacted response.""" + + created_at: int + """Unix timestamp (in seconds) when the compacted conversation was created.""" + + object: Literal["response.compaction"] + """The object type. Always `response.compaction`.""" + + output: List[ResponseOutputItem] + """The compacted list of output items. + + This is a list of all user messages, followed by a single compaction item. + """ + + usage: ResponseUsage + """ + Token accounting for the compaction pass, including cached, reasoning, and total + tokens. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..22871c841c0fa4f4f817ddb339be0125e623f57d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ComputerTool"] + + +class ComputerTool(BaseModel): + """A tool that controls a virtual computer. + + Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + """ + + display_height: int + """The height of the computer display.""" + + display_width: int + """The width of the computer display.""" + + environment: Literal["windows", "mac", "linux", "ubuntu", "browser"] + """The type of computer environment to control.""" + + type: Literal["computer_use_preview"] + """The type of the computer use tool. Always `computer_use_preview`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cdf75a43f2eea4917394245480bd7f46fb844ce8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/computer_tool_param.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ComputerToolParam"] + + +class ComputerToolParam(TypedDict, total=False): + """A tool that controls a virtual computer. + + Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + """ + + display_height: Required[int] + """The height of the computer display.""" + + display_width: Required[int] + """The width of the computer display.""" + + environment: Required[Literal["windows", "mac", "linux", "ubuntu", "browser"]] + """The type of computer environment to control.""" + + type: Required[Literal["computer_use_preview"]] + """The type of the computer use tool. Always `computer_use_preview`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..1ca401a486ee6876fa4ad5b25d03244c912e9e35 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from ..shared.custom_tool_input_format import CustomToolInputFormat + +__all__ = ["CustomTool"] + + +class CustomTool(BaseModel): + """A custom tool that processes input using a specified format. + + Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + """ + + name: str + """The name of the custom tool, used to identify it in tool calls.""" + + type: Literal["custom"] + """The type of the custom tool. Always `custom`.""" + + description: Optional[str] = None + """Optional description of the custom tool, used to provide more context.""" + + format: Optional[CustomToolInputFormat] = None + """The input format for the custom tool. Default is unconstrained text.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4ce43cdfdb3b08fed7f9d57f77f6747151d4c62b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/custom_tool_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from ..shared_params.custom_tool_input_format import CustomToolInputFormat + +__all__ = ["CustomToolParam"] + + +class CustomToolParam(TypedDict, total=False): + """A custom tool that processes input using a specified format. + + Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + """ + + name: Required[str] + """The name of the custom tool, used to identify it in tool calls.""" + + type: Required[Literal["custom"]] + """The type of the custom tool. Always `custom`.""" + + description: str + """Optional description of the custom tool, used to provide more context.""" + + format: CustomToolInputFormat + """The input format for the custom tool. Default is unconstrained text.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message.py b/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message.py new file mode 100644 index 0000000000000000000000000000000000000000..9a36a6b084a7908f3b1cf31f56e11e4de77cb96b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_input_message_content_list import ResponseInputMessageContentList + +__all__ = ["EasyInputMessage"] + + +class EasyInputMessage(BaseModel): + """ + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + """ + + content: Union[str, ResponseInputMessageContentList] + """ + Text, image, or audio input to the model, used to generate a response. Can also + contain previous assistant responses. + """ + + role: Literal["user", "assistant", "system", "developer"] + """The role of the message input. + + One of `user`, `assistant`, `system`, or `developer`. + """ + + type: Optional[Literal["message"]] = None + """The type of the message input. Always `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message_param.py new file mode 100644 index 0000000000000000000000000000000000000000..0a382bddee74abb5095e9f16b344e091d384d928 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/easy_input_message_param.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypedDict + +from .response_input_message_content_list_param import ResponseInputMessageContentListParam + +__all__ = ["EasyInputMessageParam"] + + +class EasyInputMessageParam(TypedDict, total=False): + """ + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + """ + + content: Required[Union[str, ResponseInputMessageContentListParam]] + """ + Text, image, or audio input to the model, used to generate a response. Can also + contain previous assistant responses. + """ + + role: Required[Literal["user", "assistant", "system", "developer"]] + """The role of the message input. + + One of `user`, `assistant`, `system`, or `developer`. + """ + + type: Literal["message"] + """The type of the message input. Always `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..09c12876ca66fdf6677fadbddbe62298559b22e6 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from ..shared.compound_filter import CompoundFilter +from ..shared.comparison_filter import ComparisonFilter + +__all__ = ["FileSearchTool", "Filters", "RankingOptions", "RankingOptionsHybridSearch"] + +Filters: TypeAlias = Union[ComparisonFilter, CompoundFilter, None] + + +class RankingOptionsHybridSearch(BaseModel): + """ + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + """ + + embedding_weight: float + """The weight of the embedding in the reciprocal ranking fusion.""" + + text_weight: float + """The weight of the text in the reciprocal ranking fusion.""" + + +class RankingOptions(BaseModel): + """Ranking options for search.""" + + hybrid_search: Optional[RankingOptionsHybridSearch] = None + """ + Weights that control how reciprocal rank fusion balances semantic embedding + matches versus sparse keyword matches when hybrid search is enabled. + """ + + ranker: Optional[Literal["auto", "default-2024-11-15"]] = None + """The ranker to use for the file search.""" + + score_threshold: Optional[float] = None + """The score threshold for the file search, a number between 0 and 1. + + Numbers closer to 1 will attempt to return only the most relevant results, but + may return fewer results. + """ + + +class FileSearchTool(BaseModel): + """A tool that searches for relevant content from uploaded files. + + Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + """ + + type: Literal["file_search"] + """The type of the file search tool. Always `file_search`.""" + + vector_store_ids: List[str] + """The IDs of the vector stores to search.""" + + filters: Optional[Filters] = None + """A filter to apply.""" + + max_num_results: Optional[int] = None + """The maximum number of results to return. + + This number should be between 1 and 50 inclusive. + """ + + ranking_options: Optional[RankingOptions] = None + """Ranking options for search.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..82831d0dc0bef378c51a268871397bc996d37bf0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/file_search_tool_param.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..shared_params.compound_filter import CompoundFilter +from ..shared_params.comparison_filter import ComparisonFilter + +__all__ = ["FileSearchToolParam", "Filters", "RankingOptions", "RankingOptionsHybridSearch"] + +Filters: TypeAlias = Union[ComparisonFilter, CompoundFilter] + + +class RankingOptionsHybridSearch(TypedDict, total=False): + """ + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + """ + + embedding_weight: Required[float] + """The weight of the embedding in the reciprocal ranking fusion.""" + + text_weight: Required[float] + """The weight of the text in the reciprocal ranking fusion.""" + + +class RankingOptions(TypedDict, total=False): + """Ranking options for search.""" + + hybrid_search: RankingOptionsHybridSearch + """ + Weights that control how reciprocal rank fusion balances semantic embedding + matches versus sparse keyword matches when hybrid search is enabled. + """ + + ranker: Literal["auto", "default-2024-11-15"] + """The ranker to use for the file search.""" + + score_threshold: float + """The score threshold for the file search, a number between 0 and 1. + + Numbers closer to 1 will attempt to return only the most relevant results, but + may return fewer results. + """ + + +class FileSearchToolParam(TypedDict, total=False): + """A tool that searches for relevant content from uploaded files. + + Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + """ + + type: Required[Literal["file_search"]] + """The type of the file search tool. Always `file_search`.""" + + vector_store_ids: Required[SequenceNotStr[str]] + """The IDs of the vector stores to search.""" + + filters: Optional[Filters] + """A filter to apply.""" + + max_num_results: int + """The maximum number of results to return. + + This number should be between 1 and 50 inclusive. + """ + + ranking_options: RankingOptions + """Ranking options for search.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..5b237aa705030adcea80c541056f87e40736a75e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FunctionShellTool"] + + +class FunctionShellTool(BaseModel): + """A tool that allows the model to execute shell commands.""" + + type: Literal["shell"] + """The type of the shell tool. Always `shell`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..c640ddab99548d7533681eeba4b88ec26537d251 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/function_shell_tool_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["FunctionShellToolParam"] + + +class FunctionShellToolParam(TypedDict, total=False): + """A tool that allows the model to execute shell commands.""" + + type: Required[Literal["shell"]] + """The type of the shell tool. Always `shell`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/function_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/function_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..b0827a9fa7960187f8c0ec7007c94d888e38b7e1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/function_tool.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["FunctionTool"] + + +class FunctionTool(BaseModel): + """Defines a function in your own code the model can choose to call. + + Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + """ + + name: str + """The name of the function to call.""" + + parameters: Optional[Dict[str, object]] = None + """A JSON schema object describing the parameters of the function.""" + + strict: Optional[bool] = None + """Whether to enforce strict parameter validation. Default `true`.""" + + type: Literal["function"] + """The type of the function tool. Always `function`.""" + + description: Optional[str] = None + """A description of the function. + + Used by the model to determine whether or not to call the function. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/function_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/function_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..ba0a3168c42b0ea21502153025f85cfb1c9702c5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/function_tool_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["FunctionToolParam"] + + +class FunctionToolParam(TypedDict, total=False): + """Defines a function in your own code the model can choose to call. + + Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + """ + + name: Required[str] + """The name of the function to call.""" + + parameters: Required[Optional[Dict[str, object]]] + """A JSON schema object describing the parameters of the function.""" + + strict: Required[Optional[bool]] + """Whether to enforce strict parameter validation. Default `true`.""" + + type: Required[Literal["function"]] + """The type of the function tool. Always `function`.""" + + description: Optional[str] + """A description of the function. + + Used by the model to determine whether or not to call the function. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/input_item_list_params.py b/py311/lib/python3.11/site-packages/openai/types/responses/input_item_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..44a8dc5de331f93873b7951d978cc53ace7ba4f5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/input_item_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, TypedDict + +from .response_includable import ResponseIncludable + +__all__ = ["InputItemListParams"] + + +class InputItemListParams(TypedDict, total=False): + after: str + """An item ID to list items after, used in pagination.""" + + include: List[ResponseIncludable] + """Additional fields to include in the response. + + See the `include` parameter for Response creation above for more information. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """The order to return the input items in. Default is `desc`. + + - `asc`: Return the input items in ascending order. + - `desc`: Return the input items in descending order. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_params.py b/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_params.py new file mode 100644 index 0000000000000000000000000000000000000000..97ee4bf6cafeed1d5f547d0aa6cdf2056442f988 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_params.py @@ -0,0 +1,146 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, TypeAlias, TypedDict + +from .tool_param import ToolParam +from .tool_choice_options import ToolChoiceOptions +from .tool_choice_mcp_param import ToolChoiceMcpParam +from .tool_choice_shell_param import ToolChoiceShellParam +from .tool_choice_types_param import ToolChoiceTypesParam +from ..shared_params.reasoning import Reasoning +from .tool_choice_custom_param import ToolChoiceCustomParam +from .response_input_item_param import ResponseInputItemParam +from .tool_choice_allowed_param import ToolChoiceAllowedParam +from .tool_choice_function_param import ToolChoiceFunctionParam +from .response_conversation_param import ResponseConversationParam +from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam +from .response_format_text_config_param import ResponseFormatTextConfigParam + +__all__ = ["InputTokenCountParams", "Conversation", "Text", "ToolChoice"] + + +class InputTokenCountParams(TypedDict, total=False): + conversation: Optional[Conversation] + """The conversation that this response belongs to. + + Items from this conversation are prepended to `input_items` for this response + request. Input items and output items from this response are automatically added + to this conversation after this response completes. + """ + + input: Union[str, Iterable[ResponseInputItemParam], None] + """Text, image, or file inputs to the model, used to generate a response""" + + instructions: Optional[str] + """ + A system (or developer) message inserted into the model's context. When used + along with `previous_response_id`, the instructions from a previous response + will not be carried over to the next response. This makes it simple to swap out + system (or developer) messages in new responses. + """ + + model: Optional[str] + """Model ID used to generate the response, like `gpt-4o` or `o3`. + + OpenAI offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the + [model guide](https://platform.openai.com/docs/models) to browse and compare + available models. + """ + + parallel_tool_calls: Optional[bool] + """Whether to allow the model to run tool calls in parallel.""" + + previous_response_id: Optional[str] + """The unique ID of the previous response to the model. + + Use this to create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). + Cannot be used in conjunction with `conversation`. + """ + + reasoning: Optional[Reasoning] + """ + **gpt-5 and o-series models only** Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + """ + + text: Optional[Text] + """Configuration options for a text response from the model. + + Can be plain text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + tool_choice: Optional[ToolChoice] + """Controls which tool the model should use, if any.""" + + tools: Optional[Iterable[ToolParam]] + """An array of tools the model may call while generating a response. + + You can specify which tool to use by setting the `tool_choice` parameter. + """ + + truncation: Literal["auto", "disabled"] + """The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds the model's context window size, + the model will truncate the response to fit the context window by dropping + items from the beginning of the conversation. - `disabled` (default): If the + input size will exceed the context window size for a model, the request will + fail with a 400 error. + """ + + +Conversation: TypeAlias = Union[str, ResponseConversationParam] + + +class Text(TypedDict, total=False): + """Configuration options for a text response from the model. + + Can be plain + text or structured JSON data. Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + format: ResponseFormatTextConfigParam + """An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` is + preferred for models that support it. + """ + + verbosity: Optional[Literal["low", "medium", "high"]] + """Constrains the verbosity of the model's response. + + Lower values will result in more concise responses, while higher values will + result in more verbose responses. Currently supported values are `low`, + `medium`, and `high`. + """ + + +ToolChoice: TypeAlias = Union[ + ToolChoiceOptions, + ToolChoiceAllowedParam, + ToolChoiceTypesParam, + ToolChoiceFunctionParam, + ToolChoiceMcpParam, + ToolChoiceCustomParam, + ToolChoiceApplyPatchParam, + ToolChoiceShellParam, +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_response.py b/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_response.py new file mode 100644 index 0000000000000000000000000000000000000000..30ddfc121779b728bed04b42bd1cd24c4ccdd8a6 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/input_token_count_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["InputTokenCountResponse"] + + +class InputTokenCountResponse(BaseModel): + input_tokens: int + + object: Literal["response.input_tokens"] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/parsed_response.py b/py311/lib/python3.11/site-packages/openai/types/responses/parsed_response.py new file mode 100644 index 0000000000000000000000000000000000000000..a859710590d75b929d4cc1c80de95757c488d6c0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/parsed_response.py @@ -0,0 +1,106 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, List, Union, Generic, TypeVar, Optional +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .response import Response +from ..._models import GenericModel +from .response_output_item import ( + McpCall, + McpListTools, + LocalShellCall, + McpApprovalRequest, + ImageGenerationCall, + LocalShellCallAction, +) +from .response_output_text import ResponseOutputText +from .response_output_message import ResponseOutputMessage +from .response_output_refusal import ResponseOutputRefusal +from .response_reasoning_item import ResponseReasoningItem +from .response_compaction_item import ResponseCompactionItem +from .response_custom_tool_call import ResponseCustomToolCall +from .response_computer_tool_call import ResponseComputerToolCall +from .response_function_tool_call import ResponseFunctionToolCall +from .response_function_web_search import ResponseFunctionWebSearch +from .response_apply_patch_tool_call import ResponseApplyPatchToolCall +from .response_file_search_tool_call import ResponseFileSearchToolCall +from .response_function_shell_tool_call import ResponseFunctionShellToolCall +from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall +from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput +from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput + +__all__ = ["ParsedResponse", "ParsedResponseOutputMessage", "ParsedResponseOutputText"] + +ContentType = TypeVar("ContentType") + +# we need to disable this check because we're overriding properties +# with subclasses of their types which is technically unsound as +# properties can be mutated. +# pyright: reportIncompatibleVariableOverride=false + + +class ParsedResponseOutputText(ResponseOutputText, GenericModel, Generic[ContentType]): + parsed: Optional[ContentType] = None + + +ParsedContent: TypeAlias = Annotated[ + Union[ParsedResponseOutputText[ContentType], ResponseOutputRefusal], + PropertyInfo(discriminator="type"), +] + + +class ParsedResponseOutputMessage(ResponseOutputMessage, GenericModel, Generic[ContentType]): + if TYPE_CHECKING: + content: List[ParsedContent[ContentType]] # type: ignore[assignment] + else: + content: List[ParsedContent] + + +class ParsedResponseFunctionToolCall(ResponseFunctionToolCall): + parsed_arguments: object = None + + __api_exclude__ = {"parsed_arguments"} + + +ParsedResponseOutputItem: TypeAlias = Annotated[ + Union[ + ParsedResponseOutputMessage[ContentType], + ParsedResponseFunctionToolCall, + ResponseFileSearchToolCall, + ResponseFunctionWebSearch, + ResponseComputerToolCall, + ResponseReasoningItem, + McpCall, + McpApprovalRequest, + ImageGenerationCall, + LocalShellCall, + LocalShellCallAction, + McpListTools, + ResponseCodeInterpreterToolCall, + ResponseCustomToolCall, + ResponseCompactionItem, + ResponseFunctionShellToolCall, + ResponseFunctionShellToolCallOutput, + ResponseApplyPatchToolCall, + ResponseApplyPatchToolCallOutput, + ], + PropertyInfo(discriminator="type"), +] + + +class ParsedResponse(Response, GenericModel, Generic[ContentType]): + if TYPE_CHECKING: + output: List[ParsedResponseOutputItem[ContentType]] # type: ignore[assignment] + else: + output: List[ParsedResponseOutputItem] + + @property + def output_parsed(self) -> Optional[ContentType]: + for output in self.output: + if output.type == "message": + for content in output.content: + if content.type == "output_text" and content.parsed: + return content.parsed + + return None diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response.py b/py311/lib/python3.11/site-packages/openai/types/responses/response.py new file mode 100644 index 0000000000000000000000000000000000000000..6bac7d65deaa53c6db4d402388e314f81aac3bb7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response.py @@ -0,0 +1,320 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from .tool import Tool +from ..._models import BaseModel +from .response_error import ResponseError +from .response_usage import ResponseUsage +from .response_prompt import ResponsePrompt +from .response_status import ResponseStatus +from .tool_choice_mcp import ToolChoiceMcp +from ..shared.metadata import Metadata +from ..shared.reasoning import Reasoning +from .tool_choice_shell import ToolChoiceShell +from .tool_choice_types import ToolChoiceTypes +from .tool_choice_custom import ToolChoiceCustom +from .response_input_item import ResponseInputItem +from .tool_choice_allowed import ToolChoiceAllowed +from .tool_choice_options import ToolChoiceOptions +from .response_output_item import ResponseOutputItem +from .response_text_config import ResponseTextConfig +from .tool_choice_function import ToolChoiceFunction +from ..shared.responses_model import ResponsesModel +from .tool_choice_apply_patch import ToolChoiceApplyPatch + +__all__ = ["Response", "IncompleteDetails", "ToolChoice", "Conversation"] + + +class IncompleteDetails(BaseModel): + """Details about why the response is incomplete.""" + + reason: Optional[Literal["max_output_tokens", "content_filter"]] = None + """The reason why the response is incomplete.""" + + +ToolChoice: TypeAlias = Union[ + ToolChoiceOptions, + ToolChoiceAllowed, + ToolChoiceTypes, + ToolChoiceFunction, + ToolChoiceMcp, + ToolChoiceCustom, + ToolChoiceApplyPatch, + ToolChoiceShell, +] + + +class Conversation(BaseModel): + """The conversation that this response belonged to. + + Input items and output items from this response were automatically added to this conversation. + """ + + id: str + """The unique ID of the conversation that this response was associated with.""" + + +class Response(BaseModel): + id: str + """Unique identifier for this Response.""" + + created_at: float + """Unix timestamp (in seconds) of when this Response was created.""" + + error: Optional[ResponseError] = None + """An error object returned when the model fails to generate a Response.""" + + incomplete_details: Optional[IncompleteDetails] = None + """Details about why the response is incomplete.""" + + instructions: Union[str, List[ResponseInputItem], None] = None + """A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple to + swap out system (or developer) messages in new responses. + """ + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: ResponsesModel + """Model ID used to generate the response, like `gpt-4o` or `o3`. + + OpenAI offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the + [model guide](https://platform.openai.com/docs/models) to browse and compare + available models. + """ + + object: Literal["response"] + """The object type of this resource - always set to `response`.""" + + output: List[ResponseOutputItem] + """An array of content items generated by the model. + + - The length and order of items in the `output` array is dependent on the + model's response. + - Rather than accessing the first item in the `output` array and assuming it's + an `assistant` message with the content generated by the model, you might + consider using the `output_text` property where supported in SDKs. + """ + + parallel_tool_calls: bool + """Whether to allow the model to run tool calls in parallel.""" + + temperature: Optional[float] = None + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. We generally recommend altering + this or `top_p` but not both. + """ + + tool_choice: ToolChoice + """ + How the model should select which tool (or tools) to use when generating a + response. See the `tools` parameter to see how to specify which tools the model + can call. + """ + + tools: List[Tool] + """An array of tools the model may call while generating a response. + + You can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + capabilities, like + [web search](https://platform.openai.com/docs/guides/tools-web-search) or + [file search](https://platform.openai.com/docs/guides/tools-file-search). + Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers or + predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, enabling + the model to call your own code with strongly typed arguments and outputs. + Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). + You can also use custom tools to call your own code. + """ + + top_p: Optional[float] = None + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + """ + + background: Optional[bool] = None + """ + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). + """ + + completed_at: Optional[float] = None + """ + Unix timestamp (in seconds) of when this Response was completed. Only present + when the status is `completed`. + """ + + conversation: Optional[Conversation] = None + """The conversation that this response belonged to. + + Input items and output items from this response were automatically added to this + conversation. + """ + + max_output_tokens: Optional[int] = None + """ + An upper bound for the number of tokens that can be generated for a response, + including visible output tokens and + [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + """ + + max_tool_calls: Optional[int] = None + """ + The maximum number of total calls to built-in tools that can be processed in a + response. This maximum number applies across all built-in tool calls, not per + individual tool. Any further attempts to call a tool by the model will be + ignored. + """ + + previous_response_id: Optional[str] = None + """The unique ID of the previous response to the model. + + Use this to create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). + Cannot be used in conjunction with `conversation`. + """ + + prompt: Optional[ResponsePrompt] = None + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + prompt_cache_key: Optional[str] = None + """ + Used by OpenAI to cache responses for similar requests to optimize your cache + hit rates. Replaces the `user` field. + [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + """ + + prompt_cache_retention: Optional[Literal["in-memory", "24h"]] = None + """The retention policy for the prompt cache. + + Set to `24h` to enable extended prompt caching, which keeps cached prefixes + active for longer, up to a maximum of 24 hours. + [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + """ + + reasoning: Optional[Reasoning] = None + """**gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + """ + + safety_identifier: Optional[str] = None + """ + A stable identifier used to help detect users of your application that may be + violating OpenAI's usage policies. The IDs should be a string that uniquely + identifies each user. We recommend hashing their username or email address, in + order to avoid sending us any identifying information. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + """ + + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + """Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier + configured in the Project settings. Unless otherwise configured, the Project + will use 'default'. + - If set to 'default', then the request will be processed with the standard + pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or + '[priority](https://openai.com/api-priority-processing/)', then the request + will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the + `service_tier` value based on the processing mode actually used to serve the + request. This response value may be different from the value set in the + parameter. + """ + + status: Optional[ResponseStatus] = None + """The status of the response generation. + + One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or + `incomplete`. + """ + + text: Optional[ResponseTextConfig] = None + """Configuration options for a text response from the model. + + Can be plain text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + top_logprobs: Optional[int] = None + """ + An integer between 0 and 20 specifying the number of most likely tokens to + return at each token position, each with an associated log probability. + """ + + truncation: Optional[Literal["auto", "disabled"]] = None + """The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds the model's context window size, + the model will truncate the response to fit the context window by dropping + items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window size + for a model, the request will fail with a 400 error. + """ + + usage: Optional[ResponseUsage] = None + """ + Represents token usage details including input tokens, output tokens, a + breakdown of output tokens, and the total tokens used. + """ + + user: Optional[str] = None + """This field is being replaced by `safety_identifier` and `prompt_cache_key`. + + Use `prompt_cache_key` instead to maintain caching optimizations. A stable + identifier for your end-users. Used to boost cache hit rates by better bucketing + similar requests and to help OpenAI detect and prevent abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + """ + + @property + def output_text(self) -> str: + """Convenience property that aggregates all `output_text` items from the `output` list. + + If no `output_text` content blocks exist, then an empty string is returned. + """ + texts: List[str] = [] + for output in self.output: + if output.type == "message": + for content in output.content: + if content.type == "output_text": + texts.append(content.text) + + return "".join(texts) diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..7af1300265720ade0d041efe34ac7c545299f2f7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call.py @@ -0,0 +1,84 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ResponseApplyPatchToolCall", + "Operation", + "OperationCreateFile", + "OperationDeleteFile", + "OperationUpdateFile", +] + + +class OperationCreateFile(BaseModel): + """Instruction describing how to create a file via the apply_patch tool.""" + + diff: str + """Diff to apply.""" + + path: str + """Path of the file to create.""" + + type: Literal["create_file"] + """Create a new file with the provided diff.""" + + +class OperationDeleteFile(BaseModel): + """Instruction describing how to delete a file via the apply_patch tool.""" + + path: str + """Path of the file to delete.""" + + type: Literal["delete_file"] + """Delete the specified file.""" + + +class OperationUpdateFile(BaseModel): + """Instruction describing how to update a file via the apply_patch tool.""" + + diff: str + """Diff to apply.""" + + path: str + """Path of the file to update.""" + + type: Literal["update_file"] + """Update an existing file with the provided diff.""" + + +Operation: TypeAlias = Annotated[ + Union[OperationCreateFile, OperationDeleteFile, OperationUpdateFile], PropertyInfo(discriminator="type") +] + + +class ResponseApplyPatchToolCall(BaseModel): + """A tool call that applies file diffs by creating, deleting, or updating files.""" + + id: str + """The unique ID of the apply patch tool call. + + Populated when this item is returned via API. + """ + + call_id: str + """The unique ID of the apply patch tool call generated by the model.""" + + operation: Operation + """ + One of the create_file, delete_file, or update_file operations applied via + apply_patch. + """ + + status: Literal["in_progress", "completed"] + """The status of the apply patch tool call. One of `in_progress` or `completed`.""" + + type: Literal["apply_patch_call"] + """The type of the item. Always `apply_patch_call`.""" + + created_by: Optional[str] = None + """The ID of the entity that created this tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call_output.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call_output.py new file mode 100644 index 0000000000000000000000000000000000000000..de63c6e2ee34596553d0fdfcc8896f5d2b95ae0c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_apply_patch_tool_call_output.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseApplyPatchToolCallOutput"] + + +class ResponseApplyPatchToolCallOutput(BaseModel): + """The output emitted by an apply patch tool call.""" + + id: str + """The unique ID of the apply patch tool call output. + + Populated when this item is returned via API. + """ + + call_id: str + """The unique ID of the apply patch tool call generated by the model.""" + + status: Literal["completed", "failed"] + """The status of the apply patch tool call output. One of `completed` or `failed`.""" + + type: Literal["apply_patch_call_output"] + """The type of the item. Always `apply_patch_call_output`.""" + + created_by: Optional[str] = None + """The ID of the entity that created this tool call output.""" + + output: Optional[str] = None + """Optional textual output returned by the apply patch tool.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e577d65d04bcb89fb0760bdbe1c7d449a9ade7ab --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_delta_event.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioDeltaEvent"] + + +class ResponseAudioDeltaEvent(BaseModel): + """Emitted when there is a partial audio response.""" + + delta: str + """A chunk of Base64 encoded response audio bytes.""" + + sequence_number: int + """A sequence number for this chunk of the stream response.""" + + type: Literal["response.audio.delta"] + """The type of the event. Always `response.audio.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..f5f0401c86d0e9efa89424b383e339a007ea056c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_done_event.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioDoneEvent"] + + +class ResponseAudioDoneEvent(BaseModel): + """Emitted when the audio response is complete.""" + + sequence_number: int + """The sequence number of the delta.""" + + type: Literal["response.audio.done"] + """The type of the event. Always `response.audio.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..03be59a29f6b2828e87800ec4220a73834ca6925 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_delta_event.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioTranscriptDeltaEvent"] + + +class ResponseAudioTranscriptDeltaEvent(BaseModel): + """Emitted when there is a partial transcript of audio.""" + + delta: str + """The partial transcript of the audio response.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.audio.transcript.delta"] + """The type of the event. Always `response.audio.transcript.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..87219e4844ada56cbdb0f4ef3efd50740f6850cc --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_audio_transcript_done_event.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseAudioTranscriptDoneEvent"] + + +class ResponseAudioTranscriptDoneEvent(BaseModel): + """Emitted when the full audio transcript is completed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.audio.transcript.done"] + """The type of the event. Always `response.audio.transcript.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c6bc8b73eaa6ae73c8a691e34c9e4cfc67a14c86 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_delta_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterCallCodeDeltaEvent"] + + +class ResponseCodeInterpreterCallCodeDeltaEvent(BaseModel): + """Emitted when a partial code snippet is streamed by the code interpreter.""" + + delta: str + """The partial code snippet being streamed by the code interpreter.""" + + item_id: str + """The unique identifier of the code interpreter tool call item.""" + + output_index: int + """ + The index of the output item in the response for which the code is being + streamed. + """ + + sequence_number: int + """The sequence number of this event, used to order streaming events.""" + + type: Literal["response.code_interpreter_call_code.delta"] + """The type of the event. Always `response.code_interpreter_call_code.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..186c03711a1f4d5fb765f7e85702296bd4fa328d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_code_done_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterCallCodeDoneEvent"] + + +class ResponseCodeInterpreterCallCodeDoneEvent(BaseModel): + """Emitted when the code snippet is finalized by the code interpreter.""" + + code: str + """The final code snippet output by the code interpreter.""" + + item_id: str + """The unique identifier of the code interpreter tool call item.""" + + output_index: int + """The index of the output item in the response for which the code is finalized.""" + + sequence_number: int + """The sequence number of this event, used to order streaming events.""" + + type: Literal["response.code_interpreter_call_code.done"] + """The type of the event. Always `response.code_interpreter_call_code.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..197e39e7e96ea65c53264d24750144ad48fa6c16 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_completed_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterCallCompletedEvent"] + + +class ResponseCodeInterpreterCallCompletedEvent(BaseModel): + """Emitted when the code interpreter call is completed.""" + + item_id: str + """The unique identifier of the code interpreter tool call item.""" + + output_index: int + """ + The index of the output item in the response for which the code interpreter call + is completed. + """ + + sequence_number: int + """The sequence number of this event, used to order streaming events.""" + + type: Literal["response.code_interpreter_call.completed"] + """The type of the event. Always `response.code_interpreter_call.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c775f1b86435b23bceaadcec18bbf23ca9f7163a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_in_progress_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterCallInProgressEvent"] + + +class ResponseCodeInterpreterCallInProgressEvent(BaseModel): + """Emitted when a code interpreter call is in progress.""" + + item_id: str + """The unique identifier of the code interpreter tool call item.""" + + output_index: int + """ + The index of the output item in the response for which the code interpreter call + is in progress. + """ + + sequence_number: int + """The sequence number of this event, used to order streaming events.""" + + type: Literal["response.code_interpreter_call.in_progress"] + """The type of the event. Always `response.code_interpreter_call.in_progress`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_interpreting_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_interpreting_event.py new file mode 100644 index 0000000000000000000000000000000000000000..85e9c87f08e18e6d2446ce6eb46c2c846747ef7a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_call_interpreting_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterCallInterpretingEvent"] + + +class ResponseCodeInterpreterCallInterpretingEvent(BaseModel): + """Emitted when the code interpreter is actively interpreting the code snippet.""" + + item_id: str + """The unique identifier of the code interpreter tool call item.""" + + output_index: int + """ + The index of the output item in the response for which the code interpreter is + interpreting code. + """ + + sequence_number: int + """The sequence number of this event, used to order streaming events.""" + + type: Literal["response.code_interpreter_call.interpreting"] + """The type of the event. Always `response.code_interpreter_call.interpreting`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..d7e30f4920181dc9ce152213f846edb61b4ab60f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["ResponseCodeInterpreterToolCall", "Output", "OutputLogs", "OutputImage"] + + +class OutputLogs(BaseModel): + """The logs output from the code interpreter.""" + + logs: str + """The logs output from the code interpreter.""" + + type: Literal["logs"] + """The type of the output. Always `logs`.""" + + +class OutputImage(BaseModel): + """The image output from the code interpreter.""" + + type: Literal["image"] + """The type of the output. Always `image`.""" + + url: str + """The URL of the image output from the code interpreter.""" + + +Output: TypeAlias = Annotated[Union[OutputLogs, OutputImage], PropertyInfo(discriminator="type")] + + +class ResponseCodeInterpreterToolCall(BaseModel): + """A tool call to run code.""" + + id: str + """The unique ID of the code interpreter tool call.""" + + code: Optional[str] = None + """The code to run, or null if not available.""" + + container_id: str + """The ID of the container used to run the code.""" + + outputs: Optional[List[Output]] = None + """ + The outputs generated by the code interpreter, such as logs or images. Can be + null if no outputs are available. + """ + + status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"] + """The status of the code interpreter tool call. + + Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and + `failed`. + """ + + type: Literal["code_interpreter_call"] + """The type of the code interpreter tool call. Always `code_interpreter_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..fc03a3fe48b2ce68a4ba37888e7ea5ceed60bd76 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_code_interpreter_tool_call_param.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["ResponseCodeInterpreterToolCallParam", "Output", "OutputLogs", "OutputImage"] + + +class OutputLogs(TypedDict, total=False): + """The logs output from the code interpreter.""" + + logs: Required[str] + """The logs output from the code interpreter.""" + + type: Required[Literal["logs"]] + """The type of the output. Always `logs`.""" + + +class OutputImage(TypedDict, total=False): + """The image output from the code interpreter.""" + + type: Required[Literal["image"]] + """The type of the output. Always `image`.""" + + url: Required[str] + """The URL of the image output from the code interpreter.""" + + +Output: TypeAlias = Union[OutputLogs, OutputImage] + + +class ResponseCodeInterpreterToolCallParam(TypedDict, total=False): + """A tool call to run code.""" + + id: Required[str] + """The unique ID of the code interpreter tool call.""" + + code: Required[Optional[str]] + """The code to run, or null if not available.""" + + container_id: Required[str] + """The ID of the container used to run the code.""" + + outputs: Required[Optional[Iterable[Output]]] + """ + The outputs generated by the code interpreter, such as logs or images. Can be + null if no outputs are available. + """ + + status: Required[Literal["in_progress", "completed", "incomplete", "interpreting", "failed"]] + """The status of the code interpreter tool call. + + Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and + `failed`. + """ + + type: Required[Literal["code_interpreter_call"]] + """The type of the code interpreter tool call. Always `code_interpreter_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_compact_params.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_compact_params.py new file mode 100644 index 0000000000000000000000000000000000000000..657c6a076459e0e133ad7acedc548f82c6ea1270 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_compact_params.py @@ -0,0 +1,133 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +from .response_input_item_param import ResponseInputItemParam + +__all__ = ["ResponseCompactParams"] + + +class ResponseCompactParams(TypedDict, total=False): + model: Required[ + Union[ + Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", + "gpt-5.1", + "gpt-5.1-2025-11-13", + "gpt-5.1-codex", + "gpt-5.1-mini", + "gpt-5.1-chat-latest", + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", + "gpt-5-2025-08-07", + "gpt-5-mini-2025-08-07", + "gpt-5-nano-2025-08-07", + "gpt-5-chat-latest", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "o4-mini", + "o4-mini-2025-04-16", + "o3", + "o3-2025-04-16", + "o3-mini", + "o3-mini-2025-01-31", + "o1", + "o1-2024-12-17", + "o1-preview", + "o1-preview-2024-09-12", + "o1-mini", + "o1-mini-2024-09-12", + "gpt-4o", + "gpt-4o-2024-11-20", + "gpt-4o-2024-08-06", + "gpt-4o-2024-05-13", + "gpt-4o-audio-preview", + "gpt-4o-audio-preview-2024-10-01", + "gpt-4o-audio-preview-2024-12-17", + "gpt-4o-audio-preview-2025-06-03", + "gpt-4o-mini-audio-preview", + "gpt-4o-mini-audio-preview-2024-12-17", + "gpt-4o-search-preview", + "gpt-4o-mini-search-preview", + "gpt-4o-search-preview-2025-03-11", + "gpt-4o-mini-search-preview-2025-03-11", + "chatgpt-4o-latest", + "codex-mini-latest", + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-turbo-preview", + "gpt-4-1106-preview", + "gpt-4-vision-preview", + "gpt-4", + "gpt-4-0314", + "gpt-4-0613", + "gpt-4-32k", + "gpt-4-32k-0314", + "gpt-4-32k-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0301", + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-16k-0613", + "o1-pro", + "o1-pro-2025-03-19", + "o3-pro", + "o3-pro-2025-06-10", + "o3-deep-research", + "o3-deep-research-2025-06-26", + "o4-mini-deep-research", + "o4-mini-deep-research-2025-06-26", + "computer-use-preview", + "computer-use-preview-2025-03-11", + "gpt-5-codex", + "gpt-5-pro", + "gpt-5-pro-2025-10-06", + "gpt-5.1-codex-max", + ], + str, + None, + ] + ] + """Model ID used to generate the response, like `gpt-5` or `o3`. + + OpenAI offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the + [model guide](https://platform.openai.com/docs/models) to browse and compare + available models. + """ + + input: Union[str, Iterable[ResponseInputItemParam], None] + """Text, image, or file inputs to the model, used to generate a response""" + + instructions: Optional[str] + """ + A system (or developer) message inserted into the model's context. When used + along with `previous_response_id`, the instructions from a previous response + will not be carried over to the next response. This makes it simple to swap out + system (or developer) messages in new responses. + """ + + previous_response_id: Optional[str] + """The unique ID of the previous response to the model. + + Use this to create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). + Cannot be used in conjunction with `conversation`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item.py new file mode 100644 index 0000000000000000000000000000000000000000..36e953b127b4b140f912d58a49a0bbe0b844536c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCompactionItem"] + + +class ResponseCompactionItem(BaseModel): + """ + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + """ + + id: str + """The unique ID of the compaction item.""" + + encrypted_content: str + """The encrypted content that was produced by compaction.""" + + type: Literal["compaction"] + """The type of the item. Always `compaction`.""" + + created_by: Optional[str] = None + """The identifier of the actor that created the item.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param.py new file mode 100644 index 0000000000000000000000000000000000000000..5ef134b07426d750ce3c6563f5f9a2352b87ce4b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCompactionItemParam"] + + +class ResponseCompactionItemParam(BaseModel): + """ + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + """ + + encrypted_content: str + """The encrypted content of the compaction summary.""" + + type: Literal["compaction"] + """The type of the item. Always `compaction`.""" + + id: Optional[str] = None + """The ID of the compaction item.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param_param.py new file mode 100644 index 0000000000000000000000000000000000000000..b4d72c2e5fdca8db6db607d095f67aef08ed58e7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_compaction_item_param_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseCompactionItemParamParam"] + + +class ResponseCompactionItemParamParam(TypedDict, total=False): + """ + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + """ + + encrypted_content: Required[str] + """The encrypted content of the compaction summary.""" + + type: Required[Literal["compaction"]] + """The type of the item. Always `compaction`.""" + + id: Optional[str] + """The ID of the compaction item.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..6dc958101c3fc7cbaf33e561221c1c319544e24f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_completed_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseCompletedEvent"] + + +class ResponseCompletedEvent(BaseModel): + """Emitted when the model response is complete.""" + + response: Response + """Properties of the completed response.""" + + sequence_number: int + """The sequence number for this event.""" + + type: Literal["response.completed"] + """The type of the event. Always `response.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..4e1b3cf7fdf99bbffd7c3a6552cc0ade4c9beb66 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call.py @@ -0,0 +1,237 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ResponseComputerToolCall", + "Action", + "ActionClick", + "ActionDoubleClick", + "ActionDrag", + "ActionDragPath", + "ActionKeypress", + "ActionMove", + "ActionScreenshot", + "ActionScroll", + "ActionType", + "ActionWait", + "PendingSafetyCheck", +] + + +class ActionClick(BaseModel): + """A click action.""" + + button: Literal["left", "right", "wheel", "back", "forward"] + """Indicates which mouse button was pressed during the click. + + One of `left`, `right`, `wheel`, `back`, or `forward`. + """ + + type: Literal["click"] + """Specifies the event type. For a click action, this property is always `click`.""" + + x: int + """The x-coordinate where the click occurred.""" + + y: int + """The y-coordinate where the click occurred.""" + + +class ActionDoubleClick(BaseModel): + """A double click action.""" + + type: Literal["double_click"] + """Specifies the event type. + + For a double click action, this property is always set to `double_click`. + """ + + x: int + """The x-coordinate where the double click occurred.""" + + y: int + """The y-coordinate where the double click occurred.""" + + +class ActionDragPath(BaseModel): + """An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.""" + + x: int + """The x-coordinate.""" + + y: int + """The y-coordinate.""" + + +class ActionDrag(BaseModel): + """A drag action.""" + + path: List[ActionDragPath] + """An array of coordinates representing the path of the drag action. + + Coordinates will appear as an array of objects, eg + + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` + """ + + type: Literal["drag"] + """Specifies the event type. + + For a drag action, this property is always set to `drag`. + """ + + +class ActionKeypress(BaseModel): + """A collection of keypresses the model would like to perform.""" + + keys: List[str] + """The combination of keys the model is requesting to be pressed. + + This is an array of strings, each representing a key. + """ + + type: Literal["keypress"] + """Specifies the event type. + + For a keypress action, this property is always set to `keypress`. + """ + + +class ActionMove(BaseModel): + """A mouse move action.""" + + type: Literal["move"] + """Specifies the event type. + + For a move action, this property is always set to `move`. + """ + + x: int + """The x-coordinate to move to.""" + + y: int + """The y-coordinate to move to.""" + + +class ActionScreenshot(BaseModel): + """A screenshot action.""" + + type: Literal["screenshot"] + """Specifies the event type. + + For a screenshot action, this property is always set to `screenshot`. + """ + + +class ActionScroll(BaseModel): + """A scroll action.""" + + scroll_x: int + """The horizontal scroll distance.""" + + scroll_y: int + """The vertical scroll distance.""" + + type: Literal["scroll"] + """Specifies the event type. + + For a scroll action, this property is always set to `scroll`. + """ + + x: int + """The x-coordinate where the scroll occurred.""" + + y: int + """The y-coordinate where the scroll occurred.""" + + +class ActionType(BaseModel): + """An action to type in text.""" + + text: str + """The text to type.""" + + type: Literal["type"] + """Specifies the event type. + + For a type action, this property is always set to `type`. + """ + + +class ActionWait(BaseModel): + """A wait action.""" + + type: Literal["wait"] + """Specifies the event type. + + For a wait action, this property is always set to `wait`. + """ + + +Action: TypeAlias = Annotated[ + Union[ + ActionClick, + ActionDoubleClick, + ActionDrag, + ActionKeypress, + ActionMove, + ActionScreenshot, + ActionScroll, + ActionType, + ActionWait, + ], + PropertyInfo(discriminator="type"), +] + + +class PendingSafetyCheck(BaseModel): + """A pending safety check for the computer call.""" + + id: str + """The ID of the pending safety check.""" + + code: Optional[str] = None + """The type of the pending safety check.""" + + message: Optional[str] = None + """Details about the pending safety check.""" + + +class ResponseComputerToolCall(BaseModel): + """A tool call to a computer use tool. + + See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + """ + + id: str + """The unique ID of the computer call.""" + + action: Action + """A click action.""" + + call_id: str + """An identifier used when responding to the tool call with output.""" + + pending_safety_checks: List[PendingSafetyCheck] + """The pending safety checks for the computer call.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Literal["computer_call"] + """The type of the computer call. Always `computer_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_item.py new file mode 100644 index 0000000000000000000000000000000000000000..90e935c3bd846a597b9fdaa7c438ca355ed18aa0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_item.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_computer_tool_call_output_screenshot import ResponseComputerToolCallOutputScreenshot + +__all__ = ["ResponseComputerToolCallOutputItem", "AcknowledgedSafetyCheck"] + + +class AcknowledgedSafetyCheck(BaseModel): + """A pending safety check for the computer call.""" + + id: str + """The ID of the pending safety check.""" + + code: Optional[str] = None + """The type of the pending safety check.""" + + message: Optional[str] = None + """Details about the pending safety check.""" + + +class ResponseComputerToolCallOutputItem(BaseModel): + id: str + """The unique ID of the computer call tool output.""" + + call_id: str + """The ID of the computer tool call that produced the output.""" + + output: ResponseComputerToolCallOutputScreenshot + """A computer screenshot image used with the computer use tool.""" + + type: Literal["computer_call_output"] + """The type of the computer tool call output. Always `computer_call_output`.""" + + acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]] = None + """ + The safety checks reported by the API that have been acknowledged by the + developer. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot.py new file mode 100644 index 0000000000000000000000000000000000000000..2c16f215eb238680152a565f9786eb837d2e995c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseComputerToolCallOutputScreenshot"] + + +class ResponseComputerToolCallOutputScreenshot(BaseModel): + """A computer screenshot image used with the computer use tool.""" + + type: Literal["computer_screenshot"] + """Specifies the event type. + + For a computer screenshot, this property is always set to `computer_screenshot`. + """ + + file_id: Optional[str] = None + """The identifier of an uploaded file that contains the screenshot.""" + + image_url: Optional[str] = None + """The URL of the screenshot image.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot_param.py new file mode 100644 index 0000000000000000000000000000000000000000..857ccf9fb98e4e990559c3108830c82063082d6f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_output_screenshot_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseComputerToolCallOutputScreenshotParam"] + + +class ResponseComputerToolCallOutputScreenshotParam(TypedDict, total=False): + """A computer screenshot image used with the computer use tool.""" + + type: Required[Literal["computer_screenshot"]] + """Specifies the event type. + + For a computer screenshot, this property is always set to `computer_screenshot`. + """ + + file_id: str + """The identifier of an uploaded file that contains the screenshot.""" + + image_url: str + """The URL of the screenshot image.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..550ba599cde1835eb9a7f1d557392c9c7c8ebd83 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_computer_tool_call_param.py @@ -0,0 +1,235 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr + +__all__ = [ + "ResponseComputerToolCallParam", + "Action", + "ActionClick", + "ActionDoubleClick", + "ActionDrag", + "ActionDragPath", + "ActionKeypress", + "ActionMove", + "ActionScreenshot", + "ActionScroll", + "ActionType", + "ActionWait", + "PendingSafetyCheck", +] + + +class ActionClick(TypedDict, total=False): + """A click action.""" + + button: Required[Literal["left", "right", "wheel", "back", "forward"]] + """Indicates which mouse button was pressed during the click. + + One of `left`, `right`, `wheel`, `back`, or `forward`. + """ + + type: Required[Literal["click"]] + """Specifies the event type. For a click action, this property is always `click`.""" + + x: Required[int] + """The x-coordinate where the click occurred.""" + + y: Required[int] + """The y-coordinate where the click occurred.""" + + +class ActionDoubleClick(TypedDict, total=False): + """A double click action.""" + + type: Required[Literal["double_click"]] + """Specifies the event type. + + For a double click action, this property is always set to `double_click`. + """ + + x: Required[int] + """The x-coordinate where the double click occurred.""" + + y: Required[int] + """The y-coordinate where the double click occurred.""" + + +class ActionDragPath(TypedDict, total=False): + """An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.""" + + x: Required[int] + """The x-coordinate.""" + + y: Required[int] + """The y-coordinate.""" + + +class ActionDrag(TypedDict, total=False): + """A drag action.""" + + path: Required[Iterable[ActionDragPath]] + """An array of coordinates representing the path of the drag action. + + Coordinates will appear as an array of objects, eg + + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` + """ + + type: Required[Literal["drag"]] + """Specifies the event type. + + For a drag action, this property is always set to `drag`. + """ + + +class ActionKeypress(TypedDict, total=False): + """A collection of keypresses the model would like to perform.""" + + keys: Required[SequenceNotStr[str]] + """The combination of keys the model is requesting to be pressed. + + This is an array of strings, each representing a key. + """ + + type: Required[Literal["keypress"]] + """Specifies the event type. + + For a keypress action, this property is always set to `keypress`. + """ + + +class ActionMove(TypedDict, total=False): + """A mouse move action.""" + + type: Required[Literal["move"]] + """Specifies the event type. + + For a move action, this property is always set to `move`. + """ + + x: Required[int] + """The x-coordinate to move to.""" + + y: Required[int] + """The y-coordinate to move to.""" + + +class ActionScreenshot(TypedDict, total=False): + """A screenshot action.""" + + type: Required[Literal["screenshot"]] + """Specifies the event type. + + For a screenshot action, this property is always set to `screenshot`. + """ + + +class ActionScroll(TypedDict, total=False): + """A scroll action.""" + + scroll_x: Required[int] + """The horizontal scroll distance.""" + + scroll_y: Required[int] + """The vertical scroll distance.""" + + type: Required[Literal["scroll"]] + """Specifies the event type. + + For a scroll action, this property is always set to `scroll`. + """ + + x: Required[int] + """The x-coordinate where the scroll occurred.""" + + y: Required[int] + """The y-coordinate where the scroll occurred.""" + + +class ActionType(TypedDict, total=False): + """An action to type in text.""" + + text: Required[str] + """The text to type.""" + + type: Required[Literal["type"]] + """Specifies the event type. + + For a type action, this property is always set to `type`. + """ + + +class ActionWait(TypedDict, total=False): + """A wait action.""" + + type: Required[Literal["wait"]] + """Specifies the event type. + + For a wait action, this property is always set to `wait`. + """ + + +Action: TypeAlias = Union[ + ActionClick, + ActionDoubleClick, + ActionDrag, + ActionKeypress, + ActionMove, + ActionScreenshot, + ActionScroll, + ActionType, + ActionWait, +] + + +class PendingSafetyCheck(TypedDict, total=False): + """A pending safety check for the computer call.""" + + id: Required[str] + """The ID of the pending safety check.""" + + code: Optional[str] + """The type of the pending safety check.""" + + message: Optional[str] + """Details about the pending safety check.""" + + +class ResponseComputerToolCallParam(TypedDict, total=False): + """A tool call to a computer use tool. + + See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + """ + + id: Required[str] + """The unique ID of the computer call.""" + + action: Required[Action] + """A click action.""" + + call_id: Required[str] + """An identifier used when responding to the tool call with output.""" + + pending_safety_checks: Required[Iterable[PendingSafetyCheck]] + """The pending safety checks for the computer call.""" + + status: Required[Literal["in_progress", "completed", "incomplete"]] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Required[Literal["computer_call"]] + """The type of the computer call. Always `computer_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_added_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_added_event.py new file mode 100644 index 0000000000000000000000000000000000000000..ec9893159d8dc16d15417150dcbeef81404d9ce1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_added_event.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_output_text import ResponseOutputText +from .response_output_refusal import ResponseOutputRefusal + +__all__ = ["ResponseContentPartAddedEvent", "Part", "PartReasoningText"] + + +class PartReasoningText(BaseModel): + """Reasoning text from the model.""" + + text: str + """The reasoning text from the model.""" + + type: Literal["reasoning_text"] + """The type of the reasoning text. Always `reasoning_text`.""" + + +Part: TypeAlias = Annotated[ + Union[ResponseOutputText, ResponseOutputRefusal, PartReasoningText], PropertyInfo(discriminator="type") +] + + +class ResponseContentPartAddedEvent(BaseModel): + """Emitted when a new content part is added.""" + + content_index: int + """The index of the content part that was added.""" + + item_id: str + """The ID of the output item that the content part was added to.""" + + output_index: int + """The index of the output item that the content part was added to.""" + + part: Part + """The content part that was added.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.content_part.added"] + """The type of the event. Always `response.content_part.added`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..f896ad8743c5c07be6ac63574f8ec7f3d7b97f9a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_content_part_done_event.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_output_text import ResponseOutputText +from .response_output_refusal import ResponseOutputRefusal + +__all__ = ["ResponseContentPartDoneEvent", "Part", "PartReasoningText"] + + +class PartReasoningText(BaseModel): + """Reasoning text from the model.""" + + text: str + """The reasoning text from the model.""" + + type: Literal["reasoning_text"] + """The type of the reasoning text. Always `reasoning_text`.""" + + +Part: TypeAlias = Annotated[ + Union[ResponseOutputText, ResponseOutputRefusal, PartReasoningText], PropertyInfo(discriminator="type") +] + + +class ResponseContentPartDoneEvent(BaseModel): + """Emitted when a content part is done.""" + + content_index: int + """The index of the content part that is done.""" + + item_id: str + """The ID of the output item that the content part was added to.""" + + output_index: int + """The index of the output item that the content part was added to.""" + + part: Part + """The content part that is done.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.content_part.done"] + """The type of the event. Always `response.content_part.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_conversation_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_conversation_param.py new file mode 100644 index 0000000000000000000000000000000000000000..d1587fe68a7932a8037f5efcaf5467362f46d896 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_conversation_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ResponseConversationParam"] + + +class ResponseConversationParam(TypedDict, total=False): + """The conversation that this response belongs to.""" + + id: Required[str] + """The unique ID of the conversation.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_create_params.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..15844c65979049a20eb5abf1e7038e2557fbb87e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_create_params.py @@ -0,0 +1,336 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .tool_param import ToolParam +from .response_includable import ResponseIncludable +from .tool_choice_options import ToolChoiceOptions +from .response_input_param import ResponseInputParam +from .response_prompt_param import ResponsePromptParam +from .tool_choice_mcp_param import ToolChoiceMcpParam +from ..shared_params.metadata import Metadata +from .tool_choice_shell_param import ToolChoiceShellParam +from .tool_choice_types_param import ToolChoiceTypesParam +from ..shared_params.reasoning import Reasoning +from .tool_choice_custom_param import ToolChoiceCustomParam +from .tool_choice_allowed_param import ToolChoiceAllowedParam +from .response_text_config_param import ResponseTextConfigParam +from .tool_choice_function_param import ToolChoiceFunctionParam +from .response_conversation_param import ResponseConversationParam +from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam +from ..shared_params.responses_model import ResponsesModel + +__all__ = [ + "ResponseCreateParamsBase", + "Conversation", + "StreamOptions", + "ToolChoice", + "ResponseCreateParamsNonStreaming", + "ResponseCreateParamsStreaming", +] + + +class ResponseCreateParamsBase(TypedDict, total=False): + background: Optional[bool] + """ + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). + """ + + conversation: Optional[Conversation] + """The conversation that this response belongs to. + + Items from this conversation are prepended to `input_items` for this response + request. Input items and output items from this response are automatically added + to this conversation after this response completes. + """ + + include: Optional[List[ResponseIncludable]] + """Specify additional output data to include in the model response. + + Currently supported values are: + + - `web_search_call.action.sources`: Include the sources of the web search tool + call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution + in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer + call output. + - `file_search_call.results`: Include the search results of the file search tool + call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning + tokens in reasoning item outputs. This enables reasoning items to be used in + multi-turn conversations when using the Responses API statelessly (like when + the `store` parameter is set to `false`, or when an organization is enrolled + in the zero data retention program). + """ + + input: Union[str, ResponseInputParam] + """Text, image, or file inputs to the model, used to generate a response. + + Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Image inputs](https://platform.openai.com/docs/guides/images) + - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + - [Function calling](https://platform.openai.com/docs/guides/function-calling) + """ + + instructions: Optional[str] + """A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple to + swap out system (or developer) messages in new responses. + """ + + max_output_tokens: Optional[int] + """ + An upper bound for the number of tokens that can be generated for a response, + including visible output tokens and + [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + """ + + max_tool_calls: Optional[int] + """ + The maximum number of total calls to built-in tools that can be processed in a + response. This maximum number applies across all built-in tool calls, not per + individual tool. Any further attempts to call a tool by the model will be + ignored. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: ResponsesModel + """Model ID used to generate the response, like `gpt-4o` or `o3`. + + OpenAI offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the + [model guide](https://platform.openai.com/docs/models) to browse and compare + available models. + """ + + parallel_tool_calls: Optional[bool] + """Whether to allow the model to run tool calls in parallel.""" + + previous_response_id: Optional[str] + """The unique ID of the previous response to the model. + + Use this to create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). + Cannot be used in conjunction with `conversation`. + """ + + prompt: Optional[ResponsePromptParam] + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + prompt_cache_key: str + """ + Used by OpenAI to cache responses for similar requests to optimize your cache + hit rates. Replaces the `user` field. + [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + """ + + prompt_cache_retention: Optional[Literal["in-memory", "24h"]] + """The retention policy for the prompt cache. + + Set to `24h` to enable extended prompt caching, which keeps cached prefixes + active for longer, up to a maximum of 24 hours. + [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + """ + + reasoning: Optional[Reasoning] + """**gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + """ + + safety_identifier: str + """ + A stable identifier used to help detect users of your application that may be + violating OpenAI's usage policies. The IDs should be a string that uniquely + identifies each user. We recommend hashing their username or email address, in + order to avoid sending us any identifying information. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + """ + + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + """Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier + configured in the Project settings. Unless otherwise configured, the Project + will use 'default'. + - If set to 'default', then the request will be processed with the standard + pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or + '[priority](https://openai.com/api-priority-processing/)', then the request + will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the + `service_tier` value based on the processing mode actually used to serve the + request. This response value may be different from the value set in the + parameter. + """ + + store: Optional[bool] + """Whether to store the generated model response for later retrieval via API.""" + + stream_options: Optional[StreamOptions] + """Options for streaming responses. Only set this when you set `stream: true`.""" + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. We generally recommend altering + this or `top_p` but not both. + """ + + text: ResponseTextConfigParam + """Configuration options for a text response from the model. + + Can be plain text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + tool_choice: ToolChoice + """ + How the model should select which tool (or tools) to use when generating a + response. See the `tools` parameter to see how to specify which tools the model + can call. + """ + + tools: Iterable[ToolParam] + """An array of tools the model may call while generating a response. + + You can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + capabilities, like + [web search](https://platform.openai.com/docs/guides/tools-web-search) or + [file search](https://platform.openai.com/docs/guides/tools-file-search). + Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers or + predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, enabling + the model to call your own code with strongly typed arguments and outputs. + Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). + You can also use custom tools to call your own code. + """ + + top_logprobs: Optional[int] + """ + An integer between 0 and 20 specifying the number of most likely tokens to + return at each token position, each with an associated log probability. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + """ + + truncation: Optional[Literal["auto", "disabled"]] + """The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds the model's context window size, + the model will truncate the response to fit the context window by dropping + items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window size + for a model, the request will fail with a 400 error. + """ + + user: str + """This field is being replaced by `safety_identifier` and `prompt_cache_key`. + + Use `prompt_cache_key` instead to maintain caching optimizations. A stable + identifier for your end-users. Used to boost cache hit rates by better bucketing + similar requests and to help OpenAI detect and prevent abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + """ + + +Conversation: TypeAlias = Union[str, ResponseConversationParam] + + +class StreamOptions(TypedDict, total=False): + """Options for streaming responses. Only set this when you set `stream: true`.""" + + include_obfuscation: bool + """When true, stream obfuscation will be enabled. + + Stream obfuscation adds random characters to an `obfuscation` field on streaming + delta events to normalize payload sizes as a mitigation to certain side-channel + attacks. These obfuscation fields are included by default, but add a small + amount of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between your + application and the OpenAI API. + """ + + +ToolChoice: TypeAlias = Union[ + ToolChoiceOptions, + ToolChoiceAllowedParam, + ToolChoiceTypesParam, + ToolChoiceFunctionParam, + ToolChoiceMcpParam, + ToolChoiceCustomParam, + ToolChoiceApplyPatchParam, + ToolChoiceShellParam, +] + + +class ResponseCreateParamsNonStreaming(ResponseCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + for more information. + """ + + +class ResponseCreateParamsStreaming(ResponseCreateParamsBase): + stream: Required[Literal[True]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + for more information. + """ + + +ResponseCreateParams = Union[ResponseCreateParamsNonStreaming, ResponseCreateParamsStreaming] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_created_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_created_event.py new file mode 100644 index 0000000000000000000000000000000000000000..308b2f49160dd1d081c3fa2b10214f41bde47399 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_created_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseCreatedEvent"] + + +class ResponseCreatedEvent(BaseModel): + """An event that is emitted when a response is created.""" + + response: Response + """The response that was created.""" + + sequence_number: int + """The sequence number for this event.""" + + type: Literal["response.created"] + """The type of the event. Always `response.created`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..f05743966ef7c4f33b213fca2125074442684fdc --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCustomToolCall"] + + +class ResponseCustomToolCall(BaseModel): + """A call to a custom tool created by the model.""" + + call_id: str + """An identifier used to map this custom tool call to a tool call output.""" + + input: str + """The input for the custom tool call generated by the model.""" + + name: str + """The name of the custom tool being called.""" + + type: Literal["custom_tool_call"] + """The type of the custom tool call. Always `custom_tool_call`.""" + + id: Optional[str] = None + """The unique ID of the custom tool call in the OpenAI platform.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..7473d33d9a10d3e0fe06f74e2978f6190b5bb77f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_delta_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCustomToolCallInputDeltaEvent"] + + +class ResponseCustomToolCallInputDeltaEvent(BaseModel): + """Event representing a delta (partial update) to the input of a custom tool call.""" + + delta: str + """The incremental input data (delta) for the custom tool call.""" + + item_id: str + """Unique identifier for the API item associated with this event.""" + + output_index: int + """The index of the output this delta applies to.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.custom_tool_call_input.delta"] + """The event type identifier.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..be47ae8e96794b308fb48a6d091a8f06ef7c066c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_input_done_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseCustomToolCallInputDoneEvent"] + + +class ResponseCustomToolCallInputDoneEvent(BaseModel): + """Event indicating that input for a custom tool call is complete.""" + + input: str + """The complete input data for the custom tool call.""" + + item_id: str + """Unique identifier for the API item associated with this event.""" + + output_index: int + """The index of the output this event applies to.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.custom_tool_call_input.done"] + """The event type identifier.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output.py new file mode 100644 index 0000000000000000000000000000000000000000..833956493b8ad69efdaf9fdba15d57b343aeccca --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_input_file import ResponseInputFile +from .response_input_text import ResponseInputText +from .response_input_image import ResponseInputImage + +__all__ = ["ResponseCustomToolCallOutput", "OutputOutputContentList"] + +OutputOutputContentList: TypeAlias = Annotated[ + Union[ResponseInputText, ResponseInputImage, ResponseInputFile], PropertyInfo(discriminator="type") +] + + +class ResponseCustomToolCallOutput(BaseModel): + """The output of a custom tool call from your code, being sent back to the model.""" + + call_id: str + """The call ID, used to map this custom tool call output to a custom tool call.""" + + output: Union[str, List[OutputOutputContentList]] + """ + The output from the custom tool call generated by your code. Can be a string or + an list of output content. + """ + + type: Literal["custom_tool_call_output"] + """The type of the custom tool call output. Always `custom_tool_call_output`.""" + + id: Optional[str] = None + """The unique ID of the custom tool call output in the OpenAI platform.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output_param.py new file mode 100644 index 0000000000000000000000000000000000000000..db0034216acb625298024c4d95214b7e81de8868 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_output_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .response_input_file_param import ResponseInputFileParam +from .response_input_text_param import ResponseInputTextParam +from .response_input_image_param import ResponseInputImageParam + +__all__ = ["ResponseCustomToolCallOutputParam", "OutputOutputContentList"] + +OutputOutputContentList: TypeAlias = Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] + + +class ResponseCustomToolCallOutputParam(TypedDict, total=False): + """The output of a custom tool call from your code, being sent back to the model.""" + + call_id: Required[str] + """The call ID, used to map this custom tool call output to a custom tool call.""" + + output: Required[Union[str, Iterable[OutputOutputContentList]]] + """ + The output from the custom tool call generated by your code. Can be a string or + an list of output content. + """ + + type: Required[Literal["custom_tool_call_output"]] + """The type of the custom tool call output. Always `custom_tool_call_output`.""" + + id: str + """The unique ID of the custom tool call output in the OpenAI platform.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..5d4ce3376c39b60cac40f8ea9f41532f8d9d86a3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_custom_tool_call_param.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseCustomToolCallParam"] + + +class ResponseCustomToolCallParam(TypedDict, total=False): + """A call to a custom tool created by the model.""" + + call_id: Required[str] + """An identifier used to map this custom tool call to a tool call output.""" + + input: Required[str] + """The input for the custom tool call generated by the model.""" + + name: Required[str] + """The name of the custom tool being called.""" + + type: Required[Literal["custom_tool_call"]] + """The type of the custom tool call. Always `custom_tool_call`.""" + + id: str + """The unique ID of the custom tool call in the OpenAI platform.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_error.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_error.py new file mode 100644 index 0000000000000000000000000000000000000000..90958d1c13032e2f9a1e62177bc69f191d968154 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_error.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseError"] + + +class ResponseError(BaseModel): + """An error object returned when the model fails to generate a Response.""" + + code: Literal[ + "server_error", + "rate_limit_exceeded", + "invalid_prompt", + "vector_store_timeout", + "invalid_image", + "invalid_image_format", + "invalid_base64_image", + "invalid_image_url", + "image_too_large", + "image_too_small", + "image_parse_error", + "image_content_policy_violation", + "invalid_image_mode", + "image_file_too_large", + "unsupported_image_media_type", + "empty_image_file", + "failed_to_download_image", + "image_file_not_found", + ] + """The error code for the response.""" + + message: str + """A human-readable description of the error.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_error_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_error_event.py new file mode 100644 index 0000000000000000000000000000000000000000..1789f731b4fe325937b1cf57764bcc5eef48e41a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_error_event.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseErrorEvent"] + + +class ResponseErrorEvent(BaseModel): + """Emitted when an error occurs.""" + + code: Optional[str] = None + """The error code.""" + + message: str + """The error message.""" + + param: Optional[str] = None + """The error parameter.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["error"] + """The type of the event. Always `error`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_failed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_failed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..2232c9678dbf11e8b29255419e95bcba33993308 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_failed_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseFailedEvent"] + + +class ResponseFailedEvent(BaseModel): + """An event that is emitted when a response fails.""" + + response: Response + """The response that failed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.failed"] + """The type of the event. Always `response.failed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..88ffa5ac56b09e895311acb639d3b0641f3c6e6a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_completed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFileSearchCallCompletedEvent"] + + +class ResponseFileSearchCallCompletedEvent(BaseModel): + """Emitted when a file search call is completed (results found).""" + + item_id: str + """The ID of the output item that the file search call is initiated.""" + + output_index: int + """The index of the output item that the file search call is initiated.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.file_search_call.completed"] + """The type of the event. Always `response.file_search_call.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..4f3504fda4b57e8675923969a59a18709d0ba6a3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_in_progress_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFileSearchCallInProgressEvent"] + + +class ResponseFileSearchCallInProgressEvent(BaseModel): + """Emitted when a file search call is initiated.""" + + item_id: str + """The ID of the output item that the file search call is initiated.""" + + output_index: int + """The index of the output item that the file search call is initiated.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.file_search_call.in_progress"] + """The type of the event. Always `response.file_search_call.in_progress`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_searching_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_searching_event.py new file mode 100644 index 0000000000000000000000000000000000000000..5bf1a076dd46a7d411a0cc61c84ccc75a7826b51 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_call_searching_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFileSearchCallSearchingEvent"] + + +class ResponseFileSearchCallSearchingEvent(BaseModel): + """Emitted when a file search is currently searching.""" + + item_id: str + """The ID of the output item that the file search call is initiated.""" + + output_index: int + """The index of the output item that the file search call is searching.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.file_search_call.searching"] + """The type of the event. Always `response.file_search_call.searching`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..fa45631345283f21170d95506a7f2c21a14fa3e0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFileSearchToolCall", "Result"] + + +class Result(BaseModel): + attributes: Optional[Dict[str, Union[str, float, bool]]] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. Keys are + strings with a maximum length of 64 characters. Values are strings with a + maximum length of 512 characters, booleans, or numbers. + """ + + file_id: Optional[str] = None + """The unique ID of the file.""" + + filename: Optional[str] = None + """The name of the file.""" + + score: Optional[float] = None + """The relevance score of the file - a value between 0 and 1.""" + + text: Optional[str] = None + """The text that was retrieved from the file.""" + + +class ResponseFileSearchToolCall(BaseModel): + """The results of a file search tool call. + + See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + """ + + id: str + """The unique ID of the file search tool call.""" + + queries: List[str] + """The queries used to search for files.""" + + status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] + """The status of the file search tool call. + + One of `in_progress`, `searching`, `incomplete` or `failed`, + """ + + type: Literal["file_search_call"] + """The type of the file search tool call. Always `file_search_call`.""" + + results: Optional[List[Result]] = None + """The results of the file search tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..45a5bbb48637f43b46f82989d249e68e9c97de6e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_file_search_tool_call_param.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["ResponseFileSearchToolCallParam", "Result"] + + +class Result(TypedDict, total=False): + attributes: Optional[Dict[str, Union[str, float, bool]]] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. Keys are + strings with a maximum length of 64 characters. Values are strings with a + maximum length of 512 characters, booleans, or numbers. + """ + + file_id: str + """The unique ID of the file.""" + + filename: str + """The name of the file.""" + + score: float + """The relevance score of the file - a value between 0 and 1.""" + + text: str + """The text that was retrieved from the file.""" + + +class ResponseFileSearchToolCallParam(TypedDict, total=False): + """The results of a file search tool call. + + See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + """ + + id: Required[str] + """The unique ID of the file search tool call.""" + + queries: Required[SequenceNotStr[str]] + """The queries used to search for files.""" + + status: Required[Literal["in_progress", "searching", "completed", "incomplete", "failed"]] + """The status of the file search tool call. + + One of `in_progress`, `searching`, `incomplete` or `failed`, + """ + + type: Required[Literal["file_search_call"]] + """The type of the file search tool call. Always `file_search_call`.""" + + results: Optional[Iterable[Result]] + """The results of the file search tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config.py new file mode 100644 index 0000000000000000000000000000000000000000..a4896bf9fed2ff9e47277ea5b379710bbffb36b0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..shared.response_format_text import ResponseFormatText +from ..shared.response_format_json_object import ResponseFormatJSONObject +from .response_format_text_json_schema_config import ResponseFormatTextJSONSchemaConfig + +__all__ = ["ResponseFormatTextConfig"] + +ResponseFormatTextConfig: TypeAlias = Annotated[ + Union[ResponseFormatText, ResponseFormatTextJSONSchemaConfig, ResponseFormatJSONObject], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..fcaf8f3fb6b9e5b3d4c349ed54f1186840d66ea9 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_config_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from ..shared_params.response_format_text import ResponseFormatText +from ..shared_params.response_format_json_object import ResponseFormatJSONObject +from .response_format_text_json_schema_config_param import ResponseFormatTextJSONSchemaConfigParam + +__all__ = ["ResponseFormatTextConfigParam"] + +ResponseFormatTextConfigParam: TypeAlias = Union[ + ResponseFormatText, ResponseFormatTextJSONSchemaConfigParam, ResponseFormatJSONObject +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config.py new file mode 100644 index 0000000000000000000000000000000000000000..b953112621333c726257d1fbb178a9b87490692e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ResponseFormatTextJSONSchemaConfig"] + + +class ResponseFormatTextJSONSchemaConfig(BaseModel): + """JSON Schema response format. + + Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + """ + + name: str + """The name of the response format. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + schema_: Dict[str, object] = FieldInfo(alias="schema") + """ + The schema for the response format, described as a JSON Schema object. Learn how + to build JSON schemas [here](https://json-schema.org/). + """ + + type: Literal["json_schema"] + """The type of response format being defined. Always `json_schema`.""" + + description: Optional[str] = None + """ + A description of what the response format is for, used by the model to determine + how to respond in the format. + """ + + strict: Optional[bool] = None + """ + Whether to enable strict schema adherence when generating the output. If set to + true, the model will always follow the exact schema defined in the `schema` + field. Only a subset of JSON Schema is supported when `strict` is `true`. To + learn more, read the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..6f5c6331060c9b69bdec61225c4c512517de9555 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_format_text_json_schema_config_param.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseFormatTextJSONSchemaConfigParam"] + + +class ResponseFormatTextJSONSchemaConfigParam(TypedDict, total=False): + """JSON Schema response format. + + Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + """ + + name: Required[str] + """The name of the response format. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + schema: Required[Dict[str, object]] + """ + The schema for the response format, described as a JSON Schema object. Learn how + to build JSON schemas [here](https://json-schema.org/). + """ + + type: Required[Literal["json_schema"]] + """The type of response format being defined. Always `json_schema`.""" + + description: str + """ + A description of what the response format is for, used by the model to determine + how to respond in the format. + """ + + strict: Optional[bool] + """ + Whether to enable strict schema adherence when generating the output. If set to + true, the model will always follow the exact schema defined in the `schema` + field. Only a subset of JSON Schema is supported when `strict` is `true`. To + learn more, read the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..0798c2e12378ffba43e2184455d30a2725961d70 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_delta_event.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFunctionCallArgumentsDeltaEvent"] + + +class ResponseFunctionCallArgumentsDeltaEvent(BaseModel): + """Emitted when there is a partial function-call arguments delta.""" + + delta: str + """The function-call arguments delta that is added.""" + + item_id: str + """The ID of the output item that the function-call arguments delta is added to.""" + + output_index: int + """ + The index of the output item that the function-call arguments delta is added to. + """ + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.function_call_arguments.delta"] + """The type of the event. Always `response.function_call_arguments.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..543cd073a20426e52eaed4034645b87918cc63fd --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_arguments_done_event.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFunctionCallArgumentsDoneEvent"] + + +class ResponseFunctionCallArgumentsDoneEvent(BaseModel): + """Emitted when function-call arguments are finalized.""" + + arguments: str + """The function-call arguments.""" + + item_id: str + """The ID of the item.""" + + name: str + """The name of the function that was called.""" + + output_index: int + """The index of the output item.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.function_call_arguments.done"] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item.py new file mode 100644 index 0000000000000000000000000000000000000000..41898f9eda7fca96bcafa7c2d342103c14601d4b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .response_input_file_content import ResponseInputFileContent +from .response_input_text_content import ResponseInputTextContent +from .response_input_image_content import ResponseInputImageContent + +__all__ = ["ResponseFunctionCallOutputItem"] + +ResponseFunctionCallOutputItem: TypeAlias = Annotated[ + Union[ResponseInputTextContent, ResponseInputImageContent, ResponseInputFileContent], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list.py new file mode 100644 index 0000000000000000000000000000000000000000..13db577160b100688488bf0703ceed84b0ddde50 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .response_function_call_output_item import ResponseFunctionCallOutputItem + +__all__ = ["ResponseFunctionCallOutputItemList"] + +ResponseFunctionCallOutputItemList: TypeAlias = List[ResponseFunctionCallOutputItem] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8c286d3cf097e431b0cb2af09daa5f6468ac1c3b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_list_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import TypeAlias + +from .response_input_file_content_param import ResponseInputFileContentParam +from .response_input_text_content_param import ResponseInputTextContentParam +from .response_input_image_content_param import ResponseInputImageContentParam + +__all__ = ["ResponseFunctionCallOutputItemListParam", "ResponseFunctionCallOutputItemParam"] + +ResponseFunctionCallOutputItemParam: TypeAlias = Union[ + ResponseInputTextContentParam, ResponseInputImageContentParam, ResponseInputFileContentParam +] + +ResponseFunctionCallOutputItemListParam: TypeAlias = List[ResponseFunctionCallOutputItemParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2a703cac1eda5920aefb02130301e539261db011 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_call_output_item_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .response_input_file_content_param import ResponseInputFileContentParam +from .response_input_text_content_param import ResponseInputTextContentParam +from .response_input_image_content_param import ResponseInputImageContentParam + +__all__ = ["ResponseFunctionCallOutputItemParam"] + +ResponseFunctionCallOutputItemParam: TypeAlias = Union[ + ResponseInputTextContentParam, ResponseInputImageContentParam, ResponseInputFileContentParam +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content.py new file mode 100644 index 0000000000000000000000000000000000000000..dae48f14da26d08f4942c732201f2bf7370fd1c9 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["ResponseFunctionShellCallOutputContent", "Outcome", "OutcomeTimeout", "OutcomeExit"] + + +class OutcomeTimeout(BaseModel): + """Indicates that the shell call exceeded its configured time limit.""" + + type: Literal["timeout"] + """The outcome type. Always `timeout`.""" + + +class OutcomeExit(BaseModel): + """Indicates that the shell commands finished and returned an exit code.""" + + exit_code: int + """The exit code returned by the shell process.""" + + type: Literal["exit"] + """The outcome type. Always `exit`.""" + + +Outcome: TypeAlias = Annotated[Union[OutcomeTimeout, OutcomeExit], PropertyInfo(discriminator="type")] + + +class ResponseFunctionShellCallOutputContent(BaseModel): + """Captured stdout and stderr for a portion of a shell tool call output.""" + + outcome: Outcome + """The exit or timeout outcome associated with this shell call.""" + + stderr: str + """Captured stderr output for the shell call.""" + + stdout: str + """Captured stdout output for the shell call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4d8ea70d08ab932fb4e72352bddc14c1cef758c4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_call_output_content_param.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["ResponseFunctionShellCallOutputContentParam", "Outcome", "OutcomeTimeout", "OutcomeExit"] + + +class OutcomeTimeout(TypedDict, total=False): + """Indicates that the shell call exceeded its configured time limit.""" + + type: Required[Literal["timeout"]] + """The outcome type. Always `timeout`.""" + + +class OutcomeExit(TypedDict, total=False): + """Indicates that the shell commands finished and returned an exit code.""" + + exit_code: Required[int] + """The exit code returned by the shell process.""" + + type: Required[Literal["exit"]] + """The outcome type. Always `exit`.""" + + +Outcome: TypeAlias = Union[OutcomeTimeout, OutcomeExit] + + +class ResponseFunctionShellCallOutputContentParam(TypedDict, total=False): + """Captured stdout and stderr for a portion of a shell tool call output.""" + + outcome: Required[Outcome] + """The exit or timeout outcome associated with this shell call.""" + + stderr: Required[str] + """Captured stderr output for the shell call.""" + + stdout: Required[str] + """Captured stdout output for the shell call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..7c6a184ed49e021cc4ff5822c81ff6f88881dc04 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFunctionShellToolCall", "Action"] + + +class Action(BaseModel): + """The shell commands and limits that describe how to run the tool call.""" + + commands: List[str] + + max_output_length: Optional[int] = None + """Optional maximum number of characters to return from each command.""" + + timeout_ms: Optional[int] = None + """Optional timeout in milliseconds for the commands.""" + + +class ResponseFunctionShellToolCall(BaseModel): + """A tool call that executes one or more shell commands in a managed environment.""" + + id: str + """The unique ID of the shell tool call. + + Populated when this item is returned via API. + """ + + action: Action + """The shell commands and limits that describe how to run the tool call.""" + + call_id: str + """The unique ID of the shell tool call generated by the model.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the shell call. + + One of `in_progress`, `completed`, or `incomplete`. + """ + + type: Literal["shell_call"] + """The type of the item. Always `shell_call`.""" + + created_by: Optional[str] = None + """The ID of the entity that created this tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call_output.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call_output.py new file mode 100644 index 0000000000000000000000000000000000000000..5523d57ba7367d75406f5abcbf357a100db7a98e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_shell_tool_call_output.py @@ -0,0 +1,82 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ResponseFunctionShellToolCallOutput", + "Output", + "OutputOutcome", + "OutputOutcomeTimeout", + "OutputOutcomeExit", +] + + +class OutputOutcomeTimeout(BaseModel): + """Indicates that the shell call exceeded its configured time limit.""" + + type: Literal["timeout"] + """The outcome type. Always `timeout`.""" + + +class OutputOutcomeExit(BaseModel): + """Indicates that the shell commands finished and returned an exit code.""" + + exit_code: int + """Exit code from the shell process.""" + + type: Literal["exit"] + """The outcome type. Always `exit`.""" + + +OutputOutcome: TypeAlias = Annotated[Union[OutputOutcomeTimeout, OutputOutcomeExit], PropertyInfo(discriminator="type")] + + +class Output(BaseModel): + """The content of a shell tool call output that was emitted.""" + + outcome: OutputOutcome + """ + Represents either an exit outcome (with an exit code) or a timeout outcome for a + shell call output chunk. + """ + + stderr: str + """The standard error output that was captured.""" + + stdout: str + """The standard output that was captured.""" + + created_by: Optional[str] = None + """The identifier of the actor that created the item.""" + + +class ResponseFunctionShellToolCallOutput(BaseModel): + """The output of a shell tool call that was emitted.""" + + id: str + """The unique ID of the shell call output. + + Populated when this item is returned via API. + """ + + call_id: str + """The unique ID of the shell tool call generated by the model.""" + + max_output_length: Optional[int] = None + """The maximum length of the shell command output. + + This is generated by the model and should be passed back with the raw output. + """ + + output: List[Output] + """An array of shell call output contents""" + + type: Literal["shell_call_output"] + """The type of the shell call output. Always `shell_call_output`.""" + + created_by: Optional[str] = None + """The identifier of the actor that created the item.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..194e3f7d6a795b04ae65e2ecff955cef3d76748f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFunctionToolCall"] + + +class ResponseFunctionToolCall(BaseModel): + """A tool call to run a function. + + See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + """ + + arguments: str + """A JSON string of the arguments to pass to the function.""" + + call_id: str + """The unique ID of the function tool call generated by the model.""" + + name: str + """The name of the function to run.""" + + type: Literal["function_call"] + """The type of the function tool call. Always `function_call`.""" + + id: Optional[str] = None + """The unique ID of the function tool call.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_item.py new file mode 100644 index 0000000000000000000000000000000000000000..3df299e5121db848b8c215e05cea754b688e3fd7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_item.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .response_function_tool_call import ResponseFunctionToolCall + +__all__ = ["ResponseFunctionToolCallItem"] + + +class ResponseFunctionToolCallItem(ResponseFunctionToolCall): + """A tool call to run a function. + + See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + """ + + id: str # type: ignore + """The unique ID of the function tool call.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_output_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_output_item.py new file mode 100644 index 0000000000000000000000000000000000000000..1a2c848cb3314c4ba29ee755d47f464c047e0c33 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_output_item.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_input_file import ResponseInputFile +from .response_input_text import ResponseInputText +from .response_input_image import ResponseInputImage + +__all__ = ["ResponseFunctionToolCallOutputItem", "OutputOutputContentList"] + +OutputOutputContentList: TypeAlias = Annotated[ + Union[ResponseInputText, ResponseInputImage, ResponseInputFile], PropertyInfo(discriminator="type") +] + + +class ResponseFunctionToolCallOutputItem(BaseModel): + id: str + """The unique ID of the function call tool output.""" + + call_id: str + """The unique ID of the function tool call generated by the model.""" + + output: Union[str, List[OutputOutputContentList]] + """ + The output from the function call generated by your code. Can be a string or an + list of output content. + """ + + type: Literal["function_call_output"] + """The type of the function tool call output. Always `function_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4e8dd3d629326598f58c8928da5606bd2193042c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_tool_call_param.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseFunctionToolCallParam"] + + +class ResponseFunctionToolCallParam(TypedDict, total=False): + """A tool call to run a function. + + See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + """ + + arguments: Required[str] + """A JSON string of the arguments to pass to the function.""" + + call_id: Required[str] + """The unique ID of the function tool call generated by the model.""" + + name: Required[str] + """The name of the function to run.""" + + type: Required[Literal["function_call"]] + """The type of the function tool call. Always `function_call`.""" + + id: str + """The unique ID of the function tool call.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search.py new file mode 100644 index 0000000000000000000000000000000000000000..0cb7e0b0d1594fc9e48d6847b56a50f46f77d47f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search.py @@ -0,0 +1,84 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["ResponseFunctionWebSearch", "Action", "ActionSearch", "ActionSearchSource", "ActionOpenPage", "ActionFind"] + + +class ActionSearchSource(BaseModel): + """A source used in the search.""" + + type: Literal["url"] + """The type of source. Always `url`.""" + + url: str + """The URL of the source.""" + + +class ActionSearch(BaseModel): + """Action type "search" - Performs a web search query.""" + + query: str + """[DEPRECATED] The search query.""" + + type: Literal["search"] + """The action type.""" + + queries: Optional[List[str]] = None + """The search queries.""" + + sources: Optional[List[ActionSearchSource]] = None + """The sources used in the search.""" + + +class ActionOpenPage(BaseModel): + """Action type "open_page" - Opens a specific URL from search results.""" + + type: Literal["open_page"] + """The action type.""" + + url: str + """The URL opened by the model.""" + + +class ActionFind(BaseModel): + """Action type "find": Searches for a pattern within a loaded page.""" + + pattern: str + """The pattern or text to search for within the page.""" + + type: Literal["find"] + """The action type.""" + + url: str + """The URL of the page searched for the pattern.""" + + +Action: TypeAlias = Annotated[Union[ActionSearch, ActionOpenPage, ActionFind], PropertyInfo(discriminator="type")] + + +class ResponseFunctionWebSearch(BaseModel): + """The results of a web search tool call. + + See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + """ + + id: str + """The unique ID of the web search tool call.""" + + action: Action + """ + An object describing the specific action taken in this web search call. Includes + details on how the model used the web (search, open_page, find). + """ + + status: Literal["in_progress", "searching", "completed", "failed"] + """The status of the web search tool call.""" + + type: Literal["web_search_call"] + """The type of the web search tool call. Always `web_search_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7db3e3c8330d3c5e002ed86cb9e3a0337c92b107 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_function_web_search_param.py @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr + +__all__ = [ + "ResponseFunctionWebSearchParam", + "Action", + "ActionSearch", + "ActionSearchSource", + "ActionOpenPage", + "ActionFind", +] + + +class ActionSearchSource(TypedDict, total=False): + """A source used in the search.""" + + type: Required[Literal["url"]] + """The type of source. Always `url`.""" + + url: Required[str] + """The URL of the source.""" + + +class ActionSearch(TypedDict, total=False): + """Action type "search" - Performs a web search query.""" + + query: Required[str] + """[DEPRECATED] The search query.""" + + type: Required[Literal["search"]] + """The action type.""" + + queries: SequenceNotStr[str] + """The search queries.""" + + sources: Iterable[ActionSearchSource] + """The sources used in the search.""" + + +class ActionOpenPage(TypedDict, total=False): + """Action type "open_page" - Opens a specific URL from search results.""" + + type: Required[Literal["open_page"]] + """The action type.""" + + url: Required[str] + """The URL opened by the model.""" + + +class ActionFind(TypedDict, total=False): + """Action type "find": Searches for a pattern within a loaded page.""" + + pattern: Required[str] + """The pattern or text to search for within the page.""" + + type: Required[Literal["find"]] + """The action type.""" + + url: Required[str] + """The URL of the page searched for the pattern.""" + + +Action: TypeAlias = Union[ActionSearch, ActionOpenPage, ActionFind] + + +class ResponseFunctionWebSearchParam(TypedDict, total=False): + """The results of a web search tool call. + + See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + """ + + id: Required[str] + """The unique ID of the web search tool call.""" + + action: Required[Action] + """ + An object describing the specific action taken in this web search call. Includes + details on how the model used the web (search, open_page, find). + """ + + status: Required[Literal["in_progress", "searching", "completed", "failed"]] + """The status of the web search tool call.""" + + type: Required[Literal["web_search_call"]] + """The type of the web search tool call. Always `web_search_call`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..f6ce9d0fd86713f33ea79f496ad8c1c69ad31abb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_completed_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseImageGenCallCompletedEvent"] + + +class ResponseImageGenCallCompletedEvent(BaseModel): + """ + Emitted when an image generation tool call has completed and the final image is available. + """ + + item_id: str + """The unique identifier of the image generation item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.image_generation_call.completed"] + """The type of the event. Always 'response.image_generation_call.completed'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_generating_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_generating_event.py new file mode 100644 index 0000000000000000000000000000000000000000..8e3026d0dc6512797f9c1ea433f6f4cdbdd2af96 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_generating_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseImageGenCallGeneratingEvent"] + + +class ResponseImageGenCallGeneratingEvent(BaseModel): + """ + Emitted when an image generation tool call is actively generating an image (intermediate state). + """ + + item_id: str + """The unique identifier of the image generation item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of the image generation item being processed.""" + + type: Literal["response.image_generation_call.generating"] + """The type of the event. Always 'response.image_generation_call.generating'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..60726a22b41c696e7b11f0bac704fc2a6fe47a1f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_in_progress_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseImageGenCallInProgressEvent"] + + +class ResponseImageGenCallInProgressEvent(BaseModel): + """Emitted when an image generation tool call is in progress.""" + + item_id: str + """The unique identifier of the image generation item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of the image generation item being processed.""" + + type: Literal["response.image_generation_call.in_progress"] + """The type of the event. Always 'response.image_generation_call.in_progress'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_partial_image_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_partial_image_event.py new file mode 100644 index 0000000000000000000000000000000000000000..289d5d44c0f370c4c7ef3af3bc36edbfeccb7e52 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_image_gen_call_partial_image_event.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseImageGenCallPartialImageEvent"] + + +class ResponseImageGenCallPartialImageEvent(BaseModel): + """Emitted when a partial image is available during image generation streaming.""" + + item_id: str + """The unique identifier of the image generation item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + partial_image_b64: str + """Base64-encoded partial image data, suitable for rendering as an image.""" + + partial_image_index: int + """ + 0-based index for the partial image (backend is 1-based, but this is 0-based for + the user). + """ + + sequence_number: int + """The sequence number of the image generation item being processed.""" + + type: Literal["response.image_generation_call.partial_image"] + """The type of the event. Always 'response.image_generation_call.partial_image'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..9d9bbd94b038976f54e0db24ee705a0701277314 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_in_progress_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseInProgressEvent"] + + +class ResponseInProgressEvent(BaseModel): + """Emitted when the response is in progress.""" + + response: Response + """The response that is in progress.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.in_progress"] + """The type of the event. Always `response.in_progress`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_includable.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_includable.py new file mode 100644 index 0000000000000000000000000000000000000000..675c83405ab18b40ec900b8c636693d2be605802 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_includable.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResponseIncludable"] + +ResponseIncludable: TypeAlias = Literal[ + "file_search_call.results", + "web_search_call.results", + "web_search_call.action.sources", + "message.input_image.image_url", + "computer_call_output.output.image_url", + "code_interpreter_call.outputs", + "reasoning.encrypted_content", + "message.output_text.logprobs", +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_incomplete_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_incomplete_event.py new file mode 100644 index 0000000000000000000000000000000000000000..ef99c5f0b2f75bcd7685d9421f803a0a847cb46d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_incomplete_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseIncompleteEvent"] + + +class ResponseIncompleteEvent(BaseModel): + """An event that is emitted when a response finishes as incomplete.""" + + response: Response + """The response that was incomplete.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.incomplete"] + """The type of the event. Always `response.incomplete`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio.py new file mode 100644 index 0000000000000000000000000000000000000000..f362ba4133649329b92c74d8bb3087e66beb3936 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputAudio", "InputAudio"] + + +class InputAudio(BaseModel): + data: str + """Base64-encoded audio data.""" + + format: Literal["mp3", "wav"] + """The format of the audio data. Currently supported formats are `mp3` and `wav`.""" + + +class ResponseInputAudio(BaseModel): + """An audio input to the model.""" + + input_audio: InputAudio + + type: Literal["input_audio"] + """The type of the input item. Always `input_audio`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio_param.py new file mode 100644 index 0000000000000000000000000000000000000000..0be935c54d00b810ae00f3c99745be3bf54126db --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_audio_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputAudioParam", "InputAudio"] + + +class InputAudio(TypedDict, total=False): + data: Required[str] + """Base64-encoded audio data.""" + + format: Required[Literal["mp3", "wav"]] + """The format of the audio data. Currently supported formats are `mp3` and `wav`.""" + + +class ResponseInputAudioParam(TypedDict, total=False): + """An audio input to the model.""" + + input_audio: Required[InputAudio] + + type: Required[Literal["input_audio"]] + """The type of the input item. Always `input_audio`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content.py new file mode 100644 index 0000000000000000000000000000000000000000..1726909a176a05395553a2e11fa5f5e19fc78507 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .response_input_file import ResponseInputFile +from .response_input_text import ResponseInputText +from .response_input_image import ResponseInputImage + +__all__ = ["ResponseInputContent"] + +ResponseInputContent: TypeAlias = Annotated[ + Union[ResponseInputText, ResponseInputImage, ResponseInputFile], PropertyInfo(discriminator="type") +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7791cdfd8eabdf3e2dabaa6e911f5ebcd537f690 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_content_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .response_input_file_param import ResponseInputFileParam +from .response_input_text_param import ResponseInputTextParam +from .response_input_image_param import ResponseInputImageParam + +__all__ = ["ResponseInputContentParam"] + +ResponseInputContentParam: TypeAlias = Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file.py new file mode 100644 index 0000000000000000000000000000000000000000..3e5fb70c5f4f04c8f866151ee72d6f1554445ab4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputFile"] + + +class ResponseInputFile(BaseModel): + """A file input to the model.""" + + type: Literal["input_file"] + """The type of the input item. Always `input_file`.""" + + file_data: Optional[str] = None + """The content of the file to be sent to the model.""" + + file_id: Optional[str] = None + """The ID of the file to be sent to the model.""" + + file_url: Optional[str] = None + """The URL of the file to be sent to the model.""" + + filename: Optional[str] = None + """The name of the file to be sent to the model.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content.py new file mode 100644 index 0000000000000000000000000000000000000000..f0dfef55d06912b6e68857194b5e4553cf49676a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputFileContent"] + + +class ResponseInputFileContent(BaseModel): + """A file input to the model.""" + + type: Literal["input_file"] + """The type of the input item. Always `input_file`.""" + + file_data: Optional[str] = None + """The base64-encoded data of the file to be sent to the model.""" + + file_id: Optional[str] = None + """The ID of the file to be sent to the model.""" + + file_url: Optional[str] = None + """The URL of the file to be sent to the model.""" + + filename: Optional[str] = None + """The name of the file to be sent to the model.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..376f6c7a45cba6f0e94859481b07e7fd8d2a80be --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_content_param.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputFileContentParam"] + + +class ResponseInputFileContentParam(TypedDict, total=False): + """A file input to the model.""" + + type: Required[Literal["input_file"]] + """The type of the input item. Always `input_file`.""" + + file_data: Optional[str] + """The base64-encoded data of the file to be sent to the model.""" + + file_id: Optional[str] + """The ID of the file to be sent to the model.""" + + file_url: Optional[str] + """The URL of the file to be sent to the model.""" + + filename: Optional[str] + """The name of the file to be sent to the model.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8b5da2024591110c5acec7d68964579a975eeabb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_file_param.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputFileParam"] + + +class ResponseInputFileParam(TypedDict, total=False): + """A file input to the model.""" + + type: Required[Literal["input_file"]] + """The type of the input item. Always `input_file`.""" + + file_data: str + """The content of the file to be sent to the model.""" + + file_id: Optional[str] + """The ID of the file to be sent to the model.""" + + file_url: str + """The URL of the file to be sent to the model.""" + + filename: str + """The name of the file to be sent to the model.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image.py new file mode 100644 index 0000000000000000000000000000000000000000..500bc4b346b7d08b605d059875206e32d285e397 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputImage"] + + +class ResponseInputImage(BaseModel): + """An image input to the model. + + Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + """ + + detail: Literal["low", "high", "auto"] + """The detail level of the image to be sent to the model. + + One of `high`, `low`, or `auto`. Defaults to `auto`. + """ + + type: Literal["input_image"] + """The type of the input item. Always `input_image`.""" + + file_id: Optional[str] = None + """The ID of the file to be sent to the model.""" + + image_url: Optional[str] = None + """The URL of the image to be sent to the model. + + A fully qualified URL or base64 encoded image in a data URL. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content.py new file mode 100644 index 0000000000000000000000000000000000000000..e38bc28d5efa32f9cda0bb86d24547693968ee9a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputImageContent"] + + +class ResponseInputImageContent(BaseModel): + """An image input to the model. + + Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + """ + + type: Literal["input_image"] + """The type of the input item. Always `input_image`.""" + + detail: Optional[Literal["low", "high", "auto"]] = None + """The detail level of the image to be sent to the model. + + One of `high`, `low`, or `auto`. Defaults to `auto`. + """ + + file_id: Optional[str] = None + """The ID of the file to be sent to the model.""" + + image_url: Optional[str] = None + """The URL of the image to be sent to the model. + + A fully qualified URL or base64 encoded image in a data URL. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..c21f46d7365aa5d003d722b05921b4f957f73d49 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_content_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputImageContentParam"] + + +class ResponseInputImageContentParam(TypedDict, total=False): + """An image input to the model. + + Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + """ + + type: Required[Literal["input_image"]] + """The type of the input item. Always `input_image`.""" + + detail: Optional[Literal["low", "high", "auto"]] + """The detail level of the image to be sent to the model. + + One of `high`, `low`, or `auto`. Defaults to `auto`. + """ + + file_id: Optional[str] + """The ID of the file to be sent to the model.""" + + image_url: Optional[str] + """The URL of the image to be sent to the model. + + A fully qualified URL or base64 encoded image in a data URL. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_param.py new file mode 100644 index 0000000000000000000000000000000000000000..fd8c1bd070524f28285d3bc4237758a0125805c0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_image_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputImageParam"] + + +class ResponseInputImageParam(TypedDict, total=False): + """An image input to the model. + + Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + """ + + detail: Required[Literal["low", "high", "auto"]] + """The detail level of the image to be sent to the model. + + One of `high`, `low`, or `auto`. Defaults to `auto`. + """ + + type: Required[Literal["input_image"]] + """The type of the input item. Always `input_image`.""" + + file_id: Optional[str] + """The ID of the file to be sent to the model.""" + + image_url: Optional[str] + """The URL of the image to be sent to the model. + + A fully qualified URL or base64 encoded image in a data URL. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item.py new file mode 100644 index 0000000000000000000000000000000000000000..23eb2c89508ad56078dddb7e41013bb057c06274 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item.py @@ -0,0 +1,534 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .easy_input_message import EasyInputMessage +from .response_output_message import ResponseOutputMessage +from .response_reasoning_item import ResponseReasoningItem +from .response_custom_tool_call import ResponseCustomToolCall +from .response_computer_tool_call import ResponseComputerToolCall +from .response_function_tool_call import ResponseFunctionToolCall +from .response_function_web_search import ResponseFunctionWebSearch +from .response_compaction_item_param import ResponseCompactionItemParam +from .response_file_search_tool_call import ResponseFileSearchToolCall +from .response_custom_tool_call_output import ResponseCustomToolCallOutput +from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall +from .response_input_message_content_list import ResponseInputMessageContentList +from .response_function_call_output_item_list import ResponseFunctionCallOutputItemList +from .response_function_shell_call_output_content import ResponseFunctionShellCallOutputContent +from .response_computer_tool_call_output_screenshot import ResponseComputerToolCallOutputScreenshot + +__all__ = [ + "ResponseInputItem", + "Message", + "ComputerCallOutput", + "ComputerCallOutputAcknowledgedSafetyCheck", + "FunctionCallOutput", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "LocalShellCallOutput", + "ShellCall", + "ShellCallAction", + "ShellCallOutput", + "ApplyPatchCall", + "ApplyPatchCallOperation", + "ApplyPatchCallOperationCreateFile", + "ApplyPatchCallOperationDeleteFile", + "ApplyPatchCallOperationUpdateFile", + "ApplyPatchCallOutput", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", + "McpApprovalResponse", + "McpCall", + "ItemReference", +] + + +class Message(BaseModel): + """ + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + """ + + content: ResponseInputMessageContentList + """ + A list of one or many input items to the model, containing different content + types. + """ + + role: Literal["user", "system", "developer"] + """The role of the message input. One of `user`, `system`, or `developer`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Optional[Literal["message"]] = None + """The type of the message input. Always set to `message`.""" + + +class ComputerCallOutputAcknowledgedSafetyCheck(BaseModel): + """A pending safety check for the computer call.""" + + id: str + """The ID of the pending safety check.""" + + code: Optional[str] = None + """The type of the pending safety check.""" + + message: Optional[str] = None + """Details about the pending safety check.""" + + +class ComputerCallOutput(BaseModel): + """The output of a computer tool call.""" + + call_id: str + """The ID of the computer tool call that produced the output.""" + + output: ResponseComputerToolCallOutputScreenshot + """A computer screenshot image used with the computer use tool.""" + + type: Literal["computer_call_output"] + """The type of the computer tool call output. Always `computer_call_output`.""" + + id: Optional[str] = None + """The ID of the computer tool call output.""" + + acknowledged_safety_checks: Optional[List[ComputerCallOutputAcknowledgedSafetyCheck]] = None + """ + The safety checks reported by the API that have been acknowledged by the + developer. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ + + +class FunctionCallOutput(BaseModel): + """The output of a function tool call.""" + + call_id: str + """The unique ID of the function tool call generated by the model.""" + + output: Union[str, ResponseFunctionCallOutputItemList] + """Text, image, or file output of the function tool call.""" + + type: Literal["function_call_output"] + """The type of the function tool call output. Always `function_call_output`.""" + + id: Optional[str] = None + """The unique ID of the function tool call output. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + +class ImageGenerationCall(BaseModel): + """An image generation request made by the model.""" + + id: str + """The unique ID of the image generation call.""" + + result: Optional[str] = None + """The generated image encoded in base64.""" + + status: Literal["in_progress", "completed", "generating", "failed"] + """The status of the image generation call.""" + + type: Literal["image_generation_call"] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(BaseModel): + """Execute a shell command on the server.""" + + command: List[str] + """The command to run.""" + + env: Dict[str, str] + """Environment variables to set for the command.""" + + type: Literal["exec"] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] = None + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] = None + """Optional user to run the command as.""" + + working_directory: Optional[str] = None + """Optional working directory to run the command in.""" + + +class LocalShellCall(BaseModel): + """A tool call to run a command on the local shell.""" + + id: str + """The unique ID of the local shell call.""" + + action: LocalShellCallAction + """Execute a shell command on the server.""" + + call_id: str + """The unique ID of the local shell tool call generated by the model.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the local shell call.""" + + type: Literal["local_shell_call"] + """The type of the local shell call. Always `local_shell_call`.""" + + +class LocalShellCallOutput(BaseModel): + """The output of a local shell tool call.""" + + id: str + """The unique ID of the local shell tool call generated by the model.""" + + output: str + """A JSON string of the output of the local shell tool call.""" + + type: Literal["local_shell_call_output"] + """The type of the local shell tool call output. Always `local_shell_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. One of `in_progress`, `completed`, or `incomplete`.""" + + +class ShellCallAction(BaseModel): + """The shell commands and limits that describe how to run the tool call.""" + + commands: List[str] + """Ordered shell commands for the execution environment to run.""" + + max_output_length: Optional[int] = None + """ + Maximum number of UTF-8 characters to capture from combined stdout and stderr + output. + """ + + timeout_ms: Optional[int] = None + """Maximum wall-clock time in milliseconds to allow the shell commands to run.""" + + +class ShellCall(BaseModel): + """A tool representing a request to execute one or more shell commands.""" + + action: ShellCallAction + """The shell commands and limits that describe how to run the tool call.""" + + call_id: str + """The unique ID of the shell tool call generated by the model.""" + + type: Literal["shell_call"] + """The type of the item. Always `shell_call`.""" + + id: Optional[str] = None + """The unique ID of the shell tool call. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the shell call. + + One of `in_progress`, `completed`, or `incomplete`. + """ + + +class ShellCallOutput(BaseModel): + """The streamed output items emitted by a shell tool call.""" + + call_id: str + """The unique ID of the shell tool call generated by the model.""" + + output: List[ResponseFunctionShellCallOutputContent] + """ + Captured chunks of stdout and stderr output, along with their associated + outcomes. + """ + + type: Literal["shell_call_output"] + """The type of the item. Always `shell_call_output`.""" + + id: Optional[str] = None + """The unique ID of the shell tool call output. + + Populated when this item is returned via API. + """ + + max_output_length: Optional[int] = None + """ + The maximum number of UTF-8 characters captured for this shell call's combined + output. + """ + + +class ApplyPatchCallOperationCreateFile(BaseModel): + """Instruction for creating a new file via the apply_patch tool.""" + + diff: str + """Unified diff content to apply when creating the file.""" + + path: str + """Path of the file to create relative to the workspace root.""" + + type: Literal["create_file"] + """The operation type. Always `create_file`.""" + + +class ApplyPatchCallOperationDeleteFile(BaseModel): + """Instruction for deleting an existing file via the apply_patch tool.""" + + path: str + """Path of the file to delete relative to the workspace root.""" + + type: Literal["delete_file"] + """The operation type. Always `delete_file`.""" + + +class ApplyPatchCallOperationUpdateFile(BaseModel): + """Instruction for updating an existing file via the apply_patch tool.""" + + diff: str + """Unified diff content to apply to the existing file.""" + + path: str + """Path of the file to update relative to the workspace root.""" + + type: Literal["update_file"] + """The operation type. Always `update_file`.""" + + +ApplyPatchCallOperation: TypeAlias = Annotated[ + Union[ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile], + PropertyInfo(discriminator="type"), +] + + +class ApplyPatchCall(BaseModel): + """ + A tool call representing a request to create, delete, or update files using diff patches. + """ + + call_id: str + """The unique ID of the apply patch tool call generated by the model.""" + + operation: ApplyPatchCallOperation + """ + The specific create, delete, or update instruction for the apply_patch tool + call. + """ + + status: Literal["in_progress", "completed"] + """The status of the apply patch tool call. One of `in_progress` or `completed`.""" + + type: Literal["apply_patch_call"] + """The type of the item. Always `apply_patch_call`.""" + + id: Optional[str] = None + """The unique ID of the apply patch tool call. + + Populated when this item is returned via API. + """ + + +class ApplyPatchCallOutput(BaseModel): + """The streamed output emitted by an apply patch tool call.""" + + call_id: str + """The unique ID of the apply patch tool call generated by the model.""" + + status: Literal["completed", "failed"] + """The status of the apply patch tool call output. One of `completed` or `failed`.""" + + type: Literal["apply_patch_call_output"] + """The type of the item. Always `apply_patch_call_output`.""" + + id: Optional[str] = None + """The unique ID of the apply patch tool call output. + + Populated when this item is returned via API. + """ + + output: Optional[str] = None + """ + Optional human-readable log text from the apply patch tool (e.g., patch results + or errors). + """ + + +class McpListToolsTool(BaseModel): + """A tool available on an MCP server.""" + + input_schema: object + """The JSON schema describing the tool's input.""" + + name: str + """The name of the tool.""" + + annotations: Optional[object] = None + """Additional annotations about the tool.""" + + description: Optional[str] = None + """The description of the tool.""" + + +class McpListTools(BaseModel): + """A list of tools available on an MCP server.""" + + id: str + """The unique ID of the list.""" + + server_label: str + """The label of the MCP server.""" + + tools: List[McpListToolsTool] + """The tools available on the server.""" + + type: Literal["mcp_list_tools"] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] = None + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(BaseModel): + """A request for human approval of a tool invocation.""" + + id: str + """The unique ID of the approval request.""" + + arguments: str + """A JSON string of arguments for the tool.""" + + name: str + """The name of the tool to run.""" + + server_label: str + """The label of the MCP server making the request.""" + + type: Literal["mcp_approval_request"] + """The type of the item. Always `mcp_approval_request`.""" + + +class McpApprovalResponse(BaseModel): + """A response to an MCP approval request.""" + + approval_request_id: str + """The ID of the approval request being answered.""" + + approve: bool + """Whether the request was approved.""" + + type: Literal["mcp_approval_response"] + """The type of the item. Always `mcp_approval_response`.""" + + id: Optional[str] = None + """The unique ID of the approval response""" + + reason: Optional[str] = None + """Optional reason for the decision.""" + + +class McpCall(BaseModel): + """An invocation of a tool on an MCP server.""" + + id: str + """The unique ID of the tool call.""" + + arguments: str + """A JSON string of the arguments passed to the tool.""" + + name: str + """The name of the tool that was run.""" + + server_label: str + """The label of the MCP server running the tool.""" + + type: Literal["mcp_call"] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] = None + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] = None + """The error from the tool call, if any.""" + + output: Optional[str] = None + """The output from the tool call.""" + + status: Optional[Literal["in_progress", "completed", "incomplete", "calling", "failed"]] = None + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +class ItemReference(BaseModel): + """An internal identifier for an item to reference.""" + + id: str + """The ID of the item to reference.""" + + type: Optional[Literal["item_reference"]] = None + """The type of item to reference. Always `item_reference`.""" + + +ResponseInputItem: TypeAlias = Annotated[ + Union[ + EasyInputMessage, + Message, + ResponseOutputMessage, + ResponseFileSearchToolCall, + ResponseComputerToolCall, + ComputerCallOutput, + ResponseFunctionWebSearch, + ResponseFunctionToolCall, + FunctionCallOutput, + ResponseReasoningItem, + ResponseCompactionItemParam, + ImageGenerationCall, + ResponseCodeInterpreterToolCall, + LocalShellCall, + LocalShellCallOutput, + ShellCall, + ShellCallOutput, + ApplyPatchCall, + ApplyPatchCallOutput, + McpListTools, + McpApprovalRequest, + McpApprovalResponse, + McpCall, + ResponseCustomToolCallOutput, + ResponseCustomToolCall, + ItemReference, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2c42b93021a294da4e634d226beb1d1007b5a386 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_item_param.py @@ -0,0 +1,531 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from .easy_input_message_param import EasyInputMessageParam +from .response_output_message_param import ResponseOutputMessageParam +from .response_reasoning_item_param import ResponseReasoningItemParam +from .response_custom_tool_call_param import ResponseCustomToolCallParam +from .response_computer_tool_call_param import ResponseComputerToolCallParam +from .response_function_tool_call_param import ResponseFunctionToolCallParam +from .response_function_web_search_param import ResponseFunctionWebSearchParam +from .response_compaction_item_param_param import ResponseCompactionItemParamParam +from .response_file_search_tool_call_param import ResponseFileSearchToolCallParam +from .response_custom_tool_call_output_param import ResponseCustomToolCallOutputParam +from .response_code_interpreter_tool_call_param import ResponseCodeInterpreterToolCallParam +from .response_input_message_content_list_param import ResponseInputMessageContentListParam +from .response_function_call_output_item_list_param import ResponseFunctionCallOutputItemListParam +from .response_function_shell_call_output_content_param import ResponseFunctionShellCallOutputContentParam +from .response_computer_tool_call_output_screenshot_param import ResponseComputerToolCallOutputScreenshotParam + +__all__ = [ + "ResponseInputItemParam", + "Message", + "ComputerCallOutput", + "ComputerCallOutputAcknowledgedSafetyCheck", + "FunctionCallOutput", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "LocalShellCallOutput", + "ShellCall", + "ShellCallAction", + "ShellCallOutput", + "ApplyPatchCall", + "ApplyPatchCallOperation", + "ApplyPatchCallOperationCreateFile", + "ApplyPatchCallOperationDeleteFile", + "ApplyPatchCallOperationUpdateFile", + "ApplyPatchCallOutput", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", + "McpApprovalResponse", + "McpCall", + "ItemReference", +] + + +class Message(TypedDict, total=False): + """ + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + """ + + content: Required[ResponseInputMessageContentListParam] + """ + A list of one or many input items to the model, containing different content + types. + """ + + role: Required[Literal["user", "system", "developer"]] + """The role of the message input. One of `user`, `system`, or `developer`.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Literal["message"] + """The type of the message input. Always set to `message`.""" + + +class ComputerCallOutputAcknowledgedSafetyCheck(TypedDict, total=False): + """A pending safety check for the computer call.""" + + id: Required[str] + """The ID of the pending safety check.""" + + code: Optional[str] + """The type of the pending safety check.""" + + message: Optional[str] + """Details about the pending safety check.""" + + +class ComputerCallOutput(TypedDict, total=False): + """The output of a computer tool call.""" + + call_id: Required[str] + """The ID of the computer tool call that produced the output.""" + + output: Required[ResponseComputerToolCallOutputScreenshotParam] + """A computer screenshot image used with the computer use tool.""" + + type: Required[Literal["computer_call_output"]] + """The type of the computer tool call output. Always `computer_call_output`.""" + + id: Optional[str] + """The ID of the computer tool call output.""" + + acknowledged_safety_checks: Optional[Iterable[ComputerCallOutputAcknowledgedSafetyCheck]] + """ + The safety checks reported by the API that have been acknowledged by the + developer. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ + + +class FunctionCallOutput(TypedDict, total=False): + """The output of a function tool call.""" + + call_id: Required[str] + """The unique ID of the function tool call generated by the model.""" + + output: Required[Union[str, ResponseFunctionCallOutputItemListParam]] + """Text, image, or file output of the function tool call.""" + + type: Required[Literal["function_call_output"]] + """The type of the function tool call output. Always `function_call_output`.""" + + id: Optional[str] + """The unique ID of the function tool call output. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + +class ImageGenerationCall(TypedDict, total=False): + """An image generation request made by the model.""" + + id: Required[str] + """The unique ID of the image generation call.""" + + result: Required[Optional[str]] + """The generated image encoded in base64.""" + + status: Required[Literal["in_progress", "completed", "generating", "failed"]] + """The status of the image generation call.""" + + type: Required[Literal["image_generation_call"]] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(TypedDict, total=False): + """Execute a shell command on the server.""" + + command: Required[SequenceNotStr[str]] + """The command to run.""" + + env: Required[Dict[str, str]] + """Environment variables to set for the command.""" + + type: Required[Literal["exec"]] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] + """Optional user to run the command as.""" + + working_directory: Optional[str] + """Optional working directory to run the command in.""" + + +class LocalShellCall(TypedDict, total=False): + """A tool call to run a command on the local shell.""" + + id: Required[str] + """The unique ID of the local shell call.""" + + action: Required[LocalShellCallAction] + """Execute a shell command on the server.""" + + call_id: Required[str] + """The unique ID of the local shell tool call generated by the model.""" + + status: Required[Literal["in_progress", "completed", "incomplete"]] + """The status of the local shell call.""" + + type: Required[Literal["local_shell_call"]] + """The type of the local shell call. Always `local_shell_call`.""" + + +class LocalShellCallOutput(TypedDict, total=False): + """The output of a local shell tool call.""" + + id: Required[str] + """The unique ID of the local shell tool call generated by the model.""" + + output: Required[str] + """A JSON string of the output of the local shell tool call.""" + + type: Required[Literal["local_shell_call_output"]] + """The type of the local shell tool call output. Always `local_shell_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the item. One of `in_progress`, `completed`, or `incomplete`.""" + + +class ShellCallAction(TypedDict, total=False): + """The shell commands and limits that describe how to run the tool call.""" + + commands: Required[SequenceNotStr[str]] + """Ordered shell commands for the execution environment to run.""" + + max_output_length: Optional[int] + """ + Maximum number of UTF-8 characters to capture from combined stdout and stderr + output. + """ + + timeout_ms: Optional[int] + """Maximum wall-clock time in milliseconds to allow the shell commands to run.""" + + +class ShellCall(TypedDict, total=False): + """A tool representing a request to execute one or more shell commands.""" + + action: Required[ShellCallAction] + """The shell commands and limits that describe how to run the tool call.""" + + call_id: Required[str] + """The unique ID of the shell tool call generated by the model.""" + + type: Required[Literal["shell_call"]] + """The type of the item. Always `shell_call`.""" + + id: Optional[str] + """The unique ID of the shell tool call. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the shell call. + + One of `in_progress`, `completed`, or `incomplete`. + """ + + +class ShellCallOutput(TypedDict, total=False): + """The streamed output items emitted by a shell tool call.""" + + call_id: Required[str] + """The unique ID of the shell tool call generated by the model.""" + + output: Required[Iterable[ResponseFunctionShellCallOutputContentParam]] + """ + Captured chunks of stdout and stderr output, along with their associated + outcomes. + """ + + type: Required[Literal["shell_call_output"]] + """The type of the item. Always `shell_call_output`.""" + + id: Optional[str] + """The unique ID of the shell tool call output. + + Populated when this item is returned via API. + """ + + max_output_length: Optional[int] + """ + The maximum number of UTF-8 characters captured for this shell call's combined + output. + """ + + +class ApplyPatchCallOperationCreateFile(TypedDict, total=False): + """Instruction for creating a new file via the apply_patch tool.""" + + diff: Required[str] + """Unified diff content to apply when creating the file.""" + + path: Required[str] + """Path of the file to create relative to the workspace root.""" + + type: Required[Literal["create_file"]] + """The operation type. Always `create_file`.""" + + +class ApplyPatchCallOperationDeleteFile(TypedDict, total=False): + """Instruction for deleting an existing file via the apply_patch tool.""" + + path: Required[str] + """Path of the file to delete relative to the workspace root.""" + + type: Required[Literal["delete_file"]] + """The operation type. Always `delete_file`.""" + + +class ApplyPatchCallOperationUpdateFile(TypedDict, total=False): + """Instruction for updating an existing file via the apply_patch tool.""" + + diff: Required[str] + """Unified diff content to apply to the existing file.""" + + path: Required[str] + """Path of the file to update relative to the workspace root.""" + + type: Required[Literal["update_file"]] + """The operation type. Always `update_file`.""" + + +ApplyPatchCallOperation: TypeAlias = Union[ + ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile +] + + +class ApplyPatchCall(TypedDict, total=False): + """ + A tool call representing a request to create, delete, or update files using diff patches. + """ + + call_id: Required[str] + """The unique ID of the apply patch tool call generated by the model.""" + + operation: Required[ApplyPatchCallOperation] + """ + The specific create, delete, or update instruction for the apply_patch tool + call. + """ + + status: Required[Literal["in_progress", "completed"]] + """The status of the apply patch tool call. One of `in_progress` or `completed`.""" + + type: Required[Literal["apply_patch_call"]] + """The type of the item. Always `apply_patch_call`.""" + + id: Optional[str] + """The unique ID of the apply patch tool call. + + Populated when this item is returned via API. + """ + + +class ApplyPatchCallOutput(TypedDict, total=False): + """The streamed output emitted by an apply patch tool call.""" + + call_id: Required[str] + """The unique ID of the apply patch tool call generated by the model.""" + + status: Required[Literal["completed", "failed"]] + """The status of the apply patch tool call output. One of `completed` or `failed`.""" + + type: Required[Literal["apply_patch_call_output"]] + """The type of the item. Always `apply_patch_call_output`.""" + + id: Optional[str] + """The unique ID of the apply patch tool call output. + + Populated when this item is returned via API. + """ + + output: Optional[str] + """ + Optional human-readable log text from the apply patch tool (e.g., patch results + or errors). + """ + + +class McpListToolsTool(TypedDict, total=False): + """A tool available on an MCP server.""" + + input_schema: Required[object] + """The JSON schema describing the tool's input.""" + + name: Required[str] + """The name of the tool.""" + + annotations: Optional[object] + """Additional annotations about the tool.""" + + description: Optional[str] + """The description of the tool.""" + + +class McpListTools(TypedDict, total=False): + """A list of tools available on an MCP server.""" + + id: Required[str] + """The unique ID of the list.""" + + server_label: Required[str] + """The label of the MCP server.""" + + tools: Required[Iterable[McpListToolsTool]] + """The tools available on the server.""" + + type: Required[Literal["mcp_list_tools"]] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(TypedDict, total=False): + """A request for human approval of a tool invocation.""" + + id: Required[str] + """The unique ID of the approval request.""" + + arguments: Required[str] + """A JSON string of arguments for the tool.""" + + name: Required[str] + """The name of the tool to run.""" + + server_label: Required[str] + """The label of the MCP server making the request.""" + + type: Required[Literal["mcp_approval_request"]] + """The type of the item. Always `mcp_approval_request`.""" + + +class McpApprovalResponse(TypedDict, total=False): + """A response to an MCP approval request.""" + + approval_request_id: Required[str] + """The ID of the approval request being answered.""" + + approve: Required[bool] + """Whether the request was approved.""" + + type: Required[Literal["mcp_approval_response"]] + """The type of the item. Always `mcp_approval_response`.""" + + id: Optional[str] + """The unique ID of the approval response""" + + reason: Optional[str] + """Optional reason for the decision.""" + + +class McpCall(TypedDict, total=False): + """An invocation of a tool on an MCP server.""" + + id: Required[str] + """The unique ID of the tool call.""" + + arguments: Required[str] + """A JSON string of the arguments passed to the tool.""" + + name: Required[str] + """The name of the tool that was run.""" + + server_label: Required[str] + """The label of the MCP server running the tool.""" + + type: Required[Literal["mcp_call"]] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] + """The error from the tool call, if any.""" + + output: Optional[str] + """The output from the tool call.""" + + status: Literal["in_progress", "completed", "incomplete", "calling", "failed"] + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +class ItemReference(TypedDict, total=False): + """An internal identifier for an item to reference.""" + + id: Required[str] + """The ID of the item to reference.""" + + type: Optional[Literal["item_reference"]] + """The type of item to reference. Always `item_reference`.""" + + +ResponseInputItemParam: TypeAlias = Union[ + EasyInputMessageParam, + Message, + ResponseOutputMessageParam, + ResponseFileSearchToolCallParam, + ResponseComputerToolCallParam, + ComputerCallOutput, + ResponseFunctionWebSearchParam, + ResponseFunctionToolCallParam, + FunctionCallOutput, + ResponseReasoningItemParam, + ResponseCompactionItemParamParam, + ImageGenerationCall, + ResponseCodeInterpreterToolCallParam, + LocalShellCall, + LocalShellCallOutput, + ShellCall, + ShellCallOutput, + ApplyPatchCall, + ApplyPatchCallOutput, + McpListTools, + McpApprovalRequest, + McpApprovalResponse, + McpCall, + ResponseCustomToolCallOutputParam, + ResponseCustomToolCallParam, + ItemReference, +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list.py new file mode 100644 index 0000000000000000000000000000000000000000..99b7c10f1295d4e49dc680b67a4faead0eab7b70 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .response_input_content import ResponseInputContent + +__all__ = ["ResponseInputMessageContentList"] + +ResponseInputMessageContentList: TypeAlias = List[ResponseInputContent] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list_param.py new file mode 100644 index 0000000000000000000000000000000000000000..080613df0d6020e933f892f35d8dc44b6bcadc09 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_content_list_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import TypeAlias + +from .response_input_file_param import ResponseInputFileParam +from .response_input_text_param import ResponseInputTextParam +from .response_input_image_param import ResponseInputImageParam + +__all__ = ["ResponseInputMessageContentListParam", "ResponseInputContentParam"] + +ResponseInputContentParam: TypeAlias = Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] + +ResponseInputMessageContentListParam: TypeAlias = List[ResponseInputContentParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_item.py new file mode 100644 index 0000000000000000000000000000000000000000..6a788e7fa49d87318cafbaf41a87185087ee293a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_message_item.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_input_message_content_list import ResponseInputMessageContentList + +__all__ = ["ResponseInputMessageItem"] + + +class ResponseInputMessageItem(BaseModel): + id: str + """The unique ID of the message input.""" + + content: ResponseInputMessageContentList + """ + A list of one or many input items to the model, containing different content + types. + """ + + role: Literal["user", "system", "developer"] + """The role of the message input. One of `user`, `system`, or `developer`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Optional[Literal["message"]] = None + """The type of the message input. Always set to `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_param.py new file mode 100644 index 0000000000000000000000000000000000000000..c2d12c0ab4f50561d916f694df209ca7bb14ce1b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_param.py @@ -0,0 +1,534 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from .easy_input_message_param import EasyInputMessageParam +from .response_output_message_param import ResponseOutputMessageParam +from .response_reasoning_item_param import ResponseReasoningItemParam +from .response_custom_tool_call_param import ResponseCustomToolCallParam +from .response_computer_tool_call_param import ResponseComputerToolCallParam +from .response_function_tool_call_param import ResponseFunctionToolCallParam +from .response_function_web_search_param import ResponseFunctionWebSearchParam +from .response_compaction_item_param_param import ResponseCompactionItemParamParam +from .response_file_search_tool_call_param import ResponseFileSearchToolCallParam +from .response_custom_tool_call_output_param import ResponseCustomToolCallOutputParam +from .response_code_interpreter_tool_call_param import ResponseCodeInterpreterToolCallParam +from .response_input_message_content_list_param import ResponseInputMessageContentListParam +from .response_function_call_output_item_list_param import ResponseFunctionCallOutputItemListParam +from .response_function_shell_call_output_content_param import ResponseFunctionShellCallOutputContentParam +from .response_computer_tool_call_output_screenshot_param import ResponseComputerToolCallOutputScreenshotParam + +__all__ = [ + "ResponseInputParam", + "ResponseInputItemParam", + "Message", + "ComputerCallOutput", + "ComputerCallOutputAcknowledgedSafetyCheck", + "FunctionCallOutput", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "LocalShellCallOutput", + "ShellCall", + "ShellCallAction", + "ShellCallOutput", + "ApplyPatchCall", + "ApplyPatchCallOperation", + "ApplyPatchCallOperationCreateFile", + "ApplyPatchCallOperationDeleteFile", + "ApplyPatchCallOperationUpdateFile", + "ApplyPatchCallOutput", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", + "McpApprovalResponse", + "McpCall", + "ItemReference", +] + + +class Message(TypedDict, total=False): + """ + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + """ + + content: Required[ResponseInputMessageContentListParam] + """ + A list of one or many input items to the model, containing different content + types. + """ + + role: Required[Literal["user", "system", "developer"]] + """The role of the message input. One of `user`, `system`, or `developer`.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + type: Literal["message"] + """The type of the message input. Always set to `message`.""" + + +class ComputerCallOutputAcknowledgedSafetyCheck(TypedDict, total=False): + """A pending safety check for the computer call.""" + + id: Required[str] + """The ID of the pending safety check.""" + + code: Optional[str] + """The type of the pending safety check.""" + + message: Optional[str] + """Details about the pending safety check.""" + + +class ComputerCallOutput(TypedDict, total=False): + """The output of a computer tool call.""" + + call_id: Required[str] + """The ID of the computer tool call that produced the output.""" + + output: Required[ResponseComputerToolCallOutputScreenshotParam] + """A computer screenshot image used with the computer use tool.""" + + type: Required[Literal["computer_call_output"]] + """The type of the computer tool call output. Always `computer_call_output`.""" + + id: Optional[str] + """The ID of the computer tool call output.""" + + acknowledged_safety_checks: Optional[Iterable[ComputerCallOutputAcknowledgedSafetyCheck]] + """ + The safety checks reported by the API that have been acknowledged by the + developer. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ + + +class FunctionCallOutput(TypedDict, total=False): + """The output of a function tool call.""" + + call_id: Required[str] + """The unique ID of the function tool call generated by the model.""" + + output: Required[Union[str, ResponseFunctionCallOutputItemListParam]] + """Text, image, or file output of the function tool call.""" + + type: Required[Literal["function_call_output"]] + """The type of the function tool call output. Always `function_call_output`.""" + + id: Optional[str] + """The unique ID of the function tool call output. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + +class ImageGenerationCall(TypedDict, total=False): + """An image generation request made by the model.""" + + id: Required[str] + """The unique ID of the image generation call.""" + + result: Required[Optional[str]] + """The generated image encoded in base64.""" + + status: Required[Literal["in_progress", "completed", "generating", "failed"]] + """The status of the image generation call.""" + + type: Required[Literal["image_generation_call"]] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(TypedDict, total=False): + """Execute a shell command on the server.""" + + command: Required[SequenceNotStr[str]] + """The command to run.""" + + env: Required[Dict[str, str]] + """Environment variables to set for the command.""" + + type: Required[Literal["exec"]] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] + """Optional user to run the command as.""" + + working_directory: Optional[str] + """Optional working directory to run the command in.""" + + +class LocalShellCall(TypedDict, total=False): + """A tool call to run a command on the local shell.""" + + id: Required[str] + """The unique ID of the local shell call.""" + + action: Required[LocalShellCallAction] + """Execute a shell command on the server.""" + + call_id: Required[str] + """The unique ID of the local shell tool call generated by the model.""" + + status: Required[Literal["in_progress", "completed", "incomplete"]] + """The status of the local shell call.""" + + type: Required[Literal["local_shell_call"]] + """The type of the local shell call. Always `local_shell_call`.""" + + +class LocalShellCallOutput(TypedDict, total=False): + """The output of a local shell tool call.""" + + id: Required[str] + """The unique ID of the local shell tool call generated by the model.""" + + output: Required[str] + """A JSON string of the output of the local shell tool call.""" + + type: Required[Literal["local_shell_call_output"]] + """The type of the local shell tool call output. Always `local_shell_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the item. One of `in_progress`, `completed`, or `incomplete`.""" + + +class ShellCallAction(TypedDict, total=False): + """The shell commands and limits that describe how to run the tool call.""" + + commands: Required[SequenceNotStr[str]] + """Ordered shell commands for the execution environment to run.""" + + max_output_length: Optional[int] + """ + Maximum number of UTF-8 characters to capture from combined stdout and stderr + output. + """ + + timeout_ms: Optional[int] + """Maximum wall-clock time in milliseconds to allow the shell commands to run.""" + + +class ShellCall(TypedDict, total=False): + """A tool representing a request to execute one or more shell commands.""" + + action: Required[ShellCallAction] + """The shell commands and limits that describe how to run the tool call.""" + + call_id: Required[str] + """The unique ID of the shell tool call generated by the model.""" + + type: Required[Literal["shell_call"]] + """The type of the item. Always `shell_call`.""" + + id: Optional[str] + """The unique ID of the shell tool call. + + Populated when this item is returned via API. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] + """The status of the shell call. + + One of `in_progress`, `completed`, or `incomplete`. + """ + + +class ShellCallOutput(TypedDict, total=False): + """The streamed output items emitted by a shell tool call.""" + + call_id: Required[str] + """The unique ID of the shell tool call generated by the model.""" + + output: Required[Iterable[ResponseFunctionShellCallOutputContentParam]] + """ + Captured chunks of stdout and stderr output, along with their associated + outcomes. + """ + + type: Required[Literal["shell_call_output"]] + """The type of the item. Always `shell_call_output`.""" + + id: Optional[str] + """The unique ID of the shell tool call output. + + Populated when this item is returned via API. + """ + + max_output_length: Optional[int] + """ + The maximum number of UTF-8 characters captured for this shell call's combined + output. + """ + + +class ApplyPatchCallOperationCreateFile(TypedDict, total=False): + """Instruction for creating a new file via the apply_patch tool.""" + + diff: Required[str] + """Unified diff content to apply when creating the file.""" + + path: Required[str] + """Path of the file to create relative to the workspace root.""" + + type: Required[Literal["create_file"]] + """The operation type. Always `create_file`.""" + + +class ApplyPatchCallOperationDeleteFile(TypedDict, total=False): + """Instruction for deleting an existing file via the apply_patch tool.""" + + path: Required[str] + """Path of the file to delete relative to the workspace root.""" + + type: Required[Literal["delete_file"]] + """The operation type. Always `delete_file`.""" + + +class ApplyPatchCallOperationUpdateFile(TypedDict, total=False): + """Instruction for updating an existing file via the apply_patch tool.""" + + diff: Required[str] + """Unified diff content to apply to the existing file.""" + + path: Required[str] + """Path of the file to update relative to the workspace root.""" + + type: Required[Literal["update_file"]] + """The operation type. Always `update_file`.""" + + +ApplyPatchCallOperation: TypeAlias = Union[ + ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile +] + + +class ApplyPatchCall(TypedDict, total=False): + """ + A tool call representing a request to create, delete, or update files using diff patches. + """ + + call_id: Required[str] + """The unique ID of the apply patch tool call generated by the model.""" + + operation: Required[ApplyPatchCallOperation] + """ + The specific create, delete, or update instruction for the apply_patch tool + call. + """ + + status: Required[Literal["in_progress", "completed"]] + """The status of the apply patch tool call. One of `in_progress` or `completed`.""" + + type: Required[Literal["apply_patch_call"]] + """The type of the item. Always `apply_patch_call`.""" + + id: Optional[str] + """The unique ID of the apply patch tool call. + + Populated when this item is returned via API. + """ + + +class ApplyPatchCallOutput(TypedDict, total=False): + """The streamed output emitted by an apply patch tool call.""" + + call_id: Required[str] + """The unique ID of the apply patch tool call generated by the model.""" + + status: Required[Literal["completed", "failed"]] + """The status of the apply patch tool call output. One of `completed` or `failed`.""" + + type: Required[Literal["apply_patch_call_output"]] + """The type of the item. Always `apply_patch_call_output`.""" + + id: Optional[str] + """The unique ID of the apply patch tool call output. + + Populated when this item is returned via API. + """ + + output: Optional[str] + """ + Optional human-readable log text from the apply patch tool (e.g., patch results + or errors). + """ + + +class McpListToolsTool(TypedDict, total=False): + """A tool available on an MCP server.""" + + input_schema: Required[object] + """The JSON schema describing the tool's input.""" + + name: Required[str] + """The name of the tool.""" + + annotations: Optional[object] + """Additional annotations about the tool.""" + + description: Optional[str] + """The description of the tool.""" + + +class McpListTools(TypedDict, total=False): + """A list of tools available on an MCP server.""" + + id: Required[str] + """The unique ID of the list.""" + + server_label: Required[str] + """The label of the MCP server.""" + + tools: Required[Iterable[McpListToolsTool]] + """The tools available on the server.""" + + type: Required[Literal["mcp_list_tools"]] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(TypedDict, total=False): + """A request for human approval of a tool invocation.""" + + id: Required[str] + """The unique ID of the approval request.""" + + arguments: Required[str] + """A JSON string of arguments for the tool.""" + + name: Required[str] + """The name of the tool to run.""" + + server_label: Required[str] + """The label of the MCP server making the request.""" + + type: Required[Literal["mcp_approval_request"]] + """The type of the item. Always `mcp_approval_request`.""" + + +class McpApprovalResponse(TypedDict, total=False): + """A response to an MCP approval request.""" + + approval_request_id: Required[str] + """The ID of the approval request being answered.""" + + approve: Required[bool] + """Whether the request was approved.""" + + type: Required[Literal["mcp_approval_response"]] + """The type of the item. Always `mcp_approval_response`.""" + + id: Optional[str] + """The unique ID of the approval response""" + + reason: Optional[str] + """Optional reason for the decision.""" + + +class McpCall(TypedDict, total=False): + """An invocation of a tool on an MCP server.""" + + id: Required[str] + """The unique ID of the tool call.""" + + arguments: Required[str] + """A JSON string of the arguments passed to the tool.""" + + name: Required[str] + """The name of the tool that was run.""" + + server_label: Required[str] + """The label of the MCP server running the tool.""" + + type: Required[Literal["mcp_call"]] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] + """The error from the tool call, if any.""" + + output: Optional[str] + """The output from the tool call.""" + + status: Literal["in_progress", "completed", "incomplete", "calling", "failed"] + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +class ItemReference(TypedDict, total=False): + """An internal identifier for an item to reference.""" + + id: Required[str] + """The ID of the item to reference.""" + + type: Optional[Literal["item_reference"]] + """The type of item to reference. Always `item_reference`.""" + + +ResponseInputItemParam: TypeAlias = Union[ + EasyInputMessageParam, + Message, + ResponseOutputMessageParam, + ResponseFileSearchToolCallParam, + ResponseComputerToolCallParam, + ComputerCallOutput, + ResponseFunctionWebSearchParam, + ResponseFunctionToolCallParam, + FunctionCallOutput, + ResponseReasoningItemParam, + ResponseCompactionItemParamParam, + ImageGenerationCall, + ResponseCodeInterpreterToolCallParam, + LocalShellCall, + LocalShellCallOutput, + ShellCall, + ShellCallOutput, + ApplyPatchCall, + ApplyPatchCallOutput, + McpListTools, + McpApprovalRequest, + McpApprovalResponse, + McpCall, + ResponseCustomToolCallOutputParam, + ResponseCustomToolCallParam, + ItemReference, +] + +ResponseInputParam: TypeAlias = List[ResponseInputItemParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text.py new file mode 100644 index 0000000000000000000000000000000000000000..1e06ba71f38cc0fb3cd3ee38724dbc8d33f69dcd --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputText"] + + +class ResponseInputText(BaseModel): + """A text input to the model.""" + + text: str + """The text input to the model.""" + + type: Literal["input_text"] + """The type of the input item. Always `input_text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content.py new file mode 100644 index 0000000000000000000000000000000000000000..66dbb8b0d0c9d1413a22e6860600fb8e8ff41b3a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseInputTextContent"] + + +class ResponseInputTextContent(BaseModel): + """A text input to the model.""" + + text: str + """The text input to the model.""" + + type: Literal["input_text"] + """The type of the input item. Always `input_text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..013f22d0df081e44a697541c216e42485cb6949d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_content_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputTextContentParam"] + + +class ResponseInputTextContentParam(TypedDict, total=False): + """A text input to the model.""" + + text: Required[str] + """The text input to the model.""" + + type: Required[Literal["input_text"]] + """The type of the input item. Always `input_text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_param.py new file mode 100644 index 0000000000000000000000000000000000000000..e1a2976e2eb018c31af0eed2ecbe58c2dcea5af0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_input_text_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseInputTextParam"] + + +class ResponseInputTextParam(TypedDict, total=False): + """A text input to the model.""" + + text: Required[str] + """The text input to the model.""" + + type: Required[Literal["input_text"]] + """The type of the input item. Always `input_text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_item.py new file mode 100644 index 0000000000000000000000000000000000000000..3dba681d53897ea105da4c4ba2ff13d367f61783 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_item.py @@ -0,0 +1,244 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_output_message import ResponseOutputMessage +from .response_computer_tool_call import ResponseComputerToolCall +from .response_input_message_item import ResponseInputMessageItem +from .response_function_web_search import ResponseFunctionWebSearch +from .response_apply_patch_tool_call import ResponseApplyPatchToolCall +from .response_file_search_tool_call import ResponseFileSearchToolCall +from .response_function_tool_call_item import ResponseFunctionToolCallItem +from .response_function_shell_tool_call import ResponseFunctionShellToolCall +from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall +from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput +from .response_computer_tool_call_output_item import ResponseComputerToolCallOutputItem +from .response_function_tool_call_output_item import ResponseFunctionToolCallOutputItem +from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput + +__all__ = [ + "ResponseItem", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "LocalShellCallOutput", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", + "McpApprovalResponse", + "McpCall", +] + + +class ImageGenerationCall(BaseModel): + """An image generation request made by the model.""" + + id: str + """The unique ID of the image generation call.""" + + result: Optional[str] = None + """The generated image encoded in base64.""" + + status: Literal["in_progress", "completed", "generating", "failed"] + """The status of the image generation call.""" + + type: Literal["image_generation_call"] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(BaseModel): + """Execute a shell command on the server.""" + + command: List[str] + """The command to run.""" + + env: Dict[str, str] + """Environment variables to set for the command.""" + + type: Literal["exec"] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] = None + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] = None + """Optional user to run the command as.""" + + working_directory: Optional[str] = None + """Optional working directory to run the command in.""" + + +class LocalShellCall(BaseModel): + """A tool call to run a command on the local shell.""" + + id: str + """The unique ID of the local shell call.""" + + action: LocalShellCallAction + """Execute a shell command on the server.""" + + call_id: str + """The unique ID of the local shell tool call generated by the model.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the local shell call.""" + + type: Literal["local_shell_call"] + """The type of the local shell call. Always `local_shell_call`.""" + + +class LocalShellCallOutput(BaseModel): + """The output of a local shell tool call.""" + + id: str + """The unique ID of the local shell tool call generated by the model.""" + + output: str + """A JSON string of the output of the local shell tool call.""" + + type: Literal["local_shell_call_output"] + """The type of the local shell tool call output. Always `local_shell_call_output`.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. One of `in_progress`, `completed`, or `incomplete`.""" + + +class McpListToolsTool(BaseModel): + """A tool available on an MCP server.""" + + input_schema: object + """The JSON schema describing the tool's input.""" + + name: str + """The name of the tool.""" + + annotations: Optional[object] = None + """Additional annotations about the tool.""" + + description: Optional[str] = None + """The description of the tool.""" + + +class McpListTools(BaseModel): + """A list of tools available on an MCP server.""" + + id: str + """The unique ID of the list.""" + + server_label: str + """The label of the MCP server.""" + + tools: List[McpListToolsTool] + """The tools available on the server.""" + + type: Literal["mcp_list_tools"] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] = None + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(BaseModel): + """A request for human approval of a tool invocation.""" + + id: str + """The unique ID of the approval request.""" + + arguments: str + """A JSON string of arguments for the tool.""" + + name: str + """The name of the tool to run.""" + + server_label: str + """The label of the MCP server making the request.""" + + type: Literal["mcp_approval_request"] + """The type of the item. Always `mcp_approval_request`.""" + + +class McpApprovalResponse(BaseModel): + """A response to an MCP approval request.""" + + id: str + """The unique ID of the approval response""" + + approval_request_id: str + """The ID of the approval request being answered.""" + + approve: bool + """Whether the request was approved.""" + + type: Literal["mcp_approval_response"] + """The type of the item. Always `mcp_approval_response`.""" + + reason: Optional[str] = None + """Optional reason for the decision.""" + + +class McpCall(BaseModel): + """An invocation of a tool on an MCP server.""" + + id: str + """The unique ID of the tool call.""" + + arguments: str + """A JSON string of the arguments passed to the tool.""" + + name: str + """The name of the tool that was run.""" + + server_label: str + """The label of the MCP server running the tool.""" + + type: Literal["mcp_call"] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] = None + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] = None + """The error from the tool call, if any.""" + + output: Optional[str] = None + """The output from the tool call.""" + + status: Optional[Literal["in_progress", "completed", "incomplete", "calling", "failed"]] = None + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +ResponseItem: TypeAlias = Annotated[ + Union[ + ResponseInputMessageItem, + ResponseOutputMessage, + ResponseFileSearchToolCall, + ResponseComputerToolCall, + ResponseComputerToolCallOutputItem, + ResponseFunctionWebSearch, + ResponseFunctionToolCallItem, + ResponseFunctionToolCallOutputItem, + ImageGenerationCall, + ResponseCodeInterpreterToolCall, + LocalShellCall, + LocalShellCallOutput, + ResponseFunctionShellToolCall, + ResponseFunctionShellToolCallOutput, + ResponseApplyPatchToolCall, + ResponseApplyPatchToolCallOutput, + McpListTools, + McpApprovalRequest, + McpApprovalResponse, + McpCall, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_item_list.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_item_list.py new file mode 100644 index 0000000000000000000000000000000000000000..e2b5a1a961c15b30fd9b03df9eb68d673369d90f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_item_list.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_item import ResponseItem + +__all__ = ["ResponseItemList"] + + +class ResponseItemList(BaseModel): + """A list of Response items.""" + + data: List[ResponseItem] + """A list of items used to generate this response.""" + + first_id: str + """The ID of the first item in the list.""" + + has_more: bool + """Whether there are more items available.""" + + last_id: str + """The ID of the last item in the list.""" + + object: Literal["list"] + """The type of object returned, must be `list`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..303ef494a3b4dae4c4166d97e5a380cb92d0bd31 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_delta_event.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallArgumentsDeltaEvent"] + + +class ResponseMcpCallArgumentsDeltaEvent(BaseModel): + """ + Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + """ + + delta: str + """ + A JSON string containing the partial update to the arguments for the MCP tool + call. + """ + + item_id: str + """The unique identifier of the MCP tool call item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_call_arguments.delta"] + """The type of the event. Always 'response.mcp_call_arguments.delta'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..59e71be77cf500416a2ff5599f48cd83bb59b406 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_arguments_done_event.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallArgumentsDoneEvent"] + + +class ResponseMcpCallArgumentsDoneEvent(BaseModel): + """Emitted when the arguments for an MCP tool call are finalized.""" + + arguments: str + """A JSON string containing the finalized arguments for the MCP tool call.""" + + item_id: str + """The unique identifier of the MCP tool call item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_call_arguments.done"] + """The type of the event. Always 'response.mcp_call_arguments.done'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..bee54d403965822dc8f0e50a99c0ce698996ac64 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_completed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallCompletedEvent"] + + +class ResponseMcpCallCompletedEvent(BaseModel): + """Emitted when an MCP tool call has completed successfully.""" + + item_id: str + """The ID of the MCP tool call item that completed.""" + + output_index: int + """The index of the output item that completed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_call.completed"] + """The type of the event. Always 'response.mcp_call.completed'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_failed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_failed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..cb3130b155bcaed9d88bcdd93b0f2353c32ca1c1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_failed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallFailedEvent"] + + +class ResponseMcpCallFailedEvent(BaseModel): + """Emitted when an MCP tool call has failed.""" + + item_id: str + """The ID of the MCP tool call item that failed.""" + + output_index: int + """The index of the output item that failed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_call.failed"] + """The type of the event. Always 'response.mcp_call.failed'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..7cf6a1decf4df418ec61013652c1cb06abba8069 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_call_in_progress_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpCallInProgressEvent"] + + +class ResponseMcpCallInProgressEvent(BaseModel): + """Emitted when an MCP tool call is in progress.""" + + item_id: str + """The unique identifier of the MCP tool call item being processed.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_call.in_progress"] + """The type of the event. Always 'response.mcp_call.in_progress'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..685ba59c4dbda5bf8f2ea389809f6aef699fe5d5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_completed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpListToolsCompletedEvent"] + + +class ResponseMcpListToolsCompletedEvent(BaseModel): + """Emitted when the list of available MCP tools has been successfully retrieved.""" + + item_id: str + """The ID of the MCP tool call item that produced this output.""" + + output_index: int + """The index of the output item that was processed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_list_tools.completed"] + """The type of the event. Always 'response.mcp_list_tools.completed'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_failed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_failed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c5fa54d231061e221f6af3fcc07c5a667cdb1229 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_failed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpListToolsFailedEvent"] + + +class ResponseMcpListToolsFailedEvent(BaseModel): + """Emitted when the attempt to list available MCP tools has failed.""" + + item_id: str + """The ID of the MCP tool call item that failed.""" + + output_index: int + """The index of the output item that failed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_list_tools.failed"] + """The type of the event. Always 'response.mcp_list_tools.failed'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..403fdbdeb3c59e536c8b1ed2b3237086e2bc2526 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_mcp_list_tools_in_progress_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseMcpListToolsInProgressEvent"] + + +class ResponseMcpListToolsInProgressEvent(BaseModel): + """ + Emitted when the system is in the process of retrieving the list of available MCP tools. + """ + + item_id: str + """The ID of the MCP tool call item that is being processed.""" + + output_index: int + """The index of the output item that is being processed.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.mcp_list_tools.in_progress"] + """The type of the event. Always 'response.mcp_list_tools.in_progress'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item.py new file mode 100644 index 0000000000000000000000000000000000000000..990f947b90dacfb2dc5482e9e5297dffafb7ad50 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item.py @@ -0,0 +1,205 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_output_message import ResponseOutputMessage +from .response_reasoning_item import ResponseReasoningItem +from .response_compaction_item import ResponseCompactionItem +from .response_custom_tool_call import ResponseCustomToolCall +from .response_computer_tool_call import ResponseComputerToolCall +from .response_function_tool_call import ResponseFunctionToolCall +from .response_function_web_search import ResponseFunctionWebSearch +from .response_apply_patch_tool_call import ResponseApplyPatchToolCall +from .response_file_search_tool_call import ResponseFileSearchToolCall +from .response_function_shell_tool_call import ResponseFunctionShellToolCall +from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall +from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput +from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput + +__all__ = [ + "ResponseOutputItem", + "ImageGenerationCall", + "LocalShellCall", + "LocalShellCallAction", + "McpCall", + "McpListTools", + "McpListToolsTool", + "McpApprovalRequest", +] + + +class ImageGenerationCall(BaseModel): + """An image generation request made by the model.""" + + id: str + """The unique ID of the image generation call.""" + + result: Optional[str] = None + """The generated image encoded in base64.""" + + status: Literal["in_progress", "completed", "generating", "failed"] + """The status of the image generation call.""" + + type: Literal["image_generation_call"] + """The type of the image generation call. Always `image_generation_call`.""" + + +class LocalShellCallAction(BaseModel): + """Execute a shell command on the server.""" + + command: List[str] + """The command to run.""" + + env: Dict[str, str] + """Environment variables to set for the command.""" + + type: Literal["exec"] + """The type of the local shell action. Always `exec`.""" + + timeout_ms: Optional[int] = None + """Optional timeout in milliseconds for the command.""" + + user: Optional[str] = None + """Optional user to run the command as.""" + + working_directory: Optional[str] = None + """Optional working directory to run the command in.""" + + +class LocalShellCall(BaseModel): + """A tool call to run a command on the local shell.""" + + id: str + """The unique ID of the local shell call.""" + + action: LocalShellCallAction + """Execute a shell command on the server.""" + + call_id: str + """The unique ID of the local shell tool call generated by the model.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the local shell call.""" + + type: Literal["local_shell_call"] + """The type of the local shell call. Always `local_shell_call`.""" + + +class McpCall(BaseModel): + """An invocation of a tool on an MCP server.""" + + id: str + """The unique ID of the tool call.""" + + arguments: str + """A JSON string of the arguments passed to the tool.""" + + name: str + """The name of the tool that was run.""" + + server_label: str + """The label of the MCP server running the tool.""" + + type: Literal["mcp_call"] + """The type of the item. Always `mcp_call`.""" + + approval_request_id: Optional[str] = None + """ + Unique identifier for the MCP tool call approval request. Include this value in + a subsequent `mcp_approval_response` input to approve or reject the + corresponding tool call. + """ + + error: Optional[str] = None + """The error from the tool call, if any.""" + + output: Optional[str] = None + """The output from the tool call.""" + + status: Optional[Literal["in_progress", "completed", "incomplete", "calling", "failed"]] = None + """The status of the tool call. + + One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + """ + + +class McpListToolsTool(BaseModel): + """A tool available on an MCP server.""" + + input_schema: object + """The JSON schema describing the tool's input.""" + + name: str + """The name of the tool.""" + + annotations: Optional[object] = None + """Additional annotations about the tool.""" + + description: Optional[str] = None + """The description of the tool.""" + + +class McpListTools(BaseModel): + """A list of tools available on an MCP server.""" + + id: str + """The unique ID of the list.""" + + server_label: str + """The label of the MCP server.""" + + tools: List[McpListToolsTool] + """The tools available on the server.""" + + type: Literal["mcp_list_tools"] + """The type of the item. Always `mcp_list_tools`.""" + + error: Optional[str] = None + """Error message if the server could not list tools.""" + + +class McpApprovalRequest(BaseModel): + """A request for human approval of a tool invocation.""" + + id: str + """The unique ID of the approval request.""" + + arguments: str + """A JSON string of arguments for the tool.""" + + name: str + """The name of the tool to run.""" + + server_label: str + """The label of the MCP server making the request.""" + + type: Literal["mcp_approval_request"] + """The type of the item. Always `mcp_approval_request`.""" + + +ResponseOutputItem: TypeAlias = Annotated[ + Union[ + ResponseOutputMessage, + ResponseFileSearchToolCall, + ResponseFunctionToolCall, + ResponseFunctionWebSearch, + ResponseComputerToolCall, + ResponseReasoningItem, + ResponseCompactionItem, + ImageGenerationCall, + ResponseCodeInterpreterToolCall, + LocalShellCall, + ResponseFunctionShellToolCall, + ResponseFunctionShellToolCallOutput, + ResponseApplyPatchToolCall, + ResponseApplyPatchToolCallOutput, + McpCall, + McpListTools, + McpApprovalRequest, + ResponseCustomToolCall, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_added_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_added_event.py new file mode 100644 index 0000000000000000000000000000000000000000..a42f6281e3e42a87edd69af82aca6c78f3c1defa --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_added_event.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_output_item import ResponseOutputItem + +__all__ = ["ResponseOutputItemAddedEvent"] + + +class ResponseOutputItemAddedEvent(BaseModel): + """Emitted when a new output item is added.""" + + item: ResponseOutputItem + """The output item that was added.""" + + output_index: int + """The index of the output item that was added.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.output_item.added"] + """The type of the event. Always `response.output_item.added`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..50b99da569024c32538c47533a2ff16063106d24 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_item_done_event.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_output_item import ResponseOutputItem + +__all__ = ["ResponseOutputItemDoneEvent"] + + +class ResponseOutputItemDoneEvent(BaseModel): + """Emitted when an output item is marked done.""" + + item: ResponseOutputItem + """The output item that was marked done.""" + + output_index: int + """The index of the output item that was marked done.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.output_item.done"] + """The type of the event. Always `response.output_item.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message.py new file mode 100644 index 0000000000000000000000000000000000000000..9c1d1f97fc75ed621086e338779e80d393f122f1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .response_output_text import ResponseOutputText +from .response_output_refusal import ResponseOutputRefusal + +__all__ = ["ResponseOutputMessage", "Content"] + +Content: TypeAlias = Annotated[Union[ResponseOutputText, ResponseOutputRefusal], PropertyInfo(discriminator="type")] + + +class ResponseOutputMessage(BaseModel): + """An output message from the model.""" + + id: str + """The unique ID of the output message.""" + + content: List[Content] + """The content of the output message.""" + + role: Literal["assistant"] + """The role of the output message. Always `assistant`.""" + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ + + type: Literal["message"] + """The type of the output message. Always `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9c2f5246a12a1d5a4734ead987fa003becb24b1e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_message_param.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .response_output_text_param import ResponseOutputTextParam +from .response_output_refusal_param import ResponseOutputRefusalParam + +__all__ = ["ResponseOutputMessageParam", "Content"] + +Content: TypeAlias = Union[ResponseOutputTextParam, ResponseOutputRefusalParam] + + +class ResponseOutputMessageParam(TypedDict, total=False): + """An output message from the model.""" + + id: Required[str] + """The unique ID of the output message.""" + + content: Required[Iterable[Content]] + """The content of the output message.""" + + role: Required[Literal["assistant"]] + """The role of the output message. Always `assistant`.""" + + status: Required[Literal["in_progress", "completed", "incomplete"]] + """The status of the message input. + + One of `in_progress`, `completed`, or `incomplete`. Populated when input items + are returned via API. + """ + + type: Required[Literal["message"]] + """The type of the output message. Always `message`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal.py new file mode 100644 index 0000000000000000000000000000000000000000..6bce26af741bf86f530c7bdbccb05efdd4e0cd47 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseOutputRefusal"] + + +class ResponseOutputRefusal(BaseModel): + """A refusal from the model.""" + + refusal: str + """The refusal explanation from the model.""" + + type: Literal["refusal"] + """The type of the refusal. Always `refusal`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal_param.py new file mode 100644 index 0000000000000000000000000000000000000000..02bdfdcf4f487c4c2764049ef0e45ef6b516fe63 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_refusal_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseOutputRefusalParam"] + + +class ResponseOutputRefusalParam(TypedDict, total=False): + """A refusal from the model.""" + + refusal: Required[str] + """The refusal explanation from the model.""" + + type: Required[Literal["refusal"]] + """The type of the refusal. Always `refusal`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text.py new file mode 100644 index 0000000000000000000000000000000000000000..2386fcb3c0c71921a47c1689c372900f5f753ec3 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ResponseOutputText", + "Annotation", + "AnnotationFileCitation", + "AnnotationURLCitation", + "AnnotationContainerFileCitation", + "AnnotationFilePath", + "Logprob", + "LogprobTopLogprob", +] + + +class AnnotationFileCitation(BaseModel): + """A citation to a file.""" + + file_id: str + """The ID of the file.""" + + filename: str + """The filename of the file cited.""" + + index: int + """The index of the file in the list of files.""" + + type: Literal["file_citation"] + """The type of the file citation. Always `file_citation`.""" + + +class AnnotationURLCitation(BaseModel): + """A citation for a web resource used to generate a model response.""" + + end_index: int + """The index of the last character of the URL citation in the message.""" + + start_index: int + """The index of the first character of the URL citation in the message.""" + + title: str + """The title of the web resource.""" + + type: Literal["url_citation"] + """The type of the URL citation. Always `url_citation`.""" + + url: str + """The URL of the web resource.""" + + +class AnnotationContainerFileCitation(BaseModel): + """A citation for a container file used to generate a model response.""" + + container_id: str + """The ID of the container file.""" + + end_index: int + """The index of the last character of the container file citation in the message.""" + + file_id: str + """The ID of the file.""" + + filename: str + """The filename of the container file cited.""" + + start_index: int + """The index of the first character of the container file citation in the message.""" + + type: Literal["container_file_citation"] + """The type of the container file citation. Always `container_file_citation`.""" + + +class AnnotationFilePath(BaseModel): + """A path to a file.""" + + file_id: str + """The ID of the file.""" + + index: int + """The index of the file in the list of files.""" + + type: Literal["file_path"] + """The type of the file path. Always `file_path`.""" + + +Annotation: TypeAlias = Annotated[ + Union[AnnotationFileCitation, AnnotationURLCitation, AnnotationContainerFileCitation, AnnotationFilePath], + PropertyInfo(discriminator="type"), +] + + +class LogprobTopLogprob(BaseModel): + """The top log probability of a token.""" + + token: str + + bytes: List[int] + + logprob: float + + +class Logprob(BaseModel): + """The log probability of a token.""" + + token: str + + bytes: List[int] + + logprob: float + + top_logprobs: List[LogprobTopLogprob] + + +class ResponseOutputText(BaseModel): + """A text output from the model.""" + + annotations: List[Annotation] + """The annotations of the text output.""" + + text: str + """The text output from the model.""" + + type: Literal["output_text"] + """The type of the output text. Always `output_text`.""" + + logprobs: Optional[List[Logprob]] = None diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_annotation_added_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_annotation_added_event.py new file mode 100644 index 0000000000000000000000000000000000000000..b9dc262150570f3f4f1ce0382b6e6bacb45e6494 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_annotation_added_event.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseOutputTextAnnotationAddedEvent"] + + +class ResponseOutputTextAnnotationAddedEvent(BaseModel): + """Emitted when an annotation is added to output text content.""" + + annotation: object + """The annotation object being added. (See annotation schema for details.)""" + + annotation_index: int + """The index of the annotation within the content part.""" + + content_index: int + """The index of the content part within the output item.""" + + item_id: str + """The unique identifier of the item to which the annotation is being added.""" + + output_index: int + """The index of the output item in the response's output array.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.output_text.annotation.added"] + """The type of the event. Always 'response.output_text.annotation.added'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_param.py new file mode 100644 index 0000000000000000000000000000000000000000..bc30fbcd8e1504d20fd5484284d614913f1bd674 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_output_text_param.py @@ -0,0 +1,129 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "ResponseOutputTextParam", + "Annotation", + "AnnotationFileCitation", + "AnnotationURLCitation", + "AnnotationContainerFileCitation", + "AnnotationFilePath", + "Logprob", + "LogprobTopLogprob", +] + + +class AnnotationFileCitation(TypedDict, total=False): + """A citation to a file.""" + + file_id: Required[str] + """The ID of the file.""" + + filename: Required[str] + """The filename of the file cited.""" + + index: Required[int] + """The index of the file in the list of files.""" + + type: Required[Literal["file_citation"]] + """The type of the file citation. Always `file_citation`.""" + + +class AnnotationURLCitation(TypedDict, total=False): + """A citation for a web resource used to generate a model response.""" + + end_index: Required[int] + """The index of the last character of the URL citation in the message.""" + + start_index: Required[int] + """The index of the first character of the URL citation in the message.""" + + title: Required[str] + """The title of the web resource.""" + + type: Required[Literal["url_citation"]] + """The type of the URL citation. Always `url_citation`.""" + + url: Required[str] + """The URL of the web resource.""" + + +class AnnotationContainerFileCitation(TypedDict, total=False): + """A citation for a container file used to generate a model response.""" + + container_id: Required[str] + """The ID of the container file.""" + + end_index: Required[int] + """The index of the last character of the container file citation in the message.""" + + file_id: Required[str] + """The ID of the file.""" + + filename: Required[str] + """The filename of the container file cited.""" + + start_index: Required[int] + """The index of the first character of the container file citation in the message.""" + + type: Required[Literal["container_file_citation"]] + """The type of the container file citation. Always `container_file_citation`.""" + + +class AnnotationFilePath(TypedDict, total=False): + """A path to a file.""" + + file_id: Required[str] + """The ID of the file.""" + + index: Required[int] + """The index of the file in the list of files.""" + + type: Required[Literal["file_path"]] + """The type of the file path. Always `file_path`.""" + + +Annotation: TypeAlias = Union[ + AnnotationFileCitation, AnnotationURLCitation, AnnotationContainerFileCitation, AnnotationFilePath +] + + +class LogprobTopLogprob(TypedDict, total=False): + """The top log probability of a token.""" + + token: Required[str] + + bytes: Required[Iterable[int]] + + logprob: Required[float] + + +class Logprob(TypedDict, total=False): + """The log probability of a token.""" + + token: Required[str] + + bytes: Required[Iterable[int]] + + logprob: Required[float] + + top_logprobs: Required[Iterable[LogprobTopLogprob]] + + +class ResponseOutputTextParam(TypedDict, total=False): + """A text output from the model.""" + + annotations: Required[Iterable[Annotation]] + """The annotations of the text output.""" + + text: Required[str] + """The text output from the model.""" + + type: Required[Literal["output_text"]] + """The type of the output text. Always `output_text`.""" + + logprobs: Iterable[Logprob] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt.py new file mode 100644 index 0000000000000000000000000000000000000000..e3acacf63a15e5d5127a78291b3bb482134ded86 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .response_input_file import ResponseInputFile +from .response_input_text import ResponseInputText +from .response_input_image import ResponseInputImage + +__all__ = ["ResponsePrompt", "Variables"] + +Variables: TypeAlias = Union[str, ResponseInputText, ResponseInputImage, ResponseInputFile] + + +class ResponsePrompt(BaseModel): + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + id: str + """The unique identifier of the prompt template to use.""" + + variables: Optional[Dict[str, Variables]] = None + """Optional map of values to substitute in for variables in your prompt. + + The substitution values can either be strings, or other Response input types + like images or files. + """ + + version: Optional[str] = None + """Optional version of the prompt template.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt_param.py new file mode 100644 index 0000000000000000000000000000000000000000..f9a28b62a2d863d997ffe77e0aab03654d4b4a08 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_prompt_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Required, TypeAlias, TypedDict + +from .response_input_file_param import ResponseInputFileParam +from .response_input_text_param import ResponseInputTextParam +from .response_input_image_param import ResponseInputImageParam + +__all__ = ["ResponsePromptParam", "Variables"] + +Variables: TypeAlias = Union[str, ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] + + +class ResponsePromptParam(TypedDict, total=False): + """ + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + """ + + id: Required[str] + """The unique identifier of the prompt template to use.""" + + variables: Optional[Dict[str, Variables]] + """Optional map of values to substitute in for variables in your prompt. + + The substitution values can either be strings, or other Response input types + like images or files. + """ + + version: Optional[str] + """Optional version of the prompt template.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_queued_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_queued_event.py new file mode 100644 index 0000000000000000000000000000000000000000..a554215275b51265d3c9f79f66280131f40906c2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_queued_event.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .response import Response +from ..._models import BaseModel + +__all__ = ["ResponseQueuedEvent"] + + +class ResponseQueuedEvent(BaseModel): + """Emitted when a response is queued and waiting to be processed.""" + + response: Response + """The full response object that is queued.""" + + sequence_number: int + """The sequence number for this event.""" + + type: Literal["response.queued"] + """The type of the event. Always 'response.queued'.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item.py new file mode 100644 index 0000000000000000000000000000000000000000..1a22eb60cc2e3293a8aa7df03156afb231784f6c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningItem", "Summary", "Content"] + + +class Summary(BaseModel): + """A summary text from the model.""" + + text: str + """A summary of the reasoning output from the model so far.""" + + type: Literal["summary_text"] + """The type of the object. Always `summary_text`.""" + + +class Content(BaseModel): + """Reasoning text from the model.""" + + text: str + """The reasoning text from the model.""" + + type: Literal["reasoning_text"] + """The type of the reasoning text. Always `reasoning_text`.""" + + +class ResponseReasoningItem(BaseModel): + """ + A description of the chain of thought used by a reasoning model while generating + a response. Be sure to include these items in your `input` to the Responses API + for subsequent turns of a conversation if you are manually + [managing context](https://platform.openai.com/docs/guides/conversation-state). + """ + + id: str + """The unique identifier of the reasoning content.""" + + summary: List[Summary] + """Reasoning summary content.""" + + type: Literal["reasoning"] + """The type of the object. Always `reasoning`.""" + + content: Optional[List[Content]] = None + """Reasoning text content.""" + + encrypted_content: Optional[str] = None + """ + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. + """ + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item_param.py new file mode 100644 index 0000000000000000000000000000000000000000..40320b72e19243b487e4530c5d6b80762c3d44c0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_item_param.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ResponseReasoningItemParam", "Summary", "Content"] + + +class Summary(TypedDict, total=False): + """A summary text from the model.""" + + text: Required[str] + """A summary of the reasoning output from the model so far.""" + + type: Required[Literal["summary_text"]] + """The type of the object. Always `summary_text`.""" + + +class Content(TypedDict, total=False): + """Reasoning text from the model.""" + + text: Required[str] + """The reasoning text from the model.""" + + type: Required[Literal["reasoning_text"]] + """The type of the reasoning text. Always `reasoning_text`.""" + + +class ResponseReasoningItemParam(TypedDict, total=False): + """ + A description of the chain of thought used by a reasoning model while generating + a response. Be sure to include these items in your `input` to the Responses API + for subsequent turns of a conversation if you are manually + [managing context](https://platform.openai.com/docs/guides/conversation-state). + """ + + id: Required[str] + """The unique identifier of the reasoning content.""" + + summary: Required[Iterable[Summary]] + """Reasoning summary content.""" + + type: Required[Literal["reasoning"]] + """The type of the object. Always `reasoning`.""" + + content: Iterable[Content] + """Reasoning text content.""" + + encrypted_content: Optional[str] + """ + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. + """ + + status: Literal["in_progress", "completed", "incomplete"] + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_added_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_added_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e4b0f34231c08f7eff9d5c0b523fcea9d00ba2be --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_added_event.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningSummaryPartAddedEvent", "Part"] + + +class Part(BaseModel): + """The summary part that was added.""" + + text: str + """The text of the summary part.""" + + type: Literal["summary_text"] + """The type of the summary part. Always `summary_text`.""" + + +class ResponseReasoningSummaryPartAddedEvent(BaseModel): + """Emitted when a new reasoning summary part is added.""" + + item_id: str + """The ID of the item this summary part is associated with.""" + + output_index: int + """The index of the output item this summary part is associated with.""" + + part: Part + """The summary part that was added.""" + + sequence_number: int + """The sequence number of this event.""" + + summary_index: int + """The index of the summary part within the reasoning summary.""" + + type: Literal["response.reasoning_summary_part.added"] + """The type of the event. Always `response.reasoning_summary_part.added`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..48f3f684e8b86764f691d3527390886319e75cbf --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_part_done_event.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningSummaryPartDoneEvent", "Part"] + + +class Part(BaseModel): + """The completed summary part.""" + + text: str + """The text of the summary part.""" + + type: Literal["summary_text"] + """The type of the summary part. Always `summary_text`.""" + + +class ResponseReasoningSummaryPartDoneEvent(BaseModel): + """Emitted when a reasoning summary part is completed.""" + + item_id: str + """The ID of the item this summary part is associated with.""" + + output_index: int + """The index of the output item this summary part is associated with.""" + + part: Part + """The completed summary part.""" + + sequence_number: int + """The sequence number of this event.""" + + summary_index: int + """The index of the summary part within the reasoning summary.""" + + type: Literal["response.reasoning_summary_part.done"] + """The type of the event. Always `response.reasoning_summary_part.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..84bcf039c4855af353bd36374b96e96c99d63794 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_delta_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningSummaryTextDeltaEvent"] + + +class ResponseReasoningSummaryTextDeltaEvent(BaseModel): + """Emitted when a delta is added to a reasoning summary text.""" + + delta: str + """The text delta that was added to the summary.""" + + item_id: str + """The ID of the item this summary text delta is associated with.""" + + output_index: int + """The index of the output item this summary text delta is associated with.""" + + sequence_number: int + """The sequence number of this event.""" + + summary_index: int + """The index of the summary part within the reasoning summary.""" + + type: Literal["response.reasoning_summary_text.delta"] + """The type of the event. Always `response.reasoning_summary_text.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..244d001b75327fbe6d27609c5dab544a4d238330 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_summary_text_done_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningSummaryTextDoneEvent"] + + +class ResponseReasoningSummaryTextDoneEvent(BaseModel): + """Emitted when a reasoning summary text is completed.""" + + item_id: str + """The ID of the item this summary text is associated with.""" + + output_index: int + """The index of the output item this summary text is associated with.""" + + sequence_number: int + """The sequence number of this event.""" + + summary_index: int + """The index of the summary part within the reasoning summary.""" + + text: str + """The full text of the completed reasoning summary.""" + + type: Literal["response.reasoning_summary_text.done"] + """The type of the event. Always `response.reasoning_summary_text.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..0e05226c9415054bea9e5130de9950428941c733 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_delta_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningTextDeltaEvent"] + + +class ResponseReasoningTextDeltaEvent(BaseModel): + """Emitted when a delta is added to a reasoning text.""" + + content_index: int + """The index of the reasoning content part this delta is associated with.""" + + delta: str + """The text delta that was added to the reasoning content.""" + + item_id: str + """The ID of the item this reasoning text delta is associated with.""" + + output_index: int + """The index of the output item this reasoning text delta is associated with.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.reasoning_text.delta"] + """The type of the event. Always `response.reasoning_text.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..40e3f4701c162d735a64d51e65ad8515220568e8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_reasoning_text_done_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseReasoningTextDoneEvent"] + + +class ResponseReasoningTextDoneEvent(BaseModel): + """Emitted when a reasoning text is completed.""" + + content_index: int + """The index of the reasoning content part.""" + + item_id: str + """The ID of the item this reasoning text is associated with.""" + + output_index: int + """The index of the output item this reasoning text is associated with.""" + + sequence_number: int + """The sequence number of this event.""" + + text: str + """The full text of the completed reasoning content.""" + + type: Literal["response.reasoning_text.done"] + """The type of the event. Always `response.reasoning_text.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..e3933b7ddaaad9b868aa4bf278dfe43633fa27b8 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_delta_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseRefusalDeltaEvent"] + + +class ResponseRefusalDeltaEvent(BaseModel): + """Emitted when there is a partial refusal text.""" + + content_index: int + """The index of the content part that the refusal text is added to.""" + + delta: str + """The refusal text that is added.""" + + item_id: str + """The ID of the output item that the refusal text is added to.""" + + output_index: int + """The index of the output item that the refusal text is added to.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.refusal.delta"] + """The type of the event. Always `response.refusal.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..91adeb6331956c99118a7ce7c3cfdaff291b4f56 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_refusal_done_event.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseRefusalDoneEvent"] + + +class ResponseRefusalDoneEvent(BaseModel): + """Emitted when refusal text is finalized.""" + + content_index: int + """The index of the content part that the refusal text is finalized.""" + + item_id: str + """The ID of the output item that the refusal text is finalized.""" + + output_index: int + """The index of the output item that the refusal text is finalized.""" + + refusal: str + """The refusal text that is finalized.""" + + sequence_number: int + """The sequence number of this event.""" + + type: Literal["response.refusal.done"] + """The type of the event. Always `response.refusal.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_retrieve_params.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_retrieve_params.py new file mode 100644 index 0000000000000000000000000000000000000000..4013db85cef816ad7d0c90bf5f11a2ab39bf8d5d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_retrieve_params.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypedDict + +from .response_includable import ResponseIncludable + +__all__ = ["ResponseRetrieveParamsBase", "ResponseRetrieveParamsNonStreaming", "ResponseRetrieveParamsStreaming"] + + +class ResponseRetrieveParamsBase(TypedDict, total=False): + include: List[ResponseIncludable] + """Additional fields to include in the response. + + See the `include` parameter for Response creation above for more information. + """ + + include_obfuscation: bool + """When true, stream obfuscation will be enabled. + + Stream obfuscation adds random characters to an `obfuscation` field on streaming + delta events to normalize payload sizes as a mitigation to certain side-channel + attacks. These obfuscation fields are included by default, but add a small + amount of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between your + application and the OpenAI API. + """ + + starting_after: int + """The sequence number of the event after which to start streaming.""" + + +class ResponseRetrieveParamsNonStreaming(ResponseRetrieveParamsBase, total=False): + stream: Literal[False] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + for more information. + """ + + +class ResponseRetrieveParamsStreaming(ResponseRetrieveParamsBase): + stream: Required[Literal[True]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the + [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + for more information. + """ + + +ResponseRetrieveParams = Union[ResponseRetrieveParamsNonStreaming, ResponseRetrieveParamsStreaming] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_status.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_status.py new file mode 100644 index 0000000000000000000000000000000000000000..a7887b92d2932e830f634b0b6863396569180319 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_status.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResponseStatus"] + +ResponseStatus: TypeAlias = Literal["completed", "failed", "in_progress", "cancelled", "queued", "incomplete"] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_stream_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_stream_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c0a317cd9dff7f2bdb80881c9f34dd5e21c5dda1 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_stream_event.py @@ -0,0 +1,120 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .response_error_event import ResponseErrorEvent +from .response_failed_event import ResponseFailedEvent +from .response_queued_event import ResponseQueuedEvent +from .response_created_event import ResponseCreatedEvent +from .response_completed_event import ResponseCompletedEvent +from .response_text_done_event import ResponseTextDoneEvent +from .response_audio_done_event import ResponseAudioDoneEvent +from .response_incomplete_event import ResponseIncompleteEvent +from .response_text_delta_event import ResponseTextDeltaEvent +from .response_audio_delta_event import ResponseAudioDeltaEvent +from .response_in_progress_event import ResponseInProgressEvent +from .response_refusal_done_event import ResponseRefusalDoneEvent +from .response_refusal_delta_event import ResponseRefusalDeltaEvent +from .response_mcp_call_failed_event import ResponseMcpCallFailedEvent +from .response_output_item_done_event import ResponseOutputItemDoneEvent +from .response_content_part_done_event import ResponseContentPartDoneEvent +from .response_output_item_added_event import ResponseOutputItemAddedEvent +from .response_content_part_added_event import ResponseContentPartAddedEvent +from .response_mcp_call_completed_event import ResponseMcpCallCompletedEvent +from .response_reasoning_text_done_event import ResponseReasoningTextDoneEvent +from .response_mcp_call_in_progress_event import ResponseMcpCallInProgressEvent +from .response_reasoning_text_delta_event import ResponseReasoningTextDeltaEvent +from .response_audio_transcript_done_event import ResponseAudioTranscriptDoneEvent +from .response_mcp_list_tools_failed_event import ResponseMcpListToolsFailedEvent +from .response_audio_transcript_delta_event import ResponseAudioTranscriptDeltaEvent +from .response_mcp_call_arguments_done_event import ResponseMcpCallArgumentsDoneEvent +from .response_image_gen_call_completed_event import ResponseImageGenCallCompletedEvent +from .response_mcp_call_arguments_delta_event import ResponseMcpCallArgumentsDeltaEvent +from .response_mcp_list_tools_completed_event import ResponseMcpListToolsCompletedEvent +from .response_image_gen_call_generating_event import ResponseImageGenCallGeneratingEvent +from .response_web_search_call_completed_event import ResponseWebSearchCallCompletedEvent +from .response_web_search_call_searching_event import ResponseWebSearchCallSearchingEvent +from .response_file_search_call_completed_event import ResponseFileSearchCallCompletedEvent +from .response_file_search_call_searching_event import ResponseFileSearchCallSearchingEvent +from .response_image_gen_call_in_progress_event import ResponseImageGenCallInProgressEvent +from .response_mcp_list_tools_in_progress_event import ResponseMcpListToolsInProgressEvent +from .response_custom_tool_call_input_done_event import ResponseCustomToolCallInputDoneEvent +from .response_reasoning_summary_part_done_event import ResponseReasoningSummaryPartDoneEvent +from .response_reasoning_summary_text_done_event import ResponseReasoningSummaryTextDoneEvent +from .response_web_search_call_in_progress_event import ResponseWebSearchCallInProgressEvent +from .response_custom_tool_call_input_delta_event import ResponseCustomToolCallInputDeltaEvent +from .response_file_search_call_in_progress_event import ResponseFileSearchCallInProgressEvent +from .response_function_call_arguments_done_event import ResponseFunctionCallArgumentsDoneEvent +from .response_image_gen_call_partial_image_event import ResponseImageGenCallPartialImageEvent +from .response_output_text_annotation_added_event import ResponseOutputTextAnnotationAddedEvent +from .response_reasoning_summary_part_added_event import ResponseReasoningSummaryPartAddedEvent +from .response_reasoning_summary_text_delta_event import ResponseReasoningSummaryTextDeltaEvent +from .response_function_call_arguments_delta_event import ResponseFunctionCallArgumentsDeltaEvent +from .response_code_interpreter_call_code_done_event import ResponseCodeInterpreterCallCodeDoneEvent +from .response_code_interpreter_call_completed_event import ResponseCodeInterpreterCallCompletedEvent +from .response_code_interpreter_call_code_delta_event import ResponseCodeInterpreterCallCodeDeltaEvent +from .response_code_interpreter_call_in_progress_event import ResponseCodeInterpreterCallInProgressEvent +from .response_code_interpreter_call_interpreting_event import ResponseCodeInterpreterCallInterpretingEvent + +__all__ = ["ResponseStreamEvent"] + +ResponseStreamEvent: TypeAlias = Annotated[ + Union[ + ResponseAudioDeltaEvent, + ResponseAudioDoneEvent, + ResponseAudioTranscriptDeltaEvent, + ResponseAudioTranscriptDoneEvent, + ResponseCodeInterpreterCallCodeDeltaEvent, + ResponseCodeInterpreterCallCodeDoneEvent, + ResponseCodeInterpreterCallCompletedEvent, + ResponseCodeInterpreterCallInProgressEvent, + ResponseCodeInterpreterCallInterpretingEvent, + ResponseCompletedEvent, + ResponseContentPartAddedEvent, + ResponseContentPartDoneEvent, + ResponseCreatedEvent, + ResponseErrorEvent, + ResponseFileSearchCallCompletedEvent, + ResponseFileSearchCallInProgressEvent, + ResponseFileSearchCallSearchingEvent, + ResponseFunctionCallArgumentsDeltaEvent, + ResponseFunctionCallArgumentsDoneEvent, + ResponseInProgressEvent, + ResponseFailedEvent, + ResponseIncompleteEvent, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, + ResponseReasoningSummaryPartAddedEvent, + ResponseReasoningSummaryPartDoneEvent, + ResponseReasoningSummaryTextDeltaEvent, + ResponseReasoningSummaryTextDoneEvent, + ResponseReasoningTextDeltaEvent, + ResponseReasoningTextDoneEvent, + ResponseRefusalDeltaEvent, + ResponseRefusalDoneEvent, + ResponseTextDeltaEvent, + ResponseTextDoneEvent, + ResponseWebSearchCallCompletedEvent, + ResponseWebSearchCallInProgressEvent, + ResponseWebSearchCallSearchingEvent, + ResponseImageGenCallCompletedEvent, + ResponseImageGenCallGeneratingEvent, + ResponseImageGenCallInProgressEvent, + ResponseImageGenCallPartialImageEvent, + ResponseMcpCallArgumentsDeltaEvent, + ResponseMcpCallArgumentsDoneEvent, + ResponseMcpCallCompletedEvent, + ResponseMcpCallFailedEvent, + ResponseMcpCallInProgressEvent, + ResponseMcpListToolsCompletedEvent, + ResponseMcpListToolsFailedEvent, + ResponseMcpListToolsInProgressEvent, + ResponseOutputTextAnnotationAddedEvent, + ResponseQueuedEvent, + ResponseCustomToolCallInputDeltaEvent, + ResponseCustomToolCallInputDoneEvent, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config.py new file mode 100644 index 0000000000000000000000000000000000000000..fbf4da0b03bff5fce0fca0ac7d2c7b384bef5390 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .response_format_text_config import ResponseFormatTextConfig + +__all__ = ["ResponseTextConfig"] + + +class ResponseTextConfig(BaseModel): + """Configuration options for a text response from the model. + + Can be plain + text or structured JSON data. Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + format: Optional[ResponseFormatTextConfig] = None + """An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` is + preferred for models that support it. + """ + + verbosity: Optional[Literal["low", "medium", "high"]] = None + """Constrains the verbosity of the model's response. + + Lower values will result in more concise responses, while higher values will + result in more verbose responses. Currently supported values are `low`, + `medium`, and `high`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9cd54765b0fc9734f2db72db1abbee2a8d6962ce --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_config_param.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, TypedDict + +from .response_format_text_config_param import ResponseFormatTextConfigParam + +__all__ = ["ResponseTextConfigParam"] + + +class ResponseTextConfigParam(TypedDict, total=False): + """Configuration options for a text response from the model. + + Can be plain + text or structured JSON data. Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + """ + + format: ResponseFormatTextConfigParam + """An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` is + preferred for models that support it. + """ + + verbosity: Optional[Literal["low", "medium", "high"]] + """Constrains the verbosity of the model's response. + + Lower values will result in more concise responses, while higher values will + result in more verbose responses. Currently supported values are `low`, + `medium`, and `high`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_text_delta_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..4f802abfd288f98e3443aa1612d51454f35377b6 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_delta_event.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseTextDeltaEvent", "Logprob", "LogprobTopLogprob"] + + +class LogprobTopLogprob(BaseModel): + token: Optional[str] = None + """A possible text token.""" + + logprob: Optional[float] = None + """The log probability of this token.""" + + +class Logprob(BaseModel): + """ + A logprob is the logarithmic probability that the model assigns to producing + a particular token at a given position in the sequence. Less-negative (higher) + logprob values indicate greater model confidence in that token choice. + """ + + token: str + """A possible text token.""" + + logprob: float + """The log probability of this token.""" + + top_logprobs: Optional[List[LogprobTopLogprob]] = None + """The log probability of the top 20 most likely tokens.""" + + +class ResponseTextDeltaEvent(BaseModel): + """Emitted when there is an additional text delta.""" + + content_index: int + """The index of the content part that the text delta was added to.""" + + delta: str + """The text delta that was added.""" + + item_id: str + """The ID of the output item that the text delta was added to.""" + + logprobs: List[Logprob] + """The log probabilities of the tokens in the delta.""" + + output_index: int + """The index of the output item that the text delta was added to.""" + + sequence_number: int + """The sequence number for this event.""" + + type: Literal["response.output_text.delta"] + """The type of the event. Always `response.output_text.delta`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_text_done_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_done_event.py new file mode 100644 index 0000000000000000000000000000000000000000..75bd47987096f66ededaa42f9f51ebccab2ea5ee --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_text_done_event.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseTextDoneEvent", "Logprob", "LogprobTopLogprob"] + + +class LogprobTopLogprob(BaseModel): + token: Optional[str] = None + """A possible text token.""" + + logprob: Optional[float] = None + """The log probability of this token.""" + + +class Logprob(BaseModel): + """ + A logprob is the logarithmic probability that the model assigns to producing + a particular token at a given position in the sequence. Less-negative (higher) + logprob values indicate greater model confidence in that token choice. + """ + + token: str + """A possible text token.""" + + logprob: float + """The log probability of this token.""" + + top_logprobs: Optional[List[LogprobTopLogprob]] = None + """The log probability of the top 20 most likely tokens.""" + + +class ResponseTextDoneEvent(BaseModel): + """Emitted when text content is finalized.""" + + content_index: int + """The index of the content part that the text content is finalized.""" + + item_id: str + """The ID of the output item that the text content is finalized.""" + + logprobs: List[Logprob] + """The log probabilities of the tokens in the delta.""" + + output_index: int + """The index of the output item that the text content is finalized.""" + + sequence_number: int + """The sequence number for this event.""" + + text: str + """The text content that is finalized.""" + + type: Literal["response.output_text.done"] + """The type of the event. Always `response.output_text.done`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_usage.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_usage.py new file mode 100644 index 0000000000000000000000000000000000000000..d4b739c598e1429e1edab90c9d27c04dfbb948be --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_usage.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["ResponseUsage", "InputTokensDetails", "OutputTokensDetails"] + + +class InputTokensDetails(BaseModel): + """A detailed breakdown of the input tokens.""" + + cached_tokens: int + """The number of tokens that were retrieved from the cache. + + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + """ + + +class OutputTokensDetails(BaseModel): + """A detailed breakdown of the output tokens.""" + + reasoning_tokens: int + """The number of reasoning tokens.""" + + +class ResponseUsage(BaseModel): + """ + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + """ + + input_tokens: int + """The number of input tokens.""" + + input_tokens_details: InputTokensDetails + """A detailed breakdown of the input tokens.""" + + output_tokens: int + """The number of output tokens.""" + + output_tokens_details: OutputTokensDetails + """A detailed breakdown of the output tokens.""" + + total_tokens: int + """The total number of tokens used.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_completed_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_completed_event.py new file mode 100644 index 0000000000000000000000000000000000000000..5aa7afe609439c1be20e93124adc6835447f8e08 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_completed_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseWebSearchCallCompletedEvent"] + + +class ResponseWebSearchCallCompletedEvent(BaseModel): + """Emitted when a web search call is completed.""" + + item_id: str + """Unique ID for the output item associated with the web search call.""" + + output_index: int + """The index of the output item that the web search call is associated with.""" + + sequence_number: int + """The sequence number of the web search call being processed.""" + + type: Literal["response.web_search_call.completed"] + """The type of the event. Always `response.web_search_call.completed`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_in_progress_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_in_progress_event.py new file mode 100644 index 0000000000000000000000000000000000000000..73b30ff5c0f4d1708d298771c82e28a6ebb913ab --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_in_progress_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseWebSearchCallInProgressEvent"] + + +class ResponseWebSearchCallInProgressEvent(BaseModel): + """Emitted when a web search call is initiated.""" + + item_id: str + """Unique ID for the output item associated with the web search call.""" + + output_index: int + """The index of the output item that the web search call is associated with.""" + + sequence_number: int + """The sequence number of the web search call being processed.""" + + type: Literal["response.web_search_call.in_progress"] + """The type of the event. Always `response.web_search_call.in_progress`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_searching_event.py b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_searching_event.py new file mode 100644 index 0000000000000000000000000000000000000000..959c09518743ccccf2b3b080fc301ed4ce662702 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/response_web_search_call_searching_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseWebSearchCallSearchingEvent"] + + +class ResponseWebSearchCallSearchingEvent(BaseModel): + """Emitted when a web search call is executing.""" + + item_id: str + """Unique ID for the output item associated with the web search call.""" + + output_index: int + """The index of the output item that the web search call is associated with.""" + + sequence_number: int + """The sequence number of the web search call being processed.""" + + type: Literal["response.web_search_call.searching"] + """The type of the event. Always `response.web_search_call.searching`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool.py new file mode 100644 index 0000000000000000000000000000000000000000..019962a0ba91df8659e4f78cc87f7a72c14cc42b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool.py @@ -0,0 +1,307 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from . import web_search_tool +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .custom_tool import CustomTool +from .computer_tool import ComputerTool +from .function_tool import FunctionTool +from .web_search_tool import WebSearchTool +from .apply_patch_tool import ApplyPatchTool +from .file_search_tool import FileSearchTool +from .function_shell_tool import FunctionShellTool +from .web_search_preview_tool import WebSearchPreviewTool + +__all__ = [ + "Tool", + "WebSearchTool", + "Mcp", + "McpAllowedTools", + "McpAllowedToolsMcpToolFilter", + "McpRequireApproval", + "McpRequireApprovalMcpToolApprovalFilter", + "McpRequireApprovalMcpToolApprovalFilterAlways", + "McpRequireApprovalMcpToolApprovalFilterNever", + "CodeInterpreter", + "CodeInterpreterContainer", + "CodeInterpreterContainerCodeInterpreterToolAuto", + "ImageGeneration", + "ImageGenerationInputImageMask", + "LocalShell", +] + +WebSearchToolFilters = web_search_tool.Filters +WebSearchToolUserLocation = web_search_tool.UserLocation + + +class McpAllowedToolsMcpToolFilter(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +McpAllowedTools: TypeAlias = Union[List[str], McpAllowedToolsMcpToolFilter, None] + + +class McpRequireApprovalMcpToolApprovalFilterAlways(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilterNever(BaseModel): + """A filter object to specify which tools are allowed.""" + + read_only: Optional[bool] = None + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: Optional[List[str]] = None + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilter(BaseModel): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: Optional[McpRequireApprovalMcpToolApprovalFilterAlways] = None + """A filter object to specify which tools are allowed.""" + + never: Optional[McpRequireApprovalMcpToolApprovalFilterNever] = None + """A filter object to specify which tools are allowed.""" + + +McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"], None] + + +class Mcp(BaseModel): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: str + """A label for this MCP server, used to identify it in tool calls.""" + + type: Literal["mcp"] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[McpAllowedTools] = None + """List of allowed tool names or a filter object.""" + + authorization: Optional[str] = None + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] = None + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[McpRequireApproval] = None + """Specify which of the MCP server's tools require approval.""" + + server_description: Optional[str] = None + """Optional description of the MCP server, used to provide more context.""" + + server_url: Optional[str] = None + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ + + +class CodeInterpreterContainerCodeInterpreterToolAuto(BaseModel): + """Configuration for a code interpreter container. + + Optionally specify the IDs of the files to run the code on. + """ + + type: Literal["auto"] + """Always `auto`.""" + + file_ids: Optional[List[str]] = None + """An optional list of uploaded files to make available to your code.""" + + memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]] = None + """The memory limit for the code interpreter container.""" + + +CodeInterpreterContainer: TypeAlias = Union[str, CodeInterpreterContainerCodeInterpreterToolAuto] + + +class CodeInterpreter(BaseModel): + """A tool that runs Python code to help generate a response to a prompt.""" + + container: CodeInterpreterContainer + """The code interpreter container. + + Can be a container ID or an object that specifies uploaded file IDs to make + available to your code, along with an optional `memory_limit` setting. + """ + + type: Literal["code_interpreter"] + """The type of the code interpreter tool. Always `code_interpreter`.""" + + +class ImageGenerationInputImageMask(BaseModel): + """Optional mask for inpainting. + + Contains `image_url` + (string, optional) and `file_id` (string, optional). + """ + + file_id: Optional[str] = None + """File ID for the mask image.""" + + image_url: Optional[str] = None + """Base64-encoded mask image.""" + + +class ImageGeneration(BaseModel): + """A tool that generates images using the GPT image models.""" + + type: Literal["image_generation"] + """The type of the image generation tool. Always `image_generation`.""" + + background: Optional[Literal["transparent", "opaque", "auto"]] = None + """Background type for the generated image. + + One of `transparent`, `opaque`, or `auto`. Default: `auto`. + """ + + input_fidelity: Optional[Literal["high", "low"]] = None + """ + Control how much effort the model will exert to match the style and features, + especially facial features, of input images. This parameter is only supported + for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + `low`. Defaults to `low`. + """ + + input_image_mask: Optional[ImageGenerationInputImageMask] = None + """Optional mask for inpainting. + + Contains `image_url` (string, optional) and `file_id` (string, optional). + """ + + model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"], None] = None + """The image generation model to use. Default: `gpt-image-1`.""" + + moderation: Optional[Literal["auto", "low"]] = None + """Moderation level for the generated image. Default: `auto`.""" + + output_compression: Optional[int] = None + """Compression level for the output image. Default: 100.""" + + output_format: Optional[Literal["png", "webp", "jpeg"]] = None + """The output format of the generated image. + + One of `png`, `webp`, or `jpeg`. Default: `png`. + """ + + partial_images: Optional[int] = None + """ + Number of partial images to generate in streaming mode, from 0 (default value) + to 3. + """ + + quality: Optional[Literal["low", "medium", "high", "auto"]] = None + """The quality of the generated image. + + One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + """ + + size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None + """The size of the generated image. + + One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. + """ + + +class LocalShell(BaseModel): + """A tool that allows the model to execute shell commands in a local environment.""" + + type: Literal["local_shell"] + """The type of the local shell tool. Always `local_shell`.""" + + +Tool: TypeAlias = Annotated[ + Union[ + FunctionTool, + FileSearchTool, + ComputerTool, + WebSearchTool, + Mcp, + CodeInterpreter, + ImageGeneration, + LocalShell, + FunctionShellTool, + CustomTool, + WebSearchPreviewTool, + ApplyPatchTool, + ], + PropertyInfo(discriminator="type"), +] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed.py new file mode 100644 index 0000000000000000000000000000000000000000..400e170a579df87b6d8fe5bb0c785b84adb94bd2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceAllowed"] + + +class ToolChoiceAllowed(BaseModel): + """Constrains the tools available to the model to a pre-defined set.""" + + mode: Literal["auto", "required"] + """Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + """ + + tools: List[Dict[str, object]] + """A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + """ + + type: Literal["allowed_tools"] + """Allowed tool configuration type. Always `allowed_tools`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cb316c15609a8a37dfecb59c35c765737e9dd7a5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_allowed_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceAllowedParam"] + + +class ToolChoiceAllowedParam(TypedDict, total=False): + """Constrains the tools available to the model to a pre-defined set.""" + + mode: Required[Literal["auto", "required"]] + """Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + """ + + tools: Required[Iterable[Dict[str, object]]] + """A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + """ + + type: Required[Literal["allowed_tools"]] + """Allowed tool configuration type. Always `allowed_tools`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch.py new file mode 100644 index 0000000000000000000000000000000000000000..ef5a5e8bfa1044c137d0937499cfea4895ccf3fd --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceApplyPatch"] + + +class ToolChoiceApplyPatch(BaseModel): + """Forces the model to call the apply_patch tool when executing a tool call.""" + + type: Literal["apply_patch"] + """The tool to call. Always `apply_patch`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch_param.py new file mode 100644 index 0000000000000000000000000000000000000000..193c99328a7281698cb7a57ff8058d56716d9e66 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_apply_patch_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceApplyPatchParam"] + + +class ToolChoiceApplyPatchParam(TypedDict, total=False): + """Forces the model to call the apply_patch tool when executing a tool call.""" + + type: Required[Literal["apply_patch"]] + """The tool to call. Always `apply_patch`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom.py new file mode 100644 index 0000000000000000000000000000000000000000..dec85ef78cd56e06165f3756fd06a71664857a76 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceCustom"] + + +class ToolChoiceCustom(BaseModel): + """Use this option to force the model to call a specific custom tool.""" + + name: str + """The name of the custom tool to call.""" + + type: Literal["custom"] + """For custom tool calling, the type is always `custom`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom_param.py new file mode 100644 index 0000000000000000000000000000000000000000..ccdbab568a5be11432ee2ba87e6ef1d3955f885f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_custom_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceCustomParam"] + + +class ToolChoiceCustomParam(TypedDict, total=False): + """Use this option to force the model to call a specific custom tool.""" + + name: Required[str] + """The name of the custom tool to call.""" + + type: Required[Literal["custom"]] + """For custom tool calling, the type is always `custom`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function.py new file mode 100644 index 0000000000000000000000000000000000000000..b2aab24acaac85ccf9934f9b7ac5378983dee3c7 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceFunction"] + + +class ToolChoiceFunction(BaseModel): + """Use this option to force the model to call a specific function.""" + + name: str + """The name of the function to call.""" + + type: Literal["function"] + """For function calling, the type is always `function`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function_param.py new file mode 100644 index 0000000000000000000000000000000000000000..837465ebd78b2257085d68a21ae0d9992a8a2414 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_function_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceFunctionParam"] + + +class ToolChoiceFunctionParam(TypedDict, total=False): + """Use this option to force the model to call a specific function.""" + + name: Required[str] + """The name of the function to call.""" + + type: Required[Literal["function"]] + """For function calling, the type is always `function`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp.py new file mode 100644 index 0000000000000000000000000000000000000000..a2c8049c2ddba9a21fba15c2b6599c281c6cacee --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceMcp"] + + +class ToolChoiceMcp(BaseModel): + """ + Use this option to force the model to call a specific tool on a remote MCP server. + """ + + server_label: str + """The label of the MCP server to use.""" + + type: Literal["mcp"] + """For MCP tools, the type is always `mcp`.""" + + name: Optional[str] = None + """The name of the tool to call on the server.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9726e47a47549298b550f9252c7cef1421aaf3bc --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_mcp_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceMcpParam"] + + +class ToolChoiceMcpParam(TypedDict, total=False): + """ + Use this option to force the model to call a specific tool on a remote MCP server. + """ + + server_label: Required[str] + """The label of the MCP server to use.""" + + type: Required[Literal["mcp"]] + """For MCP tools, the type is always `mcp`.""" + + name: Optional[str] + """The name of the tool to call on the server.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_options.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_options.py new file mode 100644 index 0000000000000000000000000000000000000000..c200db54e1f546a9712720773c57f1f8ec7f68bb --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_options.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ToolChoiceOptions"] + +ToolChoiceOptions: TypeAlias = Literal["none", "auto", "required"] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell.py new file mode 100644 index 0000000000000000000000000000000000000000..a78eccc387118196ab3f2661f2df86b49b59d1ad --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceShell"] + + +class ToolChoiceShell(BaseModel): + """Forces the model to call the shell tool when a tool call is required.""" + + type: Literal["shell"] + """The tool to call. Always `shell`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell_param.py new file mode 100644 index 0000000000000000000000000000000000000000..0dbcc90f3999d7537fa8c0674de0efa0280b145c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_shell_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceShellParam"] + + +class ToolChoiceShellParam(TypedDict, total=False): + """Forces the model to call the shell tool when a tool call is required.""" + + type: Required[Literal["shell"]] + """The tool to call. Always `shell`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types.py new file mode 100644 index 0000000000000000000000000000000000000000..044c014b19b1ed49e2ccb64f64da843a59f53de5 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ToolChoiceTypes"] + + +class ToolChoiceTypes(BaseModel): + """ + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + """ + + type: Literal[ + "file_search", + "web_search_preview", + "computer_use_preview", + "web_search_preview_2025_03_11", + "image_generation", + "code_interpreter", + ] + """The type of hosted tool the model should to use. + + Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer_use_preview` + - `code_interpreter` + - `image_generation` + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9bf02dbfccaca280d62ade102caca6bd3bcdbe1a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_choice_types_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ToolChoiceTypesParam"] + + +class ToolChoiceTypesParam(TypedDict, total=False): + """ + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + """ + + type: Required[ + Literal[ + "file_search", + "web_search_preview", + "computer_use_preview", + "web_search_preview_2025_03_11", + "image_generation", + "code_interpreter", + ] + ] + """The type of hosted tool the model should to use. + + Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer_use_preview` + - `code_interpreter` + - `image_generation` + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..37d3dde024d4f0b2eb1f0fca1a7f316015f7a3b9 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/tool_param.py @@ -0,0 +1,307 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from . import web_search_tool_param +from ..chat import ChatCompletionFunctionToolParam +from ..._types import SequenceNotStr +from .custom_tool_param import CustomToolParam +from .computer_tool_param import ComputerToolParam +from .function_tool_param import FunctionToolParam +from .web_search_tool_param import WebSearchToolParam +from .apply_patch_tool_param import ApplyPatchToolParam +from .file_search_tool_param import FileSearchToolParam +from .function_shell_tool_param import FunctionShellToolParam +from .web_search_preview_tool_param import WebSearchPreviewToolParam + +__all__ = [ + "ToolParam", + "Mcp", + "McpAllowedTools", + "McpAllowedToolsMcpToolFilter", + "McpRequireApproval", + "McpRequireApprovalMcpToolApprovalFilter", + "McpRequireApprovalMcpToolApprovalFilterAlways", + "McpRequireApprovalMcpToolApprovalFilterNever", + "CodeInterpreter", + "CodeInterpreterContainer", + "CodeInterpreterContainerCodeInterpreterToolAuto", + "ImageGeneration", + "ImageGenerationInputImageMask", + "LocalShell", +] + +WebSearchTool = web_search_tool_param.WebSearchToolParam +WebSearchToolFilters = web_search_tool_param.Filters +WebSearchToolUserLocation = web_search_tool_param.UserLocation + + +class McpAllowedToolsMcpToolFilter(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +McpAllowedTools: TypeAlias = Union[SequenceNotStr[str], McpAllowedToolsMcpToolFilter] + + +class McpRequireApprovalMcpToolApprovalFilterAlways(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilterNever(TypedDict, total=False): + """A filter object to specify which tools are allowed.""" + + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. + + If an MCP server is + [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + """ + + tool_names: SequenceNotStr[str] + """List of allowed tool names.""" + + +class McpRequireApprovalMcpToolApprovalFilter(TypedDict, total=False): + """Specify which of the MCP server's tools require approval. + + Can be + `always`, `never`, or a filter object associated with tools + that require approval. + """ + + always: McpRequireApprovalMcpToolApprovalFilterAlways + """A filter object to specify which tools are allowed.""" + + never: McpRequireApprovalMcpToolApprovalFilterNever + """A filter object to specify which tools are allowed.""" + + +McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"]] + + +class Mcp(TypedDict, total=False): + """ + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + """ + + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls.""" + + type: Required[Literal["mcp"]] + """The type of the MCP tool. Always `mcp`.""" + + allowed_tools: Optional[McpAllowedTools] + """List of allowed tool names or a filter object.""" + + authorization: str + """ + An OAuth access token that can be used with a remote MCP server, either with a + custom MCP server URL or a service connector. Your application must handle the + OAuth authorization flow and provide the token here. + """ + + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """Identifier for service connectors, like those available in ChatGPT. + + One of `server_url` or `connector_id` must be provided. Learn more about service + connectors + [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + Currently supported `connector_id` values are: + + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + """ + + headers: Optional[Dict[str, str]] + """Optional HTTP headers to send to the MCP server. + + Use for authentication or other purposes. + """ + + require_approval: Optional[McpRequireApproval] + """Specify which of the MCP server's tools require approval.""" + + server_description: str + """Optional description of the MCP server, used to provide more context.""" + + server_url: str + """The URL for the MCP server. + + One of `server_url` or `connector_id` must be provided. + """ + + +class CodeInterpreterContainerCodeInterpreterToolAuto(TypedDict, total=False): + """Configuration for a code interpreter container. + + Optionally specify the IDs of the files to run the code on. + """ + + type: Required[Literal["auto"]] + """Always `auto`.""" + + file_ids: SequenceNotStr[str] + """An optional list of uploaded files to make available to your code.""" + + memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]] + """The memory limit for the code interpreter container.""" + + +CodeInterpreterContainer: TypeAlias = Union[str, CodeInterpreterContainerCodeInterpreterToolAuto] + + +class CodeInterpreter(TypedDict, total=False): + """A tool that runs Python code to help generate a response to a prompt.""" + + container: Required[CodeInterpreterContainer] + """The code interpreter container. + + Can be a container ID or an object that specifies uploaded file IDs to make + available to your code, along with an optional `memory_limit` setting. + """ + + type: Required[Literal["code_interpreter"]] + """The type of the code interpreter tool. Always `code_interpreter`.""" + + +class ImageGenerationInputImageMask(TypedDict, total=False): + """Optional mask for inpainting. + + Contains `image_url` + (string, optional) and `file_id` (string, optional). + """ + + file_id: str + """File ID for the mask image.""" + + image_url: str + """Base64-encoded mask image.""" + + +class ImageGeneration(TypedDict, total=False): + """A tool that generates images using the GPT image models.""" + + type: Required[Literal["image_generation"]] + """The type of the image generation tool. Always `image_generation`.""" + + background: Literal["transparent", "opaque", "auto"] + """Background type for the generated image. + + One of `transparent`, `opaque`, or `auto`. Default: `auto`. + """ + + input_fidelity: Optional[Literal["high", "low"]] + """ + Control how much effort the model will exert to match the style and features, + especially facial features, of input images. This parameter is only supported + for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + `low`. Defaults to `low`. + """ + + input_image_mask: ImageGenerationInputImageMask + """Optional mask for inpainting. + + Contains `image_url` (string, optional) and `file_id` (string, optional). + """ + + model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"]] + """The image generation model to use. Default: `gpt-image-1`.""" + + moderation: Literal["auto", "low"] + """Moderation level for the generated image. Default: `auto`.""" + + output_compression: int + """Compression level for the output image. Default: 100.""" + + output_format: Literal["png", "webp", "jpeg"] + """The output format of the generated image. + + One of `png`, `webp`, or `jpeg`. Default: `png`. + """ + + partial_images: int + """ + Number of partial images to generate in streaming mode, from 0 (default value) + to 3. + """ + + quality: Literal["low", "medium", "high", "auto"] + """The quality of the generated image. + + One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + """ + + size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] + """The size of the generated image. + + One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. + """ + + +class LocalShell(TypedDict, total=False): + """A tool that allows the model to execute shell commands in a local environment.""" + + type: Required[Literal["local_shell"]] + """The type of the local shell tool. Always `local_shell`.""" + + +ToolParam: TypeAlias = Union[ + FunctionToolParam, + FileSearchToolParam, + ComputerToolParam, + WebSearchToolParam, + Mcp, + CodeInterpreter, + ImageGeneration, + LocalShell, + FunctionShellToolParam, + CustomToolParam, + WebSearchPreviewToolParam, + ApplyPatchToolParam, +] + + +ParseableToolParam: TypeAlias = Union[ToolParam, ChatCompletionFunctionToolParam] diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..12478e896dd4f9c1f80d3bb59e69f16db519e736 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["WebSearchPreviewTool", "UserLocation"] + + +class UserLocation(BaseModel): + """The user's location.""" + + type: Literal["approximate"] + """The type of location approximation. Always `approximate`.""" + + city: Optional[str] = None + """Free text input for the city of the user, e.g. `San Francisco`.""" + + country: Optional[str] = None + """ + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + the user, e.g. `US`. + """ + + region: Optional[str] = None + """Free text input for the region of the user, e.g. `California`.""" + + timezone: Optional[str] = None + """ + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + user, e.g. `America/Los_Angeles`. + """ + + +class WebSearchPreviewTool(BaseModel): + """This tool searches the web for relevant results to use in a response. + + Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + """ + + type: Literal["web_search_preview", "web_search_preview_2025_03_11"] + """The type of the web search tool. + + One of `web_search_preview` or `web_search_preview_2025_03_11`. + """ + + search_context_size: Optional[Literal["low", "medium", "high"]] = None + """High level guidance for the amount of context window space to use for the + search. + + One of `low`, `medium`, or `high`. `medium` is the default. + """ + + user_location: Optional[UserLocation] = None + """The user's location.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..09619a33940fa80e077837a280afbb76e1986db2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_preview_tool_param.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["WebSearchPreviewToolParam", "UserLocation"] + + +class UserLocation(TypedDict, total=False): + """The user's location.""" + + type: Required[Literal["approximate"]] + """The type of location approximation. Always `approximate`.""" + + city: Optional[str] + """Free text input for the city of the user, e.g. `San Francisco`.""" + + country: Optional[str] + """ + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + the user, e.g. `US`. + """ + + region: Optional[str] + """Free text input for the region of the user, e.g. `California`.""" + + timezone: Optional[str] + """ + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + user, e.g. `America/Los_Angeles`. + """ + + +class WebSearchPreviewToolParam(TypedDict, total=False): + """This tool searches the web for relevant results to use in a response. + + Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + """ + + type: Required[Literal["web_search_preview", "web_search_preview_2025_03_11"]] + """The type of the web search tool. + + One of `web_search_preview` or `web_search_preview_2025_03_11`. + """ + + search_context_size: Literal["low", "medium", "high"] + """High level guidance for the amount of context window space to use for the + search. + + One of `low`, `medium`, or `high`. `medium` is the default. + """ + + user_location: Optional[UserLocation] + """The user's location.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool.py b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..769f5c93a4e3a2442185176cf9af4afe55c61997 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["WebSearchTool", "Filters", "UserLocation"] + + +class Filters(BaseModel): + """Filters for the search.""" + + allowed_domains: Optional[List[str]] = None + """Allowed domains for the search. + + If not provided, all domains are allowed. Subdomains of the provided domains are + allowed as well. + + Example: `["pubmed.ncbi.nlm.nih.gov"]` + """ + + +class UserLocation(BaseModel): + """The approximate location of the user.""" + + city: Optional[str] = None + """Free text input for the city of the user, e.g. `San Francisco`.""" + + country: Optional[str] = None + """ + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + the user, e.g. `US`. + """ + + region: Optional[str] = None + """Free text input for the region of the user, e.g. `California`.""" + + timezone: Optional[str] = None + """ + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + user, e.g. `America/Los_Angeles`. + """ + + type: Optional[Literal["approximate"]] = None + """The type of location approximation. Always `approximate`.""" + + +class WebSearchTool(BaseModel): + """Search the Internet for sources related to the prompt. + + Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + """ + + type: Literal["web_search", "web_search_2025_08_26"] + """The type of the web search tool. + + One of `web_search` or `web_search_2025_08_26`. + """ + + filters: Optional[Filters] = None + """Filters for the search.""" + + search_context_size: Optional[Literal["low", "medium", "high"]] = None + """High level guidance for the amount of context window space to use for the + search. + + One of `low`, `medium`, or `high`. `medium` is the default. + """ + + user_location: Optional[UserLocation] = None + """The approximate location of the user.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool_param.py b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a4531a93049c1ee5783e93647df43323784b7a97 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/responses/web_search_tool_param.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["WebSearchToolParam", "Filters", "UserLocation"] + + +class Filters(TypedDict, total=False): + """Filters for the search.""" + + allowed_domains: Optional[SequenceNotStr[str]] + """Allowed domains for the search. + + If not provided, all domains are allowed. Subdomains of the provided domains are + allowed as well. + + Example: `["pubmed.ncbi.nlm.nih.gov"]` + """ + + +class UserLocation(TypedDict, total=False): + """The approximate location of the user.""" + + city: Optional[str] + """Free text input for the city of the user, e.g. `San Francisco`.""" + + country: Optional[str] + """ + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + the user, e.g. `US`. + """ + + region: Optional[str] + """Free text input for the region of the user, e.g. `California`.""" + + timezone: Optional[str] + """ + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + user, e.g. `America/Los_Angeles`. + """ + + type: Literal["approximate"] + """The type of location approximation. Always `approximate`.""" + + +class WebSearchToolParam(TypedDict, total=False): + """Search the Internet for sources related to the prompt. + + Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + """ + + type: Required[Literal["web_search", "web_search_2025_08_26"]] + """The type of the web search tool. + + One of `web_search` or `web_search_2025_08_26`. + """ + + filters: Optional[Filters] + """Filters for the search.""" + + search_context_size: Literal["low", "medium", "high"] + """High level guidance for the amount of context window space to use for the + search. + + One of `low`, `medium`, or `high`. `medium` is the default. + """ + + user_location: Optional[UserLocation] + """The approximate location of the user.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__init__.py b/py311/lib/python3.11/site-packages/openai/types/shared/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2930b9ae3bb637be259ce0b3d2831ea75b8f9251 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/__init__.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .metadata import Metadata as Metadata +from .reasoning import Reasoning as Reasoning +from .all_models import AllModels as AllModels +from .chat_model import ChatModel as ChatModel +from .error_object import ErrorObject as ErrorObject +from .compound_filter import CompoundFilter as CompoundFilter +from .responses_model import ResponsesModel as ResponsesModel +from .reasoning_effort import ReasoningEffort as ReasoningEffort +from .comparison_filter import ComparisonFilter as ComparisonFilter +from .function_definition import FunctionDefinition as FunctionDefinition +from .function_parameters import FunctionParameters as FunctionParameters +from .response_format_text import ResponseFormatText as ResponseFormatText +from .custom_tool_input_format import CustomToolInputFormat as CustomToolInputFormat +from .response_format_json_object import ResponseFormatJSONObject as ResponseFormatJSONObject +from .response_format_json_schema import ResponseFormatJSONSchema as ResponseFormatJSONSchema +from .response_format_text_python import ResponseFormatTextPython as ResponseFormatTextPython +from .response_format_text_grammar import ResponseFormatTextGrammar as ResponseFormatTextGrammar diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/__init__.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d838bea600d0ebda8b936784dc639ad6e47645f Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/__init__.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/all_models.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/all_models.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39b546dcf610c7fe4de9cf2b880d1829bc49eb0a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/all_models.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/comparison_filter.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/comparison_filter.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16b56b202bf08e70437bb6b4e5aa1526834b1018 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/comparison_filter.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/custom_tool_input_format.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/custom_tool_input_format.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..896ee4ace787a614f82123946fd399cc00101c6a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/custom_tool_input_format.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/error_object.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/error_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db62900b75f369284a2e07c1f40a02aab208154a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/error_object.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_definition.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_definition.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6e0e83e92d2d127b388e0f7ad7cb3ff5541c2e6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_definition.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_parameters.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_parameters.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fc72084b630488839c6f6ec7660014a6bfbbf39 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/function_parameters.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/metadata.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/metadata.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..143b2e05e19d361e0702b59f5876b47cac0d1fc6 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/metadata.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7e2edfebdd0fc8478f2245daaddc9a491621cda Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning_effort.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning_effort.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3155aa469ab5b54ea866b41a34feddbff4502295 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/reasoning_effort.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_object.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac89876688fa5ea666093827963453d48bd8274a Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_object.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_schema.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_schema.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d8842ebd44eba9b15179fbe3216b89605dce7cb Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_json_schema.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc5797341f19b1df05e87fd517ed192677450d89 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_grammar.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_grammar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82cf09a83b0d72955c2fc7ce489fe1a2e5918243 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_grammar.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_python.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_python.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94630b78b39cf7e28dcd3ed52d3830a29f01cf27 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/shared/__pycache__/response_format_text_python.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/all_models.py b/py311/lib/python3.11/site-packages/openai/types/shared/all_models.py new file mode 100644 index 0000000000000000000000000000000000000000..ba8e1d82cfaa71988e6b4b32fd59fd0291cda174 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/all_models.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from .chat_model import ChatModel + +__all__ = ["AllModels"] + +AllModels: TypeAlias = Union[ + str, + ChatModel, + Literal[ + "o1-pro", + "o1-pro-2025-03-19", + "o3-pro", + "o3-pro-2025-06-10", + "o3-deep-research", + "o3-deep-research-2025-06-26", + "o4-mini-deep-research", + "o4-mini-deep-research-2025-06-26", + "computer-use-preview", + "computer-use-preview-2025-03-11", + "gpt-5-codex", + "gpt-5-pro", + "gpt-5-pro-2025-10-06", + "gpt-5.1-codex-max", + ], +] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/chat_model.py b/py311/lib/python3.11/site-packages/openai/types/shared/chat_model.py new file mode 100644 index 0000000000000000000000000000000000000000..8223b81bef2a0b77087dc1b36cb8193ed18b3e7b --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/chat_model.py @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ChatModel"] + +ChatModel: TypeAlias = Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", + "gpt-5.1", + "gpt-5.1-2025-11-13", + "gpt-5.1-codex", + "gpt-5.1-mini", + "gpt-5.1-chat-latest", + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", + "gpt-5-2025-08-07", + "gpt-5-mini-2025-08-07", + "gpt-5-nano-2025-08-07", + "gpt-5-chat-latest", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "o4-mini", + "o4-mini-2025-04-16", + "o3", + "o3-2025-04-16", + "o3-mini", + "o3-mini-2025-01-31", + "o1", + "o1-2024-12-17", + "o1-preview", + "o1-preview-2024-09-12", + "o1-mini", + "o1-mini-2024-09-12", + "gpt-4o", + "gpt-4o-2024-11-20", + "gpt-4o-2024-08-06", + "gpt-4o-2024-05-13", + "gpt-4o-audio-preview", + "gpt-4o-audio-preview-2024-10-01", + "gpt-4o-audio-preview-2024-12-17", + "gpt-4o-audio-preview-2025-06-03", + "gpt-4o-mini-audio-preview", + "gpt-4o-mini-audio-preview-2024-12-17", + "gpt-4o-search-preview", + "gpt-4o-mini-search-preview", + "gpt-4o-search-preview-2025-03-11", + "gpt-4o-mini-search-preview-2025-03-11", + "chatgpt-4o-latest", + "codex-mini-latest", + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-turbo-preview", + "gpt-4-1106-preview", + "gpt-4-vision-preview", + "gpt-4", + "gpt-4-0314", + "gpt-4-0613", + "gpt-4-32k", + "gpt-4-32k-0314", + "gpt-4-32k-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0301", + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-16k-0613", +] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/comparison_filter.py b/py311/lib/python3.11/site-packages/openai/types/shared/comparison_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..852cac1738245eb8bbbfe9ea3f080400f5c6a335 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/comparison_filter.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ComparisonFilter"] + + +class ComparisonFilter(BaseModel): + """ + A filter used to compare a specified attribute key to a given value using a defined comparison operation. + """ + + key: str + """The key to compare against the value.""" + + type: Literal["eq", "ne", "gt", "gte", "lt", "lte"] + """ + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, + `nin`. + + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in + """ + + value: Union[str, float, bool, List[Union[str, float]]] + """ + The value to compare against the attribute key; supports string, number, or + boolean types. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/compound_filter.py b/py311/lib/python3.11/site-packages/openai/types/shared/compound_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..4801aaac1af6435a27edd4e278d4fa3a23182876 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/compound_filter.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from .comparison_filter import ComparisonFilter + +__all__ = ["CompoundFilter", "Filter"] + +Filter: TypeAlias = Union[ComparisonFilter, object] + + +class CompoundFilter(BaseModel): + """Combine multiple filters using `and` or `or`.""" + + filters: List[Filter] + """Array of filters to combine. + + Items can be `ComparisonFilter` or `CompoundFilter`. + """ + + type: Literal["and", "or"] + """Type of operation: `and` or `or`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/custom_tool_input_format.py b/py311/lib/python3.11/site-packages/openai/types/shared/custom_tool_input_format.py new file mode 100644 index 0000000000000000000000000000000000000000..9391692b7bb986e16b782289d3d57910c6cbc60a --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/custom_tool_input_format.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["CustomToolInputFormat", "Text", "Grammar"] + + +class Text(BaseModel): + """Unconstrained free-form text.""" + + type: Literal["text"] + """Unconstrained text format. Always `text`.""" + + +class Grammar(BaseModel): + """A grammar defined by the user.""" + + definition: str + """The grammar definition.""" + + syntax: Literal["lark", "regex"] + """The syntax of the grammar definition. One of `lark` or `regex`.""" + + type: Literal["grammar"] + """Grammar format. Always `grammar`.""" + + +CustomToolInputFormat: TypeAlias = Annotated[Union[Text, Grammar], PropertyInfo(discriminator="type")] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/error_object.py b/py311/lib/python3.11/site-packages/openai/types/shared/error_object.py new file mode 100644 index 0000000000000000000000000000000000000000..32d7045e006a37eb761dff818da642a6cf5d9a24 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/error_object.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ErrorObject"] + + +class ErrorObject(BaseModel): + code: Optional[str] = None + + message: str + + param: Optional[str] = None + + type: str diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/function_definition.py b/py311/lib/python3.11/site-packages/openai/types/shared/function_definition.py new file mode 100644 index 0000000000000000000000000000000000000000..33ebb9ad3e6c3300ad8c8bb88ac058919957f0e4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/function_definition.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .function_parameters import FunctionParameters + +__all__ = ["FunctionDefinition"] + + +class FunctionDefinition(BaseModel): + name: str + """The name of the function to be called. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + description: Optional[str] = None + """ + A description of what the function does, used by the model to choose when and + how to call the function. + """ + + parameters: Optional[FunctionParameters] = None + """The parameters the functions accepts, described as a JSON Schema object. + + See the [guide](https://platform.openai.com/docs/guides/function-calling) for + examples, and the + [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + documentation about the format. + + Omitting `parameters` defines a function with an empty parameter list. + """ + + strict: Optional[bool] = None + """Whether to enable strict schema adherence when generating the function call. + + If set to true, the model will follow the exact schema defined in the + `parameters` field. Only a subset of JSON Schema is supported when `strict` is + `true`. Learn more about Structured Outputs in the + [function calling guide](https://platform.openai.com/docs/guides/function-calling). + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/function_parameters.py b/py311/lib/python3.11/site-packages/openai/types/shared/function_parameters.py new file mode 100644 index 0000000000000000000000000000000000000000..a3d83e3496f94ba1ff63ca2b1088ac48a64d07f2 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/function_parameters.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict +from typing_extensions import TypeAlias + +__all__ = ["FunctionParameters"] + +FunctionParameters: TypeAlias = Dict[str, object] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/metadata.py b/py311/lib/python3.11/site-packages/openai/types/shared/metadata.py new file mode 100644 index 0000000000000000000000000000000000000000..0da88c679c27f27642b9162a17780c8930cc3bdc --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/metadata.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict +from typing_extensions import TypeAlias + +__all__ = ["Metadata"] + +Metadata: TypeAlias = Dict[str, str] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/reasoning.py b/py311/lib/python3.11/site-packages/openai/types/shared/reasoning.py new file mode 100644 index 0000000000000000000000000000000000000000..14f56a04cd7f6b2063c3c7a11ea0e0e70e4bc90c --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/reasoning.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .reasoning_effort import ReasoningEffort + +__all__ = ["Reasoning"] + + +class Reasoning(BaseModel): + """**gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + """ + + effort: Optional[ReasoningEffort] = None + """ + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported + reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool + calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not + support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + """ + + generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None + """**Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be useful for + debugging and understanding the model's reasoning process. One of `auto`, + `concise`, or `detailed`. + """ + + summary: Optional[Literal["auto", "concise", "detailed"]] = None + """A summary of the reasoning performed by the model. + + This can be useful for debugging and understanding the model's reasoning + process. One of `auto`, `concise`, or `detailed`. + + `concise` is supported for `computer-use-preview` models and all reasoning + models after `gpt-5`. + """ diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/reasoning_effort.py b/py311/lib/python3.11/site-packages/openai/types/shared/reasoning_effort.py new file mode 100644 index 0000000000000000000000000000000000000000..24d8516424dd03471171d90c29310d70defc4097 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/reasoning_effort.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal, TypeAlias + +__all__ = ["ReasoningEffort"] + +ReasoningEffort: TypeAlias = Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_object.py b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_object.py new file mode 100644 index 0000000000000000000000000000000000000000..98e0da6a2c152e546acec2dd4556f3eda95c2ef4 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_object.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFormatJSONObject"] + + +class ResponseFormatJSONObject(BaseModel): + """JSON object response format. + + An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + """ + + type: Literal["json_object"] + """The type of response format being defined. Always `json_object`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_schema.py b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_schema.py new file mode 100644 index 0000000000000000000000000000000000000000..9b2adb66cd34797bf14d60c66ebc7511e596ad16 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_json_schema.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ResponseFormatJSONSchema", "JSONSchema"] + + +class JSONSchema(BaseModel): + """Structured Outputs configuration options, including a JSON Schema.""" + + name: str + """The name of the response format. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + description: Optional[str] = None + """ + A description of what the response format is for, used by the model to determine + how to respond in the format. + """ + + schema_: Optional[Dict[str, object]] = FieldInfo(alias="schema", default=None) + """ + The schema for the response format, described as a JSON Schema object. Learn how + to build JSON schemas [here](https://json-schema.org/). + """ + + strict: Optional[bool] = None + """ + Whether to enable strict schema adherence when generating the output. If set to + true, the model will always follow the exact schema defined in the `schema` + field. Only a subset of JSON Schema is supported when `strict` is `true`. To + learn more, read the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + """ + + +class ResponseFormatJSONSchema(BaseModel): + """JSON Schema response format. + + Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + """ + + json_schema: JSONSchema + """Structured Outputs configuration options, including a JSON Schema.""" + + type: Literal["json_schema"] + """The type of response format being defined. Always `json_schema`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text.py b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text.py new file mode 100644 index 0000000000000000000000000000000000000000..9f4bc0d13edbc5b0a8bb717e2b66f94376ea4589 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFormatText"] + + +class ResponseFormatText(BaseModel): + """Default response format. Used to generate text responses.""" + + type: Literal["text"] + """The type of response format being defined. Always `text`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_grammar.py b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_grammar.py new file mode 100644 index 0000000000000000000000000000000000000000..84cd14127889d7511abae1378177da15e6e2298f --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_grammar.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFormatTextGrammar"] + + +class ResponseFormatTextGrammar(BaseModel): + """ + A custom grammar for the model to follow when generating text. + Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars). + """ + + grammar: str + """The custom grammar for the model to follow.""" + + type: Literal["grammar"] + """The type of response format being defined. Always `grammar`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_python.py b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_python.py new file mode 100644 index 0000000000000000000000000000000000000000..1b04cb62ba08595293e32466561cfbf888457774 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/response_format_text_python.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ResponseFormatTextPython"] + + +class ResponseFormatTextPython(BaseModel): + """Configure the model to generate valid Python code. + + See the + [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details. + """ + + type: Literal["python"] + """The type of response format being defined. Always `python`.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/shared/responses_model.py b/py311/lib/python3.11/site-packages/openai/types/shared/responses_model.py new file mode 100644 index 0000000000000000000000000000000000000000..38cdea9a941684ba2df5f9de9401db7a683b5db0 --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/shared/responses_model.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from .chat_model import ChatModel + +__all__ = ["ResponsesModel"] + +ResponsesModel: TypeAlias = Union[ + str, + ChatModel, + Literal[ + "o1-pro", + "o1-pro-2025-03-19", + "o3-pro", + "o3-pro-2025-06-10", + "o3-deep-research", + "o3-deep-research-2025-06-26", + "o4-mini-deep-research", + "o4-mini-deep-research-2025-06-26", + "computer-use-preview", + "computer-use-preview-2025-03-11", + "gpt-5-codex", + "gpt-5-pro", + "gpt-5-pro-2025-10-06", + "gpt-5.1-codex-max", + ], +] diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/__init__.py b/py311/lib/python3.11/site-packages/openai/types/uploads/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..41deb0ab4bf9c1987cbe67c34b010f30902dea4d --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/uploads/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .upload_part import UploadPart as UploadPart +from .part_create_params import PartCreateParams as PartCreateParams diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/__init__.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..631550ba125c68f269679dc804b44084fc18c466 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/__init__.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/part_create_params.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/part_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51cb858941685f9c9307db9027d8cf7e334cbc46 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/part_create_params.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/upload_part.cpython-311.pyc b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/upload_part.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9345f48734b716e8d921253a579017099f1d0cb9 Binary files /dev/null and b/py311/lib/python3.11/site-packages/openai/types/uploads/__pycache__/upload_part.cpython-311.pyc differ diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/part_create_params.py b/py311/lib/python3.11/site-packages/openai/types/uploads/part_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..9851ca41e96ae6019038c7ce9e26c6cc13d1e84e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/uploads/part_create_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..._types import FileTypes + +__all__ = ["PartCreateParams"] + + +class PartCreateParams(TypedDict, total=False): + data: Required[FileTypes] + """The chunk of bytes for this Part.""" diff --git a/py311/lib/python3.11/site-packages/openai/types/uploads/upload_part.py b/py311/lib/python3.11/site-packages/openai/types/uploads/upload_part.py new file mode 100644 index 0000000000000000000000000000000000000000..e585b1a227bd8d8cbc92f1114f9db34ffe15e61e --- /dev/null +++ b/py311/lib/python3.11/site-packages/openai/types/uploads/upload_part.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["UploadPart"] + + +class UploadPart(BaseModel): + """The upload Part represents a chunk of bytes we can add to an Upload object.""" + + id: str + """The upload Part unique identifier, which can be referenced in API endpoints.""" + + created_at: int + """The Unix timestamp (in seconds) for when the Part was created.""" + + object: Literal["upload.part"] + """The object type, which is always `upload.part`.""" + + upload_id: str + """The ID of the Upload object that this Part was added to."""