├── .changes ├── header.tpl.md ├── unreleased │ └── .gitkeep └── v0.1.0.md ├── .changie.yaml ├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.yml │ └── config.yml ├── pull_request_template.md └── workflows │ ├── ci.yml │ ├── dependency-review.yml │ ├── python-publish.yml │ └── verify-conventional-commits.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── docs ├── .DS_Store └── images │ ├── Sticker.png │ ├── anthropic.png │ ├── anyscale.png │ ├── azure.png │ ├── bard.png │ ├── cohere.png │ ├── header.png │ ├── localai.png │ └── openai.png ├── examples └── demo.py ├── portkey_ai ├── __init__.py ├── _portkey_scripts.py ├── _vendor │ ├── __init__.py │ ├── bin │ │ └── openai │ ├── openai-1.78.0.dist-info │ │ ├── INSTALLER │ │ ├── METADATA │ │ ├── RECORD │ │ ├── REQUESTED │ │ ├── WHEEL │ │ ├── entry_points.txt │ │ └── licenses │ │ │ └── LICENSE │ └── openai │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── _base_client.py │ │ ├── _client.py │ │ ├── _compat.py │ │ ├── _constants.py │ │ ├── _exceptions.py │ │ ├── _extras │ │ ├── __init__.py │ │ ├── _common.py │ │ ├── numpy_proxy.py │ │ ├── pandas_proxy.py │ │ └── sounddevice_proxy.py │ │ ├── _files.py │ │ ├── _legacy_response.py │ │ ├── _models.py │ │ ├── _module_client.py │ │ ├── _qs.py │ │ ├── _resource.py │ │ ├── _response.py │ │ ├── _streaming.py │ │ ├── _types.py │ │ ├── _utils │ │ ├── __init__.py │ │ ├── _logs.py │ │ ├── _proxy.py │ │ ├── _reflection.py │ │ ├── _streams.py │ │ ├── _sync.py │ │ ├── _transform.py │ │ ├── _typing.py │ │ └── _utils.py │ │ ├── _version.py │ │ ├── cli │ │ ├── __init__.py │ │ ├── _api │ │ │ ├── __init__.py │ │ │ ├── _main.py │ │ │ ├── audio.py │ │ │ ├── chat │ │ │ │ ├── __init__.py │ │ │ │ └── completions.py │ │ │ ├── completions.py │ │ │ ├── files.py │ │ │ ├── image.py │ │ │ └── models.py │ │ ├── _cli.py │ │ ├── _errors.py │ │ ├── _models.py │ │ ├── _progress.py │ │ ├── _tools │ │ │ ├── __init__.py │ │ │ ├── _main.py │ │ │ ├── fine_tunes.py │ │ │ └── migrate.py │ │ └── _utils.py │ │ ├── helpers │ │ ├── __init__.py │ │ ├── local_audio_player.py │ │ └── microphone.py │ │ ├── lib │ │ ├── .keep │ │ ├── __init__.py │ │ ├── _old_api.py │ │ ├── _parsing │ │ │ ├── __init__.py │ │ │ ├── _completions.py │ │ │ └── _responses.py │ │ ├── _pydantic.py │ │ ├── _tools.py │ │ ├── _validators.py │ │ ├── azure.py │ │ └── streaming │ │ │ ├── __init__.py │ │ │ ├── _assistants.py │ │ │ ├── _deltas.py │ │ │ ├── chat │ │ │ ├── __init__.py │ │ │ ├── _completions.py │ │ │ ├── _events.py │ │ │ └── _types.py │ │ │ └── responses │ │ │ ├── __init__.py │ │ │ ├── _events.py │ │ │ ├── _responses.py │ │ │ └── _types.py │ │ ├── pagination.py │ │ ├── py.typed │ │ ├── resources │ │ ├── __init__.py │ │ ├── audio │ │ │ ├── __init__.py │ │ │ ├── audio.py │ │ │ ├── speech.py │ │ │ ├── transcriptions.py │ │ │ └── translations.py │ │ ├── batches.py │ │ ├── beta │ │ │ ├── __init__.py │ │ │ ├── assistants.py │ │ │ ├── beta.py │ │ │ ├── chat │ │ │ │ ├── __init__.py │ │ │ │ ├── chat.py │ │ │ │ └── completions.py │ │ │ ├── realtime │ │ │ │ ├── __init__.py │ │ │ │ ├── realtime.py │ │ │ │ ├── sessions.py │ │ │ │ └── transcription_sessions.py │ │ │ └── threads │ │ │ │ ├── __init__.py │ │ │ │ ├── messages.py │ │ │ │ ├── runs │ │ │ │ ├── __init__.py │ │ │ │ ├── runs.py │ │ │ │ └── steps.py │ │ │ │ └── threads.py │ │ ├── chat │ │ │ ├── __init__.py │ │ │ ├── chat.py │ │ │ └── completions │ │ │ │ ├── __init__.py │ │ │ │ ├── completions.py │ │ │ │ └── messages.py │ │ ├── completions.py │ │ ├── embeddings.py │ │ ├── evals │ │ │ ├── __init__.py │ │ │ ├── evals.py │ │ │ └── runs │ │ │ │ ├── __init__.py │ │ │ │ ├── output_items.py │ │ │ │ └── runs.py │ │ ├── files.py │ │ ├── fine_tuning │ │ │ ├── __init__.py │ │ │ ├── alpha │ │ │ │ ├── __init__.py │ │ │ │ ├── alpha.py │ │ │ │ └── graders.py │ │ │ ├── checkpoints │ │ │ │ ├── __init__.py │ │ │ │ ├── checkpoints.py │ │ │ │ └── permissions.py │ │ │ ├── fine_tuning.py │ │ │ └── jobs │ │ │ │ ├── __init__.py │ │ │ │ ├── checkpoints.py │ │ │ │ └── jobs.py │ │ ├── images.py │ │ ├── models.py │ │ ├── moderations.py │ │ ├── responses │ │ │ ├── __init__.py │ │ │ ├── input_items.py │ │ │ └── responses.py │ │ ├── uploads │ │ │ ├── __init__.py │ │ │ ├── parts.py │ │ │ └── uploads.py │ │ └── vector_stores │ │ │ ├── __init__.py │ │ │ ├── file_batches.py │ │ │ ├── files.py │ │ │ └── vector_stores.py │ │ ├── types │ │ ├── __init__.py │ │ ├── audio │ │ │ ├── __init__.py │ │ │ ├── speech_create_params.py │ │ │ ├── speech_model.py │ │ │ ├── transcription.py │ │ │ ├── transcription_create_params.py │ │ │ ├── transcription_create_response.py │ │ │ ├── transcription_include.py │ │ │ ├── transcription_segment.py │ │ │ ├── transcription_stream_event.py │ │ │ ├── transcription_text_delta_event.py │ │ │ ├── transcription_text_done_event.py │ │ │ ├── transcription_verbose.py │ │ │ ├── transcription_word.py │ │ │ ├── translation.py │ │ │ ├── translation_create_params.py │ │ │ ├── translation_create_response.py │ │ │ └── translation_verbose.py │ │ ├── audio_model.py │ │ ├── audio_response_format.py │ │ ├── auto_file_chunking_strategy_param.py │ │ ├── batch.py │ │ ├── batch_create_params.py │ │ ├── batch_error.py │ │ ├── batch_list_params.py │ │ ├── batch_request_counts.py │ │ ├── beta │ │ │ ├── __init__.py │ │ │ ├── assistant.py │ │ │ ├── assistant_create_params.py │ │ │ ├── assistant_deleted.py │ │ │ ├── assistant_list_params.py │ │ │ ├── assistant_response_format_option.py │ │ │ ├── assistant_response_format_option_param.py │ │ │ ├── assistant_stream_event.py │ │ │ ├── assistant_tool.py │ │ │ ├── assistant_tool_choice.py │ │ │ ├── assistant_tool_choice_function.py │ │ │ ├── assistant_tool_choice_function_param.py │ │ │ ├── assistant_tool_choice_option.py │ │ │ ├── assistant_tool_choice_option_param.py │ │ │ ├── assistant_tool_choice_param.py │ │ │ ├── assistant_tool_param.py │ │ │ ├── assistant_update_params.py │ │ │ ├── chat │ │ │ │ └── __init__.py │ │ │ ├── code_interpreter_tool.py │ │ │ ├── code_interpreter_tool_param.py │ │ │ ├── file_search_tool.py │ │ │ ├── file_search_tool_param.py │ │ │ ├── function_tool.py │ │ │ ├── function_tool_param.py │ │ │ ├── realtime │ │ │ │ ├── __init__.py │ │ │ │ ├── conversation_created_event.py │ │ │ │ ├── conversation_item.py │ │ │ │ ├── conversation_item_content.py │ │ │ │ ├── conversation_item_content_param.py │ │ │ │ ├── conversation_item_create_event.py │ │ │ │ ├── conversation_item_create_event_param.py │ │ │ │ ├── conversation_item_created_event.py │ │ │ │ ├── conversation_item_delete_event.py │ │ │ │ ├── conversation_item_delete_event_param.py │ │ │ │ ├── conversation_item_deleted_event.py │ │ │ │ ├── conversation_item_input_audio_transcription_completed_event.py │ │ │ │ ├── conversation_item_input_audio_transcription_delta_event.py │ │ │ │ ├── conversation_item_input_audio_transcription_failed_event.py │ │ │ │ ├── conversation_item_param.py │ │ │ │ ├── conversation_item_retrieve_event.py │ │ │ │ ├── conversation_item_retrieve_event_param.py │ │ │ │ ├── conversation_item_truncate_event.py │ │ │ │ ├── conversation_item_truncate_event_param.py │ │ │ │ ├── conversation_item_truncated_event.py │ │ │ │ ├── conversation_item_with_reference.py │ │ │ │ ├── conversation_item_with_reference_param.py │ │ │ │ ├── error_event.py │ │ │ │ ├── input_audio_buffer_append_event.py │ │ │ │ ├── input_audio_buffer_append_event_param.py │ │ │ │ ├── input_audio_buffer_clear_event.py │ │ │ │ ├── input_audio_buffer_clear_event_param.py │ │ │ │ ├── input_audio_buffer_cleared_event.py │ │ │ │ ├── input_audio_buffer_commit_event.py │ │ │ │ ├── input_audio_buffer_commit_event_param.py │ │ │ │ ├── input_audio_buffer_committed_event.py │ │ │ │ ├── input_audio_buffer_speech_started_event.py │ │ │ │ ├── input_audio_buffer_speech_stopped_event.py │ │ │ │ ├── rate_limits_updated_event.py │ │ │ │ ├── realtime_client_event.py │ │ │ │ ├── realtime_client_event_param.py │ │ │ │ ├── realtime_connect_params.py │ │ │ │ ├── realtime_response.py │ │ │ │ ├── realtime_response_status.py │ │ │ │ ├── realtime_response_usage.py │ │ │ │ ├── realtime_server_event.py │ │ │ │ ├── response_audio_delta_event.py │ │ │ │ ├── response_audio_done_event.py │ │ │ │ ├── response_audio_transcript_delta_event.py │ │ │ │ ├── response_audio_transcript_done_event.py │ │ │ │ ├── response_cancel_event.py │ │ │ │ ├── response_cancel_event_param.py │ │ │ │ ├── response_content_part_added_event.py │ │ │ │ ├── response_content_part_done_event.py │ │ │ │ ├── response_create_event.py │ │ │ │ ├── response_create_event_param.py │ │ │ │ ├── response_created_event.py │ │ │ │ ├── response_done_event.py │ │ │ │ ├── response_function_call_arguments_delta_event.py │ │ │ │ ├── response_function_call_arguments_done_event.py │ │ │ │ ├── response_output_item_added_event.py │ │ │ │ ├── response_output_item_done_event.py │ │ │ │ ├── response_text_delta_event.py │ │ │ │ ├── response_text_done_event.py │ │ │ │ ├── session.py │ │ │ │ ├── session_create_params.py │ │ │ │ ├── session_create_response.py │ │ │ │ ├── session_created_event.py │ │ │ │ ├── session_update_event.py │ │ │ │ ├── session_update_event_param.py │ │ │ │ ├── session_updated_event.py │ │ │ │ ├── transcription_session.py │ │ │ │ ├── transcription_session_create_params.py │ │ │ │ ├── transcription_session_update.py │ │ │ │ ├── transcription_session_update_param.py │ │ │ │ └── transcription_session_updated_event.py │ │ │ ├── thread.py │ │ │ ├── thread_create_and_run_params.py │ │ │ ├── thread_create_params.py │ │ │ ├── thread_deleted.py │ │ │ ├── thread_update_params.py │ │ │ └── threads │ │ │ │ ├── __init__.py │ │ │ │ ├── annotation.py │ │ │ │ ├── annotation_delta.py │ │ │ │ ├── file_citation_annotation.py │ │ │ │ ├── file_citation_delta_annotation.py │ │ │ │ ├── file_path_annotation.py │ │ │ │ ├── file_path_delta_annotation.py │ │ │ │ ├── image_file.py │ │ │ │ ├── image_file_content_block.py │ │ │ │ ├── image_file_content_block_param.py │ │ │ │ ├── image_file_delta.py │ │ │ │ ├── image_file_delta_block.py │ │ │ │ ├── image_file_param.py │ │ │ │ ├── image_url.py │ │ │ │ ├── image_url_content_block.py │ │ │ │ ├── image_url_content_block_param.py │ │ │ │ ├── image_url_delta.py │ │ │ │ ├── image_url_delta_block.py │ │ │ │ ├── image_url_param.py │ │ │ │ ├── message.py │ │ │ │ ├── message_content.py │ │ │ │ ├── message_content_delta.py │ │ │ │ ├── message_content_part_param.py │ │ │ │ ├── message_create_params.py │ │ │ │ ├── message_deleted.py │ │ │ │ ├── message_delta.py │ │ │ │ ├── message_delta_event.py │ │ │ │ ├── message_list_params.py │ │ │ │ ├── message_update_params.py │ │ │ │ ├── refusal_content_block.py │ │ │ │ ├── refusal_delta_block.py │ │ │ │ ├── required_action_function_tool_call.py │ │ │ │ ├── run.py │ │ │ │ ├── run_create_params.py │ │ │ │ ├── run_list_params.py │ │ │ │ ├── run_status.py │ │ │ │ ├── run_submit_tool_outputs_params.py │ │ │ │ ├── run_update_params.py │ │ │ │ ├── runs │ │ │ │ ├── __init__.py │ │ │ │ ├── code_interpreter_logs.py │ │ │ │ ├── code_interpreter_output_image.py │ │ │ │ ├── code_interpreter_tool_call.py │ │ │ │ ├── code_interpreter_tool_call_delta.py │ │ │ │ ├── file_search_tool_call.py │ │ │ │ ├── file_search_tool_call_delta.py │ │ │ │ ├── function_tool_call.py │ │ │ │ ├── function_tool_call_delta.py │ │ │ │ ├── message_creation_step_details.py │ │ │ │ ├── run_step.py │ │ │ │ ├── run_step_delta.py │ │ │ │ ├── run_step_delta_event.py │ │ │ │ ├── run_step_delta_message_delta.py │ │ │ │ ├── run_step_include.py │ │ │ │ ├── step_list_params.py │ │ │ │ ├── step_retrieve_params.py │ │ │ │ ├── tool_call.py │ │ │ │ ├── tool_call_delta.py │ │ │ │ ├── tool_call_delta_object.py │ │ │ │ └── tool_calls_step_details.py │ │ │ │ ├── text.py │ │ │ │ ├── text_content_block.py │ │ │ │ ├── text_content_block_param.py │ │ │ │ ├── text_delta.py │ │ │ │ └── text_delta_block.py │ │ ├── chat │ │ │ ├── __init__.py │ │ │ ├── chat_completion.py │ │ │ ├── chat_completion_assistant_message_param.py │ │ │ ├── chat_completion_audio.py │ │ │ ├── chat_completion_audio_param.py │ │ │ ├── chat_completion_chunk.py │ │ │ ├── chat_completion_content_part_image_param.py │ │ │ ├── chat_completion_content_part_input_audio_param.py │ │ │ ├── chat_completion_content_part_param.py │ │ │ ├── chat_completion_content_part_refusal_param.py │ │ │ ├── chat_completion_content_part_text_param.py │ │ │ ├── chat_completion_deleted.py │ │ │ ├── chat_completion_developer_message_param.py │ │ │ ├── chat_completion_function_call_option_param.py │ │ │ ├── chat_completion_function_message_param.py │ │ │ ├── chat_completion_message.py │ │ │ ├── chat_completion_message_param.py │ │ │ ├── chat_completion_message_tool_call.py │ │ │ ├── chat_completion_message_tool_call_param.py │ │ │ ├── chat_completion_modality.py │ │ │ ├── chat_completion_named_tool_choice_param.py │ │ │ ├── chat_completion_prediction_content_param.py │ │ │ ├── chat_completion_reasoning_effort.py │ │ │ ├── chat_completion_role.py │ │ │ ├── chat_completion_store_message.py │ │ │ ├── chat_completion_stream_options_param.py │ │ │ ├── chat_completion_system_message_param.py │ │ │ ├── chat_completion_token_logprob.py │ │ │ ├── chat_completion_tool_choice_option_param.py │ │ │ ├── chat_completion_tool_message_param.py │ │ │ ├── chat_completion_tool_param.py │ │ │ ├── chat_completion_user_message_param.py │ │ │ ├── completion_create_params.py │ │ │ ├── completion_list_params.py │ │ │ ├── completion_update_params.py │ │ │ ├── completions │ │ │ │ ├── __init__.py │ │ │ │ └── message_list_params.py │ │ │ ├── parsed_chat_completion.py │ │ │ └── parsed_function_tool_call.py │ │ ├── chat_model.py │ │ ├── completion.py │ │ ├── completion_choice.py │ │ ├── completion_create_params.py │ │ ├── completion_usage.py │ │ ├── create_embedding_response.py │ │ ├── embedding.py │ │ ├── embedding_create_params.py │ │ ├── embedding_model.py │ │ ├── eval_create_params.py │ │ ├── eval_create_response.py │ │ ├── eval_custom_data_source_config.py │ │ ├── eval_delete_response.py │ │ ├── eval_list_params.py │ │ ├── eval_list_response.py │ │ ├── eval_retrieve_response.py │ │ ├── eval_stored_completions_data_source_config.py │ │ ├── eval_update_params.py │ │ ├── eval_update_response.py │ │ ├── evals │ │ │ ├── __init__.py │ │ │ ├── create_eval_completions_run_data_source.py │ │ │ ├── create_eval_completions_run_data_source_param.py │ │ │ ├── create_eval_jsonl_run_data_source.py │ │ │ ├── create_eval_jsonl_run_data_source_param.py │ │ │ ├── eval_api_error.py │ │ │ ├── run_cancel_response.py │ │ │ ├── run_create_params.py │ │ │ ├── run_create_response.py │ │ │ ├── run_delete_response.py │ │ │ ├── run_list_params.py │ │ │ ├── run_list_response.py │ │ │ ├── run_retrieve_response.py │ │ │ └── runs │ │ │ │ ├── __init__.py │ │ │ │ ├── output_item_list_params.py │ │ │ │ ├── output_item_list_response.py │ │ │ │ └── output_item_retrieve_response.py │ │ ├── file_chunking_strategy.py │ │ ├── file_chunking_strategy_param.py │ │ ├── file_content.py │ │ ├── file_create_params.py │ │ ├── file_deleted.py │ │ ├── file_list_params.py │ │ ├── file_object.py │ │ ├── file_purpose.py │ │ ├── fine_tuning │ │ │ ├── __init__.py │ │ │ ├── alpha │ │ │ │ ├── __init__.py │ │ │ │ ├── grader_run_params.py │ │ │ │ ├── grader_run_response.py │ │ │ │ ├── grader_validate_params.py │ │ │ │ └── grader_validate_response.py │ │ │ ├── checkpoints │ │ │ │ ├── __init__.py │ │ │ │ ├── permission_create_params.py │ │ │ │ ├── permission_create_response.py │ │ │ │ ├── permission_delete_response.py │ │ │ │ ├── permission_retrieve_params.py │ │ │ │ └── permission_retrieve_response.py │ │ │ ├── dpo_hyperparameters.py │ │ │ ├── dpo_hyperparameters_param.py │ │ │ ├── dpo_method.py │ │ │ ├── dpo_method_param.py │ │ │ ├── fine_tuning_job.py │ │ │ ├── fine_tuning_job_event.py │ │ │ ├── fine_tuning_job_integration.py │ │ │ ├── fine_tuning_job_wandb_integration.py │ │ │ ├── fine_tuning_job_wandb_integration_object.py │ │ │ ├── job_create_params.py │ │ │ ├── job_list_events_params.py │ │ │ ├── job_list_params.py │ │ │ ├── jobs │ │ │ │ ├── __init__.py │ │ │ │ ├── checkpoint_list_params.py │ │ │ │ └── fine_tuning_job_checkpoint.py │ │ │ ├── reinforcement_hyperparameters.py │ │ │ ├── reinforcement_hyperparameters_param.py │ │ │ ├── reinforcement_method.py │ │ │ ├── reinforcement_method_param.py │ │ │ ├── supervised_hyperparameters.py │ │ │ ├── supervised_hyperparameters_param.py │ │ │ ├── supervised_method.py │ │ │ └── supervised_method_param.py │ │ ├── graders │ │ │ ├── __init__.py │ │ │ ├── label_model_grader.py │ │ │ ├── label_model_grader_param.py │ │ │ ├── multi_grader.py │ │ │ ├── multi_grader_param.py │ │ │ ├── python_grader.py │ │ │ ├── python_grader_param.py │ │ │ ├── score_model_grader.py │ │ │ ├── score_model_grader_param.py │ │ │ ├── string_check_grader.py │ │ │ ├── string_check_grader_param.py │ │ │ ├── text_similarity_grader.py │ │ │ └── text_similarity_grader_param.py │ │ ├── image.py │ │ ├── image_create_variation_params.py │ │ ├── image_edit_params.py │ │ ├── image_generate_params.py │ │ ├── image_model.py │ │ ├── images_response.py │ │ ├── model.py │ │ ├── model_deleted.py │ │ ├── moderation.py │ │ ├── moderation_create_params.py │ │ ├── moderation_create_response.py │ │ ├── moderation_image_url_input_param.py │ │ ├── moderation_model.py │ │ ├── moderation_multi_modal_input_param.py │ │ ├── moderation_text_input_param.py │ │ ├── other_file_chunking_strategy_object.py │ │ ├── responses │ │ │ ├── __init__.py │ │ │ ├── computer_tool.py │ │ │ ├── computer_tool_param.py │ │ │ ├── easy_input_message.py │ │ │ ├── easy_input_message_param.py │ │ │ ├── file_search_tool.py │ │ │ ├── file_search_tool_param.py │ │ │ ├── function_tool.py │ │ │ ├── function_tool_param.py │ │ │ ├── input_item_list_params.py │ │ │ ├── parsed_response.py │ │ │ ├── response.py │ │ │ ├── response_audio_delta_event.py │ │ │ ├── response_audio_done_event.py │ │ │ ├── response_audio_transcript_delta_event.py │ │ │ ├── response_audio_transcript_done_event.py │ │ │ ├── response_code_interpreter_call_code_delta_event.py │ │ │ ├── response_code_interpreter_call_code_done_event.py │ │ │ ├── response_code_interpreter_call_completed_event.py │ │ │ ├── response_code_interpreter_call_in_progress_event.py │ │ │ ├── response_code_interpreter_call_interpreting_event.py │ │ │ ├── response_code_interpreter_tool_call.py │ │ │ ├── response_completed_event.py │ │ │ ├── response_computer_tool_call.py │ │ │ ├── response_computer_tool_call_output_item.py │ │ │ ├── response_computer_tool_call_output_screenshot.py │ │ │ ├── response_computer_tool_call_output_screenshot_param.py │ │ │ ├── response_computer_tool_call_param.py │ │ │ ├── response_content_part_added_event.py │ │ │ ├── response_content_part_done_event.py │ │ │ ├── response_create_params.py │ │ │ ├── response_created_event.py │ │ │ ├── response_error.py │ │ │ ├── response_error_event.py │ │ │ ├── response_failed_event.py │ │ │ ├── response_file_search_call_completed_event.py │ │ │ ├── response_file_search_call_in_progress_event.py │ │ │ ├── response_file_search_call_searching_event.py │ │ │ ├── response_file_search_tool_call.py │ │ │ ├── response_file_search_tool_call_param.py │ │ │ ├── response_format_text_config.py │ │ │ ├── response_format_text_config_param.py │ │ │ ├── response_format_text_json_schema_config.py │ │ │ ├── response_format_text_json_schema_config_param.py │ │ │ ├── response_function_call_arguments_delta_event.py │ │ │ ├── response_function_call_arguments_done_event.py │ │ │ ├── response_function_tool_call.py │ │ │ ├── response_function_tool_call_item.py │ │ │ ├── response_function_tool_call_output_item.py │ │ │ ├── response_function_tool_call_param.py │ │ │ ├── response_function_web_search.py │ │ │ ├── response_function_web_search_param.py │ │ │ ├── response_in_progress_event.py │ │ │ ├── response_includable.py │ │ │ ├── response_incomplete_event.py │ │ │ ├── response_input_content.py │ │ │ ├── response_input_content_param.py │ │ │ ├── response_input_file.py │ │ │ ├── response_input_file_param.py │ │ │ ├── response_input_image.py │ │ │ ├── response_input_image_param.py │ │ │ ├── response_input_item_param.py │ │ │ ├── response_input_message_content_list.py │ │ │ ├── response_input_message_content_list_param.py │ │ │ ├── response_input_message_item.py │ │ │ ├── response_input_param.py │ │ │ ├── response_input_text.py │ │ │ ├── response_input_text_param.py │ │ │ ├── response_item.py │ │ │ ├── response_item_list.py │ │ │ ├── response_output_item.py │ │ │ ├── response_output_item_added_event.py │ │ │ ├── response_output_item_done_event.py │ │ │ ├── response_output_message.py │ │ │ ├── response_output_message_param.py │ │ │ ├── response_output_refusal.py │ │ │ ├── response_output_refusal_param.py │ │ │ ├── response_output_text.py │ │ │ ├── response_output_text_param.py │ │ │ ├── response_reasoning_item.py │ │ │ ├── response_reasoning_item_param.py │ │ │ ├── response_reasoning_summary_part_added_event.py │ │ │ ├── response_reasoning_summary_part_done_event.py │ │ │ ├── response_reasoning_summary_text_delta_event.py │ │ │ ├── response_reasoning_summary_text_done_event.py │ │ │ ├── response_refusal_delta_event.py │ │ │ ├── response_refusal_done_event.py │ │ │ ├── response_retrieve_params.py │ │ │ ├── response_status.py │ │ │ ├── response_stream_event.py │ │ │ ├── response_text_annotation_delta_event.py │ │ │ ├── response_text_config.py │ │ │ ├── response_text_config_param.py │ │ │ ├── response_text_delta_event.py │ │ │ ├── response_text_done_event.py │ │ │ ├── response_usage.py │ │ │ ├── response_web_search_call_completed_event.py │ │ │ ├── response_web_search_call_in_progress_event.py │ │ │ ├── response_web_search_call_searching_event.py │ │ │ ├── tool.py │ │ │ ├── tool_choice_function.py │ │ │ ├── tool_choice_function_param.py │ │ │ ├── tool_choice_options.py │ │ │ ├── tool_choice_types.py │ │ │ ├── tool_choice_types_param.py │ │ │ ├── tool_param.py │ │ │ ├── web_search_tool.py │ │ │ └── web_search_tool_param.py │ │ ├── shared │ │ │ ├── __init__.py │ │ │ ├── all_models.py │ │ │ ├── chat_model.py │ │ │ ├── comparison_filter.py │ │ │ ├── compound_filter.py │ │ │ ├── error_object.py │ │ │ ├── function_definition.py │ │ │ ├── function_parameters.py │ │ │ ├── metadata.py │ │ │ ├── reasoning.py │ │ │ ├── reasoning_effort.py │ │ │ ├── response_format_json_object.py │ │ │ ├── response_format_json_schema.py │ │ │ ├── response_format_text.py │ │ │ └── responses_model.py │ │ ├── shared_params │ │ │ ├── __init__.py │ │ │ ├── chat_model.py │ │ │ ├── comparison_filter.py │ │ │ ├── compound_filter.py │ │ │ ├── function_definition.py │ │ │ ├── function_parameters.py │ │ │ ├── metadata.py │ │ │ ├── reasoning.py │ │ │ ├── reasoning_effort.py │ │ │ ├── response_format_json_object.py │ │ │ ├── response_format_json_schema.py │ │ │ ├── response_format_text.py │ │ │ └── responses_model.py │ │ ├── static_file_chunking_strategy.py │ │ ├── static_file_chunking_strategy_object.py │ │ ├── static_file_chunking_strategy_object_param.py │ │ ├── static_file_chunking_strategy_param.py │ │ ├── upload.py │ │ ├── upload_complete_params.py │ │ ├── upload_create_params.py │ │ ├── uploads │ │ │ ├── __init__.py │ │ │ ├── part_create_params.py │ │ │ └── upload_part.py │ │ ├── vector_store.py │ │ ├── vector_store_create_params.py │ │ ├── vector_store_deleted.py │ │ ├── vector_store_list_params.py │ │ ├── vector_store_search_params.py │ │ ├── vector_store_search_response.py │ │ ├── vector_store_update_params.py │ │ ├── vector_stores │ │ │ ├── __init__.py │ │ │ ├── file_batch_create_params.py │ │ │ ├── file_batch_list_files_params.py │ │ │ ├── file_content_response.py │ │ │ ├── file_create_params.py │ │ │ ├── file_list_params.py │ │ │ ├── file_update_params.py │ │ │ ├── vector_store_file.py │ │ │ ├── vector_store_file_batch.py │ │ │ └── vector_store_file_deleted.py │ │ └── websocket_connection_options.py │ │ └── version.py ├── api_resources │ ├── __init__.py │ ├── apis │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── api_keys.py │ │ ├── api_resource.py │ │ ├── assistants.py │ │ ├── audio.py │ │ ├── batches.py │ │ ├── beta_chat.py │ │ ├── beta_realtime.py │ │ ├── chat_complete.py │ │ ├── collections.py │ │ ├── complete.py │ │ ├── configs.py │ │ ├── create_headers.py │ │ ├── deleteMethod.py │ │ ├── embeddings.py │ │ ├── evals.py │ │ ├── feedback.py │ │ ├── fine_tuning.py │ │ ├── generation.py │ │ ├── getMethod.py │ │ ├── images.py │ │ ├── labels.py │ │ ├── logger.py │ │ ├── logs.py │ │ ├── main_files.py │ │ ├── models.py │ │ ├── moderations.py │ │ ├── post.py │ │ ├── putMethod.py │ │ ├── responses.py │ │ ├── threads.py │ │ ├── uploads.py │ │ ├── vector_stores.py │ │ └── virtual_keys.py │ ├── base_client.py │ ├── client.py │ ├── common_types.py │ ├── exceptions.py │ ├── get_audio_duration.py │ ├── global_constants.py │ ├── instrumentation │ │ ├── __init__.py │ │ ├── crewai │ │ │ ├── __init__.py │ │ │ ├── instrumentation.py │ │ │ └── patch.py │ │ ├── langgraph │ │ │ ├── __init__.py │ │ │ ├── instrumentation.py │ │ │ └── patch.py │ │ ├── litellm │ │ │ ├── __init__.py │ │ │ ├── instrumentation.py │ │ │ └── patch.py │ │ ├── openai │ │ │ ├── __init__.py │ │ │ ├── instrumentation.py │ │ │ └── patch.py │ │ ├── portkey_span_exporter.py │ │ └── utils.py │ ├── streaming.py │ ├── types │ │ ├── __init__.py │ │ ├── api_keys_type.py │ │ ├── assistant_type.py │ │ ├── audio_types.py │ │ ├── batches_type.py │ │ ├── beta_chat_type.py │ │ ├── beta_realtime.py │ │ ├── chat_complete_type.py │ │ ├── complete_type.py │ │ ├── configs_type.py │ │ ├── embeddings_type.py │ │ ├── evals_runs_output_items_type.py │ │ ├── evals_runs_type.py │ │ ├── evals_types.py │ │ ├── feedback_type.py │ │ ├── fine_tuning_alpha_grader_type.py │ │ ├── fine_tuning_type.py │ │ ├── finetuning_checkpoint_permissions.py │ │ ├── generation_type.py │ │ ├── image_type.py │ │ ├── logs_type.py │ │ ├── main_file_type.py │ │ ├── models_type.py │ │ ├── moderations_type.py │ │ ├── response_type.py │ │ ├── responses_input_items_type.py │ │ ├── shared_types.py │ │ ├── thread_message_type.py │ │ ├── thread_run_type.py │ │ ├── thread_type.py │ │ ├── upload_types.py │ │ ├── user_invite_type.py │ │ ├── utils.py │ │ ├── vector_stores_type.py │ │ └── virtual_keys_type.py │ └── utils.py ├── langchain │ ├── __init__.py │ └── portkey_langchain_callback_handler.py ├── llamaindex │ ├── __init__.py │ └── portkey_llama_callback_handler.py ├── llms │ ├── __init__.py │ ├── langchain │ │ ├── __init__.py │ │ ├── chat.py │ │ └── completion.py │ ├── llama_index │ │ ├── __init__.py │ │ ├── completions.py │ │ └── utils.py │ └── mypy.ini ├── py.typed ├── utils │ ├── __init__.py │ ├── hashing_utils.py │ └── json_utils.py └── version.py ├── pyproject.toml ├── pytest.ini ├── setup.cfg ├── tests ├── __init__.py ├── configs │ ├── assistants │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ │ └── single_with_basic_config.json │ ├── audio │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ ├── single_with_basic_config │ │ │ └── single_with_basic_config.json │ │ └── speech.mp3 │ ├── batches │ │ └── seed_tasks.jsonl │ ├── chat_completions │ │ ├── loadbalance_and_fallback │ │ │ ├── anthropic_n_openai.json │ │ │ ├── anyscale_n_openai.json │ │ │ ├── azure_n_openai.json │ │ │ └── cohere_n_openai.json │ │ ├── loadbalance_with_two_apikeys │ │ │ └── loadbalance_with_two_apikeys.json │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ │ └── single_with_basic_config.json │ ├── completions │ │ ├── loadbalance_and_fallback │ │ │ ├── anthropic_n_openai.json │ │ │ ├── anyscale_n_openai.json │ │ │ ├── azure_n_openai.json │ │ │ └── cohere_n_openai.json │ │ ├── loadbalance_with_two_apikeys │ │ │ └── loadbalance_with_two_apikeys.json │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ │ └── single_with_basic_config.json │ ├── images │ │ ├── loadbalance_and_fallback │ │ │ └── stability_n_openai.json │ │ ├── loadbalance_with_two_apikeys │ │ │ └── loadbalance_with_two_apikeys.json │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ │ └── single_with_basic_config.json │ ├── moderations │ │ ├── single_provider │ │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ │ └── single_with_basic_config.json │ └── threads │ │ ├── sample.pdf │ │ ├── single_provider │ │ └── single_provider.json │ │ ├── single_provider_with_vk_retry_cache │ │ └── single_provider_with_vk_retry_cache.json │ │ └── single_with_basic_config │ │ └── single_with_basic_config.json ├── manual_test_async_feedback.py ├── manual_test_async_thread_query.py ├── manual_test_batches.py ├── manual_test_feedback.py ├── manual_test_threads_query.py ├── models.json ├── test_assistants.py ├── test_async_audio_speech.py ├── test_async_audio_transcript.py ├── test_async_audio_translation.py ├── test_async_chat_complete.py ├── test_async_complete.py ├── test_async_images.py ├── test_async_moderations.py ├── test_audio_speech.py ├── test_audio_transcript.py ├── test_audio_translation.py ├── test_chat_complete.py ├── test_complete.py ├── test_images.py ├── test_llm_langchain.py ├── test_llm_llamaindex.py ├── test_moderations.py ├── test_threads.py ├── utils.py └── virtual_keys_replacement.sh └── vendorize.toml /.changes/header.tpl.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), 6 | and is generated by [Changie](https://github.com/miniscruff/changie). 7 | -------------------------------------------------------------------------------- /.changes/unreleased/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/.changes/unreleased/.gitkeep -------------------------------------------------------------------------------- /.changes/v0.1.0.md: -------------------------------------------------------------------------------- 1 | ## v0.1.0 - 2023-09-11 2 | -------------------------------------------------------------------------------- /.changie.yaml: -------------------------------------------------------------------------------- 1 | changesDir: .changes 2 | unreleasedDir: unreleased 3 | headerPath: header.tpl.md 4 | changelogPath: CHANGELOG.md 5 | versionExt: md 6 | versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' 7 | kindFormat: '### {{.Kind}}' 8 | changeFormat: '* {{.Body}}' 9 | kinds: 10 | - label: Added 11 | auto: minor 12 | - label: Changed 13 | auto: major 14 | - label: Deprecated 15 | auto: minor 16 | - label: Removed 17 | auto: major 18 | - label: Fixed 19 | auto: patch 20 | - label: Security 21 | auto: patch 22 | newlines: 23 | afterChangelogHeader: 1 24 | beforeChangelogVersion: 1 25 | endOfVersion: 1 26 | envPrefix: CHANGIE_ 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Portkey Community Support 4 | url: https://discord.com/invite/DD7vgKK299 5 | about: Please ask and answer questions here. 6 | - name: Portkey Bounty 7 | url: https://discord.com/invite/DD7vgKK299 8 | about: Please report security vulnerabilities here. -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | **Title:** 2 | 3 | **Description:** 4 | - Detailed change 1 5 | - Detailed change 2 6 | - ... 7 | 8 | **Motivation:** 9 | 10 | 11 | **Related Issues:** 12 | # -------------------------------------------------------------------------------- /.github/workflows/verify-conventional-commits.yml: -------------------------------------------------------------------------------- 1 | name: verify-conventional-commits 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | conventional-commits-checker: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: verify conventional commits 10 | uses: taskmedia/action-conventional-commits@v1.1.8 11 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 0.1.x | :white_check_mark: | 8 | 9 | ## Reporting a Vulnerability 10 | 11 | Please report any security vulnerabilities at `support@portkey.ai`. 12 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | ## How to file issues and get help 2 | 3 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 4 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 5 | feature request as a new Issue. 6 | 7 | For help and questions about using this project, please contact `support@portkey.ai`. Join the community discussions [here](https://discord.com/invite/DD7vgKK299). -------------------------------------------------------------------------------- /docs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/.DS_Store -------------------------------------------------------------------------------- /docs/images/Sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/Sticker.png -------------------------------------------------------------------------------- /docs/images/anthropic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/anthropic.png -------------------------------------------------------------------------------- /docs/images/anyscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/anyscale.png -------------------------------------------------------------------------------- /docs/images/azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/azure.png -------------------------------------------------------------------------------- /docs/images/bard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/bard.png -------------------------------------------------------------------------------- /docs/images/cohere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/cohere.png -------------------------------------------------------------------------------- /docs/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/header.png -------------------------------------------------------------------------------- /docs/images/localai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/localai.png -------------------------------------------------------------------------------- /docs/images/openai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/docs/images/openai.png -------------------------------------------------------------------------------- /examples/demo.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import os 4 | from portkey_ai import Portkey 5 | from dotenv import load_dotenv 6 | 7 | # from tests.utils import assert_matches_type 8 | load_dotenv(override=True) 9 | base_url = os.environ.get("PORTKEY_BASE_URL") 10 | api_key = os.environ.get("PORTKEY_API_KEY") 11 | virtual_api_key = os.environ.get("COHERE_VIRTUAL_KEY") 12 | 13 | print("starting the tests....") 14 | portkey = Portkey( 15 | base_url=base_url, 16 | api_key=api_key, 17 | virtual_key=virtual_api_key, 18 | ) 19 | 20 | print("starting the creation phase.") 21 | 22 | completion = portkey.chat.completions.create( 23 | messages=[ 24 | {"role": "system", "content": "You are an assistant"}, 25 | {"role": "user", "content": "Hello!"}, 26 | ] 27 | ) 28 | 29 | print("completion :: ", completion) 30 | -------------------------------------------------------------------------------- /portkey_ai/_portkey_scripts.py: -------------------------------------------------------------------------------- 1 | """main file""" 2 | import argparse 3 | from .version import VERSION 4 | 5 | 6 | def main(): 7 | """Main function""" 8 | parser = argparse.ArgumentParser() 9 | parser.add_argument( 10 | "--version", 11 | "-v", 12 | action="version", 13 | version=f"portkey_ai {VERSION}", 14 | help="Print version and exit.", 15 | ) 16 | 17 | _ = parser.parse_args() 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/_vendor/__init__.py -------------------------------------------------------------------------------- /portkey_ai/_vendor/bin/openai: -------------------------------------------------------------------------------- 1 | #!/Users/chandeep/Documents/Workspace/Portkey/SDK/portkey-python-sdk/venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from openai.cli import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai-1.78.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai-1.78.0.dist-info/REQUESTED: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/_vendor/openai-1.78.0.dist-info/REQUESTED -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai-1.78.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: hatchling 1.26.3 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai-1.78.0.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | openai = openai.cli:main 3 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/__main__.py: -------------------------------------------------------------------------------- 1 | from .cli import main 2 | 3 | main() 4 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_constants.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | import httpx 4 | 5 | RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" 6 | OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" 7 | 8 | # default timeout is 10 minutes 9 | DEFAULT_TIMEOUT = httpx.Timeout(timeout=600, connect=5.0) 10 | DEFAULT_MAX_RETRIES = 1 11 | DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=1000, max_keepalive_connections=100) 12 | 13 | INITIAL_RETRY_DELAY = 0.5 14 | MAX_RETRY_DELAY = 8.0 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_extras/__init__.py: -------------------------------------------------------------------------------- 1 | from .numpy_proxy import numpy as numpy, has_numpy as has_numpy 2 | from .pandas_proxy import pandas as pandas 3 | from .sounddevice_proxy import sounddevice as sounddevice 4 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_extras/_common.py: -------------------------------------------------------------------------------- 1 | from .._exceptions import OpenAIError 2 | 3 | INSTRUCTIONS = """ 4 | 5 | OpenAI error: 6 | 7 | missing `{library}` 8 | 9 | This feature requires additional dependencies: 10 | 11 | $ pip install openai[{extra}] 12 | 13 | """ 14 | 15 | 16 | def format_instructions(*, library: str, extra: str) -> str: 17 | return INSTRUCTIONS.format(library=library, extra=extra) 18 | 19 | 20 | class MissingDependencyError(OpenAIError): 21 | pass 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_extras/pandas_proxy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING, Any 4 | from typing_extensions import override 5 | 6 | from .._utils import LazyProxy 7 | from ._common import MissingDependencyError, format_instructions 8 | 9 | if TYPE_CHECKING: 10 | import pandas as pandas 11 | 12 | 13 | PANDAS_INSTRUCTIONS = format_instructions(library="pandas", extra="datalib") 14 | 15 | 16 | class PandasProxy(LazyProxy[Any]): 17 | @override 18 | def __load__(self) -> Any: 19 | try: 20 | import pandas 21 | except ImportError as err: 22 | raise MissingDependencyError(PANDAS_INSTRUCTIONS) from err 23 | 24 | return pandas 25 | 26 | 27 | if not TYPE_CHECKING: 28 | pandas = PandasProxy() 29 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_extras/sounddevice_proxy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING, Any 4 | from typing_extensions import override 5 | 6 | from .._utils import LazyProxy 7 | from ._common import MissingDependencyError, format_instructions 8 | 9 | if TYPE_CHECKING: 10 | import sounddevice as sounddevice # type: ignore 11 | 12 | 13 | SOUNDDEVICE_INSTRUCTIONS = format_instructions(library="sounddevice", extra="voice_helpers") 14 | 15 | 16 | class SounddeviceProxy(LazyProxy[Any]): 17 | @override 18 | def __load__(self) -> Any: 19 | try: 20 | import sounddevice # type: ignore 21 | except ImportError as err: 22 | raise MissingDependencyError(SOUNDDEVICE_INSTRUCTIONS) from err 23 | 24 | return sounddevice 25 | 26 | 27 | if not TYPE_CHECKING: 28 | sounddevice = SounddeviceProxy() 29 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_utils/_streams.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing_extensions import Iterator, AsyncIterator 3 | 4 | 5 | def consume_sync_iterator(iterator: Iterator[Any]) -> None: 6 | for _ in iterator: 7 | ... 8 | 9 | 10 | async def consume_async_iterator(iterator: AsyncIterator[Any]) -> None: 11 | async for _ in iterator: 12 | ... 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/_version.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | __title__ = "openai" 4 | __version__ = "1.78.0" # x-release-please-version 5 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/__init__.py: -------------------------------------------------------------------------------- 1 | from ._cli import main as main 2 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_api/__init__.py: -------------------------------------------------------------------------------- 1 | from ._main import register_commands as register_commands 2 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_api/_main.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from argparse import ArgumentParser 4 | 5 | from . import chat, audio, files, image, models, completions 6 | 7 | 8 | def register_commands(parser: ArgumentParser) -> None: 9 | subparsers = parser.add_subparsers(help="All API subcommands") 10 | 11 | chat.register(subparsers) 12 | image.register(subparsers) 13 | audio.register(subparsers) 14 | files.register(subparsers) 15 | models.register(subparsers) 16 | completions.register(subparsers) 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_api/chat/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | from argparse import ArgumentParser 5 | 6 | from . import completions 7 | 8 | if TYPE_CHECKING: 9 | from argparse import _SubParsersAction 10 | 11 | 12 | def register(subparser: _SubParsersAction[ArgumentParser]) -> None: 13 | completions.register(subparser) 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_errors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import sys 4 | 5 | import pydantic 6 | 7 | from ._utils import Colors, organization_info 8 | from .._exceptions import APIError, OpenAIError 9 | 10 | 11 | class CLIError(OpenAIError): ... 12 | 13 | 14 | class SilentCLIError(CLIError): ... 15 | 16 | 17 | def display_error(err: CLIError | APIError | pydantic.ValidationError) -> None: 18 | if isinstance(err, SilentCLIError): 19 | return 20 | 21 | sys.stderr.write("{}{}Error:{} {}\n".format(organization_info(), Colors.FAIL, Colors.ENDC, err)) 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_models.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing_extensions import ClassVar 3 | 4 | import pydantic 5 | 6 | from .. import _models 7 | from .._compat import PYDANTIC_V2, ConfigDict 8 | 9 | 10 | class BaseModel(_models.BaseModel): 11 | if PYDANTIC_V2: 12 | model_config: ClassVar[ConfigDict] = ConfigDict(extra="ignore", arbitrary_types_allowed=True) 13 | else: 14 | 15 | class Config(pydantic.BaseConfig): # type: ignore 16 | extra: Any = pydantic.Extra.ignore # type: ignore 17 | arbitrary_types_allowed: bool = True 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_tools/__init__.py: -------------------------------------------------------------------------------- 1 | from ._main import register_commands as register_commands 2 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/cli/_tools/_main.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | from argparse import ArgumentParser 5 | 6 | from . import migrate, fine_tunes 7 | 8 | if TYPE_CHECKING: 9 | from argparse import _SubParsersAction 10 | 11 | 12 | def register_commands(parser: ArgumentParser, subparser: _SubParsersAction[ArgumentParser]) -> None: 13 | migrate.register(subparser) 14 | 15 | namespaced = parser.add_subparsers(title="Tools", help="Convenience client side tools") 16 | 17 | fine_tunes.register(namespaced) 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | from .microphone import Microphone 2 | from .local_audio_player import LocalAudioPlayer 3 | 4 | __all__ = ["Microphone", "LocalAudioPlayer"] 5 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/.keep: -------------------------------------------------------------------------------- 1 | File generated from our OpenAPI spec by Stainless. 2 | 3 | This directory can be used to store custom files to expand the SDK. 4 | It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/__init__.py: -------------------------------------------------------------------------------- 1 | from ._tools import pydantic_function_tool as pydantic_function_tool 2 | from ._parsing import ResponseFormatT as ResponseFormatT 3 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/_parsing/__init__.py: -------------------------------------------------------------------------------- 1 | from ._completions import ( 2 | ResponseFormatT as ResponseFormatT, 3 | has_parseable_input, 4 | has_parseable_input as has_parseable_input, 5 | maybe_parse_content as maybe_parse_content, 6 | validate_input_tools as validate_input_tools, 7 | parse_chat_completion as parse_chat_completion, 8 | get_input_tool_by_name as get_input_tool_by_name, 9 | solve_response_format_t as solve_response_format_t, 10 | parse_function_tool_arguments as parse_function_tool_arguments, 11 | type_to_response_format_param as type_to_response_format_param, 12 | ) 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/streaming/__init__.py: -------------------------------------------------------------------------------- 1 | from ._assistants import ( 2 | AssistantEventHandler as AssistantEventHandler, 3 | AssistantEventHandlerT as AssistantEventHandlerT, 4 | AssistantStreamManager as AssistantStreamManager, 5 | AsyncAssistantEventHandler as AsyncAssistantEventHandler, 6 | AsyncAssistantEventHandlerT as AsyncAssistantEventHandlerT, 7 | AsyncAssistantStreamManager as AsyncAssistantStreamManager, 8 | ) 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/streaming/chat/_types.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing_extensions import TypeAlias 4 | 5 | from ....types.chat import ParsedChoice, ParsedChatCompletion, ParsedChatCompletionMessage 6 | 7 | ParsedChatCompletionSnapshot: TypeAlias = ParsedChatCompletion[object] 8 | """Snapshot type representing an in-progress accumulation of 9 | a `ParsedChatCompletion` object. 10 | """ 11 | 12 | ParsedChatCompletionMessageSnapshot: TypeAlias = ParsedChatCompletionMessage[object] 13 | """Snapshot type representing an in-progress accumulation of 14 | a `ParsedChatCompletionMessage` object. 15 | 16 | If the content has been fully accumulated, the `.parsed` content will be 17 | the `response_format` instance, otherwise it'll be the raw JSON parsed version. 18 | """ 19 | 20 | ParsedChoiceSnapshot: TypeAlias = ParsedChoice[object] 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/streaming/responses/__init__.py: -------------------------------------------------------------------------------- 1 | from ._events import ( 2 | ResponseTextDoneEvent as ResponseTextDoneEvent, 3 | ResponseTextDeltaEvent as ResponseTextDeltaEvent, 4 | ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent, 5 | ) 6 | from ._responses import ( 7 | ResponseStream as ResponseStream, 8 | AsyncResponseStream as AsyncResponseStream, 9 | ResponseStreamEvent as ResponseStreamEvent, 10 | ResponseStreamState as ResponseStreamState, 11 | ResponseStreamManager as ResponseStreamManager, 12 | AsyncResponseStreamManager as AsyncResponseStreamManager, 13 | ) 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/lib/streaming/responses/_types.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing_extensions import TypeAlias 4 | 5 | from ....types.responses import ParsedResponse 6 | 7 | ParsedResponseSnapshot: TypeAlias = ParsedResponse[object] 8 | """Snapshot type representing an in-progress accumulation of 9 | a `ParsedResponse` object. 10 | """ 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/_vendor/openai/py.typed -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/resources/beta/chat/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .chat import Chat, AsyncChat 4 | from .completions import Completions, AsyncCompletions 5 | 6 | __all__ = [ 7 | "Completions", 8 | "AsyncCompletions", 9 | "Chat", 10 | "AsyncChat", 11 | ] 12 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/resources/beta/chat/chat.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from ...._compat import cached_property 6 | from .completions import Completions, AsyncCompletions 7 | from ...._resource import SyncAPIResource, AsyncAPIResource 8 | 9 | __all__ = ["Chat", "AsyncChat"] 10 | 11 | 12 | class Chat(SyncAPIResource): 13 | @cached_property 14 | def completions(self) -> Completions: 15 | return Completions(self._client) 16 | 17 | 18 | class AsyncChat(AsyncAPIResource): 19 | @cached_property 20 | def completions(self) -> AsyncCompletions: 21 | return AsyncCompletions(self._client) 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/speech_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["SpeechModel"] 6 | 7 | SpeechModel: TypeAlias = Literal["tts-1", "tts-1-hd", "gpt-4o-mini-tts"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/transcription_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import TypeAlias 5 | 6 | from .transcription import Transcription 7 | from .transcription_verbose import TranscriptionVerbose 8 | 9 | __all__ = ["TranscriptionCreateResponse"] 10 | 11 | TranscriptionCreateResponse: TypeAlias = Union[Transcription, TranscriptionVerbose] 12 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/transcription_include.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["TranscriptionInclude"] 6 | 7 | TranscriptionInclude: TypeAlias = Literal["logprobs"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/transcription_stream_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ..._utils import PropertyInfo 7 | from .transcription_text_done_event import TranscriptionTextDoneEvent 8 | from .transcription_text_delta_event import TranscriptionTextDeltaEvent 9 | 10 | __all__ = ["TranscriptionStreamEvent"] 11 | 12 | TranscriptionStreamEvent: TypeAlias = Annotated[ 13 | Union[TranscriptionTextDeltaEvent, TranscriptionTextDoneEvent], PropertyInfo(discriminator="type") 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/transcription_word.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["TranscriptionWord"] 6 | 7 | 8 | class TranscriptionWord(BaseModel): 9 | end: float 10 | """End time of the word in seconds.""" 11 | 12 | start: float 13 | """Start time of the word in seconds.""" 14 | 15 | word: str 16 | """The text content of the word.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/translation.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["Translation"] 6 | 7 | 8 | class Translation(BaseModel): 9 | text: str 10 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/translation_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import TypeAlias 5 | 6 | from .translation import Translation 7 | from .translation_verbose import TranslationVerbose 8 | 9 | __all__ = ["TranslationCreateResponse"] 10 | 11 | TranslationCreateResponse: TypeAlias = Union[Translation, TranslationVerbose] 12 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio/translation_verbose.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | 5 | from ..._models import BaseModel 6 | from .transcription_segment import TranscriptionSegment 7 | 8 | __all__ = ["TranslationVerbose"] 9 | 10 | 11 | class TranslationVerbose(BaseModel): 12 | duration: float 13 | """The duration of the input audio.""" 14 | 15 | language: str 16 | """The language of the output translation (always `english`).""" 17 | 18 | text: str 19 | """The translated text.""" 20 | 21 | segments: Optional[List[TranscriptionSegment]] = None 22 | """Segments of the translated text and their corresponding details.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["AudioModel"] 6 | 7 | AudioModel: TypeAlias = Literal["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/audio_response_format.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["AudioResponseFormat"] 6 | 7 | AudioResponseFormat: TypeAlias = Literal["json", "text", "srt", "verbose_json", "vtt"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/auto_file_chunking_strategy_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["AutoFileChunkingStrategyParam"] 8 | 9 | 10 | class AutoFileChunkingStrategyParam(TypedDict, total=False): 11 | type: Required[Literal["auto"]] 12 | """Always `auto`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/batch_error.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["BatchError"] 8 | 9 | 10 | class BatchError(BaseModel): 11 | code: Optional[str] = None 12 | """An error code identifying the error type.""" 13 | 14 | line: Optional[int] = None 15 | """The line number of the input file where the error occurred, if applicable.""" 16 | 17 | message: Optional[str] = None 18 | """A human-readable message providing more details about the error.""" 19 | 20 | param: Optional[str] = None 21 | """The name of the parameter that caused the error, if applicable.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/batch_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["BatchListParams"] 8 | 9 | 10 | class BatchListParams(TypedDict, total=False): 11 | after: str 12 | """A cursor for use in pagination. 13 | 14 | `after` is an object ID that defines your place in the list. For instance, if 15 | you make a list request and receive 100 objects, ending with obj_foo, your 16 | subsequent call can include after=obj_foo in order to fetch the next page of the 17 | list. 18 | """ 19 | 20 | limit: int 21 | """A limit on the number of objects to be returned. 22 | 23 | Limit can range between 1 and 100, and the default is 20. 24 | """ 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/batch_request_counts.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .._models import BaseModel 4 | 5 | __all__ = ["BatchRequestCounts"] 6 | 7 | 8 | class BatchRequestCounts(BaseModel): 9 | completed: int 10 | """Number of requests that have been completed successfully.""" 11 | 12 | failed: int 13 | """Number of requests that have failed.""" 14 | 15 | total: int 16 | """Total number of requests in the batch.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["AssistantDeleted"] 8 | 9 | 10 | class AssistantDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["assistant.deleted"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_response_format_option.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | from ..shared.response_format_text import ResponseFormatText 7 | from ..shared.response_format_json_object import ResponseFormatJSONObject 8 | from ..shared.response_format_json_schema import ResponseFormatJSONSchema 9 | 10 | __all__ = ["AssistantResponseFormatOption"] 11 | 12 | AssistantResponseFormatOption: TypeAlias = Union[ 13 | Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_response_format_option_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import Literal, TypeAlias 7 | 8 | from ..shared_params.response_format_text import ResponseFormatText 9 | from ..shared_params.response_format_json_object import ResponseFormatJSONObject 10 | from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema 11 | 12 | __all__ = ["AssistantResponseFormatOptionParam"] 13 | 14 | AssistantResponseFormatOptionParam: TypeAlias = Union[ 15 | Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema 16 | ] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ..._utils import PropertyInfo 7 | from .function_tool import FunctionTool 8 | from .file_search_tool import FileSearchTool 9 | from .code_interpreter_tool import CodeInterpreterTool 10 | 11 | __all__ = ["AssistantTool"] 12 | 13 | AssistantTool: TypeAlias = Annotated[ 14 | Union[CodeInterpreterTool, FileSearchTool, FunctionTool], PropertyInfo(discriminator="type") 15 | ] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | from .assistant_tool_choice_function import AssistantToolChoiceFunction 8 | 9 | __all__ = ["AssistantToolChoice"] 10 | 11 | 12 | class AssistantToolChoice(BaseModel): 13 | type: Literal["function", "code_interpreter", "file_search"] 14 | """The type of the tool. If type is `function`, the function name must be set""" 15 | 16 | function: Optional[AssistantToolChoiceFunction] = None 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice_function.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["AssistantToolChoiceFunction"] 6 | 7 | 8 | class AssistantToolChoiceFunction(BaseModel): 9 | name: str 10 | """The name of the function to call.""" 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice_function_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["AssistantToolChoiceFunctionParam"] 8 | 9 | 10 | class AssistantToolChoiceFunctionParam(TypedDict, total=False): 11 | name: Required[str] 12 | """The name of the function to call.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice_option.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | from .assistant_tool_choice import AssistantToolChoice 7 | 8 | __all__ = ["AssistantToolChoiceOption"] 9 | 10 | AssistantToolChoiceOption: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoice] 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice_option_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import Literal, TypeAlias 7 | 8 | from .assistant_tool_choice_param import AssistantToolChoiceParam 9 | 10 | __all__ = ["AssistantToolChoiceOptionParam"] 11 | 12 | AssistantToolChoiceOptionParam: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoiceParam] 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_choice_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .assistant_tool_choice_function_param import AssistantToolChoiceFunctionParam 8 | 9 | __all__ = ["AssistantToolChoiceParam"] 10 | 11 | 12 | class AssistantToolChoiceParam(TypedDict, total=False): 13 | type: Required[Literal["function", "code_interpreter", "file_search"]] 14 | """The type of the tool. If type is `function`, the function name must be set""" 15 | 16 | function: AssistantToolChoiceFunctionParam 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/assistant_tool_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .function_tool_param import FunctionToolParam 9 | from .file_search_tool_param import FileSearchToolParam 10 | from .code_interpreter_tool_param import CodeInterpreterToolParam 11 | 12 | __all__ = ["AssistantToolParam"] 13 | 14 | AssistantToolParam: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/chat/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/code_interpreter_tool.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["CodeInterpreterTool"] 8 | 9 | 10 | class CodeInterpreterTool(BaseModel): 11 | type: Literal["code_interpreter"] 12 | """The type of tool being defined: `code_interpreter`""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/code_interpreter_tool_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["CodeInterpreterToolParam"] 8 | 9 | 10 | class CodeInterpreterToolParam(TypedDict, total=False): 11 | type: Required[Literal["code_interpreter"]] 12 | """The type of tool being defined: `code_interpreter`""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/function_tool.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from ..shared.function_definition import FunctionDefinition 7 | 8 | __all__ = ["FunctionTool"] 9 | 10 | 11 | class FunctionTool(BaseModel): 12 | function: FunctionDefinition 13 | 14 | type: Literal["function"] 15 | """The type of tool being defined: `function`""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/function_tool_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from ..shared_params.function_definition import FunctionDefinition 8 | 9 | __all__ = ["FunctionToolParam"] 10 | 11 | 12 | class FunctionToolParam(TypedDict, total=False): 13 | function: Required[FunctionDefinition] 14 | 15 | type: Required[Literal["function"]] 16 | """The type of tool being defined: `function`""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_created_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .conversation_item import ConversationItem 7 | 8 | __all__ = ["ConversationItemCreatedEvent"] 9 | 10 | 11 | class ConversationItemCreatedEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | item: ConversationItem 16 | """The item to add to the conversation.""" 17 | 18 | previous_item_id: str 19 | """ 20 | The ID of the preceding item in the Conversation context, allows the client to 21 | understand the order of the conversation. 22 | """ 23 | 24 | type: Literal["conversation.item.created"] 25 | """The event type, must be `conversation.item.created`.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_delete_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ConversationItemDeleteEvent"] 9 | 10 | 11 | class ConversationItemDeleteEvent(BaseModel): 12 | item_id: str 13 | """The ID of the item to delete.""" 14 | 15 | type: Literal["conversation.item.delete"] 16 | """The event type, must be `conversation.item.delete`.""" 17 | 18 | event_id: Optional[str] = None 19 | """Optional client-generated ID used to identify this event.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_delete_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ConversationItemDeleteEventParam"] 8 | 9 | 10 | class ConversationItemDeleteEventParam(TypedDict, total=False): 11 | item_id: Required[str] 12 | """The ID of the item to delete.""" 13 | 14 | type: Required[Literal["conversation.item.delete"]] 15 | """The event type, must be `conversation.item.delete`.""" 16 | 17 | event_id: str 18 | """Optional client-generated ID used to identify this event.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_deleted_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["ConversationItemDeletedEvent"] 8 | 9 | 10 | class ConversationItemDeletedEvent(BaseModel): 11 | event_id: str 12 | """The unique ID of the server event.""" 13 | 14 | item_id: str 15 | """The ID of the item that was deleted.""" 16 | 17 | type: Literal["conversation.item.deleted"] 18 | """The event type, must be `conversation.item.deleted`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_retrieve_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ConversationItemRetrieveEvent"] 9 | 10 | 11 | class ConversationItemRetrieveEvent(BaseModel): 12 | item_id: str 13 | """The ID of the item to retrieve.""" 14 | 15 | type: Literal["conversation.item.retrieve"] 16 | """The event type, must be `conversation.item.retrieve`.""" 17 | 18 | event_id: Optional[str] = None 19 | """Optional client-generated ID used to identify this event.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_retrieve_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ConversationItemRetrieveEventParam"] 8 | 9 | 10 | class ConversationItemRetrieveEventParam(TypedDict, total=False): 11 | item_id: Required[str] 12 | """The ID of the item to retrieve.""" 13 | 14 | type: Required[Literal["conversation.item.retrieve"]] 15 | """The event type, must be `conversation.item.retrieve`.""" 16 | 17 | event_id: str 18 | """Optional client-generated ID used to identify this event.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/conversation_item_truncated_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["ConversationItemTruncatedEvent"] 8 | 9 | 10 | class ConversationItemTruncatedEvent(BaseModel): 11 | audio_end_ms: int 12 | """The duration up to which the audio was truncated, in milliseconds.""" 13 | 14 | content_index: int 15 | """The index of the content part that was truncated.""" 16 | 17 | event_id: str 18 | """The unique ID of the server event.""" 19 | 20 | item_id: str 21 | """The ID of the assistant message item that was truncated.""" 22 | 23 | type: Literal["conversation.item.truncated"] 24 | """The event type, must be `conversation.item.truncated`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_append_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["InputAudioBufferAppendEvent"] 9 | 10 | 11 | class InputAudioBufferAppendEvent(BaseModel): 12 | audio: str 13 | """Base64-encoded audio bytes. 14 | 15 | This must be in the format specified by the `input_audio_format` field in the 16 | session configuration. 17 | """ 18 | 19 | type: Literal["input_audio_buffer.append"] 20 | """The event type, must be `input_audio_buffer.append`.""" 21 | 22 | event_id: Optional[str] = None 23 | """Optional client-generated ID used to identify this event.""" 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_append_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["InputAudioBufferAppendEventParam"] 8 | 9 | 10 | class InputAudioBufferAppendEventParam(TypedDict, total=False): 11 | audio: Required[str] 12 | """Base64-encoded audio bytes. 13 | 14 | This must be in the format specified by the `input_audio_format` field in the 15 | session configuration. 16 | """ 17 | 18 | type: Required[Literal["input_audio_buffer.append"]] 19 | """The event type, must be `input_audio_buffer.append`.""" 20 | 21 | event_id: str 22 | """Optional client-generated ID used to identify this event.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_clear_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["InputAudioBufferClearEvent"] 9 | 10 | 11 | class InputAudioBufferClearEvent(BaseModel): 12 | type: Literal["input_audio_buffer.clear"] 13 | """The event type, must be `input_audio_buffer.clear`.""" 14 | 15 | event_id: Optional[str] = None 16 | """Optional client-generated ID used to identify this event.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_clear_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["InputAudioBufferClearEventParam"] 8 | 9 | 10 | class InputAudioBufferClearEventParam(TypedDict, total=False): 11 | type: Required[Literal["input_audio_buffer.clear"]] 12 | """The event type, must be `input_audio_buffer.clear`.""" 13 | 14 | event_id: str 15 | """Optional client-generated ID used to identify this event.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_cleared_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["InputAudioBufferClearedEvent"] 8 | 9 | 10 | class InputAudioBufferClearedEvent(BaseModel): 11 | event_id: str 12 | """The unique ID of the server event.""" 13 | 14 | type: Literal["input_audio_buffer.cleared"] 15 | """The event type, must be `input_audio_buffer.cleared`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_commit_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["InputAudioBufferCommitEvent"] 9 | 10 | 11 | class InputAudioBufferCommitEvent(BaseModel): 12 | type: Literal["input_audio_buffer.commit"] 13 | """The event type, must be `input_audio_buffer.commit`.""" 14 | 15 | event_id: Optional[str] = None 16 | """Optional client-generated ID used to identify this event.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_commit_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["InputAudioBufferCommitEventParam"] 8 | 9 | 10 | class InputAudioBufferCommitEventParam(TypedDict, total=False): 11 | type: Required[Literal["input_audio_buffer.commit"]] 12 | """The event type, must be `input_audio_buffer.commit`.""" 13 | 14 | event_id: str 15 | """Optional client-generated ID used to identify this event.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/input_audio_buffer_committed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["InputAudioBufferCommittedEvent"] 8 | 9 | 10 | class InputAudioBufferCommittedEvent(BaseModel): 11 | event_id: str 12 | """The unique ID of the server event.""" 13 | 14 | item_id: str 15 | """The ID of the user message item that will be created.""" 16 | 17 | previous_item_id: str 18 | """The ID of the preceding item after which the new item will be inserted.""" 19 | 20 | type: Literal["input_audio_buffer.committed"] 21 | """The event type, must be `input_audio_buffer.committed`.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/realtime_connect_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["RealtimeConnectParams"] 8 | 9 | 10 | class RealtimeConnectParams(TypedDict, total=False): 11 | model: Required[str] 12 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_audio_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["ResponseAudioDoneEvent"] 8 | 9 | 10 | class ResponseAudioDoneEvent(BaseModel): 11 | content_index: int 12 | """The index of the content part in the item's content array.""" 13 | 14 | event_id: str 15 | """The unique ID of the server event.""" 16 | 17 | item_id: str 18 | """The ID of the item.""" 19 | 20 | output_index: int 21 | """The index of the output item in the response.""" 22 | 23 | response_id: str 24 | """The ID of the response.""" 25 | 26 | type: Literal["response.audio.done"] 27 | """The event type, must be `response.audio.done`.""" 28 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_cancel_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ResponseCancelEvent"] 9 | 10 | 11 | class ResponseCancelEvent(BaseModel): 12 | type: Literal["response.cancel"] 13 | """The event type, must be `response.cancel`.""" 14 | 15 | event_id: Optional[str] = None 16 | """Optional client-generated ID used to identify this event.""" 17 | 18 | response_id: Optional[str] = None 19 | """ 20 | A specific response ID to cancel - if not provided, will cancel an in-progress 21 | response in the default conversation. 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_cancel_event_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseCancelEventParam"] 8 | 9 | 10 | class ResponseCancelEventParam(TypedDict, total=False): 11 | type: Required[Literal["response.cancel"]] 12 | """The event type, must be `response.cancel`.""" 13 | 14 | event_id: str 15 | """Optional client-generated ID used to identify this event.""" 16 | 17 | response_id: str 18 | """ 19 | A specific response ID to cancel - if not provided, will cancel an in-progress 20 | response in the default conversation. 21 | """ 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_created_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .realtime_response import RealtimeResponse 7 | 8 | __all__ = ["ResponseCreatedEvent"] 9 | 10 | 11 | class ResponseCreatedEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | response: RealtimeResponse 16 | """The response resource.""" 17 | 18 | type: Literal["response.created"] 19 | """The event type, must be `response.created`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .realtime_response import RealtimeResponse 7 | 8 | __all__ = ["ResponseDoneEvent"] 9 | 10 | 11 | class ResponseDoneEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | response: RealtimeResponse 16 | """The response resource.""" 17 | 18 | type: Literal["response.done"] 19 | """The event type, must be `response.done`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_output_item_added_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .conversation_item import ConversationItem 7 | 8 | __all__ = ["ResponseOutputItemAddedEvent"] 9 | 10 | 11 | class ResponseOutputItemAddedEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | item: ConversationItem 16 | """The item to add to the conversation.""" 17 | 18 | output_index: int 19 | """The index of the output item in the Response.""" 20 | 21 | response_id: str 22 | """The ID of the Response to which the item belongs.""" 23 | 24 | type: Literal["response.output_item.added"] 25 | """The event type, must be `response.output_item.added`.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/response_output_item_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .conversation_item import ConversationItem 7 | 8 | __all__ = ["ResponseOutputItemDoneEvent"] 9 | 10 | 11 | class ResponseOutputItemDoneEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | item: ConversationItem 16 | """The item to add to the conversation.""" 17 | 18 | output_index: int 19 | """The index of the output item in the Response.""" 20 | 21 | response_id: str 22 | """The ID of the Response to which the item belongs.""" 23 | 24 | type: Literal["response.output_item.done"] 25 | """The event type, must be `response.output_item.done`.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/session_created_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .session import Session 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["SessionCreatedEvent"] 9 | 10 | 11 | class SessionCreatedEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | session: Session 16 | """Realtime session object configuration.""" 17 | 18 | type: Literal["session.created"] 19 | """The event type, must be `session.created`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/realtime/session_updated_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .session import Session 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["SessionUpdatedEvent"] 9 | 10 | 11 | class SessionUpdatedEvent(BaseModel): 12 | event_id: str 13 | """The unique ID of the server event.""" 14 | 15 | session: Session 16 | """Realtime session object configuration.""" 17 | 18 | type: Literal["session.updated"] 19 | """The event type, must be `session.updated`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/thread_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ThreadDeleted"] 8 | 9 | 10 | class ThreadDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["thread.deleted"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/annotation.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ...._utils import PropertyInfo 7 | from .file_path_annotation import FilePathAnnotation 8 | from .file_citation_annotation import FileCitationAnnotation 9 | 10 | __all__ = ["Annotation"] 11 | 12 | Annotation: TypeAlias = Annotated[Union[FileCitationAnnotation, FilePathAnnotation], PropertyInfo(discriminator="type")] 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/annotation_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ...._utils import PropertyInfo 7 | from .file_path_delta_annotation import FilePathDeltaAnnotation 8 | from .file_citation_delta_annotation import FileCitationDeltaAnnotation 9 | 10 | __all__ = ["AnnotationDelta"] 11 | 12 | AnnotationDelta: TypeAlias = Annotated[ 13 | Union[FileCitationDeltaAnnotation, FilePathDeltaAnnotation], PropertyInfo(discriminator="type") 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/file_citation_annotation.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["FileCitationAnnotation", "FileCitation"] 8 | 9 | 10 | class FileCitation(BaseModel): 11 | file_id: str 12 | """The ID of the specific File the citation is from.""" 13 | 14 | 15 | class FileCitationAnnotation(BaseModel): 16 | end_index: int 17 | 18 | file_citation: FileCitation 19 | 20 | start_index: int 21 | 22 | text: str 23 | """The text in the message content that needs to be replaced.""" 24 | 25 | type: Literal["file_citation"] 26 | """Always `file_citation`.""" 27 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/file_path_annotation.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["FilePathAnnotation", "FilePath"] 8 | 9 | 10 | class FilePath(BaseModel): 11 | file_id: str 12 | """The ID of the file that was generated.""" 13 | 14 | 15 | class FilePathAnnotation(BaseModel): 16 | end_index: int 17 | 18 | file_path: FilePath 19 | 20 | start_index: int 21 | 22 | text: str 23 | """The text in the message content that needs to be replaced.""" 24 | 25 | type: Literal["file_path"] 26 | """Always `file_path`.""" 27 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ImageFile"] 9 | 10 | 11 | class ImageFile(BaseModel): 12 | file_id: str 13 | """ 14 | The [File](https://platform.openai.com/docs/api-reference/files) ID of the image 15 | in the message content. Set `purpose="vision"` when uploading the File if you 16 | need to later display the file content. 17 | """ 18 | 19 | detail: Optional[Literal["auto", "low", "high"]] = None 20 | """Specifies the detail level of the image if specified by the user. 21 | 22 | `low` uses fewer tokens, you can opt in to high resolution using `high`. 23 | """ 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file_content_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .image_file import ImageFile 7 | 8 | __all__ = ["ImageFileContentBlock"] 9 | 10 | 11 | class ImageFileContentBlock(BaseModel): 12 | image_file: ImageFile 13 | 14 | type: Literal["image_file"] 15 | """Always `image_file`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file_content_block_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .image_file_param import ImageFileParam 8 | 9 | __all__ = ["ImageFileContentBlockParam"] 10 | 11 | 12 | class ImageFileContentBlockParam(TypedDict, total=False): 13 | image_file: Required[ImageFileParam] 14 | 15 | type: Required[Literal["image_file"]] 16 | """Always `image_file`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ImageFileDelta"] 9 | 10 | 11 | class ImageFileDelta(BaseModel): 12 | detail: Optional[Literal["auto", "low", "high"]] = None 13 | """Specifies the detail level of the image if specified by the user. 14 | 15 | `low` uses fewer tokens, you can opt in to high resolution using `high`. 16 | """ 17 | 18 | file_id: Optional[str] = None 19 | """ 20 | The [File](https://platform.openai.com/docs/api-reference/files) ID of the image 21 | in the message content. Set `purpose="vision"` when uploading the File if you 22 | need to later display the file content. 23 | """ 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file_delta_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | from .image_file_delta import ImageFileDelta 8 | 9 | __all__ = ["ImageFileDeltaBlock"] 10 | 11 | 12 | class ImageFileDeltaBlock(BaseModel): 13 | index: int 14 | """The index of the content part in the message.""" 15 | 16 | type: Literal["image_file"] 17 | """Always `image_file`.""" 18 | 19 | image_file: Optional[ImageFileDelta] = None 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_file_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ImageFileParam"] 8 | 9 | 10 | class ImageFileParam(TypedDict, total=False): 11 | file_id: Required[str] 12 | """ 13 | The [File](https://platform.openai.com/docs/api-reference/files) ID of the image 14 | in the message content. Set `purpose="vision"` when uploading the File if you 15 | need to later display the file content. 16 | """ 17 | 18 | detail: Literal["auto", "low", "high"] 19 | """Specifies the detail level of the image if specified by the user. 20 | 21 | `low` uses fewer tokens, you can opt in to high resolution using `high`. 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ImageURL"] 9 | 10 | 11 | class ImageURL(BaseModel): 12 | url: str 13 | """ 14 | The external URL of the image, must be a supported image types: jpeg, jpg, png, 15 | gif, webp. 16 | """ 17 | 18 | detail: Optional[Literal["auto", "low", "high"]] = None 19 | """Specifies the detail level of the image. 20 | 21 | `low` uses fewer tokens, you can opt in to high resolution using `high`. Default 22 | value is `auto` 23 | """ 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url_content_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .image_url import ImageURL 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ImageURLContentBlock"] 9 | 10 | 11 | class ImageURLContentBlock(BaseModel): 12 | image_url: ImageURL 13 | 14 | type: Literal["image_url"] 15 | """The type of the content part.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url_content_block_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .image_url_param import ImageURLParam 8 | 9 | __all__ = ["ImageURLContentBlockParam"] 10 | 11 | 12 | class ImageURLContentBlockParam(TypedDict, total=False): 13 | image_url: Required[ImageURLParam] 14 | 15 | type: Required[Literal["image_url"]] 16 | """The type of the content part.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["ImageURLDelta"] 9 | 10 | 11 | class ImageURLDelta(BaseModel): 12 | detail: Optional[Literal["auto", "low", "high"]] = None 13 | """Specifies the detail level of the image. 14 | 15 | `low` uses fewer tokens, you can opt in to high resolution using `high`. 16 | """ 17 | 18 | url: Optional[str] = None 19 | """ 20 | The URL of the image, must be a supported image types: jpeg, jpg, png, gif, 21 | webp. 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url_delta_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | from .image_url_delta import ImageURLDelta 8 | 9 | __all__ = ["ImageURLDeltaBlock"] 10 | 11 | 12 | class ImageURLDeltaBlock(BaseModel): 13 | index: int 14 | """The index of the content part in the message.""" 15 | 16 | type: Literal["image_url"] 17 | """Always `image_url`.""" 18 | 19 | image_url: Optional[ImageURLDelta] = None 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/image_url_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ImageURLParam"] 8 | 9 | 10 | class ImageURLParam(TypedDict, total=False): 11 | url: Required[str] 12 | """ 13 | The external URL of the image, must be a supported image types: jpeg, jpg, png, 14 | gif, webp. 15 | """ 16 | 17 | detail: Literal["auto", "low", "high"] 18 | """Specifies the detail level of the image. 19 | 20 | `low` uses fewer tokens, you can opt in to high resolution using `high`. Default 21 | value is `auto` 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_content.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ...._utils import PropertyInfo 7 | from .text_content_block import TextContentBlock 8 | from .refusal_content_block import RefusalContentBlock 9 | from .image_url_content_block import ImageURLContentBlock 10 | from .image_file_content_block import ImageFileContentBlock 11 | 12 | __all__ = ["MessageContent"] 13 | 14 | 15 | MessageContent: TypeAlias = Annotated[ 16 | Union[ImageFileContentBlock, ImageURLContentBlock, TextContentBlock, RefusalContentBlock], 17 | PropertyInfo(discriminator="type"), 18 | ] 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_content_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ...._utils import PropertyInfo 7 | from .text_delta_block import TextDeltaBlock 8 | from .refusal_delta_block import RefusalDeltaBlock 9 | from .image_url_delta_block import ImageURLDeltaBlock 10 | from .image_file_delta_block import ImageFileDeltaBlock 11 | 12 | __all__ = ["MessageContentDelta"] 13 | 14 | MessageContentDelta: TypeAlias = Annotated[ 15 | Union[ImageFileDeltaBlock, TextDeltaBlock, RefusalDeltaBlock, ImageURLDeltaBlock], 16 | PropertyInfo(discriminator="type"), 17 | ] 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_content_part_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .text_content_block_param import TextContentBlockParam 9 | from .image_url_content_block_param import ImageURLContentBlockParam 10 | from .image_file_content_block_param import ImageFileContentBlockParam 11 | 12 | __all__ = ["MessageContentPartParam"] 13 | 14 | MessageContentPartParam: TypeAlias = Union[ImageFileContentBlockParam, ImageURLContentBlockParam, TextContentBlockParam] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["MessageDeleted"] 8 | 9 | 10 | class MessageDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["thread.message.deleted"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | from .message_content_delta import MessageContentDelta 8 | 9 | __all__ = ["MessageDelta"] 10 | 11 | 12 | class MessageDelta(BaseModel): 13 | content: Optional[List[MessageContentDelta]] = None 14 | """The content of the message in array of text and/or images.""" 15 | 16 | role: Optional[Literal["user", "assistant"]] = None 17 | """The entity that produced the message. One of `user` or `assistant`.""" 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/message_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | from .message_delta import MessageDelta 7 | 8 | __all__ = ["MessageDeltaEvent"] 9 | 10 | 11 | class MessageDeltaEvent(BaseModel): 12 | id: str 13 | """The identifier of the message, which can be referenced in API endpoints.""" 14 | 15 | delta: MessageDelta 16 | """The delta containing the fields that have changed on the Message.""" 17 | 18 | object: Literal["thread.message.delta"] 19 | """The object type, which is always `thread.message.delta`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/refusal_content_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["RefusalContentBlock"] 8 | 9 | 10 | class RefusalContentBlock(BaseModel): 11 | refusal: str 12 | 13 | type: Literal["refusal"] 14 | """Always `refusal`.""" 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/refusal_delta_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["RefusalDeltaBlock"] 9 | 10 | 11 | class RefusalDeltaBlock(BaseModel): 12 | index: int 13 | """The index of the refusal part in the message.""" 14 | 15 | type: Literal["refusal"] 16 | """Always `refusal`.""" 17 | 18 | refusal: Optional[str] = None 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/run_status.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["RunStatus"] 6 | 7 | RunStatus: TypeAlias = Literal[ 8 | "queued", 9 | "in_progress", 10 | "requires_action", 11 | "cancelling", 12 | "cancelled", 13 | "failed", 14 | "completed", 15 | "incomplete", 16 | "expired", 17 | ] 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/run_update_params.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import Required, TypedDict 7 | 8 | from ...shared_params.metadata import Metadata 9 | 10 | __all__ = ["RunUpdateParams"] 11 | 12 | 13 | class RunUpdateParams(TypedDict, total=False): 14 | thread_id: Required[str] 15 | 16 | metadata: Optional[Metadata] 17 | """Set of 16 key-value pairs that can be attached to an object. 18 | 19 | This can be useful for storing additional information about the object in a 20 | structured format, and querying for objects via API or the dashboard. 21 | 22 | Keys are strings with a maximum length of 64 characters. Values are strings with 23 | a maximum length of 512 characters. 24 | """ 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/code_interpreter_logs.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ....._models import BaseModel 7 | 8 | __all__ = ["CodeInterpreterLogs"] 9 | 10 | 11 | class CodeInterpreterLogs(BaseModel): 12 | index: int 13 | """The index of the output in the outputs array.""" 14 | 15 | type: Literal["logs"] 16 | """Always `logs`.""" 17 | 18 | logs: Optional[str] = None 19 | """The text output from the Code Interpreter tool call.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/code_interpreter_output_image.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ....._models import BaseModel 7 | 8 | __all__ = ["CodeInterpreterOutputImage", "Image"] 9 | 10 | 11 | class Image(BaseModel): 12 | file_id: Optional[str] = None 13 | """ 14 | The [file](https://platform.openai.com/docs/api-reference/files) ID of the 15 | image. 16 | """ 17 | 18 | 19 | class CodeInterpreterOutputImage(BaseModel): 20 | index: int 21 | """The index of the output in the outputs array.""" 22 | 23 | type: Literal["image"] 24 | """Always `image`.""" 25 | 26 | image: Optional[Image] = None 27 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/file_search_tool_call_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ....._models import BaseModel 7 | 8 | __all__ = ["FileSearchToolCallDelta"] 9 | 10 | 11 | class FileSearchToolCallDelta(BaseModel): 12 | file_search: object 13 | """For now, this is always going to be an empty object.""" 14 | 15 | index: int 16 | """The index of the tool call in the tool calls array.""" 17 | 18 | type: Literal["file_search"] 19 | """The type of tool call. 20 | 21 | This is always going to be `file_search` for this type of tool call. 22 | """ 23 | 24 | id: Optional[str] = None 25 | """The ID of the tool call object.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/message_creation_step_details.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ....._models import BaseModel 6 | 7 | __all__ = ["MessageCreationStepDetails", "MessageCreation"] 8 | 9 | 10 | class MessageCreation(BaseModel): 11 | message_id: str 12 | """The ID of the message that was created by this run step.""" 13 | 14 | 15 | class MessageCreationStepDetails(BaseModel): 16 | message_creation: MessageCreation 17 | 18 | type: Literal["message_creation"] 19 | """Always `message_creation`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/run_step_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union, Optional 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ....._utils import PropertyInfo 7 | from ....._models import BaseModel 8 | from .tool_call_delta_object import ToolCallDeltaObject 9 | from .run_step_delta_message_delta import RunStepDeltaMessageDelta 10 | 11 | __all__ = ["RunStepDelta", "StepDetails"] 12 | 13 | StepDetails: TypeAlias = Annotated[ 14 | Union[RunStepDeltaMessageDelta, ToolCallDeltaObject], PropertyInfo(discriminator="type") 15 | ] 16 | 17 | 18 | class RunStepDelta(BaseModel): 19 | step_details: Optional[StepDetails] = None 20 | """The details of the run step.""" 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/run_step_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ....._models import BaseModel 6 | from .run_step_delta import RunStepDelta 7 | 8 | __all__ = ["RunStepDeltaEvent"] 9 | 10 | 11 | class RunStepDeltaEvent(BaseModel): 12 | id: str 13 | """The identifier of the run step, which can be referenced in API endpoints.""" 14 | 15 | delta: RunStepDelta 16 | """The delta containing the fields that have changed on the run step.""" 17 | 18 | object: Literal["thread.run.step.delta"] 19 | """The object type, which is always `thread.run.step.delta`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/run_step_delta_message_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ....._models import BaseModel 7 | 8 | __all__ = ["RunStepDeltaMessageDelta", "MessageCreation"] 9 | 10 | 11 | class MessageCreation(BaseModel): 12 | message_id: Optional[str] = None 13 | """The ID of the message that was created by this run step.""" 14 | 15 | 16 | class RunStepDeltaMessageDelta(BaseModel): 17 | type: Literal["message_creation"] 18 | """Always `message_creation`.""" 19 | 20 | message_creation: Optional[MessageCreation] = None 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/run_step_include.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["RunStepInclude"] 6 | 7 | RunStepInclude: TypeAlias = Literal["step_details.tool_calls[*].file_search.results[*].content"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/tool_call.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ....._utils import PropertyInfo 7 | from .function_tool_call import FunctionToolCall 8 | from .file_search_tool_call import FileSearchToolCall 9 | from .code_interpreter_tool_call import CodeInterpreterToolCall 10 | 11 | __all__ = ["ToolCall"] 12 | 13 | ToolCall: TypeAlias = Annotated[ 14 | Union[CodeInterpreterToolCall, FileSearchToolCall, FunctionToolCall], PropertyInfo(discriminator="type") 15 | ] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/tool_call_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ....._utils import PropertyInfo 7 | from .function_tool_call_delta import FunctionToolCallDelta 8 | from .file_search_tool_call_delta import FileSearchToolCallDelta 9 | from .code_interpreter_tool_call_delta import CodeInterpreterToolCallDelta 10 | 11 | __all__ = ["ToolCallDelta"] 12 | 13 | ToolCallDelta: TypeAlias = Annotated[ 14 | Union[CodeInterpreterToolCallDelta, FileSearchToolCallDelta, FunctionToolCallDelta], 15 | PropertyInfo(discriminator="type"), 16 | ] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/tool_call_delta_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | from typing_extensions import Literal 5 | 6 | from ....._models import BaseModel 7 | from .tool_call_delta import ToolCallDelta 8 | 9 | __all__ = ["ToolCallDeltaObject"] 10 | 11 | 12 | class ToolCallDeltaObject(BaseModel): 13 | type: Literal["tool_calls"] 14 | """Always `tool_calls`.""" 15 | 16 | tool_calls: Optional[List[ToolCallDelta]] = None 17 | """An array of tool calls the run step was involved in. 18 | 19 | These can be associated with one of three types of tools: `code_interpreter`, 20 | `file_search`, or `function`. 21 | """ 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/runs/tool_calls_step_details.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from typing_extensions import Literal 5 | 6 | from .tool_call import ToolCall 7 | from ....._models import BaseModel 8 | 9 | __all__ = ["ToolCallsStepDetails"] 10 | 11 | 12 | class ToolCallsStepDetails(BaseModel): 13 | tool_calls: List[ToolCall] 14 | """An array of tool calls the run step was involved in. 15 | 16 | These can be associated with one of three types of tools: `code_interpreter`, 17 | `file_search`, or `function`. 18 | """ 19 | 20 | type: Literal["tool_calls"] 21 | """Always `tool_calls`.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/text.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from ...._models import BaseModel 6 | from .annotation import Annotation 7 | 8 | __all__ = ["Text"] 9 | 10 | 11 | class Text(BaseModel): 12 | annotations: List[Annotation] 13 | 14 | value: str 15 | """The data that makes up the text.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/text_content_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .text import Text 6 | from ...._models import BaseModel 7 | 8 | __all__ = ["TextContentBlock"] 9 | 10 | 11 | class TextContentBlock(BaseModel): 12 | text: Text 13 | 14 | type: Literal["text"] 15 | """Always `text`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/text_content_block_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["TextContentBlockParam"] 8 | 9 | 10 | class TextContentBlockParam(TypedDict, total=False): 11 | text: Required[str] 12 | """Text content to be sent to the model""" 13 | 14 | type: Required[Literal["text"]] 15 | """Always `text`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/text_delta.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | 5 | from ...._models import BaseModel 6 | from .annotation_delta import AnnotationDelta 7 | 8 | __all__ = ["TextDelta"] 9 | 10 | 11 | class TextDelta(BaseModel): 12 | annotations: Optional[List[AnnotationDelta]] = None 13 | 14 | value: Optional[str] = None 15 | """The data that makes up the text.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/beta/threads/text_delta_block.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ...._models import BaseModel 7 | from .text_delta import TextDelta 8 | 9 | __all__ = ["TextDeltaBlock"] 10 | 11 | 12 | class TextDeltaBlock(BaseModel): 13 | index: int 14 | """The index of the content part in the message.""" 15 | 16 | type: Literal["text"] 17 | """Always `text`.""" 18 | 19 | text: Optional[TextDelta] = None 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_audio.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["ChatCompletionAudio"] 6 | 7 | 8 | class ChatCompletionAudio(BaseModel): 9 | id: str 10 | """Unique identifier for this audio response.""" 11 | 12 | data: str 13 | """ 14 | Base64 encoded audio bytes generated by the model, in the format specified in 15 | the request. 16 | """ 17 | 18 | expires_at: int 19 | """ 20 | The Unix timestamp (in seconds) for when this audio response will no longer be 21 | accessible on the server for use in multi-turn conversations. 22 | """ 23 | 24 | transcript: str 25 | """Transcript of the audio generated by the model.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_content_part_input_audio_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ChatCompletionContentPartInputAudioParam", "InputAudio"] 8 | 9 | 10 | class InputAudio(TypedDict, total=False): 11 | data: Required[str] 12 | """Base64 encoded audio data.""" 13 | 14 | format: Required[Literal["wav", "mp3"]] 15 | """The format of the encoded audio data. Currently supports "wav" and "mp3".""" 16 | 17 | 18 | class ChatCompletionContentPartInputAudioParam(TypedDict, total=False): 19 | input_audio: Required[InputAudio] 20 | 21 | type: Required[Literal["input_audio"]] 22 | """The type of the content part. Always `input_audio`.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_content_part_refusal_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ChatCompletionContentPartRefusalParam"] 8 | 9 | 10 | class ChatCompletionContentPartRefusalParam(TypedDict, total=False): 11 | refusal: Required[str] 12 | """The refusal message generated by the model.""" 13 | 14 | type: Required[Literal["refusal"]] 15 | """The type of the content part.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_content_part_text_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ChatCompletionContentPartTextParam"] 8 | 9 | 10 | class ChatCompletionContentPartTextParam(TypedDict, total=False): 11 | text: Required[str] 12 | """The text content.""" 13 | 14 | type: Required[Literal["text"]] 15 | """The type of the content part.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ChatCompletionDeleted"] 8 | 9 | 10 | class ChatCompletionDeleted(BaseModel): 11 | id: str 12 | """The ID of the chat completion that was deleted.""" 13 | 14 | deleted: bool 15 | """Whether the chat completion was deleted.""" 16 | 17 | object: Literal["chat.completion.deleted"] 18 | """The type of object being deleted.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_function_call_option_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["ChatCompletionFunctionCallOptionParam"] 8 | 9 | 10 | class ChatCompletionFunctionCallOptionParam(TypedDict, total=False): 11 | name: Required[str] 12 | """The name of the function to call.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_function_message_param.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import Literal, Required, TypedDict 7 | 8 | __all__ = ["ChatCompletionFunctionMessageParam"] 9 | 10 | 11 | class ChatCompletionFunctionMessageParam(TypedDict, total=False): 12 | content: Required[Optional[str]] 13 | """The contents of the function message.""" 14 | 15 | name: Required[str] 16 | """The name of the function to call.""" 17 | 18 | role: Required[Literal["function"]] 19 | """The role of the messages author, in this case `function`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_modality.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ChatCompletionModality"] 6 | 7 | ChatCompletionModality: TypeAlias = Literal["text", "audio"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_named_tool_choice_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ChatCompletionNamedToolChoiceParam", "Function"] 8 | 9 | 10 | class Function(TypedDict, total=False): 11 | name: Required[str] 12 | """The name of the function to call.""" 13 | 14 | 15 | class ChatCompletionNamedToolChoiceParam(TypedDict, total=False): 16 | function: Required[Function] 17 | 18 | type: Required[Literal["function"]] 19 | """The type of the tool. Currently, only `function` is supported.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_reasoning_effort.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..shared.reasoning_effort import ReasoningEffort 4 | 5 | __all__ = ["ChatCompletionReasoningEffort"] 6 | 7 | ChatCompletionReasoningEffort = ReasoningEffort 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_role.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ChatCompletionRole"] 6 | 7 | ChatCompletionRole: TypeAlias = Literal["developer", "system", "user", "assistant", "tool", "function"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_store_message.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .chat_completion_message import ChatCompletionMessage 4 | 5 | __all__ = ["ChatCompletionStoreMessage"] 6 | 7 | 8 | class ChatCompletionStoreMessage(ChatCompletionMessage): 9 | id: str 10 | """The identifier of the chat message.""" 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_tool_choice_option_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import Literal, TypeAlias 7 | 8 | from .chat_completion_named_tool_choice_param import ChatCompletionNamedToolChoiceParam 9 | 10 | __all__ = ["ChatCompletionToolChoiceOptionParam"] 11 | 12 | ChatCompletionToolChoiceOptionParam: TypeAlias = Union[ 13 | Literal["none", "auto", "required"], ChatCompletionNamedToolChoiceParam 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_tool_message_param.py: -------------------------------------------------------------------------------- 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 Union, Iterable 6 | from typing_extensions import Literal, Required, TypedDict 7 | 8 | from .chat_completion_content_part_text_param import ChatCompletionContentPartTextParam 9 | 10 | __all__ = ["ChatCompletionToolMessageParam"] 11 | 12 | 13 | class ChatCompletionToolMessageParam(TypedDict, total=False): 14 | content: Required[Union[str, Iterable[ChatCompletionContentPartTextParam]]] 15 | """The contents of the tool message.""" 16 | 17 | role: Required[Literal["tool"]] 18 | """The role of the messages author, in this case `tool`.""" 19 | 20 | tool_call_id: Required[str] 21 | """Tool call that this message is responding to.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/chat_completion_tool_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from ..shared_params.function_definition import FunctionDefinition 8 | 9 | __all__ = ["ChatCompletionToolParam"] 10 | 11 | 12 | class ChatCompletionToolParam(TypedDict, total=False): 13 | function: Required[FunctionDefinition] 14 | 15 | type: Required[Literal["function"]] 16 | """The type of the tool. Currently, only `function` is supported.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/completion_update_params.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import Required, TypedDict 7 | 8 | from ..shared_params.metadata import Metadata 9 | 10 | __all__ = ["CompletionUpdateParams"] 11 | 12 | 13 | class CompletionUpdateParams(TypedDict, total=False): 14 | metadata: Required[Optional[Metadata]] 15 | """Set of 16 key-value pairs that can be attached to an object. 16 | 17 | This can be useful for storing additional information about the object in a 18 | structured format, and querying for objects via API or the dashboard. 19 | 20 | Keys are strings with a maximum length of 64 characters. Values are strings with 21 | a maximum length of 512 characters. 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/completions/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .message_list_params import MessageListParams as MessageListParams 6 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat/completions/message_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["MessageListParams"] 8 | 9 | 10 | class MessageListParams(TypedDict, total=False): 11 | after: str 12 | """Identifier for the last message from the previous pagination request.""" 13 | 14 | limit: int 15 | """Number of messages to retrieve.""" 16 | 17 | order: Literal["asc", "desc"] 18 | """Sort order for messages by timestamp. 19 | 20 | Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. 21 | """ 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/chat_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .shared import chat_model 4 | 5 | __all__ = ["ChatModel"] 6 | 7 | ChatModel = chat_model.ChatModel 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/embedding.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from typing_extensions import Literal 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["Embedding"] 9 | 10 | 11 | class Embedding(BaseModel): 12 | embedding: List[float] 13 | """The embedding vector, which is a list of floats. 14 | 15 | The length of vector depends on the model as listed in the 16 | [embedding guide](https://platform.openai.com/docs/guides/embeddings). 17 | """ 18 | 19 | index: int 20 | """The index of the embedding in the list of embeddings.""" 21 | 22 | object: Literal["embedding"] 23 | """The object type, which is always "embedding".""" 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/embedding_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["EmbeddingModel"] 6 | 7 | EmbeddingModel: TypeAlias = Literal["text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/eval_custom_data_source_config.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Dict 4 | from typing_extensions import Literal 5 | 6 | from pydantic import Field as FieldInfo 7 | 8 | from .._models import BaseModel 9 | 10 | __all__ = ["EvalCustomDataSourceConfig"] 11 | 12 | 13 | class EvalCustomDataSourceConfig(BaseModel): 14 | schema_: Dict[str, object] = FieldInfo(alias="schema") 15 | """ 16 | The json schema for the run data source items. Learn how to build JSON schemas 17 | [here](https://json-schema.org/). 18 | """ 19 | 20 | type: Literal["custom"] 21 | """The type of data source. Always `custom`.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/eval_delete_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .._models import BaseModel 4 | 5 | __all__ = ["EvalDeleteResponse"] 6 | 7 | 8 | class EvalDeleteResponse(BaseModel): 9 | deleted: bool 10 | 11 | eval_id: str 12 | 13 | object: str 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/eval_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["EvalListParams"] 8 | 9 | 10 | class EvalListParams(TypedDict, total=False): 11 | after: str 12 | """Identifier for the last eval from the previous pagination request.""" 13 | 14 | limit: int 15 | """Number of evals to retrieve.""" 16 | 17 | order: Literal["asc", "desc"] 18 | """Sort order for evals by timestamp. 19 | 20 | Use `asc` for ascending order or `desc` for descending order. 21 | """ 22 | 23 | order_by: Literal["created_at", "updated_at"] 24 | """Evals can be ordered by creation time or last updated time. 25 | 26 | Use `created_at` for creation time or `updated_at` for last updated time. 27 | """ 28 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/eval_update_params.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import TypedDict 7 | 8 | from .shared_params.metadata import Metadata 9 | 10 | __all__ = ["EvalUpdateParams"] 11 | 12 | 13 | class EvalUpdateParams(TypedDict, total=False): 14 | metadata: Optional[Metadata] 15 | """Set of 16 key-value pairs that can be attached to an object. 16 | 17 | This can be useful for storing additional information about the object in a 18 | structured format, and querying for objects via API or the dashboard. 19 | 20 | Keys are strings with a maximum length of 64 characters. Values are strings with 21 | a maximum length of 512 characters. 22 | """ 23 | 24 | name: str 25 | """Rename the evaluation.""" 26 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/evals/eval_api_error.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["EvalAPIError"] 6 | 7 | 8 | class EvalAPIError(BaseModel): 9 | code: str 10 | """The error code.""" 11 | 12 | message: str 13 | """The error message.""" 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/evals/run_delete_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["RunDeleteResponse"] 8 | 9 | 10 | class RunDeleteResponse(BaseModel): 11 | deleted: Optional[bool] = None 12 | 13 | object: Optional[str] = None 14 | 15 | run_id: Optional[str] = None 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/evals/runs/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .output_item_list_params import OutputItemListParams as OutputItemListParams 6 | from .output_item_list_response import OutputItemListResponse as OutputItemListResponse 7 | from .output_item_retrieve_response import OutputItemRetrieveResponse as OutputItemRetrieveResponse 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/file_chunking_strategy.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from .._utils import PropertyInfo 7 | from .other_file_chunking_strategy_object import OtherFileChunkingStrategyObject 8 | from .static_file_chunking_strategy_object import StaticFileChunkingStrategyObject 9 | 10 | __all__ = ["FileChunkingStrategy"] 11 | 12 | FileChunkingStrategy: TypeAlias = Annotated[ 13 | Union[StaticFileChunkingStrategyObject, OtherFileChunkingStrategyObject], PropertyInfo(discriminator="type") 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/file_chunking_strategy_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .auto_file_chunking_strategy_param import AutoFileChunkingStrategyParam 9 | from .static_file_chunking_strategy_object_param import StaticFileChunkingStrategyObjectParam 10 | 11 | __all__ = ["FileChunkingStrategyParam"] 12 | 13 | FileChunkingStrategyParam: TypeAlias = Union[AutoFileChunkingStrategyParam, StaticFileChunkingStrategyObjectParam] 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/file_content.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import TypeAlias 4 | 5 | __all__ = ["FileContent"] 6 | 7 | FileContent: TypeAlias = str 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/file_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["FileDeleted"] 8 | 9 | 10 | class FileDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["file"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/file_purpose.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["FilePurpose"] 6 | 7 | FilePurpose: TypeAlias = Literal["assistants", "batch", "fine-tune", "vision", "user_data", "evals"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/alpha/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .grader_run_params import GraderRunParams as GraderRunParams 6 | from .grader_run_response import GraderRunResponse as GraderRunResponse 7 | from .grader_validate_params import GraderValidateParams as GraderValidateParams 8 | from .grader_validate_response import GraderValidateResponse as GraderValidateResponse 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/checkpoints/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .permission_create_params import PermissionCreateParams as PermissionCreateParams 6 | from .permission_create_response import PermissionCreateResponse as PermissionCreateResponse 7 | from .permission_delete_response import PermissionDeleteResponse as PermissionDeleteResponse 8 | from .permission_retrieve_params import PermissionRetrieveParams as PermissionRetrieveParams 9 | from .permission_retrieve_response import PermissionRetrieveResponse as PermissionRetrieveResponse 10 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/checkpoints/permission_create_params.py: -------------------------------------------------------------------------------- 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 List 6 | from typing_extensions import Required, TypedDict 7 | 8 | __all__ = ["PermissionCreateParams"] 9 | 10 | 11 | class PermissionCreateParams(TypedDict, total=False): 12 | project_ids: Required[List[str]] 13 | """The project identifiers to grant access to.""" 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/checkpoints/permission_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["PermissionCreateResponse"] 8 | 9 | 10 | class PermissionCreateResponse(BaseModel): 11 | id: str 12 | """The permission identifier, which can be referenced in the API endpoints.""" 13 | 14 | created_at: int 15 | """The Unix timestamp (in seconds) for when the permission was created.""" 16 | 17 | object: Literal["checkpoint.permission"] 18 | """The object type, which is always "checkpoint.permission".""" 19 | 20 | project_id: str 21 | """The project identifier that the permission is for.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/checkpoints/permission_delete_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["PermissionDeleteResponse"] 8 | 9 | 10 | class PermissionDeleteResponse(BaseModel): 11 | id: str 12 | """The ID of the fine-tuned model checkpoint permission that was deleted.""" 13 | 14 | deleted: bool 15 | """Whether the fine-tuned model checkpoint permission was successfully deleted.""" 16 | 17 | object: Literal["checkpoint.permission"] 18 | """The object type, which is always "checkpoint.permission".""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/checkpoints/permission_retrieve_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["PermissionRetrieveParams"] 8 | 9 | 10 | class PermissionRetrieveParams(TypedDict, total=False): 11 | after: str 12 | """Identifier for the last permission ID from the previous pagination request.""" 13 | 14 | limit: int 15 | """Number of permissions to retrieve.""" 16 | 17 | order: Literal["ascending", "descending"] 18 | """The order in which to retrieve permissions.""" 19 | 20 | project_id: str 21 | """The ID of the project to get permissions for.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/dpo_method.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | from .dpo_hyperparameters import DpoHyperparameters 7 | 8 | __all__ = ["DpoMethod"] 9 | 10 | 11 | class DpoMethod(BaseModel): 12 | hyperparameters: Optional[DpoHyperparameters] = None 13 | """The hyperparameters used for the DPO fine-tuning job.""" 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/dpo_method_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | from .dpo_hyperparameters_param import DpoHyperparametersParam 8 | 9 | __all__ = ["DpoMethodParam"] 10 | 11 | 12 | class DpoMethodParam(TypedDict, total=False): 13 | hyperparameters: DpoHyperparametersParam 14 | """The hyperparameters used for the DPO fine-tuning job.""" 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/fine_tuning_job_integration.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .fine_tuning_job_wandb_integration_object import FineTuningJobWandbIntegrationObject 4 | 5 | FineTuningJobIntegration = FineTuningJobWandbIntegrationObject 6 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/job_list_events_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["JobListEventsParams"] 8 | 9 | 10 | class JobListEventsParams(TypedDict, total=False): 11 | after: str 12 | """Identifier for the last event from the previous pagination request.""" 13 | 14 | limit: int 15 | """Number of events to retrieve.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/job_list_params.py: -------------------------------------------------------------------------------- 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, Optional 6 | from typing_extensions import TypedDict 7 | 8 | __all__ = ["JobListParams"] 9 | 10 | 11 | class JobListParams(TypedDict, total=False): 12 | after: str 13 | """Identifier for the last job from the previous pagination request.""" 14 | 15 | limit: int 16 | """Number of fine-tuning jobs to retrieve.""" 17 | 18 | metadata: Optional[Dict[str, str]] 19 | """Optional metadata filter. 20 | 21 | To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to 22 | indicate no metadata. 23 | """ 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/jobs/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .checkpoint_list_params import CheckpointListParams as CheckpointListParams 6 | from .fine_tuning_job_checkpoint import FineTuningJobCheckpoint as FineTuningJobCheckpoint 7 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/jobs/checkpoint_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["CheckpointListParams"] 8 | 9 | 10 | class CheckpointListParams(TypedDict, total=False): 11 | after: str 12 | """Identifier for the last checkpoint ID from the previous pagination request.""" 13 | 14 | limit: int 15 | """Number of checkpoints to retrieve.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/supervised_method.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | from .supervised_hyperparameters import SupervisedHyperparameters 7 | 8 | __all__ = ["SupervisedMethod"] 9 | 10 | 11 | class SupervisedMethod(BaseModel): 12 | hyperparameters: Optional[SupervisedHyperparameters] = None 13 | """The hyperparameters used for the fine-tuning job.""" 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/fine_tuning/supervised_method_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | from .supervised_hyperparameters_param import SupervisedHyperparametersParam 8 | 9 | __all__ = ["SupervisedMethodParam"] 10 | 11 | 12 | class SupervisedMethodParam(TypedDict, total=False): 13 | hyperparameters: SupervisedHyperparametersParam 14 | """The hyperparameters used for the fine-tuning job.""" 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/graders/python_grader.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["PythonGrader"] 9 | 10 | 11 | class PythonGrader(BaseModel): 12 | name: str 13 | """The name of the grader.""" 14 | 15 | source: str 16 | """The source code of the python script.""" 17 | 18 | type: Literal["python"] 19 | """The object type, which is always `python`.""" 20 | 21 | image_tag: Optional[str] = None 22 | """The image tag to use for the python script.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/graders/python_grader_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["PythonGraderParam"] 8 | 9 | 10 | class PythonGraderParam(TypedDict, total=False): 11 | name: Required[str] 12 | """The name of the grader.""" 13 | 14 | source: Required[str] 15 | """The source code of the python script.""" 16 | 17 | type: Required[Literal["python"]] 18 | """The object type, which is always `python`.""" 19 | 20 | image_tag: str 21 | """The image tag to use for the python script.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/graders/string_check_grader.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["StringCheckGrader"] 8 | 9 | 10 | class StringCheckGrader(BaseModel): 11 | input: str 12 | """The input text. This may include template strings.""" 13 | 14 | name: str 15 | """The name of the grader.""" 16 | 17 | operation: Literal["eq", "ne", "like", "ilike"] 18 | """The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.""" 19 | 20 | reference: str 21 | """The reference text. This may include template strings.""" 22 | 23 | type: Literal["string_check"] 24 | """The object type, which is always `string_check`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/image.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["Image"] 8 | 9 | 10 | class Image(BaseModel): 11 | b64_json: Optional[str] = None 12 | """The base64-encoded JSON of the generated image. 13 | 14 | Default value for `gpt-image-1`, and only present if `response_format` is set to 15 | `b64_json` for `dall-e-2` and `dall-e-3`. 16 | """ 17 | 18 | revised_prompt: Optional[str] = None 19 | """For `dall-e-3` only, the revised prompt that was used to generate the image.""" 20 | 21 | url: Optional[str] = None 22 | """ 23 | When using `dall-e-2` or `dall-e-3`, the URL of the generated image if 24 | `response_format` is set to `url` (default value). Unsupported for 25 | `gpt-image-1`. 26 | """ 27 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/image_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ImageModel"] 6 | 7 | ImageModel: TypeAlias = Literal["dall-e-2", "dall-e-3", "gpt-image-1"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["Model"] 8 | 9 | 10 | class Model(BaseModel): 11 | id: str 12 | """The model identifier, which can be referenced in the API endpoints.""" 13 | 14 | created: int 15 | """The Unix timestamp (in seconds) when the model was created.""" 16 | 17 | object: Literal["model"] 18 | """The object type, which is always "model".""" 19 | 20 | owned_by: str 21 | """The organization that owns the model.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/model_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .._models import BaseModel 4 | 5 | __all__ = ["ModelDeleted"] 6 | 7 | 8 | class ModelDeleted(BaseModel): 9 | id: str 10 | 11 | deleted: bool 12 | 13 | object: str 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/moderation_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from .._models import BaseModel 6 | from .moderation import Moderation 7 | 8 | __all__ = ["ModerationCreateResponse"] 9 | 10 | 11 | class ModerationCreateResponse(BaseModel): 12 | id: str 13 | """The unique identifier for the moderation request.""" 14 | 15 | model: str 16 | """The model used to generate the moderation results.""" 17 | 18 | results: List[Moderation] 19 | """A list of moderation objects.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/moderation_image_url_input_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ModerationImageURLInputParam", "ImageURL"] 8 | 9 | 10 | class ImageURL(TypedDict, total=False): 11 | url: Required[str] 12 | """Either a URL of the image or the base64 encoded image data.""" 13 | 14 | 15 | class ModerationImageURLInputParam(TypedDict, total=False): 16 | image_url: Required[ImageURL] 17 | """Contains either an image URL or a data URL for a base64 encoded image.""" 18 | 19 | type: Required[Literal["image_url"]] 20 | """Always `image_url`.""" 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/moderation_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ModerationModel"] 6 | 7 | ModerationModel: TypeAlias = Literal[ 8 | "omni-moderation-latest", "omni-moderation-2024-09-26", "text-moderation-latest", "text-moderation-stable" 9 | ] 10 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/moderation_multi_modal_input_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .moderation_text_input_param import ModerationTextInputParam 9 | from .moderation_image_url_input_param import ModerationImageURLInputParam 10 | 11 | __all__ = ["ModerationMultiModalInputParam"] 12 | 13 | ModerationMultiModalInputParam: TypeAlias = Union[ModerationImageURLInputParam, ModerationTextInputParam] 14 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/moderation_text_input_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ModerationTextInputParam"] 8 | 9 | 10 | class ModerationTextInputParam(TypedDict, total=False): 11 | text: Required[str] 12 | """A string of text to classify.""" 13 | 14 | type: Required[Literal["text"]] 15 | """Always `text`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/other_file_chunking_strategy_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["OtherFileChunkingStrategyObject"] 8 | 9 | 10 | class OtherFileChunkingStrategyObject(BaseModel): 11 | type: Literal["other"] 12 | """Always `other`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/computer_tool.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ComputerTool"] 8 | 9 | 10 | class ComputerTool(BaseModel): 11 | display_height: int 12 | """The height of the computer display.""" 13 | 14 | display_width: int 15 | """The width of the computer display.""" 16 | 17 | environment: Literal["windows", "mac", "linux", "ubuntu", "browser"] 18 | """The type of computer environment to control.""" 19 | 20 | type: Literal["computer_use_preview"] 21 | """The type of the computer use tool. Always `computer_use_preview`.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/computer_tool_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ComputerToolParam"] 8 | 9 | 10 | class ComputerToolParam(TypedDict, total=False): 11 | display_height: Required[int] 12 | """The height of the computer display.""" 13 | 14 | display_width: Required[int] 15 | """The width of the computer display.""" 16 | 17 | environment: Required[Literal["windows", "mac", "linux", "ubuntu", "browser"]] 18 | """The type of computer environment to control.""" 19 | 20 | type: Required[Literal["computer_use_preview"]] 21 | """The type of the computer use tool. Always `computer_use_preview`.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_audio_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseAudioDeltaEvent"] 8 | 9 | 10 | class ResponseAudioDeltaEvent(BaseModel): 11 | delta: str 12 | """A chunk of Base64 encoded response audio bytes.""" 13 | 14 | type: Literal["response.audio.delta"] 15 | """The type of the event. Always `response.audio.delta`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_audio_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseAudioDoneEvent"] 8 | 9 | 10 | class ResponseAudioDoneEvent(BaseModel): 11 | type: Literal["response.audio.done"] 12 | """The type of the event. Always `response.audio.done`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_audio_transcript_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseAudioTranscriptDeltaEvent"] 8 | 9 | 10 | class ResponseAudioTranscriptDeltaEvent(BaseModel): 11 | delta: str 12 | """The partial transcript of the audio response.""" 13 | 14 | type: Literal["response.audio.transcript.delta"] 15 | """The type of the event. Always `response.audio.transcript.delta`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_audio_transcript_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseAudioTranscriptDoneEvent"] 8 | 9 | 10 | class ResponseAudioTranscriptDoneEvent(BaseModel): 11 | type: Literal["response.audio.transcript.done"] 12 | """The type of the event. Always `response.audio.transcript.done`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_code_interpreter_call_code_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseCodeInterpreterCallCodeDeltaEvent"] 8 | 9 | 10 | class ResponseCodeInterpreterCallCodeDeltaEvent(BaseModel): 11 | delta: str 12 | """The partial code snippet added by the code interpreter.""" 13 | 14 | output_index: int 15 | """The index of the output item that the code interpreter call is in progress.""" 16 | 17 | type: Literal["response.code_interpreter_call.code.delta"] 18 | """The type of the event. Always `response.code_interpreter_call.code.delta`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_code_interpreter_call_code_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseCodeInterpreterCallCodeDoneEvent"] 8 | 9 | 10 | class ResponseCodeInterpreterCallCodeDoneEvent(BaseModel): 11 | code: str 12 | """The final code snippet output by the code interpreter.""" 13 | 14 | output_index: int 15 | """The index of the output item that the code interpreter call is in progress.""" 16 | 17 | type: Literal["response.code_interpreter_call.code.done"] 18 | """The type of the event. Always `response.code_interpreter_call.code.done`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_code_interpreter_call_completed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall 7 | 8 | __all__ = ["ResponseCodeInterpreterCallCompletedEvent"] 9 | 10 | 11 | class ResponseCodeInterpreterCallCompletedEvent(BaseModel): 12 | code_interpreter_call: ResponseCodeInterpreterToolCall 13 | """A tool call to run code.""" 14 | 15 | output_index: int 16 | """The index of the output item that the code interpreter call is in progress.""" 17 | 18 | type: Literal["response.code_interpreter_call.completed"] 19 | """The type of the event. Always `response.code_interpreter_call.completed`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_code_interpreter_call_in_progress_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall 7 | 8 | __all__ = ["ResponseCodeInterpreterCallInProgressEvent"] 9 | 10 | 11 | class ResponseCodeInterpreterCallInProgressEvent(BaseModel): 12 | code_interpreter_call: ResponseCodeInterpreterToolCall 13 | """A tool call to run code.""" 14 | 15 | output_index: int 16 | """The index of the output item that the code interpreter call is in progress.""" 17 | 18 | type: Literal["response.code_interpreter_call.in_progress"] 19 | """The type of the event. Always `response.code_interpreter_call.in_progress`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_code_interpreter_call_interpreting_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall 7 | 8 | __all__ = ["ResponseCodeInterpreterCallInterpretingEvent"] 9 | 10 | 11 | class ResponseCodeInterpreterCallInterpretingEvent(BaseModel): 12 | code_interpreter_call: ResponseCodeInterpreterToolCall 13 | """A tool call to run code.""" 14 | 15 | output_index: int 16 | """The index of the output item that the code interpreter call is in progress.""" 17 | 18 | type: Literal["response.code_interpreter_call.interpreting"] 19 | """The type of the event. Always `response.code_interpreter_call.interpreting`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_completed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .response import Response 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseCompletedEvent"] 9 | 10 | 11 | class ResponseCompletedEvent(BaseModel): 12 | response: Response 13 | """Properties of the completed response.""" 14 | 15 | type: Literal["response.completed"] 16 | """The type of the event. Always `response.completed`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_computer_tool_call_output_screenshot.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseComputerToolCallOutputScreenshot"] 9 | 10 | 11 | class ResponseComputerToolCallOutputScreenshot(BaseModel): 12 | type: Literal["computer_screenshot"] 13 | """Specifies the event type. 14 | 15 | For a computer screenshot, this property is always set to `computer_screenshot`. 16 | """ 17 | 18 | file_id: Optional[str] = None 19 | """The identifier of an uploaded file that contains the screenshot.""" 20 | 21 | image_url: Optional[str] = None 22 | """The URL of the screenshot image.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_computer_tool_call_output_screenshot_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseComputerToolCallOutputScreenshotParam"] 8 | 9 | 10 | class ResponseComputerToolCallOutputScreenshotParam(TypedDict, total=False): 11 | type: Required[Literal["computer_screenshot"]] 12 | """Specifies the event type. 13 | 14 | For a computer screenshot, this property is always set to `computer_screenshot`. 15 | """ 16 | 17 | file_id: str 18 | """The identifier of an uploaded file that contains the screenshot.""" 19 | 20 | image_url: str 21 | """The URL of the screenshot image.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_created_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .response import Response 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseCreatedEvent"] 9 | 10 | 11 | class ResponseCreatedEvent(BaseModel): 12 | response: Response 13 | """The response that was created.""" 14 | 15 | type: Literal["response.created"] 16 | """The type of the event. Always `response.created`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_error_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseErrorEvent"] 9 | 10 | 11 | class ResponseErrorEvent(BaseModel): 12 | code: Optional[str] = None 13 | """The error code.""" 14 | 15 | message: str 16 | """The error message.""" 17 | 18 | param: Optional[str] = None 19 | """The error parameter.""" 20 | 21 | type: Literal["error"] 22 | """The type of the event. Always `error`.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_failed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .response import Response 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseFailedEvent"] 9 | 10 | 11 | class ResponseFailedEvent(BaseModel): 12 | response: Response 13 | """The response that failed.""" 14 | 15 | type: Literal["response.failed"] 16 | """The type of the event. Always `response.failed`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_file_search_call_completed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFileSearchCallCompletedEvent"] 8 | 9 | 10 | class ResponseFileSearchCallCompletedEvent(BaseModel): 11 | item_id: str 12 | """The ID of the output item that the file search call is initiated.""" 13 | 14 | output_index: int 15 | """The index of the output item that the file search call is initiated.""" 16 | 17 | type: Literal["response.file_search_call.completed"] 18 | """The type of the event. Always `response.file_search_call.completed`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_file_search_call_in_progress_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFileSearchCallInProgressEvent"] 8 | 9 | 10 | class ResponseFileSearchCallInProgressEvent(BaseModel): 11 | item_id: str 12 | """The ID of the output item that the file search call is initiated.""" 13 | 14 | output_index: int 15 | """The index of the output item that the file search call is initiated.""" 16 | 17 | type: Literal["response.file_search_call.in_progress"] 18 | """The type of the event. Always `response.file_search_call.in_progress`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_file_search_call_searching_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFileSearchCallSearchingEvent"] 8 | 9 | 10 | class ResponseFileSearchCallSearchingEvent(BaseModel): 11 | item_id: str 12 | """The ID of the output item that the file search call is initiated.""" 13 | 14 | output_index: int 15 | """The index of the output item that the file search call is searching.""" 16 | 17 | type: Literal["response.file_search_call.searching"] 18 | """The type of the event. Always `response.file_search_call.searching`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_format_text_config.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ..._utils import PropertyInfo 7 | from ..shared.response_format_text import ResponseFormatText 8 | from ..shared.response_format_json_object import ResponseFormatJSONObject 9 | from .response_format_text_json_schema_config import ResponseFormatTextJSONSchemaConfig 10 | 11 | __all__ = ["ResponseFormatTextConfig"] 12 | 13 | ResponseFormatTextConfig: TypeAlias = Annotated[ 14 | Union[ResponseFormatText, ResponseFormatTextJSONSchemaConfig, ResponseFormatJSONObject], 15 | PropertyInfo(discriminator="type"), 16 | ] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_format_text_config_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from ..shared_params.response_format_text import ResponseFormatText 9 | from ..shared_params.response_format_json_object import ResponseFormatJSONObject 10 | from .response_format_text_json_schema_config_param import ResponseFormatTextJSONSchemaConfigParam 11 | 12 | __all__ = ["ResponseFormatTextConfigParam"] 13 | 14 | ResponseFormatTextConfigParam: TypeAlias = Union[ 15 | ResponseFormatText, ResponseFormatTextJSONSchemaConfigParam, ResponseFormatJSONObject 16 | ] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_function_call_arguments_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFunctionCallArgumentsDeltaEvent"] 8 | 9 | 10 | class ResponseFunctionCallArgumentsDeltaEvent(BaseModel): 11 | delta: str 12 | """The function-call arguments delta that is added.""" 13 | 14 | item_id: str 15 | """The ID of the output item that the function-call arguments delta is added to.""" 16 | 17 | output_index: int 18 | """ 19 | The index of the output item that the function-call arguments delta is added to. 20 | """ 21 | 22 | type: Literal["response.function_call_arguments.delta"] 23 | """The type of the event. Always `response.function_call_arguments.delta`.""" 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_function_call_arguments_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFunctionCallArgumentsDoneEvent"] 8 | 9 | 10 | class ResponseFunctionCallArgumentsDoneEvent(BaseModel): 11 | arguments: str 12 | """The function-call arguments.""" 13 | 14 | item_id: str 15 | """The ID of the item.""" 16 | 17 | output_index: int 18 | """The index of the output item.""" 19 | 20 | type: Literal["response.function_call_arguments.done"] 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_function_tool_call_item.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .response_function_tool_call import ResponseFunctionToolCall 4 | 5 | __all__ = ["ResponseFunctionToolCallItem"] 6 | 7 | 8 | class ResponseFunctionToolCallItem(ResponseFunctionToolCall): 9 | id: str # type: ignore 10 | """The unique ID of the function tool call.""" 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_function_web_search.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFunctionWebSearch"] 8 | 9 | 10 | class ResponseFunctionWebSearch(BaseModel): 11 | id: str 12 | """The unique ID of the web search tool call.""" 13 | 14 | status: Literal["in_progress", "searching", "completed", "failed"] 15 | """The status of the web search tool call.""" 16 | 17 | type: Literal["web_search_call"] 18 | """The type of the web search tool call. Always `web_search_call`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_function_web_search_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseFunctionWebSearchParam"] 8 | 9 | 10 | class ResponseFunctionWebSearchParam(TypedDict, total=False): 11 | id: Required[str] 12 | """The unique ID of the web search tool call.""" 13 | 14 | status: Required[Literal["in_progress", "searching", "completed", "failed"]] 15 | """The status of the web search tool call.""" 16 | 17 | type: Required[Literal["web_search_call"]] 18 | """The type of the web search tool call. Always `web_search_call`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_in_progress_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .response import Response 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseInProgressEvent"] 9 | 10 | 11 | class ResponseInProgressEvent(BaseModel): 12 | response: Response 13 | """The response that is in progress.""" 14 | 15 | type: Literal["response.in_progress"] 16 | """The type of the event. Always `response.in_progress`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_includable.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ResponseIncludable"] 6 | 7 | ResponseIncludable: TypeAlias = Literal[ 8 | "file_search_call.results", 9 | "message.input_image.image_url", 10 | "computer_call_output.output.image_url", 11 | "reasoning.encrypted_content", 12 | ] 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_incomplete_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .response import Response 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseIncompleteEvent"] 9 | 10 | 11 | class ResponseIncompleteEvent(BaseModel): 12 | response: Response 13 | """The response that was incomplete.""" 14 | 15 | type: Literal["response.incomplete"] 16 | """The type of the event. Always `response.incomplete`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_content.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ..._utils import PropertyInfo 7 | from .response_input_file import ResponseInputFile 8 | from .response_input_text import ResponseInputText 9 | from .response_input_image import ResponseInputImage 10 | 11 | __all__ = ["ResponseInputContent"] 12 | 13 | ResponseInputContent: TypeAlias = Annotated[ 14 | Union[ResponseInputText, ResponseInputImage, ResponseInputFile], PropertyInfo(discriminator="type") 15 | ] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_content_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .response_input_file_param import ResponseInputFileParam 9 | from .response_input_text_param import ResponseInputTextParam 10 | from .response_input_image_param import ResponseInputImageParam 11 | 12 | __all__ = ["ResponseInputContentParam"] 13 | 14 | ResponseInputContentParam: TypeAlias = Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_file.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["ResponseInputFile"] 9 | 10 | 11 | class ResponseInputFile(BaseModel): 12 | type: Literal["input_file"] 13 | """The type of the input item. Always `input_file`.""" 14 | 15 | file_data: Optional[str] = None 16 | """The content of the file to be sent to the model.""" 17 | 18 | file_id: Optional[str] = None 19 | """The ID of the file to be sent to the model.""" 20 | 21 | filename: Optional[str] = None 22 | """The name of the file to be sent to the model.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_file_param.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import Literal, Required, TypedDict 7 | 8 | __all__ = ["ResponseInputFileParam"] 9 | 10 | 11 | class ResponseInputFileParam(TypedDict, total=False): 12 | type: Required[Literal["input_file"]] 13 | """The type of the input item. Always `input_file`.""" 14 | 15 | file_data: str 16 | """The content of the file to be sent to the model.""" 17 | 18 | file_id: Optional[str] 19 | """The ID of the file to be sent to the model.""" 20 | 21 | filename: str 22 | """The name of the file to be sent to the model.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_message_content_list.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from typing_extensions import TypeAlias 5 | 6 | from .response_input_content import ResponseInputContent 7 | 8 | __all__ = ["ResponseInputMessageContentList"] 9 | 10 | ResponseInputMessageContentList: TypeAlias = List[ResponseInputContent] 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_message_content_list_param.py: -------------------------------------------------------------------------------- 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 List, Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .response_input_file_param import ResponseInputFileParam 9 | from .response_input_text_param import ResponseInputTextParam 10 | from .response_input_image_param import ResponseInputImageParam 11 | 12 | __all__ = ["ResponseInputMessageContentListParam", "ResponseInputContentParam"] 13 | 14 | ResponseInputContentParam: TypeAlias = Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam] 15 | 16 | ResponseInputMessageContentListParam: TypeAlias = List[ResponseInputContentParam] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_text.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseInputText"] 8 | 9 | 10 | class ResponseInputText(BaseModel): 11 | text: str 12 | """The text input to the model.""" 13 | 14 | type: Literal["input_text"] 15 | """The type of the input item. Always `input_text`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_input_text_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseInputTextParam"] 8 | 9 | 10 | class ResponseInputTextParam(TypedDict, total=False): 11 | text: Required[str] 12 | """The text input to the model.""" 13 | 14 | type: Required[Literal["input_text"]] 15 | """The type of the input item. Always `input_text`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_item_list.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | from .response_item import ResponseItem 8 | 9 | __all__ = ["ResponseItemList"] 10 | 11 | 12 | class ResponseItemList(BaseModel): 13 | data: List[ResponseItem] 14 | """A list of items used to generate this response.""" 15 | 16 | first_id: str 17 | """The ID of the first item in the list.""" 18 | 19 | has_more: bool 20 | """Whether there are more items available.""" 21 | 22 | last_id: str 23 | """The ID of the last item in the list.""" 24 | 25 | object: Literal["list"] 26 | """The type of object returned, must be `list`.""" 27 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_output_item_added_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from .response_output_item import ResponseOutputItem 7 | 8 | __all__ = ["ResponseOutputItemAddedEvent"] 9 | 10 | 11 | class ResponseOutputItemAddedEvent(BaseModel): 12 | item: ResponseOutputItem 13 | """The output item that was added.""" 14 | 15 | output_index: int 16 | """The index of the output item that was added.""" 17 | 18 | type: Literal["response.output_item.added"] 19 | """The type of the event. Always `response.output_item.added`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_output_item_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | from .response_output_item import ResponseOutputItem 7 | 8 | __all__ = ["ResponseOutputItemDoneEvent"] 9 | 10 | 11 | class ResponseOutputItemDoneEvent(BaseModel): 12 | item: ResponseOutputItem 13 | """The output item that was marked done.""" 14 | 15 | output_index: int 16 | """The index of the output item that was marked done.""" 17 | 18 | type: Literal["response.output_item.done"] 19 | """The type of the event. Always `response.output_item.done`.""" 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_output_refusal.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseOutputRefusal"] 8 | 9 | 10 | class ResponseOutputRefusal(BaseModel): 11 | refusal: str 12 | """The refusal explanationfrom the model.""" 13 | 14 | type: Literal["refusal"] 15 | """The type of the refusal. Always `refusal`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_output_refusal_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseOutputRefusalParam"] 8 | 9 | 10 | class ResponseOutputRefusalParam(TypedDict, total=False): 11 | refusal: Required[str] 12 | """The refusal explanationfrom the model.""" 13 | 14 | type: Required[Literal["refusal"]] 15 | """The type of the refusal. Always `refusal`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_refusal_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseRefusalDeltaEvent"] 8 | 9 | 10 | class ResponseRefusalDeltaEvent(BaseModel): 11 | content_index: int 12 | """The index of the content part that the refusal text is added to.""" 13 | 14 | delta: str 15 | """The refusal text that is added.""" 16 | 17 | item_id: str 18 | """The ID of the output item that the refusal text is added to.""" 19 | 20 | output_index: int 21 | """The index of the output item that the refusal text is added to.""" 22 | 23 | type: Literal["response.refusal.delta"] 24 | """The type of the event. Always `response.refusal.delta`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_refusal_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseRefusalDoneEvent"] 8 | 9 | 10 | class ResponseRefusalDoneEvent(BaseModel): 11 | content_index: int 12 | """The index of the content part that the refusal text is finalized.""" 13 | 14 | item_id: str 15 | """The ID of the output item that the refusal text is finalized.""" 16 | 17 | output_index: int 18 | """The index of the output item that the refusal text is finalized.""" 19 | 20 | refusal: str 21 | """The refusal text that is finalized.""" 22 | 23 | type: Literal["response.refusal.done"] 24 | """The type of the event. Always `response.refusal.done`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_retrieve_params.py: -------------------------------------------------------------------------------- 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 List 6 | from typing_extensions import TypedDict 7 | 8 | from .response_includable import ResponseIncludable 9 | 10 | __all__ = ["ResponseRetrieveParams"] 11 | 12 | 13 | class ResponseRetrieveParams(TypedDict, total=False): 14 | include: List[ResponseIncludable] 15 | """Additional fields to include in the response. 16 | 17 | See the `include` parameter for Response creation above for more information. 18 | """ 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_status.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ResponseStatus"] 6 | 7 | ResponseStatus: TypeAlias = Literal["completed", "failed", "in_progress", "incomplete"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_text_delta_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseTextDeltaEvent"] 8 | 9 | 10 | class ResponseTextDeltaEvent(BaseModel): 11 | content_index: int 12 | """The index of the content part that the text delta was added to.""" 13 | 14 | delta: str 15 | """The text delta that was added.""" 16 | 17 | item_id: str 18 | """The ID of the output item that the text delta was added to.""" 19 | 20 | output_index: int 21 | """The index of the output item that the text delta was added to.""" 22 | 23 | type: Literal["response.output_text.delta"] 24 | """The type of the event. Always `response.output_text.delta`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_text_done_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseTextDoneEvent"] 8 | 9 | 10 | class ResponseTextDoneEvent(BaseModel): 11 | content_index: int 12 | """The index of the content part that the text content is finalized.""" 13 | 14 | item_id: str 15 | """The ID of the output item that the text content is finalized.""" 16 | 17 | output_index: int 18 | """The index of the output item that the text content is finalized.""" 19 | 20 | text: str 21 | """The text content that is finalized.""" 22 | 23 | type: Literal["response.output_text.done"] 24 | """The type of the event. Always `response.output_text.done`.""" 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_web_search_call_completed_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseWebSearchCallCompletedEvent"] 8 | 9 | 10 | class ResponseWebSearchCallCompletedEvent(BaseModel): 11 | item_id: str 12 | """Unique ID for the output item associated with the web search call.""" 13 | 14 | output_index: int 15 | """The index of the output item that the web search call is associated with.""" 16 | 17 | type: Literal["response.web_search_call.completed"] 18 | """The type of the event. Always `response.web_search_call.completed`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_web_search_call_in_progress_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseWebSearchCallInProgressEvent"] 8 | 9 | 10 | class ResponseWebSearchCallInProgressEvent(BaseModel): 11 | item_id: str 12 | """Unique ID for the output item associated with the web search call.""" 13 | 14 | output_index: int 15 | """The index of the output item that the web search call is associated with.""" 16 | 17 | type: Literal["response.web_search_call.in_progress"] 18 | """The type of the event. Always `response.web_search_call.in_progress`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/response_web_search_call_searching_event.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseWebSearchCallSearchingEvent"] 8 | 9 | 10 | class ResponseWebSearchCallSearchingEvent(BaseModel): 11 | item_id: str 12 | """Unique ID for the output item associated with the web search call.""" 13 | 14 | output_index: int 15 | """The index of the output item that the web search call is associated with.""" 16 | 17 | type: Literal["response.web_search_call.searching"] 18 | """The type of the event. Always `response.web_search_call.searching`.""" 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Annotated, TypeAlias 5 | 6 | from ..._utils import PropertyInfo 7 | from .computer_tool import ComputerTool 8 | from .function_tool import FunctionTool 9 | from .web_search_tool import WebSearchTool 10 | from .file_search_tool import FileSearchTool 11 | 12 | __all__ = ["Tool"] 13 | 14 | Tool: TypeAlias = Annotated[ 15 | Union[FileSearchTool, FunctionTool, WebSearchTool, ComputerTool], PropertyInfo(discriminator="type") 16 | ] 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_choice_function.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ToolChoiceFunction"] 8 | 9 | 10 | class ToolChoiceFunction(BaseModel): 11 | name: str 12 | """The name of the function to call.""" 13 | 14 | type: Literal["function"] 15 | """For function calling, the type is always `function`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_choice_function_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ToolChoiceFunctionParam"] 8 | 9 | 10 | class ToolChoiceFunctionParam(TypedDict, total=False): 11 | name: Required[str] 12 | """The name of the function to call.""" 13 | 14 | type: Required[Literal["function"]] 15 | """For function calling, the type is always `function`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_choice_options.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ToolChoiceOptions"] 6 | 7 | ToolChoiceOptions: TypeAlias = Literal["none", "auto", "required"] 8 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_choice_types.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ToolChoiceTypes"] 8 | 9 | 10 | class ToolChoiceTypes(BaseModel): 11 | type: Literal["file_search", "web_search_preview", "computer_use_preview", "web_search_preview_2025_03_11"] 12 | """The type of hosted tool the model should to use. 13 | 14 | Learn more about 15 | [built-in tools](https://platform.openai.com/docs/guides/tools). 16 | 17 | Allowed values are: 18 | 19 | - `file_search` 20 | - `web_search_preview` 21 | - `computer_use_preview` 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_choice_types_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ToolChoiceTypesParam"] 8 | 9 | 10 | class ToolChoiceTypesParam(TypedDict, total=False): 11 | type: Required[ 12 | Literal["file_search", "web_search_preview", "computer_use_preview", "web_search_preview_2025_03_11"] 13 | ] 14 | """The type of hosted tool the model should to use. 15 | 16 | Learn more about 17 | [built-in tools](https://platform.openai.com/docs/guides/tools). 18 | 19 | Allowed values are: 20 | 21 | - `file_search` 22 | - `web_search_preview` 23 | - `computer_use_preview` 24 | """ 25 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/responses/tool_param.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import TypeAlias 7 | 8 | from .computer_tool_param import ComputerToolParam 9 | from .function_tool_param import FunctionToolParam 10 | from .web_search_tool_param import WebSearchToolParam 11 | from .file_search_tool_param import FileSearchToolParam 12 | from ..chat.chat_completion_tool_param import ChatCompletionToolParam 13 | 14 | __all__ = ["ToolParam"] 15 | 16 | ToolParam: TypeAlias = Union[FileSearchToolParam, FunctionToolParam, WebSearchToolParam, ComputerToolParam] 17 | 18 | ParseableToolParam: TypeAlias = Union[ToolParam, ChatCompletionToolParam] 19 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/all_models.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | from .chat_model import ChatModel 7 | 8 | __all__ = ["AllModels"] 9 | 10 | AllModels: TypeAlias = Union[ 11 | str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"] 12 | ] 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/compound_filter.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Union 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | from ..._models import BaseModel 7 | from .comparison_filter import ComparisonFilter 8 | 9 | __all__ = ["CompoundFilter", "Filter"] 10 | 11 | Filter: TypeAlias = Union[ComparisonFilter, object] 12 | 13 | 14 | class CompoundFilter(BaseModel): 15 | filters: List[Filter] 16 | """Array of filters to combine. 17 | 18 | Items can be `ComparisonFilter` or `CompoundFilter`. 19 | """ 20 | 21 | type: Literal["and", "or"] 22 | """Type of operation: `and` or `or`.""" 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/error_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ErrorObject"] 8 | 9 | 10 | class ErrorObject(BaseModel): 11 | code: Optional[str] = None 12 | 13 | message: str 14 | 15 | param: Optional[str] = None 16 | 17 | type: str 18 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/function_parameters.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Dict 4 | from typing_extensions import TypeAlias 5 | 6 | __all__ = ["FunctionParameters"] 7 | 8 | FunctionParameters: TypeAlias = Dict[str, object] 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/metadata.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Dict 4 | from typing_extensions import TypeAlias 5 | 6 | __all__ = ["Metadata"] 7 | 8 | Metadata: TypeAlias = Dict[str, str] 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/reasoning_effort.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | __all__ = ["ReasoningEffort"] 7 | 8 | ReasoningEffort: TypeAlias = Optional[Literal["low", "medium", "high"]] 9 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/response_format_json_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFormatJSONObject"] 8 | 9 | 10 | class ResponseFormatJSONObject(BaseModel): 11 | type: Literal["json_object"] 12 | """The type of response format being defined. Always `json_object`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/response_format_text.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ResponseFormatText"] 8 | 9 | 10 | class ResponseFormatText(BaseModel): 11 | type: Literal["text"] 12 | """The type of response format being defined. Always `text`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared/responses_model.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Union 4 | from typing_extensions import Literal, TypeAlias 5 | 6 | from .chat_model import ChatModel 7 | 8 | __all__ = ["ResponsesModel"] 9 | 10 | ResponsesModel: TypeAlias = Union[ 11 | str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"] 12 | ] 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/compound_filter.py: -------------------------------------------------------------------------------- 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 Union, Iterable 6 | from typing_extensions import Literal, Required, TypeAlias, TypedDict 7 | 8 | from .comparison_filter import ComparisonFilter 9 | 10 | __all__ = ["CompoundFilter", "Filter"] 11 | 12 | Filter: TypeAlias = Union[ComparisonFilter, object] 13 | 14 | 15 | class CompoundFilter(TypedDict, total=False): 16 | filters: Required[Iterable[Filter]] 17 | """Array of filters to combine. 18 | 19 | Items can be `ComparisonFilter` or `CompoundFilter`. 20 | """ 21 | 22 | type: Required[Literal["and", "or"]] 23 | """Type of operation: `and` or `or`.""" 24 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/function_parameters.py: -------------------------------------------------------------------------------- 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 6 | from typing_extensions import TypeAlias 7 | 8 | __all__ = ["FunctionParameters"] 9 | 10 | FunctionParameters: TypeAlias = Dict[str, object] 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/metadata.py: -------------------------------------------------------------------------------- 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 6 | from typing_extensions import TypeAlias 7 | 8 | __all__ = ["Metadata"] 9 | 10 | Metadata: TypeAlias = Dict[str, str] 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/reasoning_effort.py: -------------------------------------------------------------------------------- 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 Optional 6 | from typing_extensions import Literal, TypeAlias 7 | 8 | __all__ = ["ReasoningEffort"] 9 | 10 | ReasoningEffort: TypeAlias = Optional[Literal["low", "medium", "high"]] 11 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/response_format_json_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseFormatJSONObject"] 8 | 9 | 10 | class ResponseFormatJSONObject(TypedDict, total=False): 11 | type: Required[Literal["json_object"]] 12 | """The type of response format being defined. Always `json_object`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/response_format_text.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponseFormatText"] 8 | 9 | 10 | class ResponseFormatText(TypedDict, total=False): 11 | type: Required[Literal["text"]] 12 | """The type of response format being defined. Always `text`.""" 13 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/shared_params/responses_model.py: -------------------------------------------------------------------------------- 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 Union 6 | from typing_extensions import Literal, TypeAlias 7 | 8 | from ..shared.chat_model import ChatModel 9 | 10 | __all__ = ["ResponsesModel"] 11 | 12 | ResponsesModel: TypeAlias = Union[ 13 | str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"] 14 | ] 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/static_file_chunking_strategy.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .._models import BaseModel 4 | 5 | __all__ = ["StaticFileChunkingStrategy"] 6 | 7 | 8 | class StaticFileChunkingStrategy(BaseModel): 9 | chunk_overlap_tokens: int 10 | """The number of tokens that overlap between chunks. The default value is `400`. 11 | 12 | Note that the overlap must not exceed half of `max_chunk_size_tokens`. 13 | """ 14 | 15 | max_chunk_size_tokens: int 16 | """The maximum number of tokens in each chunk. 17 | 18 | The default value is `800`. The minimum value is `100` and the maximum value is 19 | `4096`. 20 | """ 21 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/static_file_chunking_strategy_object.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | from .static_file_chunking_strategy import StaticFileChunkingStrategy 7 | 8 | __all__ = ["StaticFileChunkingStrategyObject"] 9 | 10 | 11 | class StaticFileChunkingStrategyObject(BaseModel): 12 | static: StaticFileChunkingStrategy 13 | 14 | type: Literal["static"] 15 | """Always `static`.""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/static_file_chunking_strategy_object_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .static_file_chunking_strategy_param import StaticFileChunkingStrategyParam 8 | 9 | __all__ = ["StaticFileChunkingStrategyObjectParam"] 10 | 11 | 12 | class StaticFileChunkingStrategyObjectParam(TypedDict, total=False): 13 | static: Required[StaticFileChunkingStrategyParam] 14 | 15 | type: Required[Literal["static"]] 16 | """Always `static`.""" 17 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/static_file_chunking_strategy_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["StaticFileChunkingStrategyParam"] 8 | 9 | 10 | class StaticFileChunkingStrategyParam(TypedDict, total=False): 11 | chunk_overlap_tokens: Required[int] 12 | """The number of tokens that overlap between chunks. The default value is `400`. 13 | 14 | Note that the overlap must not exceed half of `max_chunk_size_tokens`. 15 | """ 16 | 17 | max_chunk_size_tokens: Required[int] 18 | """The maximum number of tokens in each chunk. 19 | 20 | The default value is `800`. The minimum value is `100` and the maximum value is 21 | `4096`. 22 | """ 23 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/upload_complete_params.py: -------------------------------------------------------------------------------- 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 List 6 | from typing_extensions import Required, TypedDict 7 | 8 | __all__ = ["UploadCompleteParams"] 9 | 10 | 11 | class UploadCompleteParams(TypedDict, total=False): 12 | part_ids: Required[List[str]] 13 | """The ordered list of Part IDs.""" 14 | 15 | md5: str 16 | """ 17 | The optional md5 checksum for the file contents to verify if the bytes uploaded 18 | matches what you expect. 19 | """ 20 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/uploads/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .upload_part import UploadPart as UploadPart 6 | from .part_create_params import PartCreateParams as PartCreateParams 7 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/uploads/part_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | from ..._types import FileTypes 8 | 9 | __all__ = ["PartCreateParams"] 10 | 11 | 12 | class PartCreateParams(TypedDict, total=False): 13 | data: Required[FileTypes] 14 | """The chunk of bytes for this Part.""" 15 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/uploads/upload_part.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["UploadPart"] 8 | 9 | 10 | class UploadPart(BaseModel): 11 | id: str 12 | """The upload Part unique identifier, which can be referenced in API endpoints.""" 13 | 14 | created_at: int 15 | """The Unix timestamp (in seconds) for when the Part was created.""" 16 | 17 | object: Literal["upload.part"] 18 | """The object type, which is always `upload.part`.""" 19 | 20 | upload_id: str 21 | """The ID of the Upload object that this Part was added to.""" 22 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/vector_store_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["VectorStoreDeleted"] 8 | 9 | 10 | class VectorStoreDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["vector_store.deleted"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/vector_stores/file_content_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["FileContentResponse"] 8 | 9 | 10 | class FileContentResponse(BaseModel): 11 | text: Optional[str] = None 12 | """The text content""" 13 | 14 | type: Optional[str] = None 15 | """The content type (currently only `"text"`)""" 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/types/vector_stores/vector_store_file_deleted.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["VectorStoreFileDeleted"] 8 | 9 | 10 | class VectorStoreFileDeleted(BaseModel): 11 | id: str 12 | 13 | deleted: bool 14 | 15 | object: Literal["vector_store.file.deleted"] 16 | -------------------------------------------------------------------------------- /portkey_ai/_vendor/openai/version.py: -------------------------------------------------------------------------------- 1 | from ._version import __version__ 2 | 3 | VERSION: str = __version__ 4 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/instrumentation/crewai/__init__.py: -------------------------------------------------------------------------------- 1 | from .instrumentation import CrewAIInstrumentor 2 | 3 | __all__ = ["CrewAIInstrumentor"] 4 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/instrumentation/langgraph/__init__.py: -------------------------------------------------------------------------------- 1 | from portkey_ai.api_resources.instrumentation.langgraph.instrumentation import ( 2 | LanggraphInstrumentor, 3 | ) 4 | 5 | __all__ = ["LanggraphInstrumentor"] 6 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/instrumentation/litellm/__init__.py: -------------------------------------------------------------------------------- 1 | from portkey_ai.api_resources.instrumentation.litellm.instrumentation import ( 2 | LitellmInstrumentor, 3 | ) 4 | 5 | __all__ = ["LitellmInstrumentor"] 6 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/instrumentation/openai/__init__.py: -------------------------------------------------------------------------------- 1 | from portkey_ai.api_resources.instrumentation.openai.instrumentation import ( 2 | OpenaiInstrumentor, 3 | ) 4 | 5 | __all__ = ["OpenaiInstrumentor"] 6 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/types/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/api_resources/types/__init__.py -------------------------------------------------------------------------------- /portkey_ai/api_resources/types/feedback_type.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | from pydantic import BaseModel 5 | 6 | 7 | class FeedbackResponse(BaseModel, extra="allow"): 8 | status: Optional[str] = None 9 | message: Optional[str] = None 10 | feedback_ids: Optional[List[str]] = None 11 | -------------------------------------------------------------------------------- /portkey_ai/api_resources/types/utils.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | import httpx 4 | 5 | from portkey_ai.api_resources.global_constants import PORTKEY_HEADER_PREFIX 6 | 7 | 8 | def parse_headers(headers: Optional[httpx.Headers]) -> dict: 9 | if headers is None: 10 | return {} 11 | 12 | _headers = {} 13 | for k, v in headers.items(): 14 | if k.startswith(PORTKEY_HEADER_PREFIX): 15 | k = k.replace(PORTKEY_HEADER_PREFIX, "") 16 | _headers[k] = v 17 | 18 | return _headers 19 | -------------------------------------------------------------------------------- /portkey_ai/langchain/__init__.py: -------------------------------------------------------------------------------- 1 | from .portkey_langchain_callback_handler import LangchainCallbackHandler 2 | 3 | __all__ = ["LangchainCallbackHandler"] 4 | -------------------------------------------------------------------------------- /portkey_ai/llamaindex/__init__.py: -------------------------------------------------------------------------------- 1 | from .portkey_llama_callback_handler import LlamaIndexCallbackHandler 2 | 3 | __all__ = ["LlamaIndexCallbackHandler"] 4 | -------------------------------------------------------------------------------- /portkey_ai/llms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/llms/__init__.py -------------------------------------------------------------------------------- /portkey_ai/llms/langchain/__init__.py: -------------------------------------------------------------------------------- 1 | from .chat import ChatPortkey 2 | from .completion import PortkeyLLM 3 | 4 | __all__ = [ 5 | "ChatPortkey", 6 | "PortkeyLLM", 7 | ] 8 | -------------------------------------------------------------------------------- /portkey_ai/llms/llama_index/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/llms/llama_index/__init__.py -------------------------------------------------------------------------------- /portkey_ai/llms/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | ignore_missing_imports = True 3 | -------------------------------------------------------------------------------- /portkey_ai/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/portkey_ai/py.typed -------------------------------------------------------------------------------- /portkey_ai/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .json_utils import serialize_kwargs, serialize_args 2 | from .hashing_utils import string_to_uuid 3 | 4 | __all__ = ["serialize_kwargs", "serialize_args", "string_to_uuid"] 5 | -------------------------------------------------------------------------------- /portkey_ai/utils/hashing_utils.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | 4 | def string_to_uuid(input_string: str) -> str: 5 | if input_string is None: 6 | return None 7 | # Using UUID v5 (SHA-1-based) - more secure but slower 8 | return str(uuid.uuid5(uuid.NAMESPACE_DNS, str(input_string))) 9 | -------------------------------------------------------------------------------- /portkey_ai/version.py: -------------------------------------------------------------------------------- 1 | VERSION = "1.13.0" 2 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.mypy] 6 | exclude = ['portkey_ai/_vendor', 'tests'] 7 | ignore_missing_imports = true 8 | follow_imports = "silent" 9 | disable_error_code = ['import-untyped', 'import-not-found'] 10 | 11 | [[tool.mypy.overrides]] 12 | module = 'portkey_ai._vendor.*' 13 | ignore_errors = true 14 | 15 | [tool.black] 16 | force-exclude = '''(portkey_ai/_vendor)/''' 17 | 18 | [tool.ruff] 19 | exclude = ["portkey_ai/_vendor", "tests"] -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/pytest.ini -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/tests/__init__.py -------------------------------------------------------------------------------- /tests/configs/assistants/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/assistants/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "cache": { 4 | "mode": "semantic", 5 | "max_age": 60 6 | }, 7 | "retry": { 8 | "attempts": 5, 9 | "on_status_codes": [ 10 | 429 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/configs/assistants/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/audio/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/audio/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "cache": { 4 | "mode": "semantic", 5 | "max_age": 60 6 | }, 7 | "retry": { 8 | "attempts": 5, 9 | "on_status_codes": [ 10 | 429 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/configs/audio/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/audio/speech.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/tests/configs/audio/speech.mp3 -------------------------------------------------------------------------------- /tests/configs/chat_completions/loadbalance_with_two_apikeys/loadbalance_with_two_apikeys.json: -------------------------------------------------------------------------------- 1 | { 2 | "strategy": { 3 | "mode": "loadbalance" 4 | }, 5 | "targets": [ 6 | { 7 | "virtual_key": "openai-virtual-key", 8 | "override_params": { 9 | "model": "gpt-3.5-turbo" 10 | } 11 | }, 12 | { 13 | "virtual_key": "anthropic-virtual-key", 14 | "override_params": { 15 | "model": "claude-2.1" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tests/configs/chat_completions/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/configs/chat_completions/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo" 5 | }, 6 | "cache": { 7 | "mode": "semantic", 8 | "max_age": 60 9 | }, 10 | "retry": { 11 | "attempts": 5, 12 | "on_status_codes": [ 13 | 429 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/configs/chat_completions/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/configs/completions/loadbalance_with_two_apikeys/loadbalance_with_two_apikeys.json: -------------------------------------------------------------------------------- 1 | { 2 | "strategy": { 3 | "mode": "loadbalance" 4 | }, 5 | "targets": [ 6 | { 7 | "virtual_key": "openai-virtual-key", 8 | "override_params": { 9 | "model": "gpt-3.5-turbo-instruct" 10 | } 11 | }, 12 | { 13 | "virtual_key": "anthropic-virtual-key", 14 | "override_params": { 15 | "model": "claude-2.1" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tests/configs/completions/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo-instruct" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/configs/completions/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo-instruct" 5 | }, 6 | "cache": { 7 | "mode": "semantic", 8 | "max_age": 60 9 | }, 10 | "retry": { 11 | "attempts": 5, 12 | "on_status_codes": [ 13 | 429 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/configs/completions/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "override_params": { 4 | "model": "gpt-3.5-turbo-instruct" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/configs/images/loadbalance_with_two_apikeys/loadbalance_with_two_apikeys.json: -------------------------------------------------------------------------------- 1 | { 2 | "strategy": { 3 | "mode": "loadbalance" 4 | }, 5 | "targets": [ 6 | { 7 | "virtual_key": "openai-virtual-key", 8 | "override_params": { 9 | "model": "dall-e-2" 10 | } 11 | }, 12 | { 13 | "virtual_key": "stability-virtual-key", 14 | "override_params": { 15 | "model": "stable-diffusion-v1-6" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tests/configs/images/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/images/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "cache": { 4 | "mode": "semantic", 5 | "max_age": 60 6 | }, 7 | "retry": { 8 | "attempts": 5, 9 | "on_status_codes": [ 10 | 429 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/configs/images/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/moderations/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/moderations/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "cache": { 4 | "mode": "semantic", 5 | "max_age": 60 6 | }, 7 | "retry": { 8 | "attempts": 5, 9 | "on_status_codes": [ 10 | 429 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/configs/moderations/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/threads/sample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Portkey-AI/portkey-python-sdk/9855b655c28fdef7bc60c94342a6b30ac9bdbaf4/tests/configs/threads/sample.pdf -------------------------------------------------------------------------------- /tests/configs/threads/single_provider/single_provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/configs/threads/single_provider_with_vk_retry_cache/single_provider_with_vk_retry_cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key", 3 | "cache": { 4 | "mode": "semantic", 5 | "max_age": 60 6 | }, 7 | "retry": { 8 | "attempts": 5, 9 | "on_status_codes": [ 10 | 429 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/configs/threads/single_with_basic_config/single_with_basic_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "virtual_key": "openai-virtual-key" 3 | } 4 | -------------------------------------------------------------------------------- /tests/manual_test_async_feedback.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from portkey_ai import AsyncPortkey 3 | import os 4 | 5 | 6 | portkey = AsyncPortkey( 7 | api_key=os.environ.get("PORTKEY_API_KEY"), 8 | ) 9 | 10 | 11 | traceId = "0c41ce35-b321-4484-bead-1c21eae02996" 12 | 13 | 14 | async def main(): 15 | print("Step: Create Feedback") 16 | result = await portkey.feedback.create( 17 | trace_id=traceId, 18 | value="1", 19 | ) 20 | print(result) 21 | 22 | update_feedback_id = result.feedback_ids[0] 23 | 24 | print("Step: Update Feedback") 25 | result = await portkey.feedback.update( 26 | feedback_id=update_feedback_id, 27 | value="7", 28 | ) 29 | print(result) 30 | 31 | 32 | asyncio.run(main()) 33 | -------------------------------------------------------------------------------- /tests/manual_test_feedback.py: -------------------------------------------------------------------------------- 1 | import os 2 | from portkey_ai import Portkey 3 | 4 | 5 | portkey = Portkey( 6 | api_key=os.environ.get("PORTKEY_API_KEY"), 7 | ) 8 | 9 | 10 | traceId = "" 11 | 12 | 13 | print("Step: Create Feedback") 14 | result = portkey.feedback.create( 15 | trace_id=traceId, 16 | value="1", 17 | ) 18 | print(result) 19 | 20 | 21 | print("Step: Update Feedback") 22 | result = portkey.feedback.update( 23 | feedback_id=traceId, 24 | value="7", 25 | ) 26 | print(result) 27 | -------------------------------------------------------------------------------- /tests/utils.py: -------------------------------------------------------------------------------- 1 | import json 2 | from typing import Any, Dict 3 | 4 | 5 | def read_json_file(path: str) -> Dict[str, Any]: 6 | return json.load(open(path, "r")) 7 | 8 | 9 | def check_chat_streaming_chunk(chunk) -> bool: 10 | stop_reason = chunk.choices[0].finish_reason 11 | if isinstance(stop_reason, str) is True: 12 | return chunk.choices[0].delta.content == "" 13 | else: 14 | return isinstance(chunk.choices[0].delta.content, str) 15 | 16 | 17 | def check_text_streaming_chunk(chunk) -> bool: 18 | return isinstance(chunk.choices[0].text, str) 19 | -------------------------------------------------------------------------------- /vendorize.toml: -------------------------------------------------------------------------------- 1 | target = "portkey_ai/_vendor" 2 | packages = [ 3 | "openai==1.78.0" 4 | ] --------------------------------------------------------------------------------