aimlapi-sdk-python 2.8.1b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aimlapi/__init__.py +243 -0
- aimlapi/__main__.py +3 -0
- aimlapi/_client.py +368 -0
- aimlapi/_utils/__init__.py +3 -0
- aimlapi/_utils/_compat.py +3 -0
- aimlapi/_utils/_datetime_parse.py +3 -0
- aimlapi/_utils/_logs.py +3 -0
- aimlapi/_utils/_proxy.py +3 -0
- aimlapi/_utils/_reflection.py +3 -0
- aimlapi/_utils/_resources_proxy.py +3 -0
- aimlapi/_utils/_streams.py +3 -0
- aimlapi/_utils/_sync.py +3 -0
- aimlapi/_utils/_transform.py +3 -0
- aimlapi/_utils/_typing.py +3 -0
- aimlapi/_utils/_utils.py +3 -0
- aimlapi/_version.py +9 -0
- aimlapi/cli/__init__.py +3 -0
- aimlapi/cli/_api/__init__.py +3 -0
- aimlapi/cli/_api/_main.py +3 -0
- aimlapi/cli/_api/audio.py +3 -0
- aimlapi/cli/_api/chat/__init__.py +3 -0
- aimlapi/cli/_api/chat/completions.py +3 -0
- aimlapi/cli/_api/completions.py +3 -0
- aimlapi/cli/_api/files.py +3 -0
- aimlapi/cli/_api/fine_tuning/__init__.py +3 -0
- aimlapi/cli/_api/fine_tuning/jobs.py +3 -0
- aimlapi/cli/_api/image.py +3 -0
- aimlapi/cli/_api/models.py +3 -0
- aimlapi/cli/_cli.py +3 -0
- aimlapi/cli/_errors.py +3 -0
- aimlapi/cli/_models.py +3 -0
- aimlapi/cli/_progress.py +3 -0
- aimlapi/cli/_tools/__init__.py +3 -0
- aimlapi/cli/_tools/_main.py +3 -0
- aimlapi/cli/_tools/fine_tunes.py +3 -0
- aimlapi/cli/_tools/migrate.py +3 -0
- aimlapi/cli/_utils.py +3 -0
- aimlapi/helpers/__init__.py +3 -0
- aimlapi/helpers/local_audio_player.py +3 -0
- aimlapi/helpers/microphone.py +3 -0
- aimlapi/lib/__init__.py +3 -0
- aimlapi/lib/_old_api.py +3 -0
- aimlapi/lib/_parsing/__init__.py +3 -0
- aimlapi/lib/_parsing/_completions.py +3 -0
- aimlapi/lib/_parsing/_responses.py +3 -0
- aimlapi/lib/_pydantic.py +3 -0
- aimlapi/lib/_realtime.py +3 -0
- aimlapi/lib/_tools.py +3 -0
- aimlapi/lib/_validators.py +3 -0
- aimlapi/lib/azure.py +3 -0
- aimlapi/lib/streaming/__init__.py +3 -0
- aimlapi/lib/streaming/_assistants.py +3 -0
- aimlapi/lib/streaming/_deltas.py +3 -0
- aimlapi/lib/streaming/chat/__init__.py +3 -0
- aimlapi/lib/streaming/chat/_completions.py +3 -0
- aimlapi/lib/streaming/chat/_events.py +3 -0
- aimlapi/lib/streaming/chat/_types.py +3 -0
- aimlapi/lib/streaming/responses/__init__.py +3 -0
- aimlapi/lib/streaming/responses/_events.py +3 -0
- aimlapi/lib/streaming/responses/_responses.py +3 -0
- aimlapi/lib/streaming/responses/_types.py +3 -0
- aimlapi/pagination.py +3 -0
- aimlapi/resources/__init__.py +3 -0
- aimlapi/resources/audio/__init__.py +47 -0
- aimlapi/resources/audio/_polling.py +129 -0
- aimlapi/resources/audio/audio.py +56 -0
- aimlapi/resources/audio/speech.py +428 -0
- aimlapi/resources/audio/transcriptions.py +219 -0
- aimlapi/resources/audio/translations.py +3 -0
- aimlapi/resources/batches.py +3 -0
- aimlapi/resources/beta/__init__.py +3 -0
- aimlapi/resources/beta/assistants.py +3 -0
- aimlapi/resources/beta/beta.py +3 -0
- aimlapi/resources/beta/chatkit/__init__.py +3 -0
- aimlapi/resources/beta/chatkit/chatkit.py +3 -0
- aimlapi/resources/beta/chatkit/sessions.py +3 -0
- aimlapi/resources/beta/chatkit/threads.py +3 -0
- aimlapi/resources/beta/realtime/__init__.py +3 -0
- aimlapi/resources/beta/realtime/realtime.py +3 -0
- aimlapi/resources/beta/realtime/sessions.py +3 -0
- aimlapi/resources/beta/realtime/transcription_sessions.py +3 -0
- aimlapi/resources/beta/threads/__init__.py +3 -0
- aimlapi/resources/beta/threads/messages.py +3 -0
- aimlapi/resources/beta/threads/runs/__init__.py +3 -0
- aimlapi/resources/beta/threads/runs/runs.py +3 -0
- aimlapi/resources/beta/threads/runs/steps.py +3 -0
- aimlapi/resources/beta/threads/threads.py +3 -0
- aimlapi/resources/chat/__init__.py +3 -0
- aimlapi/resources/chat/chat.py +86 -0
- aimlapi/resources/chat/completions/__init__.py +4 -0
- aimlapi/resources/chat/completions/completions.py +452 -0
- aimlapi/resources/chat/completions/messages.py +3 -0
- aimlapi/resources/completions.py +3 -0
- aimlapi/resources/containers/__init__.py +3 -0
- aimlapi/resources/containers/containers.py +3 -0
- aimlapi/resources/containers/files/__init__.py +3 -0
- aimlapi/resources/containers/files/content.py +3 -0
- aimlapi/resources/containers/files/files.py +3 -0
- aimlapi/resources/conversations/__init__.py +3 -0
- aimlapi/resources/conversations/conversations.py +3 -0
- aimlapi/resources/conversations/items.py +3 -0
- aimlapi/resources/embeddings.py +3 -0
- aimlapi/resources/evals/__init__.py +3 -0
- aimlapi/resources/evals/evals.py +3 -0
- aimlapi/resources/evals/runs/__init__.py +3 -0
- aimlapi/resources/evals/runs/output_items.py +3 -0
- aimlapi/resources/evals/runs/runs.py +3 -0
- aimlapi/resources/files.py +3 -0
- aimlapi/resources/fine_tuning/__init__.py +3 -0
- aimlapi/resources/fine_tuning/alpha/__init__.py +3 -0
- aimlapi/resources/fine_tuning/alpha/alpha.py +3 -0
- aimlapi/resources/fine_tuning/alpha/graders.py +3 -0
- aimlapi/resources/fine_tuning/checkpoints/__init__.py +3 -0
- aimlapi/resources/fine_tuning/checkpoints/checkpoints.py +3 -0
- aimlapi/resources/fine_tuning/checkpoints/permissions.py +3 -0
- aimlapi/resources/fine_tuning/fine_tuning.py +3 -0
- aimlapi/resources/fine_tuning/jobs/__init__.py +3 -0
- aimlapi/resources/fine_tuning/jobs/checkpoints.py +3 -0
- aimlapi/resources/fine_tuning/jobs/jobs.py +3 -0
- aimlapi/resources/images.py +184 -0
- aimlapi/resources/models.py +3 -0
- aimlapi/resources/moderations.py +3 -0
- aimlapi/resources/realtime/__init__.py +3 -0
- aimlapi/resources/realtime/calls.py +3 -0
- aimlapi/resources/realtime/client_secrets.py +3 -0
- aimlapi/resources/realtime/realtime.py +3 -0
- aimlapi/resources/responses/__init__.py +4 -0
- aimlapi/resources/responses/input_items.py +3 -0
- aimlapi/resources/responses/input_tokens.py +3 -0
- aimlapi/resources/responses/responses.py +229 -0
- aimlapi/resources/uploads/__init__.py +19 -0
- aimlapi/resources/uploads/parts.py +3 -0
- aimlapi/resources/uploads/uploads.py +99 -0
- aimlapi/resources/vector_stores/__init__.py +3 -0
- aimlapi/resources/vector_stores/file_batches.py +3 -0
- aimlapi/resources/vector_stores/files.py +3 -0
- aimlapi/resources/vector_stores/vector_stores.py +3 -0
- aimlapi/resources/videos.py +267 -0
- aimlapi/resources/webhooks.py +3 -0
- aimlapi/types/__init__.py +3 -0
- aimlapi/types/audio/__init__.py +3 -0
- aimlapi/types/audio/speech_create_params.py +3 -0
- aimlapi/types/audio/speech_model.py +3 -0
- aimlapi/types/audio/transcription.py +3 -0
- aimlapi/types/audio/transcription_create_params.py +3 -0
- aimlapi/types/audio/transcription_create_response.py +3 -0
- aimlapi/types/audio/transcription_diarized.py +3 -0
- aimlapi/types/audio/transcription_diarized_segment.py +3 -0
- aimlapi/types/audio/transcription_include.py +3 -0
- aimlapi/types/audio/transcription_segment.py +3 -0
- aimlapi/types/audio/transcription_stream_event.py +3 -0
- aimlapi/types/audio/transcription_text_delta_event.py +3 -0
- aimlapi/types/audio/transcription_text_done_event.py +3 -0
- aimlapi/types/audio/transcription_text_segment_event.py +3 -0
- aimlapi/types/audio/transcription_verbose.py +3 -0
- aimlapi/types/audio/transcription_word.py +3 -0
- aimlapi/types/audio/translation.py +3 -0
- aimlapi/types/audio/translation_create_params.py +3 -0
- aimlapi/types/audio/translation_create_response.py +3 -0
- aimlapi/types/audio/translation_verbose.py +3 -0
- aimlapi/types/audio_model.py +3 -0
- aimlapi/types/audio_response_format.py +3 -0
- aimlapi/types/auto_file_chunking_strategy_param.py +3 -0
- aimlapi/types/batch.py +3 -0
- aimlapi/types/batch_create_params.py +3 -0
- aimlapi/types/batch_error.py +3 -0
- aimlapi/types/batch_list_params.py +3 -0
- aimlapi/types/batch_request_counts.py +3 -0
- aimlapi/types/batch_usage.py +3 -0
- aimlapi/types/beta/__init__.py +3 -0
- aimlapi/types/beta/assistant.py +3 -0
- aimlapi/types/beta/assistant_create_params.py +3 -0
- aimlapi/types/beta/assistant_deleted.py +3 -0
- aimlapi/types/beta/assistant_list_params.py +3 -0
- aimlapi/types/beta/assistant_response_format_option.py +3 -0
- aimlapi/types/beta/assistant_response_format_option_param.py +3 -0
- aimlapi/types/beta/assistant_stream_event.py +3 -0
- aimlapi/types/beta/assistant_tool.py +3 -0
- aimlapi/types/beta/assistant_tool_choice.py +3 -0
- aimlapi/types/beta/assistant_tool_choice_function.py +3 -0
- aimlapi/types/beta/assistant_tool_choice_function_param.py +3 -0
- aimlapi/types/beta/assistant_tool_choice_option.py +3 -0
- aimlapi/types/beta/assistant_tool_choice_option_param.py +3 -0
- aimlapi/types/beta/assistant_tool_choice_param.py +3 -0
- aimlapi/types/beta/assistant_tool_param.py +3 -0
- aimlapi/types/beta/assistant_update_params.py +3 -0
- aimlapi/types/beta/chat/__init__.py +3 -0
- aimlapi/types/beta/chatkit/__init__.py +3 -0
- aimlapi/types/beta/chatkit/chat_session.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_automatic_thread_titling.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_chatkit_configuration.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_chatkit_configuration_param.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_expires_after_param.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_file_upload.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_history.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_rate_limits.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_rate_limits_param.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_status.py +3 -0
- aimlapi/types/beta/chatkit/chat_session_workflow_param.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_attachment.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_response_output_text.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_thread.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_thread_assistant_message_item.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_thread_item_list.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_thread_user_message_item.py +3 -0
- aimlapi/types/beta/chatkit/chatkit_widget_item.py +3 -0
- aimlapi/types/beta/chatkit/session_create_params.py +3 -0
- aimlapi/types/beta/chatkit/thread_delete_response.py +3 -0
- aimlapi/types/beta/chatkit/thread_list_items_params.py +3 -0
- aimlapi/types/beta/chatkit/thread_list_params.py +3 -0
- aimlapi/types/beta/chatkit_workflow.py +3 -0
- aimlapi/types/beta/code_interpreter_tool.py +3 -0
- aimlapi/types/beta/code_interpreter_tool_param.py +3 -0
- aimlapi/types/beta/file_search_tool.py +3 -0
- aimlapi/types/beta/file_search_tool_param.py +3 -0
- aimlapi/types/beta/function_tool.py +3 -0
- aimlapi/types/beta/function_tool_param.py +3 -0
- aimlapi/types/beta/realtime/__init__.py +3 -0
- aimlapi/types/beta/realtime/conversation_created_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_content.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_content_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_create_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_create_event_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_created_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_delete_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_delete_event_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_deleted_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_retrieve_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_retrieve_event_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_truncate_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_truncate_event_param.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_truncated_event.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_with_reference.py +3 -0
- aimlapi/types/beta/realtime/conversation_item_with_reference_param.py +3 -0
- aimlapi/types/beta/realtime/error_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_append_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_append_event_param.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_clear_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_clear_event_param.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_cleared_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_commit_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_commit_event_param.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_committed_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_speech_started_event.py +3 -0
- aimlapi/types/beta/realtime/input_audio_buffer_speech_stopped_event.py +3 -0
- aimlapi/types/beta/realtime/rate_limits_updated_event.py +3 -0
- aimlapi/types/beta/realtime/realtime_client_event.py +3 -0
- aimlapi/types/beta/realtime/realtime_client_event_param.py +3 -0
- aimlapi/types/beta/realtime/realtime_connect_params.py +3 -0
- aimlapi/types/beta/realtime/realtime_response.py +3 -0
- aimlapi/types/beta/realtime/realtime_response_status.py +3 -0
- aimlapi/types/beta/realtime/realtime_response_usage.py +3 -0
- aimlapi/types/beta/realtime/realtime_server_event.py +3 -0
- aimlapi/types/beta/realtime/response_audio_delta_event.py +3 -0
- aimlapi/types/beta/realtime/response_audio_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_audio_transcript_delta_event.py +3 -0
- aimlapi/types/beta/realtime/response_audio_transcript_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_cancel_event.py +3 -0
- aimlapi/types/beta/realtime/response_cancel_event_param.py +3 -0
- aimlapi/types/beta/realtime/response_content_part_added_event.py +3 -0
- aimlapi/types/beta/realtime/response_content_part_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_create_event.py +3 -0
- aimlapi/types/beta/realtime/response_create_event_param.py +3 -0
- aimlapi/types/beta/realtime/response_created_event.py +3 -0
- aimlapi/types/beta/realtime/response_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_function_call_arguments_delta_event.py +3 -0
- aimlapi/types/beta/realtime/response_function_call_arguments_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_output_item_added_event.py +3 -0
- aimlapi/types/beta/realtime/response_output_item_done_event.py +3 -0
- aimlapi/types/beta/realtime/response_text_delta_event.py +3 -0
- aimlapi/types/beta/realtime/response_text_done_event.py +3 -0
- aimlapi/types/beta/realtime/session.py +3 -0
- aimlapi/types/beta/realtime/session_create_params.py +3 -0
- aimlapi/types/beta/realtime/session_create_response.py +3 -0
- aimlapi/types/beta/realtime/session_created_event.py +3 -0
- aimlapi/types/beta/realtime/session_update_event.py +3 -0
- aimlapi/types/beta/realtime/session_update_event_param.py +3 -0
- aimlapi/types/beta/realtime/session_updated_event.py +3 -0
- aimlapi/types/beta/realtime/transcription_session.py +3 -0
- aimlapi/types/beta/realtime/transcription_session_create_params.py +3 -0
- aimlapi/types/beta/realtime/transcription_session_update.py +3 -0
- aimlapi/types/beta/realtime/transcription_session_update_param.py +3 -0
- aimlapi/types/beta/realtime/transcription_session_updated_event.py +3 -0
- aimlapi/types/beta/thread.py +3 -0
- aimlapi/types/beta/thread_create_and_run_params.py +3 -0
- aimlapi/types/beta/thread_create_params.py +3 -0
- aimlapi/types/beta/thread_deleted.py +3 -0
- aimlapi/types/beta/thread_update_params.py +3 -0
- aimlapi/types/beta/threads/__init__.py +3 -0
- aimlapi/types/beta/threads/annotation.py +3 -0
- aimlapi/types/beta/threads/annotation_delta.py +3 -0
- aimlapi/types/beta/threads/file_citation_annotation.py +3 -0
- aimlapi/types/beta/threads/file_citation_delta_annotation.py +3 -0
- aimlapi/types/beta/threads/file_path_annotation.py +3 -0
- aimlapi/types/beta/threads/file_path_delta_annotation.py +3 -0
- aimlapi/types/beta/threads/image_file.py +3 -0
- aimlapi/types/beta/threads/image_file_content_block.py +3 -0
- aimlapi/types/beta/threads/image_file_content_block_param.py +3 -0
- aimlapi/types/beta/threads/image_file_delta.py +3 -0
- aimlapi/types/beta/threads/image_file_delta_block.py +3 -0
- aimlapi/types/beta/threads/image_file_param.py +3 -0
- aimlapi/types/beta/threads/image_url.py +3 -0
- aimlapi/types/beta/threads/image_url_content_block.py +3 -0
- aimlapi/types/beta/threads/image_url_content_block_param.py +3 -0
- aimlapi/types/beta/threads/image_url_delta.py +3 -0
- aimlapi/types/beta/threads/image_url_delta_block.py +3 -0
- aimlapi/types/beta/threads/image_url_param.py +3 -0
- aimlapi/types/beta/threads/message.py +3 -0
- aimlapi/types/beta/threads/message_content.py +3 -0
- aimlapi/types/beta/threads/message_content_delta.py +3 -0
- aimlapi/types/beta/threads/message_content_part_param.py +3 -0
- aimlapi/types/beta/threads/message_create_params.py +3 -0
- aimlapi/types/beta/threads/message_deleted.py +3 -0
- aimlapi/types/beta/threads/message_delta.py +3 -0
- aimlapi/types/beta/threads/message_delta_event.py +3 -0
- aimlapi/types/beta/threads/message_list_params.py +3 -0
- aimlapi/types/beta/threads/message_update_params.py +3 -0
- aimlapi/types/beta/threads/refusal_content_block.py +3 -0
- aimlapi/types/beta/threads/refusal_delta_block.py +3 -0
- aimlapi/types/beta/threads/required_action_function_tool_call.py +3 -0
- aimlapi/types/beta/threads/run.py +3 -0
- aimlapi/types/beta/threads/run_create_params.py +3 -0
- aimlapi/types/beta/threads/run_list_params.py +3 -0
- aimlapi/types/beta/threads/run_status.py +3 -0
- aimlapi/types/beta/threads/run_submit_tool_outputs_params.py +3 -0
- aimlapi/types/beta/threads/run_update_params.py +3 -0
- aimlapi/types/beta/threads/runs/__init__.py +3 -0
- aimlapi/types/beta/threads/runs/code_interpreter_logs.py +3 -0
- aimlapi/types/beta/threads/runs/code_interpreter_output_image.py +3 -0
- aimlapi/types/beta/threads/runs/code_interpreter_tool_call.py +3 -0
- aimlapi/types/beta/threads/runs/code_interpreter_tool_call_delta.py +3 -0
- aimlapi/types/beta/threads/runs/file_search_tool_call.py +3 -0
- aimlapi/types/beta/threads/runs/file_search_tool_call_delta.py +3 -0
- aimlapi/types/beta/threads/runs/function_tool_call.py +3 -0
- aimlapi/types/beta/threads/runs/function_tool_call_delta.py +3 -0
- aimlapi/types/beta/threads/runs/message_creation_step_details.py +3 -0
- aimlapi/types/beta/threads/runs/run_step.py +3 -0
- aimlapi/types/beta/threads/runs/run_step_delta.py +3 -0
- aimlapi/types/beta/threads/runs/run_step_delta_event.py +3 -0
- aimlapi/types/beta/threads/runs/run_step_delta_message_delta.py +3 -0
- aimlapi/types/beta/threads/runs/run_step_include.py +3 -0
- aimlapi/types/beta/threads/runs/step_list_params.py +3 -0
- aimlapi/types/beta/threads/runs/step_retrieve_params.py +3 -0
- aimlapi/types/beta/threads/runs/tool_call.py +3 -0
- aimlapi/types/beta/threads/runs/tool_call_delta.py +3 -0
- aimlapi/types/beta/threads/runs/tool_call_delta_object.py +3 -0
- aimlapi/types/beta/threads/runs/tool_calls_step_details.py +3 -0
- aimlapi/types/beta/threads/text.py +3 -0
- aimlapi/types/beta/threads/text_content_block.py +3 -0
- aimlapi/types/beta/threads/text_content_block_param.py +3 -0
- aimlapi/types/beta/threads/text_delta.py +3 -0
- aimlapi/types/beta/threads/text_delta_block.py +3 -0
- aimlapi/types/chat/__init__.py +3 -0
- aimlapi/types/chat/chat_completion.py +3 -0
- aimlapi/types/chat/chat_completion_allowed_tool_choice_param.py +3 -0
- aimlapi/types/chat/chat_completion_allowed_tools_param.py +3 -0
- aimlapi/types/chat/chat_completion_assistant_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_audio.py +3 -0
- aimlapi/types/chat/chat_completion_audio_param.py +3 -0
- aimlapi/types/chat/chat_completion_chunk.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_image.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_image_param.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_input_audio_param.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_param.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_refusal_param.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_text.py +3 -0
- aimlapi/types/chat/chat_completion_content_part_text_param.py +3 -0
- aimlapi/types/chat/chat_completion_custom_tool_param.py +3 -0
- aimlapi/types/chat/chat_completion_deleted.py +3 -0
- aimlapi/types/chat/chat_completion_developer_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_function_call_option_param.py +3 -0
- aimlapi/types/chat/chat_completion_function_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_function_tool.py +3 -0
- aimlapi/types/chat/chat_completion_function_tool_param.py +3 -0
- aimlapi/types/chat/chat_completion_message.py +3 -0
- aimlapi/types/chat/chat_completion_message_custom_tool_call.py +3 -0
- aimlapi/types/chat/chat_completion_message_custom_tool_call_param.py +3 -0
- aimlapi/types/chat/chat_completion_message_function_tool_call.py +3 -0
- aimlapi/types/chat/chat_completion_message_function_tool_call_param.py +3 -0
- aimlapi/types/chat/chat_completion_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_message_tool_call.py +3 -0
- aimlapi/types/chat/chat_completion_message_tool_call_param.py +3 -0
- aimlapi/types/chat/chat_completion_message_tool_call_union_param.py +3 -0
- aimlapi/types/chat/chat_completion_modality.py +3 -0
- aimlapi/types/chat/chat_completion_named_tool_choice_custom_param.py +3 -0
- aimlapi/types/chat/chat_completion_named_tool_choice_param.py +3 -0
- aimlapi/types/chat/chat_completion_prediction_content_param.py +3 -0
- aimlapi/types/chat/chat_completion_reasoning_effort.py +3 -0
- aimlapi/types/chat/chat_completion_role.py +3 -0
- aimlapi/types/chat/chat_completion_store_message.py +3 -0
- aimlapi/types/chat/chat_completion_stream_options_param.py +3 -0
- aimlapi/types/chat/chat_completion_system_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_token_logprob.py +3 -0
- aimlapi/types/chat/chat_completion_tool_choice_option_param.py +3 -0
- aimlapi/types/chat/chat_completion_tool_message_param.py +3 -0
- aimlapi/types/chat/chat_completion_tool_param.py +3 -0
- aimlapi/types/chat/chat_completion_tool_union_param.py +3 -0
- aimlapi/types/chat/chat_completion_user_message_param.py +3 -0
- aimlapi/types/chat/completion_create_params.py +3 -0
- aimlapi/types/chat/completion_list_params.py +3 -0
- aimlapi/types/chat/completion_update_params.py +3 -0
- aimlapi/types/chat/completions/__init__.py +3 -0
- aimlapi/types/chat/completions/message_list_params.py +3 -0
- aimlapi/types/chat/parsed_chat_completion.py +3 -0
- aimlapi/types/chat/parsed_function_tool_call.py +3 -0
- aimlapi/types/chat_model.py +3 -0
- aimlapi/types/completion.py +3 -0
- aimlapi/types/completion_choice.py +3 -0
- aimlapi/types/completion_create_params.py +3 -0
- aimlapi/types/completion_usage.py +3 -0
- aimlapi/types/container_create_params.py +3 -0
- aimlapi/types/container_create_response.py +3 -0
- aimlapi/types/container_list_params.py +3 -0
- aimlapi/types/container_list_response.py +3 -0
- aimlapi/types/container_retrieve_response.py +3 -0
- aimlapi/types/containers/__init__.py +3 -0
- aimlapi/types/containers/file_create_params.py +3 -0
- aimlapi/types/containers/file_create_response.py +3 -0
- aimlapi/types/containers/file_list_params.py +3 -0
- aimlapi/types/containers/file_list_response.py +3 -0
- aimlapi/types/containers/file_retrieve_response.py +3 -0
- aimlapi/types/containers/files/__init__.py +3 -0
- aimlapi/types/conversations/__init__.py +3 -0
- aimlapi/types/conversations/computer_screenshot_content.py +3 -0
- aimlapi/types/conversations/conversation.py +3 -0
- aimlapi/types/conversations/conversation_create_params.py +3 -0
- aimlapi/types/conversations/conversation_deleted_resource.py +3 -0
- aimlapi/types/conversations/conversation_item.py +3 -0
- aimlapi/types/conversations/conversation_item_list.py +3 -0
- aimlapi/types/conversations/conversation_update_params.py +3 -0
- aimlapi/types/conversations/input_file_content.py +3 -0
- aimlapi/types/conversations/input_file_content_param.py +3 -0
- aimlapi/types/conversations/input_image_content.py +3 -0
- aimlapi/types/conversations/input_image_content_param.py +3 -0
- aimlapi/types/conversations/input_text_content.py +3 -0
- aimlapi/types/conversations/input_text_content_param.py +3 -0
- aimlapi/types/conversations/item_create_params.py +3 -0
- aimlapi/types/conversations/item_list_params.py +3 -0
- aimlapi/types/conversations/item_retrieve_params.py +3 -0
- aimlapi/types/conversations/message.py +3 -0
- aimlapi/types/conversations/output_text_content.py +3 -0
- aimlapi/types/conversations/output_text_content_param.py +3 -0
- aimlapi/types/conversations/refusal_content.py +3 -0
- aimlapi/types/conversations/refusal_content_param.py +3 -0
- aimlapi/types/conversations/summary_text_content.py +3 -0
- aimlapi/types/conversations/text_content.py +3 -0
- aimlapi/types/create_embedding_response.py +3 -0
- aimlapi/types/embedding.py +3 -0
- aimlapi/types/embedding_create_params.py +3 -0
- aimlapi/types/embedding_model.py +3 -0
- aimlapi/types/eval_create_params.py +3 -0
- aimlapi/types/eval_create_response.py +3 -0
- aimlapi/types/eval_custom_data_source_config.py +3 -0
- aimlapi/types/eval_delete_response.py +3 -0
- aimlapi/types/eval_list_params.py +3 -0
- aimlapi/types/eval_list_response.py +3 -0
- aimlapi/types/eval_retrieve_response.py +3 -0
- aimlapi/types/eval_stored_completions_data_source_config.py +3 -0
- aimlapi/types/eval_update_params.py +3 -0
- aimlapi/types/eval_update_response.py +3 -0
- aimlapi/types/evals/__init__.py +3 -0
- aimlapi/types/evals/create_eval_completions_run_data_source.py +3 -0
- aimlapi/types/evals/create_eval_completions_run_data_source_param.py +3 -0
- aimlapi/types/evals/create_eval_jsonl_run_data_source.py +3 -0
- aimlapi/types/evals/create_eval_jsonl_run_data_source_param.py +3 -0
- aimlapi/types/evals/eval_api_error.py +3 -0
- aimlapi/types/evals/run_cancel_response.py +3 -0
- aimlapi/types/evals/run_create_params.py +3 -0
- aimlapi/types/evals/run_create_response.py +3 -0
- aimlapi/types/evals/run_delete_response.py +3 -0
- aimlapi/types/evals/run_list_params.py +3 -0
- aimlapi/types/evals/run_list_response.py +3 -0
- aimlapi/types/evals/run_retrieve_response.py +3 -0
- aimlapi/types/evals/runs/__init__.py +3 -0
- aimlapi/types/evals/runs/output_item_list_params.py +3 -0
- aimlapi/types/evals/runs/output_item_list_response.py +3 -0
- aimlapi/types/evals/runs/output_item_retrieve_response.py +3 -0
- aimlapi/types/file_chunking_strategy.py +3 -0
- aimlapi/types/file_chunking_strategy_param.py +3 -0
- aimlapi/types/file_content.py +3 -0
- aimlapi/types/file_create_params.py +3 -0
- aimlapi/types/file_deleted.py +3 -0
- aimlapi/types/file_list_params.py +3 -0
- aimlapi/types/file_object.py +3 -0
- aimlapi/types/file_purpose.py +3 -0
- aimlapi/types/fine_tuning/__init__.py +3 -0
- aimlapi/types/fine_tuning/alpha/__init__.py +3 -0
- aimlapi/types/fine_tuning/alpha/grader_run_params.py +3 -0
- aimlapi/types/fine_tuning/alpha/grader_run_response.py +3 -0
- aimlapi/types/fine_tuning/alpha/grader_validate_params.py +3 -0
- aimlapi/types/fine_tuning/alpha/grader_validate_response.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/__init__.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/permission_create_params.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/permission_create_response.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/permission_delete_response.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/permission_retrieve_params.py +3 -0
- aimlapi/types/fine_tuning/checkpoints/permission_retrieve_response.py +3 -0
- aimlapi/types/fine_tuning/dpo_hyperparameters.py +3 -0
- aimlapi/types/fine_tuning/dpo_hyperparameters_param.py +3 -0
- aimlapi/types/fine_tuning/dpo_method.py +3 -0
- aimlapi/types/fine_tuning/dpo_method_param.py +3 -0
- aimlapi/types/fine_tuning/fine_tuning_job.py +3 -0
- aimlapi/types/fine_tuning/fine_tuning_job_event.py +3 -0
- aimlapi/types/fine_tuning/fine_tuning_job_integration.py +3 -0
- aimlapi/types/fine_tuning/fine_tuning_job_wandb_integration.py +3 -0
- aimlapi/types/fine_tuning/fine_tuning_job_wandb_integration_object.py +3 -0
- aimlapi/types/fine_tuning/job_create_params.py +3 -0
- aimlapi/types/fine_tuning/job_list_events_params.py +3 -0
- aimlapi/types/fine_tuning/job_list_params.py +3 -0
- aimlapi/types/fine_tuning/jobs/__init__.py +3 -0
- aimlapi/types/fine_tuning/jobs/checkpoint_list_params.py +3 -0
- aimlapi/types/fine_tuning/jobs/fine_tuning_job_checkpoint.py +3 -0
- aimlapi/types/fine_tuning/reinforcement_hyperparameters.py +3 -0
- aimlapi/types/fine_tuning/reinforcement_hyperparameters_param.py +3 -0
- aimlapi/types/fine_tuning/reinforcement_method.py +3 -0
- aimlapi/types/fine_tuning/reinforcement_method_param.py +3 -0
- aimlapi/types/fine_tuning/supervised_hyperparameters.py +3 -0
- aimlapi/types/fine_tuning/supervised_hyperparameters_param.py +3 -0
- aimlapi/types/fine_tuning/supervised_method.py +3 -0
- aimlapi/types/fine_tuning/supervised_method_param.py +3 -0
- aimlapi/types/graders/__init__.py +3 -0
- aimlapi/types/graders/label_model_grader.py +3 -0
- aimlapi/types/graders/label_model_grader_param.py +3 -0
- aimlapi/types/graders/multi_grader.py +3 -0
- aimlapi/types/graders/multi_grader_param.py +3 -0
- aimlapi/types/graders/python_grader.py +3 -0
- aimlapi/types/graders/python_grader_param.py +3 -0
- aimlapi/types/graders/score_model_grader.py +3 -0
- aimlapi/types/graders/score_model_grader_param.py +3 -0
- aimlapi/types/graders/string_check_grader.py +3 -0
- aimlapi/types/graders/string_check_grader_param.py +3 -0
- aimlapi/types/graders/text_similarity_grader.py +3 -0
- aimlapi/types/graders/text_similarity_grader_param.py +3 -0
- aimlapi/types/image.py +3 -0
- aimlapi/types/image_create_variation_params.py +3 -0
- aimlapi/types/image_edit_completed_event.py +3 -0
- aimlapi/types/image_edit_params.py +3 -0
- aimlapi/types/image_edit_partial_image_event.py +3 -0
- aimlapi/types/image_edit_stream_event.py +3 -0
- aimlapi/types/image_gen_completed_event.py +3 -0
- aimlapi/types/image_gen_partial_image_event.py +3 -0
- aimlapi/types/image_gen_stream_event.py +3 -0
- aimlapi/types/image_generate_params.py +3 -0
- aimlapi/types/image_model.py +3 -0
- aimlapi/types/images_response.py +3 -0
- aimlapi/types/model.py +3 -0
- aimlapi/types/model_deleted.py +3 -0
- aimlapi/types/moderation.py +3 -0
- aimlapi/types/moderation_create_params.py +3 -0
- aimlapi/types/moderation_create_response.py +3 -0
- aimlapi/types/moderation_image_url_input_param.py +3 -0
- aimlapi/types/moderation_model.py +3 -0
- aimlapi/types/moderation_multi_modal_input_param.py +3 -0
- aimlapi/types/moderation_text_input_param.py +3 -0
- aimlapi/types/other_file_chunking_strategy_object.py +3 -0
- aimlapi/types/realtime/__init__.py +3 -0
- aimlapi/types/realtime/audio_transcription.py +3 -0
- aimlapi/types/realtime/audio_transcription_param.py +3 -0
- aimlapi/types/realtime/call_accept_params.py +3 -0
- aimlapi/types/realtime/call_create_params.py +3 -0
- aimlapi/types/realtime/call_refer_params.py +3 -0
- aimlapi/types/realtime/call_reject_params.py +3 -0
- aimlapi/types/realtime/client_secret_create_params.py +3 -0
- aimlapi/types/realtime/client_secret_create_response.py +3 -0
- aimlapi/types/realtime/conversation_created_event.py +3 -0
- aimlapi/types/realtime/conversation_item.py +3 -0
- aimlapi/types/realtime/conversation_item_added.py +3 -0
- aimlapi/types/realtime/conversation_item_create_event.py +3 -0
- aimlapi/types/realtime/conversation_item_create_event_param.py +3 -0
- aimlapi/types/realtime/conversation_item_created_event.py +3 -0
- aimlapi/types/realtime/conversation_item_delete_event.py +3 -0
- aimlapi/types/realtime/conversation_item_delete_event_param.py +3 -0
- aimlapi/types/realtime/conversation_item_deleted_event.py +3 -0
- aimlapi/types/realtime/conversation_item_done.py +3 -0
- aimlapi/types/realtime/conversation_item_input_audio_transcription_completed_event.py +3 -0
- aimlapi/types/realtime/conversation_item_input_audio_transcription_delta_event.py +3 -0
- aimlapi/types/realtime/conversation_item_input_audio_transcription_failed_event.py +3 -0
- aimlapi/types/realtime/conversation_item_input_audio_transcription_segment.py +3 -0
- aimlapi/types/realtime/conversation_item_param.py +3 -0
- aimlapi/types/realtime/conversation_item_retrieve_event.py +3 -0
- aimlapi/types/realtime/conversation_item_retrieve_event_param.py +3 -0
- aimlapi/types/realtime/conversation_item_truncate_event.py +3 -0
- aimlapi/types/realtime/conversation_item_truncate_event_param.py +3 -0
- aimlapi/types/realtime/conversation_item_truncated_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_append_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_append_event_param.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_clear_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_clear_event_param.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_cleared_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_commit_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_commit_event_param.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_committed_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_speech_started_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_speech_stopped_event.py +3 -0
- aimlapi/types/realtime/input_audio_buffer_timeout_triggered.py +3 -0
- aimlapi/types/realtime/log_prob_properties.py +3 -0
- aimlapi/types/realtime/mcp_list_tools_completed.py +3 -0
- aimlapi/types/realtime/mcp_list_tools_failed.py +3 -0
- aimlapi/types/realtime/mcp_list_tools_in_progress.py +3 -0
- aimlapi/types/realtime/noise_reduction_type.py +3 -0
- aimlapi/types/realtime/output_audio_buffer_clear_event.py +3 -0
- aimlapi/types/realtime/output_audio_buffer_clear_event_param.py +3 -0
- aimlapi/types/realtime/rate_limits_updated_event.py +3 -0
- aimlapi/types/realtime/realtime_audio_config.py +3 -0
- aimlapi/types/realtime/realtime_audio_config_input.py +3 -0
- aimlapi/types/realtime/realtime_audio_config_input_param.py +3 -0
- aimlapi/types/realtime/realtime_audio_config_output.py +3 -0
- aimlapi/types/realtime/realtime_audio_config_output_param.py +3 -0
- aimlapi/types/realtime/realtime_audio_config_param.py +3 -0
- aimlapi/types/realtime/realtime_audio_formats.py +3 -0
- aimlapi/types/realtime/realtime_audio_formats_param.py +3 -0
- aimlapi/types/realtime/realtime_audio_input_turn_detection.py +3 -0
- aimlapi/types/realtime/realtime_audio_input_turn_detection_param.py +3 -0
- aimlapi/types/realtime/realtime_client_event.py +3 -0
- aimlapi/types/realtime/realtime_client_event_param.py +3 -0
- aimlapi/types/realtime/realtime_connect_params.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_assistant_message.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_assistant_message_param.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_function_call.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_function_call_output.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_function_call_output_param.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_function_call_param.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_system_message.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_system_message_param.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_user_message.py +3 -0
- aimlapi/types/realtime/realtime_conversation_item_user_message_param.py +3 -0
- aimlapi/types/realtime/realtime_error.py +3 -0
- aimlapi/types/realtime/realtime_error_event.py +3 -0
- aimlapi/types/realtime/realtime_function_tool.py +3 -0
- aimlapi/types/realtime/realtime_function_tool_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_approval_request.py +3 -0
- aimlapi/types/realtime/realtime_mcp_approval_request_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_approval_response.py +3 -0
- aimlapi/types/realtime/realtime_mcp_approval_response_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_list_tools.py +3 -0
- aimlapi/types/realtime/realtime_mcp_list_tools_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_protocol_error.py +3 -0
- aimlapi/types/realtime/realtime_mcp_protocol_error_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_tool_call.py +3 -0
- aimlapi/types/realtime/realtime_mcp_tool_call_param.py +3 -0
- aimlapi/types/realtime/realtime_mcp_tool_execution_error.py +3 -0
- aimlapi/types/realtime/realtime_mcp_tool_execution_error_param.py +3 -0
- aimlapi/types/realtime/realtime_mcphttp_error.py +3 -0
- aimlapi/types/realtime/realtime_mcphttp_error_param.py +3 -0
- aimlapi/types/realtime/realtime_response.py +3 -0
- aimlapi/types/realtime/realtime_response_create_audio_output.py +3 -0
- aimlapi/types/realtime/realtime_response_create_audio_output_param.py +3 -0
- aimlapi/types/realtime/realtime_response_create_mcp_tool.py +3 -0
- aimlapi/types/realtime/realtime_response_create_mcp_tool_param.py +3 -0
- aimlapi/types/realtime/realtime_response_create_params.py +3 -0
- aimlapi/types/realtime/realtime_response_create_params_param.py +3 -0
- aimlapi/types/realtime/realtime_response_status.py +3 -0
- aimlapi/types/realtime/realtime_response_usage.py +3 -0
- aimlapi/types/realtime/realtime_response_usage_input_token_details.py +3 -0
- aimlapi/types/realtime/realtime_response_usage_output_token_details.py +3 -0
- aimlapi/types/realtime/realtime_server_event.py +3 -0
- aimlapi/types/realtime/realtime_session_client_secret.py +3 -0
- aimlapi/types/realtime/realtime_session_create_request.py +3 -0
- aimlapi/types/realtime/realtime_session_create_request_param.py +3 -0
- aimlapi/types/realtime/realtime_session_create_response.py +3 -0
- aimlapi/types/realtime/realtime_tool_choice_config.py +3 -0
- aimlapi/types/realtime/realtime_tool_choice_config_param.py +3 -0
- aimlapi/types/realtime/realtime_tools_config.py +3 -0
- aimlapi/types/realtime/realtime_tools_config_param.py +3 -0
- aimlapi/types/realtime/realtime_tools_config_union.py +3 -0
- aimlapi/types/realtime/realtime_tools_config_union_param.py +3 -0
- aimlapi/types/realtime/realtime_tracing_config.py +3 -0
- aimlapi/types/realtime/realtime_tracing_config_param.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio_input.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio_input_param.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio_input_turn_detection.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio_input_turn_detection_param.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_audio_param.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_create_request.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_create_request_param.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_create_response.py +3 -0
- aimlapi/types/realtime/realtime_transcription_session_turn_detection.py +3 -0
- aimlapi/types/realtime/realtime_truncation.py +3 -0
- aimlapi/types/realtime/realtime_truncation_param.py +3 -0
- aimlapi/types/realtime/realtime_truncation_retention_ratio.py +3 -0
- aimlapi/types/realtime/realtime_truncation_retention_ratio_param.py +3 -0
- aimlapi/types/realtime/response_audio_delta_event.py +3 -0
- aimlapi/types/realtime/response_audio_done_event.py +3 -0
- aimlapi/types/realtime/response_audio_transcript_delta_event.py +3 -0
- aimlapi/types/realtime/response_audio_transcript_done_event.py +3 -0
- aimlapi/types/realtime/response_cancel_event.py +3 -0
- aimlapi/types/realtime/response_cancel_event_param.py +3 -0
- aimlapi/types/realtime/response_content_part_added_event.py +3 -0
- aimlapi/types/realtime/response_content_part_done_event.py +3 -0
- aimlapi/types/realtime/response_create_event.py +3 -0
- aimlapi/types/realtime/response_create_event_param.py +3 -0
- aimlapi/types/realtime/response_created_event.py +3 -0
- aimlapi/types/realtime/response_done_event.py +3 -0
- aimlapi/types/realtime/response_function_call_arguments_delta_event.py +3 -0
- aimlapi/types/realtime/response_function_call_arguments_done_event.py +3 -0
- aimlapi/types/realtime/response_mcp_call_arguments_delta.py +3 -0
- aimlapi/types/realtime/response_mcp_call_arguments_done.py +3 -0
- aimlapi/types/realtime/response_mcp_call_completed.py +3 -0
- aimlapi/types/realtime/response_mcp_call_failed.py +3 -0
- aimlapi/types/realtime/response_mcp_call_in_progress.py +3 -0
- aimlapi/types/realtime/response_output_item_added_event.py +3 -0
- aimlapi/types/realtime/response_output_item_done_event.py +3 -0
- aimlapi/types/realtime/response_text_delta_event.py +3 -0
- aimlapi/types/realtime/response_text_done_event.py +3 -0
- aimlapi/types/realtime/session_created_event.py +3 -0
- aimlapi/types/realtime/session_update_event.py +3 -0
- aimlapi/types/realtime/session_update_event_param.py +3 -0
- aimlapi/types/realtime/session_updated_event.py +3 -0
- aimlapi/types/responses/__init__.py +3 -0
- aimlapi/types/responses/computer_tool.py +3 -0
- aimlapi/types/responses/computer_tool_param.py +3 -0
- aimlapi/types/responses/custom_tool.py +3 -0
- aimlapi/types/responses/custom_tool_param.py +3 -0
- aimlapi/types/responses/easy_input_message.py +3 -0
- aimlapi/types/responses/easy_input_message_param.py +3 -0
- aimlapi/types/responses/file_search_tool.py +3 -0
- aimlapi/types/responses/file_search_tool_param.py +3 -0
- aimlapi/types/responses/function_tool.py +3 -0
- aimlapi/types/responses/function_tool_param.py +3 -0
- aimlapi/types/responses/input_item_list_params.py +3 -0
- aimlapi/types/responses/input_token_count_params.py +3 -0
- aimlapi/types/responses/input_token_count_response.py +3 -0
- aimlapi/types/responses/parsed_response.py +3 -0
- aimlapi/types/responses/response.py +3 -0
- aimlapi/types/responses/response_audio_delta_event.py +3 -0
- aimlapi/types/responses/response_audio_done_event.py +3 -0
- aimlapi/types/responses/response_audio_transcript_delta_event.py +3 -0
- aimlapi/types/responses/response_audio_transcript_done_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_call_code_delta_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_call_code_done_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_call_completed_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_call_in_progress_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_call_interpreting_event.py +3 -0
- aimlapi/types/responses/response_code_interpreter_tool_call.py +3 -0
- aimlapi/types/responses/response_code_interpreter_tool_call_param.py +3 -0
- aimlapi/types/responses/response_completed_event.py +3 -0
- aimlapi/types/responses/response_computer_tool_call.py +3 -0
- aimlapi/types/responses/response_computer_tool_call_output_item.py +3 -0
- aimlapi/types/responses/response_computer_tool_call_output_screenshot.py +3 -0
- aimlapi/types/responses/response_computer_tool_call_output_screenshot_param.py +3 -0
- aimlapi/types/responses/response_computer_tool_call_param.py +3 -0
- aimlapi/types/responses/response_content_part_added_event.py +3 -0
- aimlapi/types/responses/response_content_part_done_event.py +3 -0
- aimlapi/types/responses/response_conversation_param.py +3 -0
- aimlapi/types/responses/response_create_params.py +3 -0
- aimlapi/types/responses/response_created_event.py +3 -0
- aimlapi/types/responses/response_custom_tool_call.py +3 -0
- aimlapi/types/responses/response_custom_tool_call_input_delta_event.py +3 -0
- aimlapi/types/responses/response_custom_tool_call_input_done_event.py +3 -0
- aimlapi/types/responses/response_custom_tool_call_output.py +3 -0
- aimlapi/types/responses/response_custom_tool_call_output_param.py +3 -0
- aimlapi/types/responses/response_custom_tool_call_param.py +3 -0
- aimlapi/types/responses/response_error.py +3 -0
- aimlapi/types/responses/response_error_event.py +3 -0
- aimlapi/types/responses/response_failed_event.py +3 -0
- aimlapi/types/responses/response_file_search_call_completed_event.py +3 -0
- aimlapi/types/responses/response_file_search_call_in_progress_event.py +3 -0
- aimlapi/types/responses/response_file_search_call_searching_event.py +3 -0
- aimlapi/types/responses/response_file_search_tool_call.py +3 -0
- aimlapi/types/responses/response_file_search_tool_call_param.py +3 -0
- aimlapi/types/responses/response_format_text_config.py +3 -0
- aimlapi/types/responses/response_format_text_config_param.py +3 -0
- aimlapi/types/responses/response_format_text_json_schema_config.py +3 -0
- aimlapi/types/responses/response_format_text_json_schema_config_param.py +3 -0
- aimlapi/types/responses/response_function_call_arguments_delta_event.py +3 -0
- aimlapi/types/responses/response_function_call_arguments_done_event.py +3 -0
- aimlapi/types/responses/response_function_call_output_item.py +3 -0
- aimlapi/types/responses/response_function_call_output_item_list.py +3 -0
- aimlapi/types/responses/response_function_call_output_item_list_param.py +3 -0
- aimlapi/types/responses/response_function_call_output_item_param.py +3 -0
- aimlapi/types/responses/response_function_tool_call.py +3 -0
- aimlapi/types/responses/response_function_tool_call_item.py +3 -0
- aimlapi/types/responses/response_function_tool_call_output_item.py +3 -0
- aimlapi/types/responses/response_function_tool_call_param.py +3 -0
- aimlapi/types/responses/response_function_web_search.py +3 -0
- aimlapi/types/responses/response_function_web_search_param.py +3 -0
- aimlapi/types/responses/response_image_gen_call_completed_event.py +3 -0
- aimlapi/types/responses/response_image_gen_call_generating_event.py +3 -0
- aimlapi/types/responses/response_image_gen_call_in_progress_event.py +3 -0
- aimlapi/types/responses/response_image_gen_call_partial_image_event.py +3 -0
- aimlapi/types/responses/response_in_progress_event.py +3 -0
- aimlapi/types/responses/response_includable.py +3 -0
- aimlapi/types/responses/response_incomplete_event.py +3 -0
- aimlapi/types/responses/response_input_audio.py +3 -0
- aimlapi/types/responses/response_input_audio_param.py +3 -0
- aimlapi/types/responses/response_input_content.py +3 -0
- aimlapi/types/responses/response_input_content_param.py +3 -0
- aimlapi/types/responses/response_input_file.py +3 -0
- aimlapi/types/responses/response_input_file_content.py +3 -0
- aimlapi/types/responses/response_input_file_content_param.py +3 -0
- aimlapi/types/responses/response_input_file_param.py +3 -0
- aimlapi/types/responses/response_input_image.py +3 -0
- aimlapi/types/responses/response_input_image_content.py +3 -0
- aimlapi/types/responses/response_input_image_content_param.py +3 -0
- aimlapi/types/responses/response_input_image_param.py +3 -0
- aimlapi/types/responses/response_input_item.py +3 -0
- aimlapi/types/responses/response_input_item_param.py +3 -0
- aimlapi/types/responses/response_input_message_content_list.py +3 -0
- aimlapi/types/responses/response_input_message_content_list_param.py +3 -0
- aimlapi/types/responses/response_input_message_item.py +3 -0
- aimlapi/types/responses/response_input_param.py +3 -0
- aimlapi/types/responses/response_input_text.py +3 -0
- aimlapi/types/responses/response_input_text_content.py +3 -0
- aimlapi/types/responses/response_input_text_content_param.py +3 -0
- aimlapi/types/responses/response_input_text_param.py +3 -0
- aimlapi/types/responses/response_item.py +3 -0
- aimlapi/types/responses/response_item_list.py +3 -0
- aimlapi/types/responses/response_mcp_call_arguments_delta_event.py +3 -0
- aimlapi/types/responses/response_mcp_call_arguments_done_event.py +3 -0
- aimlapi/types/responses/response_mcp_call_completed_event.py +3 -0
- aimlapi/types/responses/response_mcp_call_failed_event.py +3 -0
- aimlapi/types/responses/response_mcp_call_in_progress_event.py +3 -0
- aimlapi/types/responses/response_mcp_list_tools_completed_event.py +3 -0
- aimlapi/types/responses/response_mcp_list_tools_failed_event.py +3 -0
- aimlapi/types/responses/response_mcp_list_tools_in_progress_event.py +3 -0
- aimlapi/types/responses/response_output_item.py +3 -0
- aimlapi/types/responses/response_output_item_added_event.py +3 -0
- aimlapi/types/responses/response_output_item_done_event.py +3 -0
- aimlapi/types/responses/response_output_message.py +3 -0
- aimlapi/types/responses/response_output_message_param.py +3 -0
- aimlapi/types/responses/response_output_refusal.py +3 -0
- aimlapi/types/responses/response_output_refusal_param.py +3 -0
- aimlapi/types/responses/response_output_text.py +3 -0
- aimlapi/types/responses/response_output_text_annotation_added_event.py +3 -0
- aimlapi/types/responses/response_output_text_param.py +3 -0
- aimlapi/types/responses/response_prompt.py +3 -0
- aimlapi/types/responses/response_prompt_param.py +3 -0
- aimlapi/types/responses/response_queued_event.py +3 -0
- aimlapi/types/responses/response_reasoning_item.py +3 -0
- aimlapi/types/responses/response_reasoning_item_param.py +3 -0
- aimlapi/types/responses/response_reasoning_summary_part_added_event.py +3 -0
- aimlapi/types/responses/response_reasoning_summary_part_done_event.py +3 -0
- aimlapi/types/responses/response_reasoning_summary_text_delta_event.py +3 -0
- aimlapi/types/responses/response_reasoning_summary_text_done_event.py +3 -0
- aimlapi/types/responses/response_reasoning_text_delta_event.py +3 -0
- aimlapi/types/responses/response_reasoning_text_done_event.py +3 -0
- aimlapi/types/responses/response_refusal_delta_event.py +3 -0
- aimlapi/types/responses/response_refusal_done_event.py +3 -0
- aimlapi/types/responses/response_retrieve_params.py +3 -0
- aimlapi/types/responses/response_status.py +3 -0
- aimlapi/types/responses/response_stream_event.py +3 -0
- aimlapi/types/responses/response_text_config.py +3 -0
- aimlapi/types/responses/response_text_config_param.py +3 -0
- aimlapi/types/responses/response_text_delta_event.py +3 -0
- aimlapi/types/responses/response_text_done_event.py +3 -0
- aimlapi/types/responses/response_usage.py +3 -0
- aimlapi/types/responses/response_web_search_call_completed_event.py +3 -0
- aimlapi/types/responses/response_web_search_call_in_progress_event.py +3 -0
- aimlapi/types/responses/response_web_search_call_searching_event.py +3 -0
- aimlapi/types/responses/tool.py +3 -0
- aimlapi/types/responses/tool_choice_allowed.py +3 -0
- aimlapi/types/responses/tool_choice_allowed_param.py +3 -0
- aimlapi/types/responses/tool_choice_custom.py +3 -0
- aimlapi/types/responses/tool_choice_custom_param.py +3 -0
- aimlapi/types/responses/tool_choice_function.py +3 -0
- aimlapi/types/responses/tool_choice_function_param.py +3 -0
- aimlapi/types/responses/tool_choice_mcp.py +3 -0
- aimlapi/types/responses/tool_choice_mcp_param.py +3 -0
- aimlapi/types/responses/tool_choice_options.py +3 -0
- aimlapi/types/responses/tool_choice_types.py +3 -0
- aimlapi/types/responses/tool_choice_types_param.py +3 -0
- aimlapi/types/responses/tool_param.py +3 -0
- aimlapi/types/responses/web_search_preview_tool.py +3 -0
- aimlapi/types/responses/web_search_preview_tool_param.py +3 -0
- aimlapi/types/responses/web_search_tool.py +3 -0
- aimlapi/types/responses/web_search_tool_param.py +3 -0
- aimlapi/types/shared/__init__.py +3 -0
- aimlapi/types/shared/all_models.py +3 -0
- aimlapi/types/shared/chat_model.py +3 -0
- aimlapi/types/shared/comparison_filter.py +3 -0
- aimlapi/types/shared/compound_filter.py +3 -0
- aimlapi/types/shared/custom_tool_input_format.py +3 -0
- aimlapi/types/shared/error_object.py +3 -0
- aimlapi/types/shared/function_definition.py +3 -0
- aimlapi/types/shared/function_parameters.py +3 -0
- aimlapi/types/shared/metadata.py +3 -0
- aimlapi/types/shared/reasoning.py +3 -0
- aimlapi/types/shared/reasoning_effort.py +3 -0
- aimlapi/types/shared/response_format_json_object.py +3 -0
- aimlapi/types/shared/response_format_json_schema.py +3 -0
- aimlapi/types/shared/response_format_text.py +3 -0
- aimlapi/types/shared/response_format_text_grammar.py +3 -0
- aimlapi/types/shared/response_format_text_python.py +3 -0
- aimlapi/types/shared/responses_model.py +3 -0
- aimlapi/types/shared_params/__init__.py +3 -0
- aimlapi/types/shared_params/chat_model.py +3 -0
- aimlapi/types/shared_params/comparison_filter.py +3 -0
- aimlapi/types/shared_params/compound_filter.py +3 -0
- aimlapi/types/shared_params/custom_tool_input_format.py +3 -0
- aimlapi/types/shared_params/function_definition.py +3 -0
- aimlapi/types/shared_params/function_parameters.py +3 -0
- aimlapi/types/shared_params/metadata.py +3 -0
- aimlapi/types/shared_params/reasoning.py +3 -0
- aimlapi/types/shared_params/reasoning_effort.py +3 -0
- aimlapi/types/shared_params/response_format_json_object.py +3 -0
- aimlapi/types/shared_params/response_format_json_schema.py +3 -0
- aimlapi/types/shared_params/response_format_text.py +3 -0
- aimlapi/types/shared_params/responses_model.py +3 -0
- aimlapi/types/static_file_chunking_strategy.py +3 -0
- aimlapi/types/static_file_chunking_strategy_object.py +3 -0
- aimlapi/types/static_file_chunking_strategy_object_param.py +3 -0
- aimlapi/types/static_file_chunking_strategy_param.py +3 -0
- aimlapi/types/upload.py +3 -0
- aimlapi/types/upload_complete_params.py +3 -0
- aimlapi/types/upload_create_params.py +3 -0
- aimlapi/types/uploads/__init__.py +3 -0
- aimlapi/types/uploads/part_create_params.py +3 -0
- aimlapi/types/uploads/upload_part.py +3 -0
- aimlapi/types/vector_store.py +3 -0
- aimlapi/types/vector_store_create_params.py +3 -0
- aimlapi/types/vector_store_deleted.py +3 -0
- aimlapi/types/vector_store_list_params.py +3 -0
- aimlapi/types/vector_store_search_params.py +3 -0
- aimlapi/types/vector_store_search_response.py +3 -0
- aimlapi/types/vector_store_update_params.py +3 -0
- aimlapi/types/vector_stores/__init__.py +3 -0
- aimlapi/types/vector_stores/file_batch_create_params.py +3 -0
- aimlapi/types/vector_stores/file_batch_list_files_params.py +3 -0
- aimlapi/types/vector_stores/file_content_response.py +3 -0
- aimlapi/types/vector_stores/file_create_params.py +3 -0
- aimlapi/types/vector_stores/file_list_params.py +3 -0
- aimlapi/types/vector_stores/file_update_params.py +3 -0
- aimlapi/types/vector_stores/vector_store_file.py +3 -0
- aimlapi/types/vector_stores/vector_store_file_batch.py +3 -0
- aimlapi/types/vector_stores/vector_store_file_deleted.py +3 -0
- aimlapi/types/video.py +3 -0
- aimlapi/types/video_create_error.py +3 -0
- aimlapi/types/video_create_params.py +3 -0
- aimlapi/types/video_delete_response.py +3 -0
- aimlapi/types/video_download_content_params.py +3 -0
- aimlapi/types/video_list_params.py +3 -0
- aimlapi/types/video_model.py +3 -0
- aimlapi/types/video_remix_params.py +3 -0
- aimlapi/types/video_seconds.py +3 -0
- aimlapi/types/video_size.py +3 -0
- aimlapi/types/webhooks/__init__.py +3 -0
- aimlapi/types/webhooks/batch_cancelled_webhook_event.py +3 -0
- aimlapi/types/webhooks/batch_completed_webhook_event.py +3 -0
- aimlapi/types/webhooks/batch_expired_webhook_event.py +3 -0
- aimlapi/types/webhooks/batch_failed_webhook_event.py +3 -0
- aimlapi/types/webhooks/eval_run_canceled_webhook_event.py +3 -0
- aimlapi/types/webhooks/eval_run_failed_webhook_event.py +3 -0
- aimlapi/types/webhooks/eval_run_succeeded_webhook_event.py +3 -0
- aimlapi/types/webhooks/fine_tuning_job_cancelled_webhook_event.py +3 -0
- aimlapi/types/webhooks/fine_tuning_job_failed_webhook_event.py +3 -0
- aimlapi/types/webhooks/fine_tuning_job_succeeded_webhook_event.py +3 -0
- aimlapi/types/webhooks/realtime_call_incoming_webhook_event.py +3 -0
- aimlapi/types/webhooks/response_cancelled_webhook_event.py +3 -0
- aimlapi/types/webhooks/response_completed_webhook_event.py +3 -0
- aimlapi/types/webhooks/response_failed_webhook_event.py +3 -0
- aimlapi/types/webhooks/response_incomplete_webhook_event.py +3 -0
- aimlapi/types/webhooks/unwrap_webhook_event.py +3 -0
- aimlapi/types/websocket_connection_options.py +3 -0
- aimlapi/version.py +3 -0
- aimlapi_sdk_python-2.8.1b0.dist-info/METADATA +886 -0
- aimlapi_sdk_python-2.8.1b0.dist-info/RECORD +1958 -0
- aimlapi_sdk_python-2.8.1b0.dist-info/WHEEL +4 -0
- aimlapi_sdk_python-2.8.1b0.dist-info/entry_points.txt +2 -0
- aimlapi_sdk_python-2.8.1b0.dist-info/licenses/LICENSE +201 -0
- openai/__init__.py +395 -0
- openai/__main__.py +3 -0
- openai/_base_client.py +2027 -0
- openai/_client.py +1272 -0
- openai/_compat.py +231 -0
- openai/_constants.py +14 -0
- openai/_exceptions.py +161 -0
- openai/_extras/__init__.py +3 -0
- openai/_extras/_common.py +21 -0
- openai/_extras/numpy_proxy.py +37 -0
- openai/_extras/pandas_proxy.py +28 -0
- openai/_extras/sounddevice_proxy.py +28 -0
- openai/_files.py +123 -0
- openai/_legacy_response.py +488 -0
- openai/_models.py +897 -0
- openai/_module_client.py +173 -0
- openai/_qs.py +150 -0
- openai/_resource.py +43 -0
- openai/_response.py +848 -0
- openai/_streaming.py +408 -0
- openai/_types.py +264 -0
- openai/_utils/__init__.py +67 -0
- openai/_utils/_compat.py +45 -0
- openai/_utils/_datetime_parse.py +136 -0
- openai/_utils/_logs.py +42 -0
- openai/_utils/_proxy.py +65 -0
- openai/_utils/_reflection.py +45 -0
- openai/_utils/_resources_proxy.py +24 -0
- openai/_utils/_streams.py +12 -0
- openai/_utils/_sync.py +58 -0
- openai/_utils/_transform.py +457 -0
- openai/_utils/_typing.py +156 -0
- openai/_utils/_utils.py +437 -0
- openai/_version.py +4 -0
- openai/cli/__init__.py +1 -0
- openai/cli/_api/__init__.py +1 -0
- openai/cli/_api/_main.py +17 -0
- openai/cli/_api/audio.py +108 -0
- openai/cli/_api/chat/__init__.py +13 -0
- openai/cli/_api/chat/completions.py +160 -0
- openai/cli/_api/completions.py +173 -0
- openai/cli/_api/files.py +80 -0
- openai/cli/_api/fine_tuning/__init__.py +13 -0
- openai/cli/_api/fine_tuning/jobs.py +170 -0
- openai/cli/_api/image.py +139 -0
- openai/cli/_api/models.py +45 -0
- openai/cli/_cli.py +233 -0
- openai/cli/_errors.py +21 -0
- openai/cli/_models.py +17 -0
- openai/cli/_progress.py +59 -0
- openai/cli/_tools/__init__.py +1 -0
- openai/cli/_tools/_main.py +17 -0
- openai/cli/_tools/fine_tunes.py +63 -0
- openai/cli/_tools/migrate.py +164 -0
- openai/cli/_utils.py +45 -0
- openai/helpers/__init__.py +4 -0
- openai/helpers/local_audio_player.py +165 -0
- openai/helpers/microphone.py +100 -0
- openai/lib/.keep +4 -0
- openai/lib/__init__.py +2 -0
- openai/lib/_old_api.py +72 -0
- openai/lib/_parsing/__init__.py +12 -0
- openai/lib/_parsing/_completions.py +305 -0
- openai/lib/_parsing/_responses.py +180 -0
- openai/lib/_pydantic.py +155 -0
- openai/lib/_realtime.py +92 -0
- openai/lib/_tools.py +66 -0
- openai/lib/_validators.py +809 -0
- openai/lib/azure.py +647 -0
- openai/lib/streaming/__init__.py +8 -0
- openai/lib/streaming/_assistants.py +1038 -0
- openai/lib/streaming/_deltas.py +64 -0
- openai/lib/streaming/chat/__init__.py +27 -0
- openai/lib/streaming/chat/_completions.py +770 -0
- openai/lib/streaming/chat/_events.py +123 -0
- openai/lib/streaming/chat/_types.py +20 -0
- openai/lib/streaming/responses/__init__.py +13 -0
- openai/lib/streaming/responses/_events.py +148 -0
- openai/lib/streaming/responses/_responses.py +372 -0
- openai/lib/streaming/responses/_types.py +10 -0
- openai/pagination.py +190 -0
- openai/py.typed +0 -0
- openai/resources/__init__.py +229 -0
- openai/resources/audio/__init__.py +61 -0
- openai/resources/audio/audio.py +166 -0
- openai/resources/audio/speech.py +255 -0
- openai/resources/audio/transcriptions.py +980 -0
- openai/resources/audio/translations.py +367 -0
- openai/resources/batches.py +530 -0
- openai/resources/beta/__init__.py +61 -0
- openai/resources/beta/assistants.py +1049 -0
- openai/resources/beta/beta.py +187 -0
- openai/resources/beta/chatkit/__init__.py +47 -0
- openai/resources/beta/chatkit/chatkit.py +134 -0
- openai/resources/beta/chatkit/sessions.py +301 -0
- openai/resources/beta/chatkit/threads.py +521 -0
- openai/resources/beta/realtime/__init__.py +47 -0
- openai/resources/beta/realtime/realtime.py +1094 -0
- openai/resources/beta/realtime/sessions.py +424 -0
- openai/resources/beta/realtime/transcription_sessions.py +282 -0
- openai/resources/beta/threads/__init__.py +47 -0
- openai/resources/beta/threads/messages.py +718 -0
- openai/resources/beta/threads/runs/__init__.py +33 -0
- openai/resources/beta/threads/runs/runs.py +3122 -0
- openai/resources/beta/threads/runs/steps.py +399 -0
- openai/resources/beta/threads/threads.py +1935 -0
- openai/resources/chat/__init__.py +33 -0
- openai/resources/chat/chat.py +102 -0
- openai/resources/chat/completions/__init__.py +33 -0
- openai/resources/chat/completions/completions.py +3143 -0
- openai/resources/chat/completions/messages.py +212 -0
- openai/resources/completions.py +1160 -0
- openai/resources/containers/__init__.py +33 -0
- openai/resources/containers/containers.py +510 -0
- openai/resources/containers/files/__init__.py +33 -0
- openai/resources/containers/files/content.py +173 -0
- openai/resources/containers/files/files.py +545 -0
- openai/resources/conversations/__init__.py +33 -0
- openai/resources/conversations/conversations.py +486 -0
- openai/resources/conversations/items.py +557 -0
- openai/resources/embeddings.py +298 -0
- openai/resources/evals/__init__.py +33 -0
- openai/resources/evals/evals.py +662 -0
- openai/resources/evals/runs/__init__.py +33 -0
- openai/resources/evals/runs/output_items.py +315 -0
- openai/resources/evals/runs/runs.py +634 -0
- openai/resources/files.py +770 -0
- openai/resources/fine_tuning/__init__.py +61 -0
- openai/resources/fine_tuning/alpha/__init__.py +33 -0
- openai/resources/fine_tuning/alpha/alpha.py +102 -0
- openai/resources/fine_tuning/alpha/graders.py +282 -0
- openai/resources/fine_tuning/checkpoints/__init__.py +33 -0
- openai/resources/fine_tuning/checkpoints/checkpoints.py +102 -0
- openai/resources/fine_tuning/checkpoints/permissions.py +418 -0
- openai/resources/fine_tuning/fine_tuning.py +166 -0
- openai/resources/fine_tuning/jobs/__init__.py +33 -0
- openai/resources/fine_tuning/jobs/checkpoints.py +199 -0
- openai/resources/fine_tuning/jobs/jobs.py +918 -0
- openai/resources/images.py +1858 -0
- openai/resources/models.py +306 -0
- openai/resources/moderations.py +197 -0
- openai/resources/realtime/__init__.py +47 -0
- openai/resources/realtime/calls.py +764 -0
- openai/resources/realtime/client_secrets.py +189 -0
- openai/resources/realtime/realtime.py +1079 -0
- openai/resources/responses/__init__.py +47 -0
- openai/resources/responses/input_items.py +226 -0
- openai/resources/responses/input_tokens.py +309 -0
- openai/resources/responses/responses.py +3130 -0
- openai/resources/uploads/__init__.py +33 -0
- openai/resources/uploads/parts.py +205 -0
- openai/resources/uploads/uploads.py +719 -0
- openai/resources/vector_stores/__init__.py +47 -0
- openai/resources/vector_stores/file_batches.py +813 -0
- openai/resources/vector_stores/files.py +939 -0
- openai/resources/vector_stores/vector_stores.py +875 -0
- openai/resources/videos.py +847 -0
- openai/resources/webhooks.py +210 -0
- openai/types/__init__.py +115 -0
- openai/types/audio/__init__.py +23 -0
- openai/types/audio/speech_create_params.py +57 -0
- openai/types/audio/speech_model.py +7 -0
- openai/types/audio/transcription.py +71 -0
- openai/types/audio/transcription_create_params.py +172 -0
- openai/types/audio/transcription_create_response.py +12 -0
- openai/types/audio/transcription_diarized.py +63 -0
- openai/types/audio/transcription_diarized_segment.py +32 -0
- openai/types/audio/transcription_include.py +7 -0
- openai/types/audio/transcription_segment.py +49 -0
- openai/types/audio/transcription_stream_event.py +16 -0
- openai/types/audio/transcription_text_delta_event.py +41 -0
- openai/types/audio/transcription_text_done_event.py +63 -0
- openai/types/audio/transcription_text_segment_event.py +27 -0
- openai/types/audio/transcription_verbose.py +38 -0
- openai/types/audio/transcription_word.py +16 -0
- openai/types/audio/translation.py +9 -0
- openai/types/audio/translation_create_params.py +49 -0
- openai/types/audio/translation_create_response.py +11 -0
- openai/types/audio/translation_verbose.py +22 -0
- openai/types/audio_model.py +7 -0
- openai/types/audio_response_format.py +7 -0
- openai/types/auto_file_chunking_strategy_param.py +12 -0
- openai/types/batch.py +104 -0
- openai/types/batch_create_params.py +72 -0
- openai/types/batch_error.py +21 -0
- openai/types/batch_list_params.py +24 -0
- openai/types/batch_request_counts.py +16 -0
- openai/types/batch_usage.py +35 -0
- openai/types/beta/__init__.py +34 -0
- openai/types/beta/assistant.py +134 -0
- openai/types/beta/assistant_create_params.py +220 -0
- openai/types/beta/assistant_deleted.py +15 -0
- openai/types/beta/assistant_list_params.py +39 -0
- openai/types/beta/assistant_response_format_option.py +14 -0
- openai/types/beta/assistant_response_format_option_param.py +16 -0
- openai/types/beta/assistant_stream_event.py +294 -0
- openai/types/beta/assistant_tool.py +15 -0
- openai/types/beta/assistant_tool_choice.py +16 -0
- openai/types/beta/assistant_tool_choice_function.py +10 -0
- openai/types/beta/assistant_tool_choice_function_param.py +12 -0
- openai/types/beta/assistant_tool_choice_option.py +10 -0
- openai/types/beta/assistant_tool_choice_option_param.py +12 -0
- openai/types/beta/assistant_tool_choice_param.py +16 -0
- openai/types/beta/assistant_tool_param.py +14 -0
- openai/types/beta/assistant_update_params.py +191 -0
- openai/types/beta/chat/__init__.py +3 -0
- openai/types/beta/chatkit/__init__.py +32 -0
- openai/types/beta/chatkit/chat_session.py +43 -0
- openai/types/beta/chatkit/chat_session_automatic_thread_titling.py +10 -0
- openai/types/beta/chatkit/chat_session_chatkit_configuration.py +19 -0
- openai/types/beta/chatkit/chat_session_chatkit_configuration_param.py +59 -0
- openai/types/beta/chatkit/chat_session_expires_after_param.py +15 -0
- openai/types/beta/chatkit/chat_session_file_upload.py +18 -0
- openai/types/beta/chatkit/chat_session_history.py +18 -0
- openai/types/beta/chatkit/chat_session_rate_limits.py +10 -0
- openai/types/beta/chatkit/chat_session_rate_limits_param.py +12 -0
- openai/types/beta/chatkit/chat_session_status.py +7 -0
- openai/types/beta/chatkit/chat_session_workflow_param.py +34 -0
- openai/types/beta/chatkit/chatkit_attachment.py +25 -0
- openai/types/beta/chatkit/chatkit_response_output_text.py +62 -0
- openai/types/beta/chatkit/chatkit_thread.py +56 -0
- openai/types/beta/chatkit/chatkit_thread_assistant_message_item.py +29 -0
- openai/types/beta/chatkit/chatkit_thread_item_list.py +144 -0
- openai/types/beta/chatkit/chatkit_thread_user_message_item.py +77 -0
- openai/types/beta/chatkit/chatkit_widget_item.py +27 -0
- openai/types/beta/chatkit/session_create_params.py +35 -0
- openai/types/beta/chatkit/thread_delete_response.py +18 -0
- openai/types/beta/chatkit/thread_list_items_params.py +27 -0
- openai/types/beta/chatkit/thread_list_params.py +33 -0
- openai/types/beta/chatkit_workflow.py +32 -0
- openai/types/beta/code_interpreter_tool.py +12 -0
- openai/types/beta/code_interpreter_tool_param.py +12 -0
- openai/types/beta/file_search_tool.py +55 -0
- openai/types/beta/file_search_tool_param.py +54 -0
- openai/types/beta/function_tool.py +15 -0
- openai/types/beta/function_tool_param.py +16 -0
- openai/types/beta/realtime/__init__.py +96 -0
- openai/types/beta/realtime/conversation_created_event.py +27 -0
- openai/types/beta/realtime/conversation_item.py +61 -0
- openai/types/beta/realtime/conversation_item_content.py +32 -0
- openai/types/beta/realtime/conversation_item_content_param.py +31 -0
- openai/types/beta/realtime/conversation_item_create_event.py +29 -0
- openai/types/beta/realtime/conversation_item_create_event_param.py +29 -0
- openai/types/beta/realtime/conversation_item_created_event.py +27 -0
- openai/types/beta/realtime/conversation_item_delete_event.py +19 -0
- openai/types/beta/realtime/conversation_item_delete_event_param.py +18 -0
- openai/types/beta/realtime/conversation_item_deleted_event.py +18 -0
- openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py +87 -0
- openai/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py +39 -0
- openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py +39 -0
- openai/types/beta/realtime/conversation_item_param.py +62 -0
- openai/types/beta/realtime/conversation_item_retrieve_event.py +19 -0
- openai/types/beta/realtime/conversation_item_retrieve_event_param.py +18 -0
- openai/types/beta/realtime/conversation_item_truncate_event.py +32 -0
- openai/types/beta/realtime/conversation_item_truncate_event_param.py +31 -0
- openai/types/beta/realtime/conversation_item_truncated_event.py +24 -0
- openai/types/beta/realtime/conversation_item_with_reference.py +87 -0
- openai/types/beta/realtime/conversation_item_with_reference_param.py +87 -0
- openai/types/beta/realtime/error_event.py +36 -0
- openai/types/beta/realtime/input_audio_buffer_append_event.py +23 -0
- openai/types/beta/realtime/input_audio_buffer_append_event_param.py +22 -0
- openai/types/beta/realtime/input_audio_buffer_clear_event.py +16 -0
- openai/types/beta/realtime/input_audio_buffer_clear_event_param.py +15 -0
- openai/types/beta/realtime/input_audio_buffer_cleared_event.py +15 -0
- openai/types/beta/realtime/input_audio_buffer_commit_event.py +16 -0
- openai/types/beta/realtime/input_audio_buffer_commit_event_param.py +15 -0
- openai/types/beta/realtime/input_audio_buffer_committed_event.py +25 -0
- openai/types/beta/realtime/input_audio_buffer_speech_started_event.py +26 -0
- openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py +25 -0
- openai/types/beta/realtime/rate_limits_updated_event.py +33 -0
- openai/types/beta/realtime/realtime_client_event.py +47 -0
- openai/types/beta/realtime/realtime_client_event_param.py +44 -0
- openai/types/beta/realtime/realtime_connect_params.py +11 -0
- openai/types/beta/realtime/realtime_response.py +87 -0
- openai/types/beta/realtime/realtime_response_status.py +39 -0
- openai/types/beta/realtime/realtime_response_usage.py +52 -0
- openai/types/beta/realtime/realtime_server_event.py +133 -0
- openai/types/beta/realtime/response_audio_delta_event.py +30 -0
- openai/types/beta/realtime/response_audio_done_event.py +27 -0
- openai/types/beta/realtime/response_audio_transcript_delta_event.py +30 -0
- openai/types/beta/realtime/response_audio_transcript_done_event.py +30 -0
- openai/types/beta/realtime/response_cancel_event.py +22 -0
- openai/types/beta/realtime/response_cancel_event_param.py +21 -0
- openai/types/beta/realtime/response_content_part_added_event.py +45 -0
- openai/types/beta/realtime/response_content_part_done_event.py +45 -0
- openai/types/beta/realtime/response_create_event.py +121 -0
- openai/types/beta/realtime/response_create_event_param.py +122 -0
- openai/types/beta/realtime/response_created_event.py +19 -0
- openai/types/beta/realtime/response_done_event.py +19 -0
- openai/types/beta/realtime/response_function_call_arguments_delta_event.py +30 -0
- openai/types/beta/realtime/response_function_call_arguments_done_event.py +30 -0
- openai/types/beta/realtime/response_output_item_added_event.py +25 -0
- openai/types/beta/realtime/response_output_item_done_event.py +25 -0
- openai/types/beta/realtime/response_text_delta_event.py +30 -0
- openai/types/beta/realtime/response_text_done_event.py +30 -0
- openai/types/beta/realtime/session.py +279 -0
- openai/types/beta/realtime/session_create_params.py +298 -0
- openai/types/beta/realtime/session_create_response.py +196 -0
- openai/types/beta/realtime/session_created_event.py +19 -0
- openai/types/beta/realtime/session_update_event.py +312 -0
- openai/types/beta/realtime/session_update_event_param.py +310 -0
- openai/types/beta/realtime/session_updated_event.py +19 -0
- openai/types/beta/realtime/transcription_session.py +100 -0
- openai/types/beta/realtime/transcription_session_create_params.py +173 -0
- openai/types/beta/realtime/transcription_session_update.py +185 -0
- openai/types/beta/realtime/transcription_session_update_param.py +185 -0
- openai/types/beta/realtime/transcription_session_updated_event.py +24 -0
- openai/types/beta/thread.py +63 -0
- openai/types/beta/thread_create_and_run_params.py +397 -0
- openai/types/beta/thread_create_params.py +186 -0
- openai/types/beta/thread_deleted.py +15 -0
- openai/types/beta/thread_update_params.py +56 -0
- openai/types/beta/threads/__init__.py +46 -0
- openai/types/beta/threads/annotation.py +12 -0
- openai/types/beta/threads/annotation_delta.py +14 -0
- openai/types/beta/threads/file_citation_annotation.py +26 -0
- openai/types/beta/threads/file_citation_delta_annotation.py +33 -0
- openai/types/beta/threads/file_path_annotation.py +26 -0
- openai/types/beta/threads/file_path_delta_annotation.py +30 -0
- openai/types/beta/threads/image_file.py +23 -0
- openai/types/beta/threads/image_file_content_block.py +15 -0
- openai/types/beta/threads/image_file_content_block_param.py +16 -0
- openai/types/beta/threads/image_file_delta.py +23 -0
- openai/types/beta/threads/image_file_delta_block.py +19 -0
- openai/types/beta/threads/image_file_param.py +22 -0
- openai/types/beta/threads/image_url.py +23 -0
- openai/types/beta/threads/image_url_content_block.py +15 -0
- openai/types/beta/threads/image_url_content_block_param.py +16 -0
- openai/types/beta/threads/image_url_delta.py +22 -0
- openai/types/beta/threads/image_url_delta_block.py +19 -0
- openai/types/beta/threads/image_url_param.py +22 -0
- openai/types/beta/threads/message.py +103 -0
- openai/types/beta/threads/message_content.py +18 -0
- openai/types/beta/threads/message_content_delta.py +17 -0
- openai/types/beta/threads/message_content_part_param.py +14 -0
- openai/types/beta/threads/message_create_params.py +55 -0
- openai/types/beta/threads/message_deleted.py +15 -0
- openai/types/beta/threads/message_delta.py +17 -0
- openai/types/beta/threads/message_delta_event.py +19 -0
- openai/types/beta/threads/message_list_params.py +42 -0
- openai/types/beta/threads/message_update_params.py +24 -0
- openai/types/beta/threads/refusal_content_block.py +14 -0
- openai/types/beta/threads/refusal_delta_block.py +18 -0
- openai/types/beta/threads/required_action_function_tool_call.py +34 -0
- openai/types/beta/threads/run.py +245 -0
- openai/types/beta/threads/run_create_params.py +268 -0
- openai/types/beta/threads/run_list_params.py +39 -0
- openai/types/beta/threads/run_status.py +17 -0
- openai/types/beta/threads/run_submit_tool_outputs_params.py +52 -0
- openai/types/beta/threads/run_update_params.py +24 -0
- openai/types/beta/threads/runs/__init__.py +24 -0
- openai/types/beta/threads/runs/code_interpreter_logs.py +19 -0
- openai/types/beta/threads/runs/code_interpreter_output_image.py +26 -0
- openai/types/beta/threads/runs/code_interpreter_tool_call.py +70 -0
- openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py +44 -0
- openai/types/beta/threads/runs/file_search_tool_call.py +78 -0
- openai/types/beta/threads/runs/file_search_tool_call_delta.py +25 -0
- openai/types/beta/threads/runs/function_tool_call.py +38 -0
- openai/types/beta/threads/runs/function_tool_call_delta.py +41 -0
- openai/types/beta/threads/runs/message_creation_step_details.py +19 -0
- openai/types/beta/threads/runs/run_step.py +115 -0
- openai/types/beta/threads/runs/run_step_delta.py +20 -0
- openai/types/beta/threads/runs/run_step_delta_event.py +19 -0
- openai/types/beta/threads/runs/run_step_delta_message_delta.py +20 -0
- openai/types/beta/threads/runs/run_step_include.py +7 -0
- openai/types/beta/threads/runs/step_list_params.py +56 -0
- openai/types/beta/threads/runs/step_retrieve_params.py +28 -0
- openai/types/beta/threads/runs/tool_call.py +15 -0
- openai/types/beta/threads/runs/tool_call_delta.py +16 -0
- openai/types/beta/threads/runs/tool_call_delta_object.py +21 -0
- openai/types/beta/threads/runs/tool_calls_step_details.py +21 -0
- openai/types/beta/threads/text.py +15 -0
- openai/types/beta/threads/text_content_block.py +15 -0
- openai/types/beta/threads/text_content_block_param.py +15 -0
- openai/types/beta/threads/text_delta.py +15 -0
- openai/types/beta/threads/text_delta_block.py +19 -0
- openai/types/chat/__init__.py +102 -0
- openai/types/chat/chat_completion.py +89 -0
- openai/types/chat/chat_completion_allowed_tool_choice_param.py +17 -0
- openai/types/chat/chat_completion_allowed_tools_param.py +32 -0
- openai/types/chat/chat_completion_assistant_message_param.py +70 -0
- openai/types/chat/chat_completion_audio.py +25 -0
- openai/types/chat/chat_completion_audio_param.py +25 -0
- openai/types/chat/chat_completion_chunk.py +166 -0
- openai/types/chat/chat_completion_content_part_image.py +27 -0
- openai/types/chat/chat_completion_content_part_image_param.py +26 -0
- openai/types/chat/chat_completion_content_part_input_audio_param.py +22 -0
- openai/types/chat/chat_completion_content_part_param.py +41 -0
- openai/types/chat/chat_completion_content_part_refusal_param.py +15 -0
- openai/types/chat/chat_completion_content_part_text.py +15 -0
- openai/types/chat/chat_completion_content_part_text_param.py +15 -0
- openai/types/chat/chat_completion_custom_tool_param.py +58 -0
- openai/types/chat/chat_completion_deleted.py +18 -0
- openai/types/chat/chat_completion_developer_message_param.py +25 -0
- openai/types/chat/chat_completion_function_call_option_param.py +12 -0
- openai/types/chat/chat_completion_function_message_param.py +19 -0
- openai/types/chat/chat_completion_function_tool.py +15 -0
- openai/types/chat/chat_completion_function_tool_param.py +16 -0
- openai/types/chat/chat_completion_message.py +79 -0
- openai/types/chat/chat_completion_message_custom_tool_call.py +26 -0
- openai/types/chat/chat_completion_message_custom_tool_call_param.py +26 -0
- openai/types/chat/chat_completion_message_function_tool_call.py +31 -0
- openai/types/chat/chat_completion_message_function_tool_call_param.py +31 -0
- openai/types/chat/chat_completion_message_param.py +24 -0
- openai/types/chat/chat_completion_message_tool_call.py +17 -0
- openai/types/chat/chat_completion_message_tool_call_param.py +14 -0
- openai/types/chat/chat_completion_message_tool_call_union_param.py +15 -0
- openai/types/chat/chat_completion_modality.py +7 -0
- openai/types/chat/chat_completion_named_tool_choice_custom_param.py +19 -0
- openai/types/chat/chat_completion_named_tool_choice_param.py +19 -0
- openai/types/chat/chat_completion_prediction_content_param.py +25 -0
- openai/types/chat/chat_completion_reasoning_effort.py +7 -0
- openai/types/chat/chat_completion_role.py +7 -0
- openai/types/chat/chat_completion_store_message.py +23 -0
- openai/types/chat/chat_completion_stream_options_param.py +31 -0
- openai/types/chat/chat_completion_system_message_param.py +25 -0
- openai/types/chat/chat_completion_token_logprob.py +57 -0
- openai/types/chat/chat_completion_tool_choice_option_param.py +19 -0
- openai/types/chat/chat_completion_tool_message_param.py +21 -0
- openai/types/chat/chat_completion_tool_param.py +14 -0
- openai/types/chat/chat_completion_tool_union_param.py +13 -0
- openai/types/chat/chat_completion_user_message_param.py +25 -0
- openai/types/chat/completion_create_params.py +450 -0
- openai/types/chat/completion_list_params.py +37 -0
- openai/types/chat/completion_update_params.py +22 -0
- openai/types/chat/completions/__init__.py +5 -0
- openai/types/chat/completions/message_list_params.py +21 -0
- openai/types/chat/parsed_chat_completion.py +40 -0
- openai/types/chat/parsed_function_tool_call.py +29 -0
- openai/types/chat_model.py +7 -0
- openai/types/completion.py +37 -0
- openai/types/completion_choice.py +35 -0
- openai/types/completion_create_params.py +189 -0
- openai/types/completion_usage.py +54 -0
- openai/types/container_create_params.py +30 -0
- openai/types/container_create_response.py +40 -0
- openai/types/container_list_params.py +30 -0
- openai/types/container_list_response.py +40 -0
- openai/types/container_retrieve_response.py +40 -0
- openai/types/containers/__init__.py +9 -0
- openai/types/containers/file_create_params.py +17 -0
- openai/types/containers/file_create_response.py +30 -0
- openai/types/containers/file_list_params.py +30 -0
- openai/types/containers/file_list_response.py +30 -0
- openai/types/containers/file_retrieve_response.py +30 -0
- openai/types/containers/files/__init__.py +3 -0
- openai/types/conversations/__init__.py +27 -0
- openai/types/conversations/computer_screenshot_content.py +22 -0
- openai/types/conversations/conversation.py +30 -0
- openai/types/conversations/conversation_create_params.py +29 -0
- openai/types/conversations/conversation_deleted_resource.py +15 -0
- openai/types/conversations/conversation_item.py +230 -0
- openai/types/conversations/conversation_item_list.py +26 -0
- openai/types/conversations/conversation_update_params.py +22 -0
- openai/types/conversations/input_file_content.py +7 -0
- openai/types/conversations/input_file_content_param.py +7 -0
- openai/types/conversations/input_image_content.py +7 -0
- openai/types/conversations/input_image_content_param.py +7 -0
- openai/types/conversations/input_text_content.py +7 -0
- openai/types/conversations/input_text_content_param.py +7 -0
- openai/types/conversations/item_create_params.py +24 -0
- openai/types/conversations/item_list_params.py +50 -0
- openai/types/conversations/item_retrieve_params.py +22 -0
- openai/types/conversations/message.py +66 -0
- openai/types/conversations/output_text_content.py +7 -0
- openai/types/conversations/output_text_content_param.py +7 -0
- openai/types/conversations/refusal_content.py +7 -0
- openai/types/conversations/refusal_content_param.py +7 -0
- openai/types/conversations/summary_text_content.py +15 -0
- openai/types/conversations/text_content.py +13 -0
- openai/types/create_embedding_response.py +31 -0
- openai/types/embedding.py +23 -0
- openai/types/embedding_create_params.py +55 -0
- openai/types/embedding_model.py +7 -0
- openai/types/eval_create_params.py +202 -0
- openai/types/eval_create_response.py +111 -0
- openai/types/eval_custom_data_source_config.py +21 -0
- openai/types/eval_delete_response.py +13 -0
- openai/types/eval_list_params.py +27 -0
- openai/types/eval_list_response.py +111 -0
- openai/types/eval_retrieve_response.py +111 -0
- openai/types/eval_stored_completions_data_source_config.py +32 -0
- openai/types/eval_update_params.py +25 -0
- openai/types/eval_update_response.py +111 -0
- openai/types/evals/__init__.py +22 -0
- openai/types/evals/create_eval_completions_run_data_source.py +236 -0
- openai/types/evals/create_eval_completions_run_data_source_param.py +232 -0
- openai/types/evals/create_eval_jsonl_run_data_source.py +42 -0
- openai/types/evals/create_eval_jsonl_run_data_source_param.py +47 -0
- openai/types/evals/eval_api_error.py +13 -0
- openai/types/evals/run_cancel_response.py +417 -0
- openai/types/evals/run_create_params.py +340 -0
- openai/types/evals/run_create_response.py +417 -0
- openai/types/evals/run_delete_response.py +15 -0
- openai/types/evals/run_list_params.py +27 -0
- openai/types/evals/run_list_response.py +417 -0
- openai/types/evals/run_retrieve_response.py +417 -0
- openai/types/evals/runs/__init__.py +7 -0
- openai/types/evals/runs/output_item_list_params.py +30 -0
- openai/types/evals/runs/output_item_list_response.py +134 -0
- openai/types/evals/runs/output_item_retrieve_response.py +134 -0
- openai/types/file_chunking_strategy.py +14 -0
- openai/types/file_chunking_strategy_param.py +13 -0
- openai/types/file_content.py +7 -0
- openai/types/file_create_params.py +45 -0
- openai/types/file_deleted.py +15 -0
- openai/types/file_list_params.py +33 -0
- openai/types/file_object.py +58 -0
- openai/types/file_purpose.py +7 -0
- openai/types/fine_tuning/__init__.py +26 -0
- openai/types/fine_tuning/alpha/__init__.py +8 -0
- openai/types/fine_tuning/alpha/grader_run_params.py +40 -0
- openai/types/fine_tuning/alpha/grader_run_response.py +67 -0
- openai/types/fine_tuning/alpha/grader_validate_params.py +24 -0
- openai/types/fine_tuning/alpha/grader_validate_response.py +20 -0
- openai/types/fine_tuning/checkpoints/__init__.py +9 -0
- openai/types/fine_tuning/checkpoints/permission_create_params.py +14 -0
- openai/types/fine_tuning/checkpoints/permission_create_response.py +21 -0
- openai/types/fine_tuning/checkpoints/permission_delete_response.py +18 -0
- openai/types/fine_tuning/checkpoints/permission_retrieve_params.py +21 -0
- openai/types/fine_tuning/checkpoints/permission_retrieve_response.py +34 -0
- openai/types/fine_tuning/dpo_hyperparameters.py +36 -0
- openai/types/fine_tuning/dpo_hyperparameters_param.py +36 -0
- openai/types/fine_tuning/dpo_method.py +13 -0
- openai/types/fine_tuning/dpo_method_param.py +14 -0
- openai/types/fine_tuning/fine_tuning_job.py +161 -0
- openai/types/fine_tuning/fine_tuning_job_event.py +32 -0
- openai/types/fine_tuning/fine_tuning_job_integration.py +5 -0
- openai/types/fine_tuning/fine_tuning_job_wandb_integration.py +33 -0
- openai/types/fine_tuning/fine_tuning_job_wandb_integration_object.py +21 -0
- openai/types/fine_tuning/job_create_params.py +176 -0
- openai/types/fine_tuning/job_list_events_params.py +15 -0
- openai/types/fine_tuning/job_list_params.py +23 -0
- openai/types/fine_tuning/jobs/__init__.py +6 -0
- openai/types/fine_tuning/jobs/checkpoint_list_params.py +15 -0
- openai/types/fine_tuning/jobs/fine_tuning_job_checkpoint.py +47 -0
- openai/types/fine_tuning/reinforcement_hyperparameters.py +43 -0
- openai/types/fine_tuning/reinforcement_hyperparameters_param.py +43 -0
- openai/types/fine_tuning/reinforcement_method.py +24 -0
- openai/types/fine_tuning/reinforcement_method_param.py +27 -0
- openai/types/fine_tuning/supervised_hyperparameters.py +29 -0
- openai/types/fine_tuning/supervised_hyperparameters_param.py +29 -0
- openai/types/fine_tuning/supervised_method.py +13 -0
- openai/types/fine_tuning/supervised_method_param.py +14 -0
- openai/types/graders/__init__.py +16 -0
- openai/types/graders/label_model_grader.py +70 -0
- openai/types/graders/label_model_grader_param.py +77 -0
- openai/types/graders/multi_grader.py +32 -0
- openai/types/graders/multi_grader_param.py +35 -0
- openai/types/graders/python_grader.py +22 -0
- openai/types/graders/python_grader_param.py +21 -0
- openai/types/graders/score_model_grader.py +109 -0
- openai/types/graders/score_model_grader_param.py +115 -0
- openai/types/graders/string_check_grader.py +24 -0
- openai/types/graders/string_check_grader_param.py +24 -0
- openai/types/graders/text_similarity_grader.py +40 -0
- openai/types/graders/text_similarity_grader_param.py +42 -0
- openai/types/image.py +26 -0
- openai/types/image_create_variation_params.py +48 -0
- openai/types/image_edit_completed_event.py +55 -0
- openai/types/image_edit_params.py +145 -0
- openai/types/image_edit_partial_image_event.py +33 -0
- openai/types/image_edit_stream_event.py +14 -0
- openai/types/image_gen_completed_event.py +55 -0
- openai/types/image_gen_partial_image_event.py +33 -0
- openai/types/image_gen_stream_event.py +14 -0
- openai/types/image_generate_params.py +143 -0
- openai/types/image_model.py +7 -0
- openai/types/images_response.py +60 -0
- openai/types/model.py +21 -0
- openai/types/model_deleted.py +13 -0
- openai/types/moderation.py +186 -0
- openai/types/moderation_create_params.py +30 -0
- openai/types/moderation_create_response.py +19 -0
- openai/types/moderation_image_url_input_param.py +20 -0
- openai/types/moderation_model.py +9 -0
- openai/types/moderation_multi_modal_input_param.py +13 -0
- openai/types/moderation_text_input_param.py +15 -0
- openai/types/other_file_chunking_strategy_object.py +12 -0
- openai/types/realtime/__init__.py +237 -0
- openai/types/realtime/audio_transcription.py +37 -0
- openai/types/realtime/audio_transcription_param.py +34 -0
- openai/types/realtime/call_accept_params.py +122 -0
- openai/types/realtime/call_create_params.py +17 -0
- openai/types/realtime/call_refer_params.py +15 -0
- openai/types/realtime/call_reject_params.py +15 -0
- openai/types/realtime/client_secret_create_params.py +46 -0
- openai/types/realtime/client_secret_create_response.py +26 -0
- openai/types/realtime/conversation_created_event.py +27 -0
- openai/types/realtime/conversation_item.py +32 -0
- openai/types/realtime/conversation_item_added.py +26 -0
- openai/types/realtime/conversation_item_create_event.py +29 -0
- openai/types/realtime/conversation_item_create_event_param.py +29 -0
- openai/types/realtime/conversation_item_created_event.py +27 -0
- openai/types/realtime/conversation_item_delete_event.py +19 -0
- openai/types/realtime/conversation_item_delete_event_param.py +18 -0
- openai/types/realtime/conversation_item_deleted_event.py +18 -0
- openai/types/realtime/conversation_item_done.py +26 -0
- openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py +79 -0
- openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py +36 -0
- openai/types/realtime/conversation_item_input_audio_transcription_failed_event.py +39 -0
- openai/types/realtime/conversation_item_input_audio_transcription_segment.py +36 -0
- openai/types/realtime/conversation_item_param.py +30 -0
- openai/types/realtime/conversation_item_retrieve_event.py +19 -0
- openai/types/realtime/conversation_item_retrieve_event_param.py +18 -0
- openai/types/realtime/conversation_item_truncate_event.py +32 -0
- openai/types/realtime/conversation_item_truncate_event_param.py +31 -0
- openai/types/realtime/conversation_item_truncated_event.py +24 -0
- openai/types/realtime/input_audio_buffer_append_event.py +23 -0
- openai/types/realtime/input_audio_buffer_append_event_param.py +22 -0
- openai/types/realtime/input_audio_buffer_clear_event.py +16 -0
- openai/types/realtime/input_audio_buffer_clear_event_param.py +15 -0
- openai/types/realtime/input_audio_buffer_cleared_event.py +15 -0
- openai/types/realtime/input_audio_buffer_commit_event.py +16 -0
- openai/types/realtime/input_audio_buffer_commit_event_param.py +15 -0
- openai/types/realtime/input_audio_buffer_committed_event.py +25 -0
- openai/types/realtime/input_audio_buffer_speech_started_event.py +26 -0
- openai/types/realtime/input_audio_buffer_speech_stopped_event.py +25 -0
- openai/types/realtime/input_audio_buffer_timeout_triggered.py +30 -0
- openai/types/realtime/log_prob_properties.py +18 -0
- openai/types/realtime/mcp_list_tools_completed.py +18 -0
- openai/types/realtime/mcp_list_tools_failed.py +18 -0
- openai/types/realtime/mcp_list_tools_in_progress.py +18 -0
- openai/types/realtime/noise_reduction_type.py +7 -0
- openai/types/realtime/output_audio_buffer_clear_event.py +16 -0
- openai/types/realtime/output_audio_buffer_clear_event_param.py +15 -0
- openai/types/realtime/rate_limits_updated_event.py +33 -0
- openai/types/realtime/realtime_audio_config.py +15 -0
- openai/types/realtime/realtime_audio_config_input.py +63 -0
- openai/types/realtime/realtime_audio_config_input_param.py +65 -0
- openai/types/realtime/realtime_audio_config_output.py +36 -0
- openai/types/realtime/realtime_audio_config_output_param.py +35 -0
- openai/types/realtime/realtime_audio_config_param.py +16 -0
- openai/types/realtime/realtime_audio_formats.py +30 -0
- openai/types/realtime/realtime_audio_formats_param.py +29 -0
- openai/types/realtime/realtime_audio_input_turn_detection.py +98 -0
- openai/types/realtime/realtime_audio_input_turn_detection_param.py +95 -0
- openai/types/realtime/realtime_client_event.py +36 -0
- openai/types/realtime/realtime_client_event_param.py +34 -0
- openai/types/realtime/realtime_connect_params.py +13 -0
- openai/types/realtime/realtime_conversation_item_assistant_message.py +58 -0
- openai/types/realtime/realtime_conversation_item_assistant_message_param.py +58 -0
- openai/types/realtime/realtime_conversation_item_function_call.py +41 -0
- openai/types/realtime/realtime_conversation_item_function_call_output.py +37 -0
- openai/types/realtime/realtime_conversation_item_function_call_output_param.py +36 -0
- openai/types/realtime/realtime_conversation_item_function_call_param.py +40 -0
- openai/types/realtime/realtime_conversation_item_system_message.py +42 -0
- openai/types/realtime/realtime_conversation_item_system_message_param.py +42 -0
- openai/types/realtime/realtime_conversation_item_user_message.py +69 -0
- openai/types/realtime/realtime_conversation_item_user_message_param.py +69 -0
- openai/types/realtime/realtime_error.py +24 -0
- openai/types/realtime/realtime_error_event.py +19 -0
- openai/types/realtime/realtime_function_tool.py +25 -0
- openai/types/realtime/realtime_function_tool_param.py +24 -0
- openai/types/realtime/realtime_mcp_approval_request.py +24 -0
- openai/types/realtime/realtime_mcp_approval_request_param.py +24 -0
- openai/types/realtime/realtime_mcp_approval_response.py +25 -0
- openai/types/realtime/realtime_mcp_approval_response_param.py +25 -0
- openai/types/realtime/realtime_mcp_list_tools.py +36 -0
- openai/types/realtime/realtime_mcp_list_tools_param.py +36 -0
- openai/types/realtime/realtime_mcp_protocol_error.py +15 -0
- openai/types/realtime/realtime_mcp_protocol_error_param.py +15 -0
- openai/types/realtime/realtime_mcp_tool_call.py +43 -0
- openai/types/realtime/realtime_mcp_tool_call_param.py +40 -0
- openai/types/realtime/realtime_mcp_tool_execution_error.py +13 -0
- openai/types/realtime/realtime_mcp_tool_execution_error_param.py +13 -0
- openai/types/realtime/realtime_mcphttp_error.py +15 -0
- openai/types/realtime/realtime_mcphttp_error_param.py +15 -0
- openai/types/realtime/realtime_response.py +98 -0
- openai/types/realtime/realtime_response_create_audio_output.py +29 -0
- openai/types/realtime/realtime_response_create_audio_output_param.py +28 -0
- openai/types/realtime/realtime_response_create_mcp_tool.py +135 -0
- openai/types/realtime/realtime_response_create_mcp_tool_param.py +135 -0
- openai/types/realtime/realtime_response_create_params.py +98 -0
- openai/types/realtime/realtime_response_create_params_param.py +99 -0
- openai/types/realtime/realtime_response_status.py +39 -0
- openai/types/realtime/realtime_response_usage.py +41 -0
- openai/types/realtime/realtime_response_usage_input_token_details.py +35 -0
- openai/types/realtime/realtime_response_usage_output_token_details.py +15 -0
- openai/types/realtime/realtime_server_event.py +155 -0
- openai/types/realtime/realtime_session_client_secret.py +20 -0
- openai/types/realtime/realtime_session_create_request.py +122 -0
- openai/types/realtime/realtime_session_create_request_param.py +122 -0
- openai/types/realtime/realtime_session_create_response.py +475 -0
- openai/types/realtime/realtime_tool_choice_config.py +12 -0
- openai/types/realtime/realtime_tool_choice_config_param.py +14 -0
- openai/types/realtime/realtime_tools_config.py +10 -0
- openai/types/realtime/realtime_tools_config_param.py +143 -0
- openai/types/realtime/realtime_tools_config_union.py +141 -0
- openai/types/realtime/realtime_tools_config_union_param.py +140 -0
- openai/types/realtime/realtime_tracing_config.py +31 -0
- openai/types/realtime/realtime_tracing_config_param.py +31 -0
- openai/types/realtime/realtime_transcription_session_audio.py +12 -0
- openai/types/realtime/realtime_transcription_session_audio_input.py +65 -0
- openai/types/realtime/realtime_transcription_session_audio_input_param.py +67 -0
- openai/types/realtime/realtime_transcription_session_audio_input_turn_detection.py +98 -0
- openai/types/realtime/realtime_transcription_session_audio_input_turn_detection_param.py +95 -0
- openai/types/realtime/realtime_transcription_session_audio_param.py +13 -0
- openai/types/realtime/realtime_transcription_session_create_request.py +27 -0
- openai/types/realtime/realtime_transcription_session_create_request_param.py +28 -0
- openai/types/realtime/realtime_transcription_session_create_response.py +68 -0
- openai/types/realtime/realtime_transcription_session_turn_detection.py +32 -0
- openai/types/realtime/realtime_truncation.py +10 -0
- openai/types/realtime/realtime_truncation_param.py +12 -0
- openai/types/realtime/realtime_truncation_retention_ratio.py +38 -0
- openai/types/realtime/realtime_truncation_retention_ratio_param.py +37 -0
- openai/types/realtime/response_audio_delta_event.py +30 -0
- openai/types/realtime/response_audio_done_event.py +27 -0
- openai/types/realtime/response_audio_transcript_delta_event.py +30 -0
- openai/types/realtime/response_audio_transcript_done_event.py +30 -0
- openai/types/realtime/response_cancel_event.py +22 -0
- openai/types/realtime/response_cancel_event_param.py +21 -0
- openai/types/realtime/response_content_part_added_event.py +45 -0
- openai/types/realtime/response_content_part_done_event.py +45 -0
- openai/types/realtime/response_create_event.py +20 -0
- openai/types/realtime/response_create_event_param.py +20 -0
- openai/types/realtime/response_created_event.py +19 -0
- openai/types/realtime/response_done_event.py +19 -0
- openai/types/realtime/response_function_call_arguments_delta_event.py +30 -0
- openai/types/realtime/response_function_call_arguments_done_event.py +30 -0
- openai/types/realtime/response_mcp_call_arguments_delta.py +31 -0
- openai/types/realtime/response_mcp_call_arguments_done.py +27 -0
- openai/types/realtime/response_mcp_call_completed.py +21 -0
- openai/types/realtime/response_mcp_call_failed.py +21 -0
- openai/types/realtime/response_mcp_call_in_progress.py +21 -0
- openai/types/realtime/response_output_item_added_event.py +25 -0
- openai/types/realtime/response_output_item_done_event.py +25 -0
- openai/types/realtime/response_text_delta_event.py +30 -0
- openai/types/realtime/response_text_done_event.py +30 -0
- openai/types/realtime/session_created_event.py +23 -0
- openai/types/realtime/session_update_event.py +31 -0
- openai/types/realtime/session_update_event_param.py +32 -0
- openai/types/realtime/session_updated_event.py +23 -0
- openai/types/responses/__init__.py +270 -0
- openai/types/responses/apply_patch_tool.py +12 -0
- openai/types/responses/apply_patch_tool_param.py +12 -0
- openai/types/responses/computer_tool.py +21 -0
- openai/types/responses/computer_tool_param.py +21 -0
- openai/types/responses/custom_tool.py +23 -0
- openai/types/responses/custom_tool_param.py +23 -0
- openai/types/responses/easy_input_message.py +26 -0
- openai/types/responses/easy_input_message_param.py +27 -0
- openai/types/responses/file_search_tool.py +58 -0
- openai/types/responses/file_search_tool_param.py +60 -0
- openai/types/responses/function_shell_tool.py +12 -0
- openai/types/responses/function_shell_tool_param.py +12 -0
- openai/types/responses/function_tool.py +28 -0
- openai/types/responses/function_tool_param.py +28 -0
- openai/types/responses/input_item_list_params.py +34 -0
- openai/types/responses/input_token_count_params.py +142 -0
- openai/types/responses/input_token_count_response.py +13 -0
- openai/types/responses/parsed_response.py +105 -0
- openai/types/responses/response.py +307 -0
- openai/types/responses/response_apply_patch_tool_call.py +76 -0
- openai/types/responses/response_apply_patch_tool_call_output.py +31 -0
- openai/types/responses/response_audio_delta_event.py +18 -0
- openai/types/responses/response_audio_done_event.py +15 -0
- openai/types/responses/response_audio_transcript_delta_event.py +18 -0
- openai/types/responses/response_audio_transcript_done_event.py +15 -0
- openai/types/responses/response_code_interpreter_call_code_delta_event.py +27 -0
- openai/types/responses/response_code_interpreter_call_code_done_event.py +24 -0
- openai/types/responses/response_code_interpreter_call_completed_event.py +24 -0
- openai/types/responses/response_code_interpreter_call_in_progress_event.py +24 -0
- openai/types/responses/response_code_interpreter_call_interpreting_event.py +24 -0
- openai/types/responses/response_code_interpreter_tool_call.py +55 -0
- openai/types/responses/response_code_interpreter_tool_call_param.py +54 -0
- openai/types/responses/response_completed_event.py +19 -0
- openai/types/responses/response_computer_tool_call.py +209 -0
- openai/types/responses/response_computer_tool_call_output_item.py +47 -0
- openai/types/responses/response_computer_tool_call_output_screenshot.py +22 -0
- openai/types/responses/response_computer_tool_call_output_screenshot_param.py +21 -0
- openai/types/responses/response_computer_tool_call_param.py +207 -0
- openai/types/responses/response_content_part_added_event.py +44 -0
- openai/types/responses/response_content_part_done_event.py +44 -0
- openai/types/responses/response_conversation_param.py +12 -0
- openai/types/responses/response_create_params.py +334 -0
- openai/types/responses/response_created_event.py +19 -0
- openai/types/responses/response_custom_tool_call.py +25 -0
- openai/types/responses/response_custom_tool_call_input_delta_event.py +24 -0
- openai/types/responses/response_custom_tool_call_input_done_event.py +24 -0
- openai/types/responses/response_custom_tool_call_output.py +33 -0
- openai/types/responses/response_custom_tool_call_output_param.py +31 -0
- openai/types/responses/response_custom_tool_call_param.py +24 -0
- openai/types/responses/response_error.py +34 -0
- openai/types/responses/response_error_event.py +25 -0
- openai/types/responses/response_failed_event.py +19 -0
- openai/types/responses/response_file_search_call_completed_event.py +21 -0
- openai/types/responses/response_file_search_call_in_progress_event.py +21 -0
- openai/types/responses/response_file_search_call_searching_event.py +21 -0
- openai/types/responses/response_file_search_tool_call.py +51 -0
- openai/types/responses/response_file_search_tool_call_param.py +53 -0
- openai/types/responses/response_format_text_config.py +16 -0
- openai/types/responses/response_format_text_config_param.py +16 -0
- openai/types/responses/response_format_text_json_schema_config.py +43 -0
- openai/types/responses/response_format_text_json_schema_config_param.py +41 -0
- openai/types/responses/response_function_call_arguments_delta_event.py +26 -0
- openai/types/responses/response_function_call_arguments_done_event.py +26 -0
- openai/types/responses/response_function_call_output_item.py +16 -0
- openai/types/responses/response_function_call_output_item_list.py +10 -0
- openai/types/responses/response_function_call_output_item_list_param.py +18 -0
- openai/types/responses/response_function_call_output_item_param.py +16 -0
- openai/types/responses/response_function_shell_call_output_content.py +36 -0
- openai/types/responses/response_function_shell_call_output_content_param.py +35 -0
- openai/types/responses/response_function_shell_tool_call.py +44 -0
- openai/types/responses/response_function_shell_tool_call_output.py +70 -0
- openai/types/responses/response_function_tool_call.py +32 -0
- openai/types/responses/response_function_tool_call_item.py +10 -0
- openai/types/responses/response_function_tool_call_output_item.py +40 -0
- openai/types/responses/response_function_tool_call_param.py +31 -0
- openai/types/responses/response_function_web_search.py +67 -0
- openai/types/responses/response_function_web_search_param.py +73 -0
- openai/types/responses/response_image_gen_call_completed_event.py +21 -0
- openai/types/responses/response_image_gen_call_generating_event.py +21 -0
- openai/types/responses/response_image_gen_call_in_progress_event.py +21 -0
- openai/types/responses/response_image_gen_call_partial_image_event.py +30 -0
- openai/types/responses/response_in_progress_event.py +19 -0
- openai/types/responses/response_includable.py +16 -0
- openai/types/responses/response_incomplete_event.py +19 -0
- openai/types/responses/response_input_audio.py +22 -0
- openai/types/responses/response_input_audio_param.py +22 -0
- openai/types/responses/response_input_content.py +15 -0
- openai/types/responses/response_input_content_param.py +14 -0
- openai/types/responses/response_input_file.py +25 -0
- openai/types/responses/response_input_file_content.py +25 -0
- openai/types/responses/response_input_file_content_param.py +25 -0
- openai/types/responses/response_input_file_param.py +25 -0
- openai/types/responses/response_input_image.py +28 -0
- openai/types/responses/response_input_image_content.py +28 -0
- openai/types/responses/response_input_image_content_param.py +28 -0
- openai/types/responses/response_input_image_param.py +28 -0
- openai/types/responses/response_input_item.py +482 -0
- openai/types/responses/response_input_item_param.py +479 -0
- openai/types/responses/response_input_message_content_list.py +10 -0
- openai/types/responses/response_input_message_content_list_param.py +16 -0
- openai/types/responses/response_input_message_item.py +33 -0
- openai/types/responses/response_input_param.py +482 -0
- openai/types/responses/response_input_text.py +15 -0
- openai/types/responses/response_input_text_content.py +15 -0
- openai/types/responses/response_input_text_content_param.py +15 -0
- openai/types/responses/response_input_text_param.py +15 -0
- openai/types/responses/response_item.py +226 -0
- openai/types/responses/response_item_list.py +26 -0
- openai/types/responses/response_mcp_call_arguments_delta_event.py +27 -0
- openai/types/responses/response_mcp_call_arguments_done_event.py +24 -0
- openai/types/responses/response_mcp_call_completed_event.py +21 -0
- openai/types/responses/response_mcp_call_failed_event.py +21 -0
- openai/types/responses/response_mcp_call_in_progress_event.py +21 -0
- openai/types/responses/response_mcp_list_tools_completed_event.py +21 -0
- openai/types/responses/response_mcp_list_tools_failed_event.py +21 -0
- openai/types/responses/response_mcp_list_tools_in_progress_event.py +21 -0
- openai/types/responses/response_output_item.py +189 -0
- openai/types/responses/response_output_item_added_event.py +22 -0
- openai/types/responses/response_output_item_done_event.py +22 -0
- openai/types/responses/response_output_message.py +34 -0
- openai/types/responses/response_output_message_param.py +34 -0
- openai/types/responses/response_output_refusal.py +15 -0
- openai/types/responses/response_output_refusal_param.py +15 -0
- openai/types/responses/response_output_text.py +117 -0
- openai/types/responses/response_output_text_annotation_added_event.py +30 -0
- openai/types/responses/response_output_text_param.py +115 -0
- openai/types/responses/response_prompt.py +28 -0
- openai/types/responses/response_prompt_param.py +29 -0
- openai/types/responses/response_queued_event.py +19 -0
- openai/types/responses/response_reasoning_item.py +51 -0
- openai/types/responses/response_reasoning_item_param.py +51 -0
- openai/types/responses/response_reasoning_summary_part_added_event.py +35 -0
- openai/types/responses/response_reasoning_summary_part_done_event.py +35 -0
- openai/types/responses/response_reasoning_summary_text_delta_event.py +27 -0
- openai/types/responses/response_reasoning_summary_text_done_event.py +27 -0
- openai/types/responses/response_reasoning_text_delta_event.py +27 -0
- openai/types/responses/response_reasoning_text_done_event.py +27 -0
- openai/types/responses/response_refusal_delta_event.py +27 -0
- openai/types/responses/response_refusal_done_event.py +27 -0
- openai/types/responses/response_retrieve_params.py +59 -0
- openai/types/responses/response_status.py +7 -0
- openai/types/responses/response_stream_event.py +120 -0
- openai/types/responses/response_text_config.py +35 -0
- openai/types/responses/response_text_config_param.py +36 -0
- openai/types/responses/response_text_delta_event.py +50 -0
- openai/types/responses/response_text_done_event.py +50 -0
- openai/types/responses/response_usage.py +35 -0
- openai/types/responses/response_web_search_call_completed_event.py +21 -0
- openai/types/responses/response_web_search_call_in_progress_event.py +21 -0
- openai/types/responses/response_web_search_call_searching_event.py +21 -0
- openai/types/responses/tool.py +271 -0
- openai/types/responses/tool_choice_allowed.py +36 -0
- openai/types/responses/tool_choice_allowed_param.py +36 -0
- openai/types/responses/tool_choice_apply_patch.py +12 -0
- openai/types/responses/tool_choice_apply_patch_param.py +12 -0
- openai/types/responses/tool_choice_custom.py +15 -0
- openai/types/responses/tool_choice_custom_param.py +15 -0
- openai/types/responses/tool_choice_function.py +15 -0
- openai/types/responses/tool_choice_function_param.py +15 -0
- openai/types/responses/tool_choice_mcp.py +19 -0
- openai/types/responses/tool_choice_mcp_param.py +19 -0
- openai/types/responses/tool_choice_options.py +7 -0
- openai/types/responses/tool_choice_shell.py +12 -0
- openai/types/responses/tool_choice_shell_param.py +12 -0
- openai/types/responses/tool_choice_types.py +31 -0
- openai/types/responses/tool_choice_types_param.py +33 -0
- openai/types/responses/tool_param.py +271 -0
- openai/types/responses/web_search_preview_tool.py +49 -0
- openai/types/responses/web_search_preview_tool_param.py +49 -0
- openai/types/responses/web_search_tool.py +63 -0
- openai/types/responses/web_search_tool_param.py +65 -0
- openai/types/shared/__init__.py +19 -0
- openai/types/shared/all_models.py +28 -0
- openai/types/shared/chat_model.py +75 -0
- openai/types/shared/comparison_filter.py +34 -0
- openai/types/shared/compound_filter.py +22 -0
- openai/types/shared/custom_tool_input_format.py +28 -0
- openai/types/shared/error_object.py +17 -0
- openai/types/shared/function_definition.py +43 -0
- openai/types/shared/function_parameters.py +8 -0
- openai/types/shared/metadata.py +8 -0
- openai/types/shared/reasoning.py +44 -0
- openai/types/shared/reasoning_effort.py +8 -0
- openai/types/shared/response_format_json_object.py +12 -0
- openai/types/shared/response_format_json_schema.py +48 -0
- openai/types/shared/response_format_text.py +12 -0
- openai/types/shared/response_format_text_grammar.py +15 -0
- openai/types/shared/response_format_text_python.py +12 -0
- openai/types/shared/responses_model.py +28 -0
- openai/types/shared_params/__init__.py +15 -0
- openai/types/shared_params/chat_model.py +77 -0
- openai/types/shared_params/comparison_filter.py +36 -0
- openai/types/shared_params/compound_filter.py +23 -0
- openai/types/shared_params/custom_tool_input_format.py +27 -0
- openai/types/shared_params/function_definition.py +45 -0
- openai/types/shared_params/function_parameters.py +10 -0
- openai/types/shared_params/metadata.py +10 -0
- openai/types/shared_params/reasoning.py +45 -0
- openai/types/shared_params/reasoning_effort.py +10 -0
- openai/types/shared_params/response_format_json_object.py +12 -0
- openai/types/shared_params/response_format_json_schema.py +46 -0
- openai/types/shared_params/response_format_text.py +12 -0
- openai/types/shared_params/responses_model.py +30 -0
- openai/types/static_file_chunking_strategy.py +20 -0
- openai/types/static_file_chunking_strategy_object.py +15 -0
- openai/types/static_file_chunking_strategy_object_param.py +16 -0
- openai/types/static_file_chunking_strategy_param.py +22 -0
- openai/types/upload.py +42 -0
- openai/types/upload_complete_params.py +20 -0
- openai/types/upload_create_params.py +52 -0
- openai/types/uploads/__init__.py +6 -0
- openai/types/uploads/part_create_params.py +14 -0
- openai/types/uploads/upload_part.py +21 -0
- openai/types/vector_store.py +82 -0
- openai/types/vector_store_create_params.py +61 -0
- openai/types/vector_store_deleted.py +15 -0
- openai/types/vector_store_list_params.py +39 -0
- openai/types/vector_store_search_params.py +42 -0
- openai/types/vector_store_search_response.py +39 -0
- openai/types/vector_store_update_params.py +39 -0
- openai/types/vector_stores/__init__.py +13 -0
- openai/types/vector_stores/file_batch_create_params.py +70 -0
- openai/types/vector_stores/file_batch_list_files_params.py +47 -0
- openai/types/vector_stores/file_content_response.py +15 -0
- openai/types/vector_stores/file_create_params.py +35 -0
- openai/types/vector_stores/file_list_params.py +45 -0
- openai/types/vector_stores/file_update_params.py +21 -0
- openai/types/vector_stores/vector_store_file.py +67 -0
- openai/types/vector_stores/vector_store_file_batch.py +54 -0
- openai/types/vector_stores/vector_store_file_deleted.py +15 -0
- openai/types/video.py +53 -0
- openai/types/video_create_error.py +11 -0
- openai/types/video_create_params.py +29 -0
- openai/types/video_delete_response.py +18 -0
- openai/types/video_download_content_params.py +12 -0
- openai/types/video_list_params.py +21 -0
- openai/types/video_model.py +7 -0
- openai/types/video_remix_params.py +12 -0
- openai/types/video_seconds.py +7 -0
- openai/types/video_size.py +7 -0
- openai/types/webhooks/__init__.py +24 -0
- openai/types/webhooks/batch_cancelled_webhook_event.py +30 -0
- openai/types/webhooks/batch_completed_webhook_event.py +30 -0
- openai/types/webhooks/batch_expired_webhook_event.py +30 -0
- openai/types/webhooks/batch_failed_webhook_event.py +30 -0
- openai/types/webhooks/eval_run_canceled_webhook_event.py +30 -0
- openai/types/webhooks/eval_run_failed_webhook_event.py +30 -0
- openai/types/webhooks/eval_run_succeeded_webhook_event.py +30 -0
- openai/types/webhooks/fine_tuning_job_cancelled_webhook_event.py +30 -0
- openai/types/webhooks/fine_tuning_job_failed_webhook_event.py +30 -0
- openai/types/webhooks/fine_tuning_job_succeeded_webhook_event.py +30 -0
- openai/types/webhooks/realtime_call_incoming_webhook_event.py +41 -0
- openai/types/webhooks/response_cancelled_webhook_event.py +30 -0
- openai/types/webhooks/response_completed_webhook_event.py +30 -0
- openai/types/webhooks/response_failed_webhook_event.py +30 -0
- openai/types/webhooks/response_incomplete_webhook_event.py +30 -0
- openai/types/webhooks/unwrap_webhook_event.py +44 -0
- openai/types/websocket_connection_options.py +36 -0
- openai/version.py +3 -0
|
@@ -0,0 +1,1160 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, overload
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from .. import _legacy_response
|
|
11
|
+
from ..types import completion_create_params
|
|
12
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
13
|
+
from .._utils import required_args, maybe_transform, async_maybe_transform
|
|
14
|
+
from .._compat import cached_property
|
|
15
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
|
|
17
|
+
from .._streaming import Stream, AsyncStream
|
|
18
|
+
from .._base_client import (
|
|
19
|
+
make_request_options,
|
|
20
|
+
)
|
|
21
|
+
from ..types.completion import Completion
|
|
22
|
+
from ..types.chat.chat_completion_stream_options_param import ChatCompletionStreamOptionsParam
|
|
23
|
+
|
|
24
|
+
__all__ = ["Completions", "AsyncCompletions"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Completions(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> CompletionsWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return CompletionsWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> CompletionsWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return CompletionsWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
@overload
|
|
48
|
+
def create(
|
|
49
|
+
self,
|
|
50
|
+
*,
|
|
51
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
52
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
53
|
+
best_of: Optional[int] | Omit = omit,
|
|
54
|
+
echo: Optional[bool] | Omit = omit,
|
|
55
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
56
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
57
|
+
logprobs: Optional[int] | Omit = omit,
|
|
58
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
59
|
+
n: Optional[int] | Omit = omit,
|
|
60
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
61
|
+
seed: Optional[int] | Omit = omit,
|
|
62
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
63
|
+
stream: Optional[Literal[False]] | Omit = omit,
|
|
64
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
65
|
+
suffix: Optional[str] | Omit = omit,
|
|
66
|
+
temperature: Optional[float] | Omit = omit,
|
|
67
|
+
top_p: Optional[float] | Omit = omit,
|
|
68
|
+
user: str | Omit = omit,
|
|
69
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
70
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
71
|
+
extra_headers: Headers | None = None,
|
|
72
|
+
extra_query: Query | None = None,
|
|
73
|
+
extra_body: Body | None = None,
|
|
74
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
75
|
+
) -> Completion:
|
|
76
|
+
"""
|
|
77
|
+
Creates a completion for the provided prompt and parameters.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
model: ID of the model to use. You can use the
|
|
81
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
82
|
+
see all of your available models, or see our
|
|
83
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
84
|
+
them.
|
|
85
|
+
|
|
86
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
87
|
+
strings, array of tokens, or array of token arrays.
|
|
88
|
+
|
|
89
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
90
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
91
|
+
beginning of a new document.
|
|
92
|
+
|
|
93
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
94
|
+
the highest log probability per token). Results cannot be streamed.
|
|
95
|
+
|
|
96
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
97
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
98
|
+
|
|
99
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
100
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
101
|
+
settings for `max_tokens` and `stop`.
|
|
102
|
+
|
|
103
|
+
echo: Echo back the prompt in addition to the completion
|
|
104
|
+
|
|
105
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
106
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
107
|
+
repeat the same line verbatim.
|
|
108
|
+
|
|
109
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
110
|
+
|
|
111
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
112
|
+
|
|
113
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
114
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
115
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
116
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
117
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
118
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
119
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
120
|
+
|
|
121
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
122
|
+
from being generated.
|
|
123
|
+
|
|
124
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
125
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
126
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
127
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
128
|
+
|
|
129
|
+
The maximum value for `logprobs` is 5.
|
|
130
|
+
|
|
131
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
132
|
+
completion.
|
|
133
|
+
|
|
134
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
135
|
+
context length.
|
|
136
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
137
|
+
for counting tokens.
|
|
138
|
+
|
|
139
|
+
n: How many completions to generate for each prompt.
|
|
140
|
+
|
|
141
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
142
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
143
|
+
settings for `max_tokens` and `stop`.
|
|
144
|
+
|
|
145
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
146
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
147
|
+
talk about new topics.
|
|
148
|
+
|
|
149
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
150
|
+
|
|
151
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
152
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
153
|
+
the same result.
|
|
154
|
+
|
|
155
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
156
|
+
response parameter to monitor changes in the backend.
|
|
157
|
+
|
|
158
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
159
|
+
|
|
160
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
161
|
+
returned text will not contain the stop sequence.
|
|
162
|
+
|
|
163
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
164
|
+
data-only
|
|
165
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
166
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
167
|
+
message.
|
|
168
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
169
|
+
|
|
170
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
171
|
+
|
|
172
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
173
|
+
|
|
174
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
175
|
+
|
|
176
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
177
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
178
|
+
focused and deterministic.
|
|
179
|
+
|
|
180
|
+
We generally recommend altering this or `top_p` but not both.
|
|
181
|
+
|
|
182
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
183
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
184
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
185
|
+
|
|
186
|
+
We generally recommend altering this or `temperature` but not both.
|
|
187
|
+
|
|
188
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
189
|
+
and detect abuse.
|
|
190
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
191
|
+
|
|
192
|
+
extra_headers: Send extra headers
|
|
193
|
+
|
|
194
|
+
extra_query: Add additional query parameters to the request
|
|
195
|
+
|
|
196
|
+
extra_body: Add additional JSON properties to the request
|
|
197
|
+
|
|
198
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
199
|
+
"""
|
|
200
|
+
...
|
|
201
|
+
|
|
202
|
+
@overload
|
|
203
|
+
def create(
|
|
204
|
+
self,
|
|
205
|
+
*,
|
|
206
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
207
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
208
|
+
stream: Literal[True],
|
|
209
|
+
best_of: Optional[int] | Omit = omit,
|
|
210
|
+
echo: Optional[bool] | Omit = omit,
|
|
211
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
212
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
213
|
+
logprobs: Optional[int] | Omit = omit,
|
|
214
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
215
|
+
n: Optional[int] | Omit = omit,
|
|
216
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
217
|
+
seed: Optional[int] | Omit = omit,
|
|
218
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
219
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
220
|
+
suffix: Optional[str] | Omit = omit,
|
|
221
|
+
temperature: Optional[float] | Omit = omit,
|
|
222
|
+
top_p: Optional[float] | Omit = omit,
|
|
223
|
+
user: str | Omit = omit,
|
|
224
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
225
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
226
|
+
extra_headers: Headers | None = None,
|
|
227
|
+
extra_query: Query | None = None,
|
|
228
|
+
extra_body: Body | None = None,
|
|
229
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
230
|
+
) -> Stream[Completion]:
|
|
231
|
+
"""
|
|
232
|
+
Creates a completion for the provided prompt and parameters.
|
|
233
|
+
|
|
234
|
+
Args:
|
|
235
|
+
model: ID of the model to use. You can use the
|
|
236
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
237
|
+
see all of your available models, or see our
|
|
238
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
239
|
+
them.
|
|
240
|
+
|
|
241
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
242
|
+
strings, array of tokens, or array of token arrays.
|
|
243
|
+
|
|
244
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
245
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
246
|
+
beginning of a new document.
|
|
247
|
+
|
|
248
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
249
|
+
data-only
|
|
250
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
251
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
252
|
+
message.
|
|
253
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
254
|
+
|
|
255
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
256
|
+
the highest log probability per token). Results cannot be streamed.
|
|
257
|
+
|
|
258
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
259
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
260
|
+
|
|
261
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
262
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
263
|
+
settings for `max_tokens` and `stop`.
|
|
264
|
+
|
|
265
|
+
echo: Echo back the prompt in addition to the completion
|
|
266
|
+
|
|
267
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
268
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
269
|
+
repeat the same line verbatim.
|
|
270
|
+
|
|
271
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
272
|
+
|
|
273
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
274
|
+
|
|
275
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
276
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
277
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
278
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
279
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
280
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
281
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
282
|
+
|
|
283
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
284
|
+
from being generated.
|
|
285
|
+
|
|
286
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
287
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
288
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
289
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
290
|
+
|
|
291
|
+
The maximum value for `logprobs` is 5.
|
|
292
|
+
|
|
293
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
294
|
+
completion.
|
|
295
|
+
|
|
296
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
297
|
+
context length.
|
|
298
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
299
|
+
for counting tokens.
|
|
300
|
+
|
|
301
|
+
n: How many completions to generate for each prompt.
|
|
302
|
+
|
|
303
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
304
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
305
|
+
settings for `max_tokens` and `stop`.
|
|
306
|
+
|
|
307
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
308
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
309
|
+
talk about new topics.
|
|
310
|
+
|
|
311
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
312
|
+
|
|
313
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
314
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
315
|
+
the same result.
|
|
316
|
+
|
|
317
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
318
|
+
response parameter to monitor changes in the backend.
|
|
319
|
+
|
|
320
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
321
|
+
|
|
322
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
323
|
+
returned text will not contain the stop sequence.
|
|
324
|
+
|
|
325
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
326
|
+
|
|
327
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
328
|
+
|
|
329
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
330
|
+
|
|
331
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
332
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
333
|
+
focused and deterministic.
|
|
334
|
+
|
|
335
|
+
We generally recommend altering this or `top_p` but not both.
|
|
336
|
+
|
|
337
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
338
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
339
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
340
|
+
|
|
341
|
+
We generally recommend altering this or `temperature` but not both.
|
|
342
|
+
|
|
343
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
344
|
+
and detect abuse.
|
|
345
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
346
|
+
|
|
347
|
+
extra_headers: Send extra headers
|
|
348
|
+
|
|
349
|
+
extra_query: Add additional query parameters to the request
|
|
350
|
+
|
|
351
|
+
extra_body: Add additional JSON properties to the request
|
|
352
|
+
|
|
353
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
354
|
+
"""
|
|
355
|
+
...
|
|
356
|
+
|
|
357
|
+
@overload
|
|
358
|
+
def create(
|
|
359
|
+
self,
|
|
360
|
+
*,
|
|
361
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
362
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
363
|
+
stream: bool,
|
|
364
|
+
best_of: Optional[int] | Omit = omit,
|
|
365
|
+
echo: Optional[bool] | Omit = omit,
|
|
366
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
367
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
368
|
+
logprobs: Optional[int] | Omit = omit,
|
|
369
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
370
|
+
n: Optional[int] | Omit = omit,
|
|
371
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
372
|
+
seed: Optional[int] | Omit = omit,
|
|
373
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
374
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
375
|
+
suffix: Optional[str] | Omit = omit,
|
|
376
|
+
temperature: Optional[float] | Omit = omit,
|
|
377
|
+
top_p: Optional[float] | Omit = omit,
|
|
378
|
+
user: str | Omit = omit,
|
|
379
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
380
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
381
|
+
extra_headers: Headers | None = None,
|
|
382
|
+
extra_query: Query | None = None,
|
|
383
|
+
extra_body: Body | None = None,
|
|
384
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
385
|
+
) -> Completion | Stream[Completion]:
|
|
386
|
+
"""
|
|
387
|
+
Creates a completion for the provided prompt and parameters.
|
|
388
|
+
|
|
389
|
+
Args:
|
|
390
|
+
model: ID of the model to use. You can use the
|
|
391
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
392
|
+
see all of your available models, or see our
|
|
393
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
394
|
+
them.
|
|
395
|
+
|
|
396
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
397
|
+
strings, array of tokens, or array of token arrays.
|
|
398
|
+
|
|
399
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
400
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
401
|
+
beginning of a new document.
|
|
402
|
+
|
|
403
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
404
|
+
data-only
|
|
405
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
406
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
407
|
+
message.
|
|
408
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
409
|
+
|
|
410
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
411
|
+
the highest log probability per token). Results cannot be streamed.
|
|
412
|
+
|
|
413
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
414
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
415
|
+
|
|
416
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
417
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
418
|
+
settings for `max_tokens` and `stop`.
|
|
419
|
+
|
|
420
|
+
echo: Echo back the prompt in addition to the completion
|
|
421
|
+
|
|
422
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
423
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
424
|
+
repeat the same line verbatim.
|
|
425
|
+
|
|
426
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
427
|
+
|
|
428
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
429
|
+
|
|
430
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
431
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
432
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
433
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
434
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
435
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
436
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
437
|
+
|
|
438
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
439
|
+
from being generated.
|
|
440
|
+
|
|
441
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
442
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
443
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
444
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
445
|
+
|
|
446
|
+
The maximum value for `logprobs` is 5.
|
|
447
|
+
|
|
448
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
449
|
+
completion.
|
|
450
|
+
|
|
451
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
452
|
+
context length.
|
|
453
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
454
|
+
for counting tokens.
|
|
455
|
+
|
|
456
|
+
n: How many completions to generate for each prompt.
|
|
457
|
+
|
|
458
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
459
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
460
|
+
settings for `max_tokens` and `stop`.
|
|
461
|
+
|
|
462
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
463
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
464
|
+
talk about new topics.
|
|
465
|
+
|
|
466
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
467
|
+
|
|
468
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
469
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
470
|
+
the same result.
|
|
471
|
+
|
|
472
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
473
|
+
response parameter to monitor changes in the backend.
|
|
474
|
+
|
|
475
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
476
|
+
|
|
477
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
478
|
+
returned text will not contain the stop sequence.
|
|
479
|
+
|
|
480
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
481
|
+
|
|
482
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
483
|
+
|
|
484
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
485
|
+
|
|
486
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
487
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
488
|
+
focused and deterministic.
|
|
489
|
+
|
|
490
|
+
We generally recommend altering this or `top_p` but not both.
|
|
491
|
+
|
|
492
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
493
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
494
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
495
|
+
|
|
496
|
+
We generally recommend altering this or `temperature` but not both.
|
|
497
|
+
|
|
498
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
499
|
+
and detect abuse.
|
|
500
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
501
|
+
|
|
502
|
+
extra_headers: Send extra headers
|
|
503
|
+
|
|
504
|
+
extra_query: Add additional query parameters to the request
|
|
505
|
+
|
|
506
|
+
extra_body: Add additional JSON properties to the request
|
|
507
|
+
|
|
508
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
509
|
+
"""
|
|
510
|
+
...
|
|
511
|
+
|
|
512
|
+
@required_args(["model", "prompt"], ["model", "prompt", "stream"])
|
|
513
|
+
def create(
|
|
514
|
+
self,
|
|
515
|
+
*,
|
|
516
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
517
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
518
|
+
best_of: Optional[int] | Omit = omit,
|
|
519
|
+
echo: Optional[bool] | Omit = omit,
|
|
520
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
521
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
522
|
+
logprobs: Optional[int] | Omit = omit,
|
|
523
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
524
|
+
n: Optional[int] | Omit = omit,
|
|
525
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
526
|
+
seed: Optional[int] | Omit = omit,
|
|
527
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
528
|
+
stream: Optional[Literal[False]] | Literal[True] | Omit = omit,
|
|
529
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
530
|
+
suffix: Optional[str] | Omit = omit,
|
|
531
|
+
temperature: Optional[float] | Omit = omit,
|
|
532
|
+
top_p: Optional[float] | Omit = omit,
|
|
533
|
+
user: str | Omit = omit,
|
|
534
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
535
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
536
|
+
extra_headers: Headers | None = None,
|
|
537
|
+
extra_query: Query | None = None,
|
|
538
|
+
extra_body: Body | None = None,
|
|
539
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
540
|
+
) -> Completion | Stream[Completion]:
|
|
541
|
+
return self._post(
|
|
542
|
+
"/completions",
|
|
543
|
+
body=maybe_transform(
|
|
544
|
+
{
|
|
545
|
+
"model": model,
|
|
546
|
+
"prompt": prompt,
|
|
547
|
+
"best_of": best_of,
|
|
548
|
+
"echo": echo,
|
|
549
|
+
"frequency_penalty": frequency_penalty,
|
|
550
|
+
"logit_bias": logit_bias,
|
|
551
|
+
"logprobs": logprobs,
|
|
552
|
+
"max_tokens": max_tokens,
|
|
553
|
+
"n": n,
|
|
554
|
+
"presence_penalty": presence_penalty,
|
|
555
|
+
"seed": seed,
|
|
556
|
+
"stop": stop,
|
|
557
|
+
"stream": stream,
|
|
558
|
+
"stream_options": stream_options,
|
|
559
|
+
"suffix": suffix,
|
|
560
|
+
"temperature": temperature,
|
|
561
|
+
"top_p": top_p,
|
|
562
|
+
"user": user,
|
|
563
|
+
},
|
|
564
|
+
completion_create_params.CompletionCreateParamsStreaming
|
|
565
|
+
if stream
|
|
566
|
+
else completion_create_params.CompletionCreateParamsNonStreaming,
|
|
567
|
+
),
|
|
568
|
+
options=make_request_options(
|
|
569
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
570
|
+
),
|
|
571
|
+
cast_to=Completion,
|
|
572
|
+
stream=stream or False,
|
|
573
|
+
stream_cls=Stream[Completion],
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
class AsyncCompletions(AsyncAPIResource):
|
|
578
|
+
@cached_property
|
|
579
|
+
def with_raw_response(self) -> AsyncCompletionsWithRawResponse:
|
|
580
|
+
"""
|
|
581
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
582
|
+
the raw response object instead of the parsed content.
|
|
583
|
+
|
|
584
|
+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
|
|
585
|
+
"""
|
|
586
|
+
return AsyncCompletionsWithRawResponse(self)
|
|
587
|
+
|
|
588
|
+
@cached_property
|
|
589
|
+
def with_streaming_response(self) -> AsyncCompletionsWithStreamingResponse:
|
|
590
|
+
"""
|
|
591
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
592
|
+
|
|
593
|
+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
|
|
594
|
+
"""
|
|
595
|
+
return AsyncCompletionsWithStreamingResponse(self)
|
|
596
|
+
|
|
597
|
+
@overload
|
|
598
|
+
async def create(
|
|
599
|
+
self,
|
|
600
|
+
*,
|
|
601
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
602
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
603
|
+
best_of: Optional[int] | Omit = omit,
|
|
604
|
+
echo: Optional[bool] | Omit = omit,
|
|
605
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
606
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
607
|
+
logprobs: Optional[int] | Omit = omit,
|
|
608
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
609
|
+
n: Optional[int] | Omit = omit,
|
|
610
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
611
|
+
seed: Optional[int] | Omit = omit,
|
|
612
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
613
|
+
stream: Optional[Literal[False]] | Omit = omit,
|
|
614
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
615
|
+
suffix: Optional[str] | Omit = omit,
|
|
616
|
+
temperature: Optional[float] | Omit = omit,
|
|
617
|
+
top_p: Optional[float] | Omit = omit,
|
|
618
|
+
user: str | Omit = omit,
|
|
619
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
620
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
621
|
+
extra_headers: Headers | None = None,
|
|
622
|
+
extra_query: Query | None = None,
|
|
623
|
+
extra_body: Body | None = None,
|
|
624
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
625
|
+
) -> Completion:
|
|
626
|
+
"""
|
|
627
|
+
Creates a completion for the provided prompt and parameters.
|
|
628
|
+
|
|
629
|
+
Args:
|
|
630
|
+
model: ID of the model to use. You can use the
|
|
631
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
632
|
+
see all of your available models, or see our
|
|
633
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
634
|
+
them.
|
|
635
|
+
|
|
636
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
637
|
+
strings, array of tokens, or array of token arrays.
|
|
638
|
+
|
|
639
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
640
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
641
|
+
beginning of a new document.
|
|
642
|
+
|
|
643
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
644
|
+
the highest log probability per token). Results cannot be streamed.
|
|
645
|
+
|
|
646
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
647
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
648
|
+
|
|
649
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
650
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
651
|
+
settings for `max_tokens` and `stop`.
|
|
652
|
+
|
|
653
|
+
echo: Echo back the prompt in addition to the completion
|
|
654
|
+
|
|
655
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
656
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
657
|
+
repeat the same line verbatim.
|
|
658
|
+
|
|
659
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
660
|
+
|
|
661
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
662
|
+
|
|
663
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
664
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
665
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
666
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
667
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
668
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
669
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
670
|
+
|
|
671
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
672
|
+
from being generated.
|
|
673
|
+
|
|
674
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
675
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
676
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
677
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
678
|
+
|
|
679
|
+
The maximum value for `logprobs` is 5.
|
|
680
|
+
|
|
681
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
682
|
+
completion.
|
|
683
|
+
|
|
684
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
685
|
+
context length.
|
|
686
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
687
|
+
for counting tokens.
|
|
688
|
+
|
|
689
|
+
n: How many completions to generate for each prompt.
|
|
690
|
+
|
|
691
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
692
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
693
|
+
settings for `max_tokens` and `stop`.
|
|
694
|
+
|
|
695
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
696
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
697
|
+
talk about new topics.
|
|
698
|
+
|
|
699
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
700
|
+
|
|
701
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
702
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
703
|
+
the same result.
|
|
704
|
+
|
|
705
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
706
|
+
response parameter to monitor changes in the backend.
|
|
707
|
+
|
|
708
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
709
|
+
|
|
710
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
711
|
+
returned text will not contain the stop sequence.
|
|
712
|
+
|
|
713
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
714
|
+
data-only
|
|
715
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
716
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
717
|
+
message.
|
|
718
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
719
|
+
|
|
720
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
721
|
+
|
|
722
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
723
|
+
|
|
724
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
725
|
+
|
|
726
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
727
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
728
|
+
focused and deterministic.
|
|
729
|
+
|
|
730
|
+
We generally recommend altering this or `top_p` but not both.
|
|
731
|
+
|
|
732
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
733
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
734
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
735
|
+
|
|
736
|
+
We generally recommend altering this or `temperature` but not both.
|
|
737
|
+
|
|
738
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
739
|
+
and detect abuse.
|
|
740
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
741
|
+
|
|
742
|
+
extra_headers: Send extra headers
|
|
743
|
+
|
|
744
|
+
extra_query: Add additional query parameters to the request
|
|
745
|
+
|
|
746
|
+
extra_body: Add additional JSON properties to the request
|
|
747
|
+
|
|
748
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
749
|
+
"""
|
|
750
|
+
...
|
|
751
|
+
|
|
752
|
+
@overload
|
|
753
|
+
async def create(
|
|
754
|
+
self,
|
|
755
|
+
*,
|
|
756
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
757
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
758
|
+
stream: Literal[True],
|
|
759
|
+
best_of: Optional[int] | Omit = omit,
|
|
760
|
+
echo: Optional[bool] | Omit = omit,
|
|
761
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
762
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
763
|
+
logprobs: Optional[int] | Omit = omit,
|
|
764
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
765
|
+
n: Optional[int] | Omit = omit,
|
|
766
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
767
|
+
seed: Optional[int] | Omit = omit,
|
|
768
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
769
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
770
|
+
suffix: Optional[str] | Omit = omit,
|
|
771
|
+
temperature: Optional[float] | Omit = omit,
|
|
772
|
+
top_p: Optional[float] | Omit = omit,
|
|
773
|
+
user: str | Omit = omit,
|
|
774
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
775
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
776
|
+
extra_headers: Headers | None = None,
|
|
777
|
+
extra_query: Query | None = None,
|
|
778
|
+
extra_body: Body | None = None,
|
|
779
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
780
|
+
) -> AsyncStream[Completion]:
|
|
781
|
+
"""
|
|
782
|
+
Creates a completion for the provided prompt and parameters.
|
|
783
|
+
|
|
784
|
+
Args:
|
|
785
|
+
model: ID of the model to use. You can use the
|
|
786
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
787
|
+
see all of your available models, or see our
|
|
788
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
789
|
+
them.
|
|
790
|
+
|
|
791
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
792
|
+
strings, array of tokens, or array of token arrays.
|
|
793
|
+
|
|
794
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
795
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
796
|
+
beginning of a new document.
|
|
797
|
+
|
|
798
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
799
|
+
data-only
|
|
800
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
801
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
802
|
+
message.
|
|
803
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
804
|
+
|
|
805
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
806
|
+
the highest log probability per token). Results cannot be streamed.
|
|
807
|
+
|
|
808
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
809
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
810
|
+
|
|
811
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
812
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
813
|
+
settings for `max_tokens` and `stop`.
|
|
814
|
+
|
|
815
|
+
echo: Echo back the prompt in addition to the completion
|
|
816
|
+
|
|
817
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
818
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
819
|
+
repeat the same line verbatim.
|
|
820
|
+
|
|
821
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
822
|
+
|
|
823
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
824
|
+
|
|
825
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
826
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
827
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
828
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
829
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
830
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
831
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
832
|
+
|
|
833
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
834
|
+
from being generated.
|
|
835
|
+
|
|
836
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
837
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
838
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
839
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
840
|
+
|
|
841
|
+
The maximum value for `logprobs` is 5.
|
|
842
|
+
|
|
843
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
844
|
+
completion.
|
|
845
|
+
|
|
846
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
847
|
+
context length.
|
|
848
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
849
|
+
for counting tokens.
|
|
850
|
+
|
|
851
|
+
n: How many completions to generate for each prompt.
|
|
852
|
+
|
|
853
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
854
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
855
|
+
settings for `max_tokens` and `stop`.
|
|
856
|
+
|
|
857
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
858
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
859
|
+
talk about new topics.
|
|
860
|
+
|
|
861
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
862
|
+
|
|
863
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
864
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
865
|
+
the same result.
|
|
866
|
+
|
|
867
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
868
|
+
response parameter to monitor changes in the backend.
|
|
869
|
+
|
|
870
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
871
|
+
|
|
872
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
873
|
+
returned text will not contain the stop sequence.
|
|
874
|
+
|
|
875
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
876
|
+
|
|
877
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
878
|
+
|
|
879
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
880
|
+
|
|
881
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
882
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
883
|
+
focused and deterministic.
|
|
884
|
+
|
|
885
|
+
We generally recommend altering this or `top_p` but not both.
|
|
886
|
+
|
|
887
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
888
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
889
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
890
|
+
|
|
891
|
+
We generally recommend altering this or `temperature` but not both.
|
|
892
|
+
|
|
893
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
894
|
+
and detect abuse.
|
|
895
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
896
|
+
|
|
897
|
+
extra_headers: Send extra headers
|
|
898
|
+
|
|
899
|
+
extra_query: Add additional query parameters to the request
|
|
900
|
+
|
|
901
|
+
extra_body: Add additional JSON properties to the request
|
|
902
|
+
|
|
903
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
904
|
+
"""
|
|
905
|
+
...
|
|
906
|
+
|
|
907
|
+
@overload
|
|
908
|
+
async def create(
|
|
909
|
+
self,
|
|
910
|
+
*,
|
|
911
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
912
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
913
|
+
stream: bool,
|
|
914
|
+
best_of: Optional[int] | Omit = omit,
|
|
915
|
+
echo: Optional[bool] | Omit = omit,
|
|
916
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
917
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
918
|
+
logprobs: Optional[int] | Omit = omit,
|
|
919
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
920
|
+
n: Optional[int] | Omit = omit,
|
|
921
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
922
|
+
seed: Optional[int] | Omit = omit,
|
|
923
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
924
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
925
|
+
suffix: Optional[str] | Omit = omit,
|
|
926
|
+
temperature: Optional[float] | Omit = omit,
|
|
927
|
+
top_p: Optional[float] | Omit = omit,
|
|
928
|
+
user: str | Omit = omit,
|
|
929
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
930
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
931
|
+
extra_headers: Headers | None = None,
|
|
932
|
+
extra_query: Query | None = None,
|
|
933
|
+
extra_body: Body | None = None,
|
|
934
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
935
|
+
) -> Completion | AsyncStream[Completion]:
|
|
936
|
+
"""
|
|
937
|
+
Creates a completion for the provided prompt and parameters.
|
|
938
|
+
|
|
939
|
+
Args:
|
|
940
|
+
model: ID of the model to use. You can use the
|
|
941
|
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
942
|
+
see all of your available models, or see our
|
|
943
|
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
944
|
+
them.
|
|
945
|
+
|
|
946
|
+
prompt: The prompt(s) to generate completions for, encoded as a string, array of
|
|
947
|
+
strings, array of tokens, or array of token arrays.
|
|
948
|
+
|
|
949
|
+
Note that <|endoftext|> is the document separator that the model sees during
|
|
950
|
+
training, so if a prompt is not specified the model will generate as if from the
|
|
951
|
+
beginning of a new document.
|
|
952
|
+
|
|
953
|
+
stream: Whether to stream back partial progress. If set, tokens will be sent as
|
|
954
|
+
data-only
|
|
955
|
+
[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
|
|
956
|
+
as they become available, with the stream terminated by a `data: [DONE]`
|
|
957
|
+
message.
|
|
958
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
|
959
|
+
|
|
960
|
+
best_of: Generates `best_of` completions server-side and returns the "best" (the one with
|
|
961
|
+
the highest log probability per token). Results cannot be streamed.
|
|
962
|
+
|
|
963
|
+
When used with `n`, `best_of` controls the number of candidate completions and
|
|
964
|
+
`n` specifies how many to return – `best_of` must be greater than `n`.
|
|
965
|
+
|
|
966
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
967
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
968
|
+
settings for `max_tokens` and `stop`.
|
|
969
|
+
|
|
970
|
+
echo: Echo back the prompt in addition to the completion
|
|
971
|
+
|
|
972
|
+
frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their
|
|
973
|
+
existing frequency in the text so far, decreasing the model's likelihood to
|
|
974
|
+
repeat the same line verbatim.
|
|
975
|
+
|
|
976
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
977
|
+
|
|
978
|
+
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
|
|
979
|
+
|
|
980
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the GPT
|
|
981
|
+
tokenizer) to an associated bias value from -100 to 100. You can use this
|
|
982
|
+
[tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs.
|
|
983
|
+
Mathematically, the bias is added to the logits generated by the model prior to
|
|
984
|
+
sampling. The exact effect will vary per model, but values between -1 and 1
|
|
985
|
+
should decrease or increase likelihood of selection; values like -100 or 100
|
|
986
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
987
|
+
|
|
988
|
+
As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token
|
|
989
|
+
from being generated.
|
|
990
|
+
|
|
991
|
+
logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as
|
|
992
|
+
well the chosen tokens. For example, if `logprobs` is 5, the API will return a
|
|
993
|
+
list of the 5 most likely tokens. The API will always return the `logprob` of
|
|
994
|
+
the sampled token, so there may be up to `logprobs+1` elements in the response.
|
|
995
|
+
|
|
996
|
+
The maximum value for `logprobs` is 5.
|
|
997
|
+
|
|
998
|
+
max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the
|
|
999
|
+
completion.
|
|
1000
|
+
|
|
1001
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
|
1002
|
+
context length.
|
|
1003
|
+
[Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
1004
|
+
for counting tokens.
|
|
1005
|
+
|
|
1006
|
+
n: How many completions to generate for each prompt.
|
|
1007
|
+
|
|
1008
|
+
**Note:** Because this parameter generates many completions, it can quickly
|
|
1009
|
+
consume your token quota. Use carefully and ensure that you have reasonable
|
|
1010
|
+
settings for `max_tokens` and `stop`.
|
|
1011
|
+
|
|
1012
|
+
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
1013
|
+
whether they appear in the text so far, increasing the model's likelihood to
|
|
1014
|
+
talk about new topics.
|
|
1015
|
+
|
|
1016
|
+
[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
|
|
1017
|
+
|
|
1018
|
+
seed: If specified, our system will make a best effort to sample deterministically,
|
|
1019
|
+
such that repeated requests with the same `seed` and parameters should return
|
|
1020
|
+
the same result.
|
|
1021
|
+
|
|
1022
|
+
Determinism is not guaranteed, and you should refer to the `system_fingerprint`
|
|
1023
|
+
response parameter to monitor changes in the backend.
|
|
1024
|
+
|
|
1025
|
+
stop: Not supported with latest reasoning models `o3` and `o4-mini`.
|
|
1026
|
+
|
|
1027
|
+
Up to 4 sequences where the API will stop generating further tokens. The
|
|
1028
|
+
returned text will not contain the stop sequence.
|
|
1029
|
+
|
|
1030
|
+
stream_options: Options for streaming response. Only set this when you set `stream: true`.
|
|
1031
|
+
|
|
1032
|
+
suffix: The suffix that comes after a completion of inserted text.
|
|
1033
|
+
|
|
1034
|
+
This parameter is only supported for `gpt-3.5-turbo-instruct`.
|
|
1035
|
+
|
|
1036
|
+
temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
1037
|
+
make the output more random, while lower values like 0.2 will make it more
|
|
1038
|
+
focused and deterministic.
|
|
1039
|
+
|
|
1040
|
+
We generally recommend altering this or `top_p` but not both.
|
|
1041
|
+
|
|
1042
|
+
top_p: An alternative to sampling with temperature, called nucleus sampling, where the
|
|
1043
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
1044
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
1045
|
+
|
|
1046
|
+
We generally recommend altering this or `temperature` but not both.
|
|
1047
|
+
|
|
1048
|
+
user: A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
1049
|
+
and detect abuse.
|
|
1050
|
+
[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
1051
|
+
|
|
1052
|
+
extra_headers: Send extra headers
|
|
1053
|
+
|
|
1054
|
+
extra_query: Add additional query parameters to the request
|
|
1055
|
+
|
|
1056
|
+
extra_body: Add additional JSON properties to the request
|
|
1057
|
+
|
|
1058
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1059
|
+
"""
|
|
1060
|
+
...
|
|
1061
|
+
|
|
1062
|
+
@required_args(["model", "prompt"], ["model", "prompt", "stream"])
|
|
1063
|
+
async def create(
|
|
1064
|
+
self,
|
|
1065
|
+
*,
|
|
1066
|
+
model: Union[str, Literal["gpt-3.5-turbo-instruct", "davinci-002", "babbage-002"]],
|
|
1067
|
+
prompt: Union[str, SequenceNotStr[str], Iterable[int], Iterable[Iterable[int]], None],
|
|
1068
|
+
best_of: Optional[int] | Omit = omit,
|
|
1069
|
+
echo: Optional[bool] | Omit = omit,
|
|
1070
|
+
frequency_penalty: Optional[float] | Omit = omit,
|
|
1071
|
+
logit_bias: Optional[Dict[str, int]] | Omit = omit,
|
|
1072
|
+
logprobs: Optional[int] | Omit = omit,
|
|
1073
|
+
max_tokens: Optional[int] | Omit = omit,
|
|
1074
|
+
n: Optional[int] | Omit = omit,
|
|
1075
|
+
presence_penalty: Optional[float] | Omit = omit,
|
|
1076
|
+
seed: Optional[int] | Omit = omit,
|
|
1077
|
+
stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit,
|
|
1078
|
+
stream: Optional[Literal[False]] | Literal[True] | Omit = omit,
|
|
1079
|
+
stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit,
|
|
1080
|
+
suffix: Optional[str] | Omit = omit,
|
|
1081
|
+
temperature: Optional[float] | Omit = omit,
|
|
1082
|
+
top_p: Optional[float] | Omit = omit,
|
|
1083
|
+
user: str | Omit = omit,
|
|
1084
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1085
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1086
|
+
extra_headers: Headers | None = None,
|
|
1087
|
+
extra_query: Query | None = None,
|
|
1088
|
+
extra_body: Body | None = None,
|
|
1089
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1090
|
+
) -> Completion | AsyncStream[Completion]:
|
|
1091
|
+
return await self._post(
|
|
1092
|
+
"/completions",
|
|
1093
|
+
body=await async_maybe_transform(
|
|
1094
|
+
{
|
|
1095
|
+
"model": model,
|
|
1096
|
+
"prompt": prompt,
|
|
1097
|
+
"best_of": best_of,
|
|
1098
|
+
"echo": echo,
|
|
1099
|
+
"frequency_penalty": frequency_penalty,
|
|
1100
|
+
"logit_bias": logit_bias,
|
|
1101
|
+
"logprobs": logprobs,
|
|
1102
|
+
"max_tokens": max_tokens,
|
|
1103
|
+
"n": n,
|
|
1104
|
+
"presence_penalty": presence_penalty,
|
|
1105
|
+
"seed": seed,
|
|
1106
|
+
"stop": stop,
|
|
1107
|
+
"stream": stream,
|
|
1108
|
+
"stream_options": stream_options,
|
|
1109
|
+
"suffix": suffix,
|
|
1110
|
+
"temperature": temperature,
|
|
1111
|
+
"top_p": top_p,
|
|
1112
|
+
"user": user,
|
|
1113
|
+
},
|
|
1114
|
+
completion_create_params.CompletionCreateParamsStreaming
|
|
1115
|
+
if stream
|
|
1116
|
+
else completion_create_params.CompletionCreateParamsNonStreaming,
|
|
1117
|
+
),
|
|
1118
|
+
options=make_request_options(
|
|
1119
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1120
|
+
),
|
|
1121
|
+
cast_to=Completion,
|
|
1122
|
+
stream=stream or False,
|
|
1123
|
+
stream_cls=AsyncStream[Completion],
|
|
1124
|
+
)
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
class CompletionsWithRawResponse:
|
|
1128
|
+
def __init__(self, completions: Completions) -> None:
|
|
1129
|
+
self._completions = completions
|
|
1130
|
+
|
|
1131
|
+
self.create = _legacy_response.to_raw_response_wrapper(
|
|
1132
|
+
completions.create,
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
class AsyncCompletionsWithRawResponse:
|
|
1137
|
+
def __init__(self, completions: AsyncCompletions) -> None:
|
|
1138
|
+
self._completions = completions
|
|
1139
|
+
|
|
1140
|
+
self.create = _legacy_response.async_to_raw_response_wrapper(
|
|
1141
|
+
completions.create,
|
|
1142
|
+
)
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
class CompletionsWithStreamingResponse:
|
|
1146
|
+
def __init__(self, completions: Completions) -> None:
|
|
1147
|
+
self._completions = completions
|
|
1148
|
+
|
|
1149
|
+
self.create = to_streamed_response_wrapper(
|
|
1150
|
+
completions.create,
|
|
1151
|
+
)
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
class AsyncCompletionsWithStreamingResponse:
|
|
1155
|
+
def __init__(self, completions: AsyncCompletions) -> None:
|
|
1156
|
+
self._completions = completions
|
|
1157
|
+
|
|
1158
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1159
|
+
completions.create,
|
|
1160
|
+
)
|