ogx_open_client 1.0.3.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ogx_client/__init__.py +1135 -0
- ogx_client/_exceptions.py +114 -0
- ogx_client/_types.py +312 -0
- ogx_client/_version.py +8 -0
- ogx_client/api/__init__.py +33 -0
- ogx_client/api/admin_api.py +1411 -0
- ogx_client/api/alpha_api.py +354 -0
- ogx_client/api/batches_api.py +1247 -0
- ogx_client/api/chat_api.py +352 -0
- ogx_client/api/chat_completions_api.py +1028 -0
- ogx_client/api/completions_api.py +440 -0
- ogx_client/api/connectors_api.py +1235 -0
- ogx_client/api/conversations_api.py +1288 -0
- ogx_client/api/embeddings_api.py +429 -0
- ogx_client/api/file_batches_api.py +1370 -0
- ogx_client/api/file_processors_api.py +442 -0
- ogx_client/api/files_api.py +1539 -0
- ogx_client/api/inference_api.py +429 -0
- ogx_client/api/input_items_api.py +472 -0
- ogx_client/api/inspect_api.py +617 -0
- ogx_client/api/interactions_api.py +430 -0
- ogx_client/api/items_api.py +1359 -0
- ogx_client/api/messages_api.py +2466 -0
- ogx_client/api/models_api.py +451 -0
- ogx_client/api/openai_api.py +481 -0
- ogx_client/api/prompts_api.py +1883 -0
- ogx_client/api/providers_api.py +636 -0
- ogx_client/api/responses_api.py +1876 -0
- ogx_client/api/routes_api.py +389 -0
- ogx_client/api/tools_api.py +389 -0
- ogx_client/api/vector_io_api.py +740 -0
- ogx_client/api/vector_stores_api.py +1936 -0
- ogx_client/api/vector_stores_files_api.py +2011 -0
- ogx_client/api/versions_api.py +386 -0
- ogx_client/api_client.py +833 -0
- ogx_client/api_response.py +21 -0
- ogx_client/async_api_client.py +203 -0
- ogx_client/async_api_response.py +134 -0
- ogx_client/async_stream.py +161 -0
- ogx_client/configuration.py +585 -0
- ogx_client/exceptions.py +253 -0
- ogx_client/lib/__init__.py +17 -0
- ogx_client/lib/_utils.py +26 -0
- ogx_client/lib/agents/__init__.py +5 -0
- ogx_client/lib/agents/agent.py +540 -0
- ogx_client/lib/agents/client_tool.py +258 -0
- ogx_client/lib/agents/event_logger.py +134 -0
- ogx_client/lib/agents/event_synthesizer.py +448 -0
- ogx_client/lib/agents/react/__init__.py +5 -0
- ogx_client/lib/agents/react/agent.py +94 -0
- ogx_client/lib/agents/react/prompts.py +151 -0
- ogx_client/lib/agents/react/tool_parser.py +59 -0
- ogx_client/lib/agents/tool_parser.py +42 -0
- ogx_client/lib/agents/turn_events.py +268 -0
- ogx_client/lib/agents/types.py +63 -0
- ogx_client/lib/cli/__init__.py +12 -0
- ogx_client/lib/cli/common/__init__.py +5 -0
- ogx_client/lib/cli/common/utils.py +54 -0
- ogx_client/lib/cli/configure.py +68 -0
- ogx_client/lib/cli/constants.py +14 -0
- ogx_client/lib/cli/datasets/__init__.py +9 -0
- ogx_client/lib/cli/datasets/datasets.py +22 -0
- ogx_client/lib/cli/datasets/list.py +32 -0
- ogx_client/lib/cli/datasets/register.py +78 -0
- ogx_client/lib/cli/datasets/unregister.py +20 -0
- ogx_client/lib/cli/eval/__init__.py +9 -0
- ogx_client/lib/cli/eval/eval.py +22 -0
- ogx_client/lib/cli/eval/run_benchmark.py +193 -0
- ogx_client/lib/cli/eval/run_scoring.py +116 -0
- ogx_client/lib/cli/eval/utils.py +59 -0
- ogx_client/lib/cli/eval_tasks/__init__.py +9 -0
- ogx_client/lib/cli/eval_tasks/eval_tasks.py +65 -0
- ogx_client/lib/cli/eval_tasks/list.py +35 -0
- ogx_client/lib/cli/inference/__init__.py +9 -0
- ogx_client/lib/cli/inference/inference.py +88 -0
- ogx_client/lib/cli/inspect/__init__.py +9 -0
- ogx_client/lib/cli/inspect/inspect.py +19 -0
- ogx_client/lib/cli/inspect/version.py +22 -0
- ogx_client/lib/cli/models/__init__.py +9 -0
- ogx_client/lib/cli/models/models.py +149 -0
- ogx_client/lib/cli/ogx_client.py +111 -0
- ogx_client/lib/cli/post_training/__init__.py +9 -0
- ogx_client/lib/cli/post_training/post_training.py +114 -0
- ogx_client/lib/cli/providers/__init__.py +9 -0
- ogx_client/lib/cli/providers/inspect.py +33 -0
- ogx_client/lib/cli/providers/list.py +32 -0
- ogx_client/lib/cli/providers/providers.py +21 -0
- ogx_client/lib/cli/scoring_functions/__init__.py +9 -0
- ogx_client/lib/cli/scoring_functions/list.py +38 -0
- ogx_client/lib/cli/scoring_functions/scoring_functions.py +62 -0
- ogx_client/lib/cli/toolgroups/__init__.py +9 -0
- ogx_client/lib/cli/toolgroups/toolgroups.py +129 -0
- ogx_client/lib/cli/vector_stores/__init__.py +9 -0
- ogx_client/lib/cli/vector_stores/vector_stores.py +138 -0
- ogx_client/lib/inference/__init__.py +5 -0
- ogx_client/lib/inference/event_logger.py +58 -0
- ogx_client/lib/inference/utils.py +21 -0
- ogx_client/lib/stream_printer.py +30 -0
- ogx_client/lib/tools/__init__.py +9 -0
- ogx_client/lib/tools/mcp_oauth.py +303 -0
- ogx_client/models/__init__.py +505 -0
- ogx_client/models/add_items_request.py +148 -0
- ogx_client/models/allowed_tools_config.py +145 -0
- ogx_client/models/allowed_tools_filter.py +141 -0
- ogx_client/models/anthropic_base64_image_source.py +140 -0
- ogx_client/models/anthropic_base64_image_source_anthropic_url_image_source.py +396 -0
- ogx_client/models/anthropic_count_tokens_request.py +170 -0
- ogx_client/models/anthropic_count_tokens_response.py +119 -0
- ogx_client/models/anthropic_create_message_request.py +217 -0
- ogx_client/models/anthropic_image_block.py +144 -0
- ogx_client/models/anthropic_list_models_response.py +163 -0
- ogx_client/models/anthropic_message.py +141 -0
- ogx_client/models/anthropic_message_response.py +187 -0
- ogx_client/models/anthropic_model_info.py +149 -0
- ogx_client/models/anthropic_text_block.py +131 -0
- ogx_client/models/anthropic_text_block5_variants.py +549 -0
- ogx_client/models/anthropic_text_block5_variants1.py +549 -0
- ogx_client/models/anthropic_text_block_anthropic_image_block.py +203 -0
- ogx_client/models/anthropic_thinking_block.py +138 -0
- ogx_client/models/anthropic_thinking_config.py +137 -0
- ogx_client/models/anthropic_tool_def.py +128 -0
- ogx_client/models/anthropic_tool_result_block_input.py +153 -0
- ogx_client/models/anthropic_tool_result_block_output.py +153 -0
- ogx_client/models/anthropic_tool_use_block.py +135 -0
- ogx_client/models/anthropic_url_image_source.py +131 -0
- ogx_client/models/anthropic_usage.py +135 -0
- ogx_client/models/api.py +59 -0
- ogx_client/models/approval_filter.py +148 -0
- ogx_client/models/array_type.py +129 -0
- ogx_client/models/batch.py +302 -0
- ogx_client/models/batch_error.py +158 -0
- ogx_client/models/batch_request_counts.py +136 -0
- ogx_client/models/batch_usage.py +166 -0
- ogx_client/models/bf16_quantization_config.py +129 -0
- ogx_client/models/boolean_type.py +129 -0
- ogx_client/models/cancel_batch_request.py +119 -0
- ogx_client/models/chat_completion_input_type.py +129 -0
- ogx_client/models/chat_completion_message.py +216 -0
- ogx_client/models/chat_completion_message_custom_tool_call.py +143 -0
- ogx_client/models/chat_completion_message_custom_tool_call_custom.py +121 -0
- ogx_client/models/chat_completion_message_function_call.py +121 -0
- ogx_client/models/chat_completion_message_list.py +165 -0
- ogx_client/models/chat_completion_message_tool_call.py +143 -0
- ogx_client/models/chat_completion_message_tool_call_chat_completion_message_custom_tool_call.py +203 -0
- ogx_client/models/chat_completion_message_tool_call_chat_completion_message_custom_tool_call1.py +206 -0
- ogx_client/models/chat_completion_message_tool_call_function.py +121 -0
- ogx_client/models/chunk.py +151 -0
- ogx_client/models/chunk_for_deletion.py +121 -0
- ogx_client/models/chunk_metadata.py +180 -0
- ogx_client/models/compact_response_request.py +239 -0
- ogx_client/models/comparison_filter.py +135 -0
- ogx_client/models/completion_input_type.py +129 -0
- ogx_client/models/compound_filter.py +128 -0
- ogx_client/models/connector.py +152 -0
- ogx_client/models/connector_input.py +131 -0
- ogx_client/models/connector_type.py +42 -0
- ogx_client/models/context_management.py +133 -0
- ogx_client/models/conversation.py +140 -0
- ogx_client/models/conversation_deleted_resource.py +133 -0
- ogx_client/models/conversation_item.py +855 -0
- ogx_client/models/conversation_item_create_request.py +148 -0
- ogx_client/models/conversation_item_deleted_resource.py +133 -0
- ogx_client/models/conversation_item_include.py +48 -0
- ogx_client/models/conversation_item_list.py +158 -0
- ogx_client/models/conversation_message.py +149 -0
- ogx_client/models/create_batch_request.py +144 -0
- ogx_client/models/create_conversation_request.py +159 -0
- ogx_client/models/create_message_batch_request.py +148 -0
- ogx_client/models/create_prompt_request.py +126 -0
- ogx_client/models/create_response_request.py +407 -0
- ogx_client/models/custom_tool_config.py +119 -0
- ogx_client/models/delete_chunks_request.py +132 -0
- ogx_client/models/delete_conversation_request.py +119 -0
- ogx_client/models/delete_file_request.py +119 -0
- ogx_client/models/delete_item_request.py +121 -0
- ogx_client/models/delete_prompt_request.py +119 -0
- ogx_client/models/dialog_type.py +129 -0
- ogx_client/models/embedded_chunk.py +157 -0
- ogx_client/models/embedded_chunk_input.py +157 -0
- ogx_client/models/embedded_chunk_output.py +157 -0
- ogx_client/models/embeddings_response.py +136 -0
- ogx_client/models/error.py +143 -0
- ogx_client/models/error_detail.py +313 -0
- ogx_client/models/errors.py +172 -0
- ogx_client/models/expires_after.py +129 -0
- ogx_client/models/fp8_quantization_config.py +129 -0
- ogx_client/models/function_tool_config.py +119 -0
- ogx_client/models/get_chat_completion_request.py +119 -0
- ogx_client/models/get_connector_request.py +119 -0
- ogx_client/models/get_connector_tool_request.py +121 -0
- ogx_client/models/get_conversation_request.py +119 -0
- ogx_client/models/get_model_request.py +119 -0
- ogx_client/models/get_model_v1_models_model_id_get200_response.py +414 -0
- ogx_client/models/get_prompt_request.py +126 -0
- ogx_client/models/google_create_interaction_request.py +213 -0
- ogx_client/models/google_function_call_content.py +153 -0
- ogx_client/models/google_function_call_output.py +153 -0
- ogx_client/models/google_function_declaration.py +146 -0
- ogx_client/models/google_function_response_content.py +160 -0
- ogx_client/models/google_generation_config.py +146 -0
- ogx_client/models/google_input_turn.py +141 -0
- ogx_client/models/google_interaction_response.py +199 -0
- ogx_client/models/google_list_models_response.py +147 -0
- ogx_client/models/google_model_info.py +123 -0
- ogx_client/models/google_text_content.py +131 -0
- ogx_client/models/google_text_content_google_function_call_content_google_function_response_content.py +218 -0
- ogx_client/models/google_text_output.py +131 -0
- ogx_client/models/google_text_output_google_function_call_output_google_thought_output.py +447 -0
- ogx_client/models/google_thought_output.py +149 -0
- ogx_client/models/google_tool.py +145 -0
- ogx_client/models/google_usage.py +136 -0
- ogx_client/models/grammar_response_format.py +131 -0
- ogx_client/models/greedy_sampling_strategy.py +129 -0
- ogx_client/models/greedy_sampling_strategy_top_p_sampling_strategy_top_k_sampling_strategy.py +447 -0
- ogx_client/models/health_info.py +120 -0
- ogx_client/models/health_status.py +44 -0
- ogx_client/models/image_content_item.py +144 -0
- ogx_client/models/image_content_item_input.py +144 -0
- ogx_client/models/image_content_item_input_text_content_item.py +396 -0
- ogx_client/models/image_content_item_output.py +144 -0
- ogx_client/models/image_content_item_output_text_content_item.py +396 -0
- ogx_client/models/image_content_item_text_content_item.py +396 -0
- ogx_client/models/image_delta.py +131 -0
- ogx_client/models/inline_provider_spec.py +183 -0
- ogx_client/models/input_tokens_details.py +132 -0
- ogx_client/models/insert_chunks_request.py +139 -0
- ogx_client/models/inspect_provider_request.py +119 -0
- ogx_client/models/int4_quantization_config.py +136 -0
- ogx_client/models/integer_number.py +207 -0
- ogx_client/models/interleaved_content.py +280 -0
- ogx_client/models/interleaved_content_item.py +396 -0
- ogx_client/models/job.py +122 -0
- ogx_client/models/job_status.py +46 -0
- ogx_client/models/json_schema_response_format.py +131 -0
- ogx_client/models/json_type.py +129 -0
- ogx_client/models/list_batches_request.py +126 -0
- ogx_client/models/list_batches_response.py +158 -0
- ogx_client/models/list_chat_completion_messages_request.py +142 -0
- ogx_client/models/list_chat_completions_request.py +147 -0
- ogx_client/models/list_connector_tools_request.py +119 -0
- ogx_client/models/list_connectors_response.py +147 -0
- ogx_client/models/list_files_request.py +147 -0
- ogx_client/models/list_items_request.py +158 -0
- ogx_client/models/list_message_batches_response.py +163 -0
- ogx_client/models/list_models_response.py +147 -0
- ogx_client/models/list_models_v1_models_get200_response.py +414 -0
- ogx_client/models/list_number_string.py +265 -0
- ogx_client/models/list_open_ai_chat_completion_response.py +165 -0
- ogx_client/models/list_open_ai_file_response.py +165 -0
- ogx_client/models/list_open_ai_response_input_item.py +159 -0
- ogx_client/models/list_open_ai_response_object.py +165 -0
- ogx_client/models/list_prompt_versions_request.py +119 -0
- ogx_client/models/list_prompts_response.py +147 -0
- ogx_client/models/list_providers_response.py +147 -0
- ogx_client/models/list_routes_request.py +134 -0
- ogx_client/models/list_routes_response.py +147 -0
- ogx_client/models/list_string_allowed_tools_filter.py +269 -0
- ogx_client/models/list_tool_defs_response.py +147 -0
- ogx_client/models/list_tool_groups_response.py +147 -0
- ogx_client/models/list_tools_request.py +124 -0
- ogx_client/models/list_tools_response.py +147 -0
- ogx_client/models/mcp_list_tools_tool.py +128 -0
- ogx_client/models/message_batch.py +187 -0
- ogx_client/models/message_batch_request_counts.py +127 -0
- ogx_client/models/message_batch_request_params.py +142 -0
- ogx_client/models/metric_in_response.py +141 -0
- ogx_client/models/model.py +171 -0
- ogx_client/models/model_type.py +44 -0
- ogx_client/models/number_type.py +129 -0
- ogx_client/models/object_type.py +129 -0
- ogx_client/models/open_ai_assistant_message_param.py +187 -0
- ogx_client/models/open_ai_assistant_message_param_input.py +187 -0
- ogx_client/models/open_ai_assistant_message_param_output.py +187 -0
- ogx_client/models/open_ai_attach_file_request.py +164 -0
- ogx_client/models/open_ai_chat_completion.py +173 -0
- ogx_client/models/open_ai_chat_completion_chunk.py +173 -0
- ogx_client/models/open_ai_chat_completion_content_part_image_param.py +144 -0
- ogx_client/models/open_ai_chat_completion_content_part_param.py +447 -0
- ogx_client/models/open_ai_chat_completion_content_part_text_param.py +131 -0
- ogx_client/models/open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param.py +203 -0
- ogx_client/models/open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param_open_ai_file.py +447 -0
- ogx_client/models/open_ai_chat_completion_custom_tool_call_function.py +121 -0
- ogx_client/models/open_ai_chat_completion_request_with_extra_body.py +377 -0
- ogx_client/models/open_ai_chat_completion_response_message.py +180 -0
- ogx_client/models/open_ai_chat_completion_tool_call_function.py +121 -0
- ogx_client/models/open_ai_chat_completion_tool_choice.py +447 -0
- ogx_client/models/open_ai_chat_completion_tool_choice_allowed_tools.py +144 -0
- ogx_client/models/open_ai_chat_completion_tool_choice_custom_tool.py +144 -0
- ogx_client/models/open_ai_chat_completion_tool_choice_function_tool.py +144 -0
- ogx_client/models/open_ai_chat_completion_usage.py +154 -0
- ogx_client/models/open_ai_chat_completion_usage_completion_tokens_details.py +120 -0
- ogx_client/models/open_ai_chat_completion_usage_prompt_tokens_details.py +120 -0
- ogx_client/models/open_ai_choice.py +167 -0
- ogx_client/models/open_ai_choice_delta.py +163 -0
- ogx_client/models/open_ai_choice_logprobs.py +169 -0
- ogx_client/models/open_ai_chunk_choice.py +162 -0
- ogx_client/models/open_ai_chunk_choice_logprobs.py +169 -0
- ogx_client/models/open_ai_compacted_response.py +161 -0
- ogx_client/models/open_ai_completion.py +149 -0
- ogx_client/models/open_ai_completion_choice.py +154 -0
- ogx_client/models/open_ai_completion_logprobs.py +162 -0
- ogx_client/models/open_ai_completion_request_with_extra_body.py +273 -0
- ogx_client/models/open_ai_completion_with_input_messages.py +186 -0
- ogx_client/models/open_ai_create_vector_store_file_batch_request_with_extra_body.py +212 -0
- ogx_client/models/open_ai_create_vector_store_request_with_extra_body.py +198 -0
- ogx_client/models/open_ai_delete_response_object.py +133 -0
- ogx_client/models/open_ai_developer_message_param.py +151 -0
- ogx_client/models/open_ai_embedding_data.py +147 -0
- ogx_client/models/open_ai_embedding_usage.py +121 -0
- ogx_client/models/open_ai_embeddings_request_with_extra_body.py +164 -0
- ogx_client/models/open_ai_embeddings_response.py +160 -0
- ogx_client/models/open_ai_file.py +144 -0
- ogx_client/models/open_ai_file_delete_response.py +133 -0
- ogx_client/models/open_ai_file_file.py +138 -0
- ogx_client/models/open_ai_file_object.py +153 -0
- ogx_client/models/open_ai_file_purpose.py +50 -0
- ogx_client/models/open_ai_file_upload_purpose.py +47 -0
- ogx_client/models/open_ai_finish_reason.py +46 -0
- ogx_client/models/open_ai_image_url.py +136 -0
- ogx_client/models/open_ai_list_models_response.py +142 -0
- ogx_client/models/open_ai_message_param.py +549 -0
- ogx_client/models/open_ai_model.py +142 -0
- ogx_client/models/open_ai_response_annotation_citation.py +137 -0
- ogx_client/models/open_ai_response_annotation_container_file_citation.py +139 -0
- ogx_client/models/open_ai_response_annotation_file_citation.py +135 -0
- ogx_client/models/open_ai_response_annotation_file_citation4_variants.py +498 -0
- ogx_client/models/open_ai_response_annotation_file_path.py +133 -0
- ogx_client/models/open_ai_response_annotations.py +498 -0
- ogx_client/models/open_ai_response_compaction.py +138 -0
- ogx_client/models/open_ai_response_content_part.py +447 -0
- ogx_client/models/open_ai_response_content_part_output_text.py +162 -0
- ogx_client/models/open_ai_response_content_part_output_text_open_ai_response_content_part_refusal_open_ai_response_content_part_reasoning_text.py +447 -0
- ogx_client/models/open_ai_response_content_part_reasoning_summary.py +131 -0
- ogx_client/models/open_ai_response_content_part_reasoning_text.py +131 -0
- ogx_client/models/open_ai_response_content_part_refusal.py +131 -0
- ogx_client/models/open_ai_response_error.py +121 -0
- ogx_client/models/open_ai_response_format_json_object.py +129 -0
- ogx_client/models/open_ai_response_format_json_schema.py +144 -0
- ogx_client/models/open_ai_response_format_param.py +447 -0
- ogx_client/models/open_ai_response_format_text.py +129 -0
- ogx_client/models/open_ai_response_format_text_open_ai_response_format_json_schema_open_ai_response_format_json_object.py +453 -0
- ogx_client/models/open_ai_response_incomplete_details.py +119 -0
- ogx_client/models/open_ai_response_input.py +251 -0
- ogx_client/models/open_ai_response_input_function_tool_call_output.py +160 -0
- ogx_client/models/open_ai_response_input_function_tool_call_output_open_ai_response_mcp_approval_response_open_ai_response_compaction.py +233 -0
- ogx_client/models/open_ai_response_input_message_content.py +447 -0
- ogx_client/models/open_ai_response_input_message_content_file.py +157 -0
- ogx_client/models/open_ai_response_input_message_content_image.py +155 -0
- ogx_client/models/open_ai_response_input_message_content_text.py +131 -0
- ogx_client/models/open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file.py +447 -0
- ogx_client/models/open_ai_response_input_tool.py +516 -0
- ogx_client/models/open_ai_response_input_tool_choice.py +203 -0
- ogx_client/models/open_ai_response_input_tool_choice_allowed_tools.py +143 -0
- ogx_client/models/open_ai_response_input_tool_choice_allowed_tools6_variants.py +618 -0
- ogx_client/models/open_ai_response_input_tool_choice_custom_tool.py +131 -0
- ogx_client/models/open_ai_response_input_tool_choice_file_search.py +129 -0
- ogx_client/models/open_ai_response_input_tool_choice_function_tool.py +131 -0
- ogx_client/models/open_ai_response_input_tool_choice_mcp_tool.py +138 -0
- ogx_client/models/open_ai_response_input_tool_choice_mode.py +44 -0
- ogx_client/models/open_ai_response_input_tool_choice_mode1.py +209 -0
- ogx_client/models/open_ai_response_input_tool_choice_mode2.py +209 -0
- ogx_client/models/open_ai_response_input_tool_choice_web_search.py +129 -0
- ogx_client/models/open_ai_response_input_tool_file_search.py +166 -0
- ogx_client/models/open_ai_response_input_tool_function.py +152 -0
- ogx_client/models/open_ai_response_input_tool_mcp.py +194 -0
- ogx_client/models/open_ai_response_input_tool_web_search.py +147 -0
- ogx_client/models/open_ai_response_input_tool_web_search4_variants.py +516 -0
- ogx_client/models/open_ai_response_input_tool_web_search4_variants1.py +516 -0
- ogx_client/models/open_ai_response_mcp_approval_request.py +137 -0
- ogx_client/models/open_ai_response_mcp_approval_response.py +147 -0
- ogx_client/models/open_ai_response_message.py +167 -0
- ogx_client/models/open_ai_response_message11_variants.py +855 -0
- ogx_client/models/open_ai_response_message8_variants.py +702 -0
- ogx_client/models/open_ai_response_message_input.py +167 -0
- ogx_client/models/open_ai_response_message_input11_variants.py +855 -0
- ogx_client/models/open_ai_response_message_input8_variants.py +702 -0
- ogx_client/models/open_ai_response_message_output.py +167 -0
- ogx_client/models/open_ai_response_message_output11_variants.py +855 -0
- ogx_client/models/open_ai_response_message_output8_variants.py +702 -0
- ogx_client/models/open_ai_response_message_output_union.py +233 -0
- ogx_client/models/open_ai_response_object.py +412 -0
- ogx_client/models/open_ai_response_object_stream.py +2181 -0
- ogx_client/models/open_ai_response_object_stream_error.py +147 -0
- ogx_client/models/open_ai_response_object_stream_response_completed.py +146 -0
- ogx_client/models/open_ai_response_object_stream_response_content_part_added.py +154 -0
- ogx_client/models/open_ai_response_object_stream_response_content_part_done.py +154 -0
- ogx_client/models/open_ai_response_object_stream_response_created.py +146 -0
- ogx_client/models/open_ai_response_object_stream_response_failed.py +146 -0
- ogx_client/models/open_ai_response_object_stream_response_file_search_call_completed.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_file_search_call_in_progress.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_file_search_call_searching.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_function_call_arguments_delta.py +137 -0
- ogx_client/models/open_ai_response_object_stream_response_function_call_arguments_done.py +137 -0
- ogx_client/models/open_ai_response_object_stream_response_in_progress.py +146 -0
- ogx_client/models/open_ai_response_object_stream_response_incomplete.py +146 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_call_arguments_delta.py +137 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_call_arguments_done.py +137 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_call_completed.py +131 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_call_failed.py +131 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_call_in_progress.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_list_tools_completed.py +131 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_list_tools_failed.py +131 -0
- ogx_client/models/open_ai_response_object_stream_response_mcp_list_tools_in_progress.py +131 -0
- ogx_client/models/open_ai_response_object_stream_response_output_item_added.py +150 -0
- ogx_client/models/open_ai_response_object_stream_response_output_item_done.py +150 -0
- ogx_client/models/open_ai_response_object_stream_response_output_text_annotation_added.py +154 -0
- ogx_client/models/open_ai_response_object_stream_response_output_text_delta.py +157 -0
- ogx_client/models/open_ai_response_object_stream_response_output_text_done.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_summary_part_added.py +152 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_summary_part_done.py +152 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_summary_text_delta.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_summary_text_done.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_text_delta.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_reasoning_text_done.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_refusal_delta.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_refusal_done.py +139 -0
- ogx_client/models/open_ai_response_object_stream_response_web_search_call_completed.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_web_search_call_in_progress.py +135 -0
- ogx_client/models/open_ai_response_object_stream_response_web_search_call_searching.py +135 -0
- ogx_client/models/open_ai_response_object_with_input.py +425 -0
- ogx_client/models/open_ai_response_output.py +702 -0
- ogx_client/models/open_ai_response_output_item.py +702 -0
- ogx_client/models/open_ai_response_output_message_content.py +396 -0
- ogx_client/models/open_ai_response_output_message_content_output_text.py +162 -0
- ogx_client/models/open_ai_response_output_message_content_output_text_input.py +162 -0
- ogx_client/models/open_ai_response_output_message_content_output_text_input_open_ai_response_content_part_refusal.py +396 -0
- ogx_client/models/open_ai_response_output_message_content_output_text_open_ai_response_content_part_refusal.py +396 -0
- ogx_client/models/open_ai_response_output_message_content_output_text_output.py +162 -0
- ogx_client/models/open_ai_response_output_message_content_output_text_output_open_ai_response_content_part_refusal.py +396 -0
- ogx_client/models/open_ai_response_output_message_file_search_tool_call.py +153 -0
- ogx_client/models/open_ai_response_output_message_file_search_tool_call_results.py +127 -0
- ogx_client/models/open_ai_response_output_message_function_tool_call.py +149 -0
- ogx_client/models/open_ai_response_output_message_mcp_call.py +151 -0
- ogx_client/models/open_ai_response_output_message_mcp_list_tools.py +146 -0
- ogx_client/models/open_ai_response_output_message_reasoning_content.py +131 -0
- ogx_client/models/open_ai_response_output_message_reasoning_item.py +179 -0
- ogx_client/models/open_ai_response_output_message_reasoning_summary.py +131 -0
- ogx_client/models/open_ai_response_output_message_web_search_tool_call.py +133 -0
- ogx_client/models/open_ai_response_prompt.py +151 -0
- ogx_client/models/open_ai_response_reasoning.py +168 -0
- ogx_client/models/open_ai_response_text.py +154 -0
- ogx_client/models/open_ai_response_text_format.py +157 -0
- ogx_client/models/open_ai_response_tool.py +516 -0
- ogx_client/models/open_ai_response_tool_mcp.py +151 -0
- ogx_client/models/open_ai_response_usage.py +153 -0
- ogx_client/models/open_ai_response_usage_input_tokens_details.py +119 -0
- ogx_client/models/open_ai_response_usage_output_tokens_details.py +119 -0
- ogx_client/models/open_ai_search_vector_store_request.py +171 -0
- ogx_client/models/open_ai_system_message_param.py +151 -0
- ogx_client/models/open_ai_token_log_prob.py +146 -0
- ogx_client/models/open_ai_tool_message_param.py +146 -0
- ogx_client/models/open_ai_top_log_prob.py +128 -0
- ogx_client/models/open_ai_update_vector_store_file_request.py +119 -0
- ogx_client/models/open_ai_update_vector_store_request.py +151 -0
- ogx_client/models/open_ai_user_message_param.py +151 -0
- ogx_client/models/open_ai_user_message_param_input.py +151 -0
- ogx_client/models/open_ai_user_message_param_input5_variants.py +549 -0
- ogx_client/models/open_ai_user_message_param_output.py +151 -0
- ogx_client/models/open_ai_user_message_param_output5_variants.py +549 -0
- ogx_client/models/open_aijson_schema.py +140 -0
- ogx_client/models/order.py +43 -0
- ogx_client/models/output_tokens_details.py +132 -0
- ogx_client/models/paginated_response.py +145 -0
- ogx_client/models/param_type.py +753 -0
- ogx_client/models/process_file_request.py +151 -0
- ogx_client/models/process_file_response.py +149 -0
- ogx_client/models/prompt.py +133 -0
- ogx_client/models/provider_info.py +127 -0
- ogx_client/models/provider_spec.py +169 -0
- ogx_client/models/query_chunks_request.py +141 -0
- ogx_client/models/query_chunks_response.py +149 -0
- ogx_client/models/register_model_request.py +155 -0
- ogx_client/models/remote_provider_spec.py +178 -0
- ogx_client/models/rerank_data.py +122 -0
- ogx_client/models/rerank_request.py +155 -0
- ogx_client/models/rerank_response.py +147 -0
- ogx_client/models/response_format.py +396 -0
- ogx_client/models/response_item_include.py +48 -0
- ogx_client/models/response_retrieve_item_v1_conversations_conversation_id_items_item_id_get.py +849 -0
- ogx_client/models/response_stream_options.py +119 -0
- ogx_client/models/response_truncation.py +43 -0
- ogx_client/models/retrieve_batch_request.py +119 -0
- ogx_client/models/retrieve_file_content_request.py +119 -0
- ogx_client/models/retrieve_file_request.py +119 -0
- ogx_client/models/retrieve_item_request.py +121 -0
- ogx_client/models/route_info.py +123 -0
- ogx_client/models/sampling_params.py +154 -0
- ogx_client/models/sampling_strategy.py +447 -0
- ogx_client/models/score_request.py +136 -0
- ogx_client/models/scoring_result.py +124 -0
- ogx_client/models/search_ranking_options.py +160 -0
- ogx_client/models/service_tier.py +45 -0
- ogx_client/models/set_default_version_body_request.py +119 -0
- ogx_client/models/set_default_version_request.py +121 -0
- ogx_client/models/string4_variants.py +415 -0
- ogx_client/models/string4_variants1.py +416 -0
- ogx_client/models/string_approval_filter.py +222 -0
- ogx_client/models/string_list_anthropic_text_block.py +272 -0
- ogx_client/models/string_list_anthropic_text_block1.py +272 -0
- ogx_client/models/string_list_anthropic_text_block_anthropic_image_block.py +266 -0
- ogx_client/models/string_list_google_input_turn.py +266 -0
- ogx_client/models/string_list_google_text_content_google_function_call_content_google_function_response_content.py +266 -0
- ogx_client/models/string_list_image_content_item_input_text_content_item.py +280 -0
- ogx_client/models/string_list_image_content_item_input_text_content_item1.py +280 -0
- ogx_client/models/string_list_image_content_item_output_text_content_item.py +280 -0
- ogx_client/models/string_list_image_content_item_text_content_item.py +286 -0
- ogx_client/models/string_list_image_content_item_text_content_item1.py +280 -0
- ogx_client/models/string_list_image_content_item_text_content_item2.py +286 -0
- ogx_client/models/string_list_image_content_item_text_content_item3.py +280 -0
- ogx_client/models/string_list_image_content_item_text_content_item4.py +280 -0
- ogx_client/models/string_list_image_content_item_text_content_item5.py +280 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param.py +272 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param1.py +266 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param2.py +266 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param3.py +266 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param4.py +272 -0
- ogx_client/models/string_list_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param_open_ai_file.py +266 -0
- ogx_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file.py +266 -0
- ogx_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_input_open_ai_response_content_part_refusal.py +342 -0
- ogx_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_open_ai_response_content_part_refusal.py +342 -0
- ogx_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_output_open_ai_response_content_part_refusal.py +342 -0
- ogx_client/models/string_list_open_ai_response_message_union_open_ai_response_input_function_tool_call_output.py +272 -0
- ogx_client/models/string_list_open_ai_response_message_union_open_ai_response_input_function_tool_call_output1.py +266 -0
- ogx_client/models/string_list_string.py +271 -0
- ogx_client/models/string_list_string1.py +265 -0
- ogx_client/models/string_list_string2.py +265 -0
- ogx_client/models/string_number_boolean.py +225 -0
- ogx_client/models/string_number_boolean1.py +224 -0
- ogx_client/models/string_object.py +271 -0
- ogx_client/models/string_object1.py +271 -0
- ogx_client/models/string_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param.py +220 -0
- ogx_client/models/string_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param1.py +220 -0
- ogx_client/models/string_type.py +129 -0
- ogx_client/models/system_message.py +144 -0
- ogx_client/models/text_content_item.py +131 -0
- ogx_client/models/text_delta.py +131 -0
- ogx_client/models/token_log_probs.py +119 -0
- ogx_client/models/tool_config.py +119 -0
- ogx_client/models/tool_def.py +154 -0
- ogx_client/models/tool_group.py +167 -0
- ogx_client/models/tool_group_input.py +148 -0
- ogx_client/models/tool_invocation_result.py +158 -0
- ogx_client/models/tool_response_message.py +146 -0
- ogx_client/models/top_k_sampling_strategy.py +132 -0
- ogx_client/models/top_p_sampling_strategy.py +134 -0
- ogx_client/models/union_type.py +129 -0
- ogx_client/models/unregister_model_request.py +119 -0
- ogx_client/models/update_conversation_request.py +119 -0
- ogx_client/models/update_prompt_body_request.py +130 -0
- ogx_client/models/update_prompt_request.py +132 -0
- ogx_client/models/upload_file_request.py +140 -0
- ogx_client/models/url.py +119 -0
- ogx_client/models/urlor_data.py +144 -0
- ogx_client/models/user_message.py +164 -0
- ogx_client/models/vector_store_chunking_strategy.py +453 -0
- ogx_client/models/vector_store_chunking_strategy_auto.py +129 -0
- ogx_client/models/vector_store_chunking_strategy_auto_vector_store_chunking_strategy_static_vector_store_chunking_strategy_contextual.py +453 -0
- ogx_client/models/vector_store_chunking_strategy_auto_vector_store_chunking_strategy_static_vector_store_chunking_strategy_contextual1.py +447 -0
- ogx_client/models/vector_store_chunking_strategy_contextual.py +144 -0
- ogx_client/models/vector_store_chunking_strategy_contextual_config.py +145 -0
- ogx_client/models/vector_store_chunking_strategy_static.py +144 -0
- ogx_client/models/vector_store_chunking_strategy_static_config.py +122 -0
- ogx_client/models/vector_store_content.py +162 -0
- ogx_client/models/vector_store_create_request.py +167 -0
- ogx_client/models/vector_store_delete_response.py +133 -0
- ogx_client/models/vector_store_expiration_after.py +129 -0
- ogx_client/models/vector_store_file_batch_file_entry.py +164 -0
- ogx_client/models/vector_store_file_batch_object.py +159 -0
- ogx_client/models/vector_store_file_content_response.py +151 -0
- ogx_client/models/vector_store_file_counts.py +127 -0
- ogx_client/models/vector_store_file_delete_response.py +133 -0
- ogx_client/models/vector_store_file_last_error.py +128 -0
- ogx_client/models/vector_store_file_object.py +206 -0
- ogx_client/models/vector_store_file_status.py +45 -0
- ogx_client/models/vector_store_files_list_in_batch_response.py +148 -0
- ogx_client/models/vector_store_list_files_response.py +148 -0
- ogx_client/models/vector_store_list_response.py +148 -0
- ogx_client/models/vector_store_modify_request.py +151 -0
- ogx_client/models/vector_store_object.py +202 -0
- ogx_client/models/vector_store_search_request.py +151 -0
- ogx_client/models/vector_store_search_response.py +161 -0
- ogx_client/models/vector_store_search_response_page.py +153 -0
- ogx_client/models/vector_store_status.py +44 -0
- ogx_client/models/version_info.py +119 -0
- ogx_client/ogx_client.py +309 -0
- ogx_client/py.typed +0 -0
- ogx_client/rest.py +255 -0
- ogx_client/stream.py +183 -0
- ogx_open_client/__init__.py +1167 -0
- ogx_open_client/_exceptions.py +114 -0
- ogx_open_client/_types.py +312 -0
- ogx_open_client/_version.py +8 -0
- ogx_open_client/api/__init__.py +33 -0
- ogx_open_client/api/admin_api.py +1411 -0
- ogx_open_client/api/alpha_api.py +354 -0
- ogx_open_client/api/batches_api.py +1247 -0
- ogx_open_client/api/chat_api.py +352 -0
- ogx_open_client/api/chat_completions_api.py +1028 -0
- ogx_open_client/api/completions_api.py +440 -0
- ogx_open_client/api/connectors_api.py +1235 -0
- ogx_open_client/api/conversations_api.py +1288 -0
- ogx_open_client/api/embeddings_api.py +429 -0
- ogx_open_client/api/file_batches_api.py +1370 -0
- ogx_open_client/api/file_processors_api.py +442 -0
- ogx_open_client/api/files_api.py +1539 -0
- ogx_open_client/api/inference_api.py +429 -0
- ogx_open_client/api/input_items_api.py +472 -0
- ogx_open_client/api/inspect_api.py +617 -0
- ogx_open_client/api/interactions_api.py +430 -0
- ogx_open_client/api/items_api.py +1359 -0
- ogx_open_client/api/messages_api.py +2466 -0
- ogx_open_client/api/models_api.py +451 -0
- ogx_open_client/api/openai_api.py +481 -0
- ogx_open_client/api/prompts_api.py +1883 -0
- ogx_open_client/api/providers_api.py +636 -0
- ogx_open_client/api/responses_api.py +1876 -0
- ogx_open_client/api/routes_api.py +389 -0
- ogx_open_client/api/tools_api.py +389 -0
- ogx_open_client/api/vector_io_api.py +740 -0
- ogx_open_client/api/vector_stores_api.py +1936 -0
- ogx_open_client/api/vector_stores_files_api.py +2011 -0
- ogx_open_client/api/versions_api.py +386 -0
- ogx_open_client/api_client.py +833 -0
- ogx_open_client/api_response.py +21 -0
- ogx_open_client/async_api_client.py +203 -0
- ogx_open_client/async_api_response.py +134 -0
- ogx_open_client/async_stream.py +161 -0
- ogx_open_client/configuration.py +585 -0
- ogx_open_client/exceptions.py +253 -0
- ogx_open_client/lib/__init__.py +17 -0
- ogx_open_client/lib/_utils.py +26 -0
- ogx_open_client/lib/agents/__init__.py +5 -0
- ogx_open_client/lib/agents/agent.py +540 -0
- ogx_open_client/lib/agents/client_tool.py +258 -0
- ogx_open_client/lib/agents/event_logger.py +134 -0
- ogx_open_client/lib/agents/event_synthesizer.py +448 -0
- ogx_open_client/lib/agents/react/__init__.py +5 -0
- ogx_open_client/lib/agents/react/agent.py +94 -0
- ogx_open_client/lib/agents/react/prompts.py +151 -0
- ogx_open_client/lib/agents/react/tool_parser.py +59 -0
- ogx_open_client/lib/agents/tool_parser.py +42 -0
- ogx_open_client/lib/agents/turn_events.py +268 -0
- ogx_open_client/lib/agents/types.py +63 -0
- ogx_open_client/lib/cli/__init__.py +12 -0
- ogx_open_client/lib/cli/common/__init__.py +5 -0
- ogx_open_client/lib/cli/common/utils.py +54 -0
- ogx_open_client/lib/cli/configure.py +68 -0
- ogx_open_client/lib/cli/constants.py +14 -0
- ogx_open_client/lib/cli/datasets/__init__.py +9 -0
- ogx_open_client/lib/cli/datasets/datasets.py +22 -0
- ogx_open_client/lib/cli/datasets/list.py +32 -0
- ogx_open_client/lib/cli/datasets/register.py +78 -0
- ogx_open_client/lib/cli/datasets/unregister.py +20 -0
- ogx_open_client/lib/cli/eval/__init__.py +9 -0
- ogx_open_client/lib/cli/eval/eval.py +22 -0
- ogx_open_client/lib/cli/eval/run_benchmark.py +193 -0
- ogx_open_client/lib/cli/eval/run_scoring.py +116 -0
- ogx_open_client/lib/cli/eval/utils.py +59 -0
- ogx_open_client/lib/cli/eval_tasks/__init__.py +9 -0
- ogx_open_client/lib/cli/eval_tasks/eval_tasks.py +65 -0
- ogx_open_client/lib/cli/eval_tasks/list.py +35 -0
- ogx_open_client/lib/cli/inference/__init__.py +9 -0
- ogx_open_client/lib/cli/inference/inference.py +88 -0
- ogx_open_client/lib/cli/inspect/__init__.py +9 -0
- ogx_open_client/lib/cli/inspect/inspect.py +19 -0
- ogx_open_client/lib/cli/inspect/version.py +22 -0
- ogx_open_client/lib/cli/models/__init__.py +9 -0
- ogx_open_client/lib/cli/models/models.py +149 -0
- ogx_open_client/lib/cli/ogx_client.py +111 -0
- ogx_open_client/lib/cli/post_training/__init__.py +9 -0
- ogx_open_client/lib/cli/post_training/post_training.py +114 -0
- ogx_open_client/lib/cli/providers/__init__.py +9 -0
- ogx_open_client/lib/cli/providers/inspect.py +33 -0
- ogx_open_client/lib/cli/providers/list.py +32 -0
- ogx_open_client/lib/cli/providers/providers.py +21 -0
- ogx_open_client/lib/cli/scoring_functions/__init__.py +9 -0
- ogx_open_client/lib/cli/scoring_functions/list.py +38 -0
- ogx_open_client/lib/cli/scoring_functions/scoring_functions.py +62 -0
- ogx_open_client/lib/cli/toolgroups/__init__.py +9 -0
- ogx_open_client/lib/cli/toolgroups/toolgroups.py +129 -0
- ogx_open_client/lib/cli/vector_stores/__init__.py +9 -0
- ogx_open_client/lib/cli/vector_stores/vector_stores.py +138 -0
- ogx_open_client/lib/inference/__init__.py +5 -0
- ogx_open_client/lib/inference/event_logger.py +58 -0
- ogx_open_client/lib/inference/utils.py +21 -0
- ogx_open_client/lib/stream_printer.py +30 -0
- ogx_open_client/lib/tools/__init__.py +9 -0
- ogx_open_client/lib/tools/mcp_oauth.py +303 -0
- ogx_open_client/models/__init__.py +521 -0
- ogx_open_client/models/add_items_request.py +148 -0
- ogx_open_client/models/allowed_tools_config.py +145 -0
- ogx_open_client/models/allowed_tools_filter.py +141 -0
- ogx_open_client/models/anthropic_base64_image_source.py +140 -0
- ogx_open_client/models/anthropic_base64_image_source_anthropic_url_image_source.py +396 -0
- ogx_open_client/models/anthropic_bash_tool.py +161 -0
- ogx_open_client/models/anthropic_cache_control.py +129 -0
- ogx_open_client/models/anthropic_count_tokens_request.py +170 -0
- ogx_open_client/models/anthropic_count_tokens_response.py +119 -0
- ogx_open_client/models/anthropic_create_message_request.py +217 -0
- ogx_open_client/models/anthropic_custom_tool_def.py +160 -0
- ogx_open_client/models/anthropic_custom_tool_def4_variants.py +510 -0
- ogx_open_client/models/anthropic_image_block.py +164 -0
- ogx_open_client/models/anthropic_list_models_response.py +163 -0
- ogx_open_client/models/anthropic_message.py +141 -0
- ogx_open_client/models/anthropic_message_response.py +187 -0
- ogx_open_client/models/anthropic_model_info.py +149 -0
- ogx_open_client/models/anthropic_redacted_thinking_block.py +131 -0
- ogx_open_client/models/anthropic_text_block.py +151 -0
- ogx_open_client/models/anthropic_text_block5_variants.py +549 -0
- ogx_open_client/models/anthropic_text_block5_variants1.py +549 -0
- ogx_open_client/models/anthropic_text_block6_variants.py +600 -0
- ogx_open_client/models/anthropic_text_block6_variants1.py +600 -0
- ogx_open_client/models/anthropic_text_block_anthropic_image_block.py +203 -0
- ogx_open_client/models/anthropic_text_editor_tool.py +155 -0
- ogx_open_client/models/anthropic_thinking_block.py +158 -0
- ogx_open_client/models/anthropic_thinking_config.py +137 -0
- ogx_open_client/models/anthropic_tool_def.py +128 -0
- ogx_open_client/models/anthropic_tool_result_block_input.py +173 -0
- ogx_open_client/models/anthropic_tool_result_block_output.py +173 -0
- ogx_open_client/models/anthropic_tool_use_block.py +155 -0
- ogx_open_client/models/anthropic_url_image_source.py +131 -0
- ogx_open_client/models/anthropic_usage.py +135 -0
- ogx_open_client/models/anthropic_web_search_tool.py +202 -0
- ogx_open_client/models/api.py +59 -0
- ogx_open_client/models/approval_filter.py +148 -0
- ogx_open_client/models/array_type.py +129 -0
- ogx_open_client/models/batch.py +302 -0
- ogx_open_client/models/batch_error.py +158 -0
- ogx_open_client/models/batch_request_counts.py +136 -0
- ogx_open_client/models/batch_usage.py +166 -0
- ogx_open_client/models/bf16_quantization_config.py +129 -0
- ogx_open_client/models/boolean_type.py +129 -0
- ogx_open_client/models/cancel_batch_request.py +119 -0
- ogx_open_client/models/chat_completion_input_type.py +129 -0
- ogx_open_client/models/chat_completion_message.py +216 -0
- ogx_open_client/models/chat_completion_message_custom_tool_call.py +143 -0
- ogx_open_client/models/chat_completion_message_custom_tool_call_custom.py +121 -0
- ogx_open_client/models/chat_completion_message_function_call.py +121 -0
- ogx_open_client/models/chat_completion_message_list.py +165 -0
- ogx_open_client/models/chat_completion_message_tool_call.py +143 -0
- ogx_open_client/models/chat_completion_message_tool_call_chat_completion_message_custom_tool_call.py +203 -0
- ogx_open_client/models/chat_completion_message_tool_call_chat_completion_message_custom_tool_call1.py +206 -0
- ogx_open_client/models/chat_completion_message_tool_call_function.py +121 -0
- ogx_open_client/models/chunk.py +151 -0
- ogx_open_client/models/chunk_for_deletion.py +121 -0
- ogx_open_client/models/chunk_metadata.py +180 -0
- ogx_open_client/models/compact_response_request.py +239 -0
- ogx_open_client/models/comparison_filter.py +135 -0
- ogx_open_client/models/completion_input_type.py +129 -0
- ogx_open_client/models/compound_filter.py +128 -0
- ogx_open_client/models/connector.py +152 -0
- ogx_open_client/models/connector_input.py +131 -0
- ogx_open_client/models/connector_type.py +42 -0
- ogx_open_client/models/context_management.py +133 -0
- ogx_open_client/models/conversation.py +140 -0
- ogx_open_client/models/conversation_deleted_resource.py +133 -0
- ogx_open_client/models/conversation_item.py +855 -0
- ogx_open_client/models/conversation_item_create_request.py +148 -0
- ogx_open_client/models/conversation_item_deleted_resource.py +133 -0
- ogx_open_client/models/conversation_item_include.py +48 -0
- ogx_open_client/models/conversation_item_list.py +158 -0
- ogx_open_client/models/conversation_message.py +149 -0
- ogx_open_client/models/create_batch_request.py +144 -0
- ogx_open_client/models/create_conversation_request.py +159 -0
- ogx_open_client/models/create_message_batch_request.py +148 -0
- ogx_open_client/models/create_prompt_request.py +126 -0
- ogx_open_client/models/create_response_request.py +402 -0
- ogx_open_client/models/custom_tool_config.py +119 -0
- ogx_open_client/models/delete_chunks_request.py +132 -0
- ogx_open_client/models/delete_conversation_request.py +119 -0
- ogx_open_client/models/delete_file_request.py +119 -0
- ogx_open_client/models/delete_item_request.py +121 -0
- ogx_open_client/models/delete_prompt_request.py +119 -0
- ogx_open_client/models/dialog_type.py +129 -0
- ogx_open_client/models/embedded_chunk.py +157 -0
- ogx_open_client/models/embedded_chunk_input.py +157 -0
- ogx_open_client/models/embedded_chunk_output.py +157 -0
- ogx_open_client/models/embeddings_response.py +136 -0
- ogx_open_client/models/error.py +143 -0
- ogx_open_client/models/error_detail.py +313 -0
- ogx_open_client/models/errors.py +172 -0
- ogx_open_client/models/expires_after.py +129 -0
- ogx_open_client/models/fp8_quantization_config.py +129 -0
- ogx_open_client/models/function_tool_config.py +119 -0
- ogx_open_client/models/get_chat_completion_request.py +119 -0
- ogx_open_client/models/get_connector_request.py +119 -0
- ogx_open_client/models/get_connector_tool_request.py +121 -0
- ogx_open_client/models/get_conversation_request.py +119 -0
- ogx_open_client/models/get_model_request.py +119 -0
- ogx_open_client/models/get_model_v1_models_model_id_get200_response.py +414 -0
- ogx_open_client/models/get_prompt_request.py +126 -0
- ogx_open_client/models/google_create_interaction_request.py +213 -0
- ogx_open_client/models/google_function_call_content.py +153 -0
- ogx_open_client/models/google_function_call_output.py +153 -0
- ogx_open_client/models/google_function_declaration.py +146 -0
- ogx_open_client/models/google_function_response_content.py +160 -0
- ogx_open_client/models/google_generation_config.py +146 -0
- ogx_open_client/models/google_input_turn.py +141 -0
- ogx_open_client/models/google_interaction_response.py +199 -0
- ogx_open_client/models/google_list_models_response.py +147 -0
- ogx_open_client/models/google_model_info.py +123 -0
- ogx_open_client/models/google_text_content.py +131 -0
- ogx_open_client/models/google_text_content_google_function_call_content_google_function_response_content.py +218 -0
- ogx_open_client/models/google_text_output.py +131 -0
- ogx_open_client/models/google_text_output_google_function_call_output_google_thought_output.py +447 -0
- ogx_open_client/models/google_thought_output.py +149 -0
- ogx_open_client/models/google_tool.py +145 -0
- ogx_open_client/models/google_usage.py +136 -0
- ogx_open_client/models/grammar_response_format.py +131 -0
- ogx_open_client/models/greedy_sampling_strategy.py +129 -0
- ogx_open_client/models/greedy_sampling_strategy_top_p_sampling_strategy_top_k_sampling_strategy.py +447 -0
- ogx_open_client/models/health_info.py +120 -0
- ogx_open_client/models/health_status.py +44 -0
- ogx_open_client/models/image_content_item.py +144 -0
- ogx_open_client/models/image_content_item_input.py +144 -0
- ogx_open_client/models/image_content_item_input_text_content_item.py +396 -0
- ogx_open_client/models/image_content_item_output.py +144 -0
- ogx_open_client/models/image_content_item_output_text_content_item.py +396 -0
- ogx_open_client/models/image_content_item_text_content_item.py +396 -0
- ogx_open_client/models/image_delta.py +131 -0
- ogx_open_client/models/inline_provider_spec.py +183 -0
- ogx_open_client/models/input_tokens_details.py +132 -0
- ogx_open_client/models/insert_chunks_request.py +139 -0
- ogx_open_client/models/inspect_provider_request.py +119 -0
- ogx_open_client/models/int4_quantization_config.py +136 -0
- ogx_open_client/models/integer_number.py +207 -0
- ogx_open_client/models/interleaved_content.py +280 -0
- ogx_open_client/models/interleaved_content_item.py +396 -0
- ogx_open_client/models/job.py +122 -0
- ogx_open_client/models/job_status.py +46 -0
- ogx_open_client/models/json_schema_response_format.py +131 -0
- ogx_open_client/models/json_type.py +129 -0
- ogx_open_client/models/list_batches_request.py +126 -0
- ogx_open_client/models/list_batches_response.py +158 -0
- ogx_open_client/models/list_chat_completion_messages_request.py +142 -0
- ogx_open_client/models/list_chat_completions_request.py +147 -0
- ogx_open_client/models/list_connector_tools_request.py +119 -0
- ogx_open_client/models/list_connectors_response.py +147 -0
- ogx_open_client/models/list_files_request.py +147 -0
- ogx_open_client/models/list_items_request.py +158 -0
- ogx_open_client/models/list_message_batches_response.py +163 -0
- ogx_open_client/models/list_models_response.py +147 -0
- ogx_open_client/models/list_models_v1_models_get200_response.py +414 -0
- ogx_open_client/models/list_number_string.py +265 -0
- ogx_open_client/models/list_open_ai_chat_completion_response.py +165 -0
- ogx_open_client/models/list_open_ai_file_response.py +165 -0
- ogx_open_client/models/list_open_ai_response_input_item.py +159 -0
- ogx_open_client/models/list_open_ai_response_object.py +165 -0
- ogx_open_client/models/list_prompt_versions_request.py +119 -0
- ogx_open_client/models/list_prompts_response.py +147 -0
- ogx_open_client/models/list_providers_response.py +147 -0
- ogx_open_client/models/list_routes_request.py +134 -0
- ogx_open_client/models/list_routes_response.py +147 -0
- ogx_open_client/models/list_string_allowed_tools_filter.py +269 -0
- ogx_open_client/models/list_tool_defs_response.py +147 -0
- ogx_open_client/models/list_tool_groups_response.py +147 -0
- ogx_open_client/models/list_tools_request.py +124 -0
- ogx_open_client/models/list_tools_response.py +147 -0
- ogx_open_client/models/mcp_list_tools_tool.py +128 -0
- ogx_open_client/models/message_batch.py +187 -0
- ogx_open_client/models/message_batch_request_counts.py +127 -0
- ogx_open_client/models/message_batch_request_params.py +142 -0
- ogx_open_client/models/metric_in_response.py +141 -0
- ogx_open_client/models/model.py +171 -0
- ogx_open_client/models/model_type.py +44 -0
- ogx_open_client/models/number_type.py +129 -0
- ogx_open_client/models/object_type.py +129 -0
- ogx_open_client/models/open_ai_assistant_message_param.py +187 -0
- ogx_open_client/models/open_ai_assistant_message_param_input.py +187 -0
- ogx_open_client/models/open_ai_assistant_message_param_output.py +187 -0
- ogx_open_client/models/open_ai_attach_file_request.py +164 -0
- ogx_open_client/models/open_ai_chat_completion.py +173 -0
- ogx_open_client/models/open_ai_chat_completion_chunk.py +173 -0
- ogx_open_client/models/open_ai_chat_completion_content_part_image_param.py +144 -0
- ogx_open_client/models/open_ai_chat_completion_content_part_param.py +447 -0
- ogx_open_client/models/open_ai_chat_completion_content_part_text_param.py +131 -0
- ogx_open_client/models/open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param.py +203 -0
- ogx_open_client/models/open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param_open_ai_file.py +447 -0
- ogx_open_client/models/open_ai_chat_completion_custom_tool_call_function.py +121 -0
- ogx_open_client/models/open_ai_chat_completion_request_with_extra_body.py +377 -0
- ogx_open_client/models/open_ai_chat_completion_response_message.py +180 -0
- ogx_open_client/models/open_ai_chat_completion_tool_call_function.py +121 -0
- ogx_open_client/models/open_ai_chat_completion_tool_choice.py +447 -0
- ogx_open_client/models/open_ai_chat_completion_tool_choice_allowed_tools.py +144 -0
- ogx_open_client/models/open_ai_chat_completion_tool_choice_custom_tool.py +144 -0
- ogx_open_client/models/open_ai_chat_completion_tool_choice_function_tool.py +144 -0
- ogx_open_client/models/open_ai_chat_completion_usage.py +154 -0
- ogx_open_client/models/open_ai_chat_completion_usage_completion_tokens_details.py +120 -0
- ogx_open_client/models/open_ai_chat_completion_usage_prompt_tokens_details.py +120 -0
- ogx_open_client/models/open_ai_choice.py +167 -0
- ogx_open_client/models/open_ai_choice_delta.py +163 -0
- ogx_open_client/models/open_ai_choice_logprobs.py +169 -0
- ogx_open_client/models/open_ai_chunk_choice.py +162 -0
- ogx_open_client/models/open_ai_chunk_choice_logprobs.py +169 -0
- ogx_open_client/models/open_ai_compacted_response.py +161 -0
- ogx_open_client/models/open_ai_completion.py +149 -0
- ogx_open_client/models/open_ai_completion_choice.py +154 -0
- ogx_open_client/models/open_ai_completion_logprobs.py +162 -0
- ogx_open_client/models/open_ai_completion_request_with_extra_body.py +273 -0
- ogx_open_client/models/open_ai_completion_with_input_messages.py +186 -0
- ogx_open_client/models/open_ai_create_vector_store_file_batch_request_with_extra_body.py +212 -0
- ogx_open_client/models/open_ai_create_vector_store_request_with_extra_body.py +198 -0
- ogx_open_client/models/open_ai_delete_response_object.py +133 -0
- ogx_open_client/models/open_ai_developer_message_param.py +151 -0
- ogx_open_client/models/open_ai_embedding_data.py +147 -0
- ogx_open_client/models/open_ai_embedding_usage.py +121 -0
- ogx_open_client/models/open_ai_embeddings_request_with_extra_body.py +164 -0
- ogx_open_client/models/open_ai_embeddings_response.py +160 -0
- ogx_open_client/models/open_ai_file.py +144 -0
- ogx_open_client/models/open_ai_file_delete_response.py +133 -0
- ogx_open_client/models/open_ai_file_file.py +138 -0
- ogx_open_client/models/open_ai_file_object.py +153 -0
- ogx_open_client/models/open_ai_file_purpose.py +50 -0
- ogx_open_client/models/open_ai_file_upload_purpose.py +47 -0
- ogx_open_client/models/open_ai_finish_reason.py +46 -0
- ogx_open_client/models/open_ai_image_url.py +136 -0
- ogx_open_client/models/open_ai_list_models_response.py +142 -0
- ogx_open_client/models/open_ai_message_param.py +549 -0
- ogx_open_client/models/open_ai_model.py +142 -0
- ogx_open_client/models/open_ai_response_annotation_citation.py +137 -0
- ogx_open_client/models/open_ai_response_annotation_container_file_citation.py +139 -0
- ogx_open_client/models/open_ai_response_annotation_file_citation.py +135 -0
- ogx_open_client/models/open_ai_response_annotation_file_citation4_variants.py +498 -0
- ogx_open_client/models/open_ai_response_annotation_file_path.py +133 -0
- ogx_open_client/models/open_ai_response_annotations.py +498 -0
- ogx_open_client/models/open_ai_response_compaction.py +138 -0
- ogx_open_client/models/open_ai_response_content_part.py +447 -0
- ogx_open_client/models/open_ai_response_content_part_output_text.py +162 -0
- ogx_open_client/models/open_ai_response_content_part_output_text_open_ai_response_content_part_refusal_open_ai_response_content_part_reasoning_text.py +447 -0
- ogx_open_client/models/open_ai_response_content_part_reasoning_summary.py +131 -0
- ogx_open_client/models/open_ai_response_content_part_reasoning_text.py +131 -0
- ogx_open_client/models/open_ai_response_content_part_refusal.py +131 -0
- ogx_open_client/models/open_ai_response_error.py +121 -0
- ogx_open_client/models/open_ai_response_format_json_object.py +129 -0
- ogx_open_client/models/open_ai_response_format_json_schema.py +144 -0
- ogx_open_client/models/open_ai_response_format_param.py +447 -0
- ogx_open_client/models/open_ai_response_format_text.py +129 -0
- ogx_open_client/models/open_ai_response_format_text_open_ai_response_format_json_schema_open_ai_response_format_json_object.py +453 -0
- ogx_open_client/models/open_ai_response_incomplete_details.py +119 -0
- ogx_open_client/models/open_ai_response_input.py +251 -0
- ogx_open_client/models/open_ai_response_input_function_tool_call_output.py +160 -0
- ogx_open_client/models/open_ai_response_input_function_tool_call_output_open_ai_response_mcp_approval_response_open_ai_response_compaction.py +233 -0
- ogx_open_client/models/open_ai_response_input_message_content.py +447 -0
- ogx_open_client/models/open_ai_response_input_message_content_file.py +157 -0
- ogx_open_client/models/open_ai_response_input_message_content_image.py +155 -0
- ogx_open_client/models/open_ai_response_input_message_content_text.py +131 -0
- ogx_open_client/models/open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file.py +447 -0
- ogx_open_client/models/open_ai_response_input_tool.py +516 -0
- ogx_open_client/models/open_ai_response_input_tool_choice.py +203 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_allowed_tools.py +143 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_allowed_tools6_variants.py +618 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_custom_tool.py +131 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_file_search.py +129 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_function_tool.py +131 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_mcp_tool.py +138 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_mode.py +44 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_mode1.py +209 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_mode2.py +209 -0
- ogx_open_client/models/open_ai_response_input_tool_choice_web_search.py +129 -0
- ogx_open_client/models/open_ai_response_input_tool_file_search.py +166 -0
- ogx_open_client/models/open_ai_response_input_tool_function.py +152 -0
- ogx_open_client/models/open_ai_response_input_tool_mcp.py +194 -0
- ogx_open_client/models/open_ai_response_input_tool_web_search.py +186 -0
- ogx_open_client/models/open_ai_response_input_tool_web_search4_variants.py +516 -0
- ogx_open_client/models/open_ai_response_input_tool_web_search4_variants1.py +516 -0
- ogx_open_client/models/open_ai_response_mcp_approval_request.py +137 -0
- ogx_open_client/models/open_ai_response_mcp_approval_response.py +147 -0
- ogx_open_client/models/open_ai_response_message.py +167 -0
- ogx_open_client/models/open_ai_response_message11_variants.py +855 -0
- ogx_open_client/models/open_ai_response_message8_variants.py +702 -0
- ogx_open_client/models/open_ai_response_message_input.py +167 -0
- ogx_open_client/models/open_ai_response_message_input11_variants.py +855 -0
- ogx_open_client/models/open_ai_response_message_input8_variants.py +702 -0
- ogx_open_client/models/open_ai_response_message_output.py +167 -0
- ogx_open_client/models/open_ai_response_message_output11_variants.py +855 -0
- ogx_open_client/models/open_ai_response_message_output8_variants.py +702 -0
- ogx_open_client/models/open_ai_response_message_output_union.py +233 -0
- ogx_open_client/models/open_ai_response_object.py +407 -0
- ogx_open_client/models/open_ai_response_object_stream.py +2181 -0
- ogx_open_client/models/open_ai_response_object_stream_error.py +147 -0
- ogx_open_client/models/open_ai_response_object_stream_response_completed.py +146 -0
- ogx_open_client/models/open_ai_response_object_stream_response_content_part_added.py +154 -0
- ogx_open_client/models/open_ai_response_object_stream_response_content_part_done.py +154 -0
- ogx_open_client/models/open_ai_response_object_stream_response_created.py +146 -0
- ogx_open_client/models/open_ai_response_object_stream_response_failed.py +146 -0
- ogx_open_client/models/open_ai_response_object_stream_response_file_search_call_completed.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_file_search_call_in_progress.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_file_search_call_searching.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_function_call_arguments_delta.py +137 -0
- ogx_open_client/models/open_ai_response_object_stream_response_function_call_arguments_done.py +137 -0
- ogx_open_client/models/open_ai_response_object_stream_response_in_progress.py +146 -0
- ogx_open_client/models/open_ai_response_object_stream_response_incomplete.py +146 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_call_arguments_delta.py +137 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_call_arguments_done.py +137 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_call_completed.py +131 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_call_failed.py +131 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_call_in_progress.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_list_tools_completed.py +131 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_list_tools_failed.py +131 -0
- ogx_open_client/models/open_ai_response_object_stream_response_mcp_list_tools_in_progress.py +131 -0
- ogx_open_client/models/open_ai_response_object_stream_response_output_item_added.py +150 -0
- ogx_open_client/models/open_ai_response_object_stream_response_output_item_done.py +150 -0
- ogx_open_client/models/open_ai_response_object_stream_response_output_text_annotation_added.py +154 -0
- ogx_open_client/models/open_ai_response_object_stream_response_output_text_delta.py +157 -0
- ogx_open_client/models/open_ai_response_object_stream_response_output_text_done.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_summary_part_added.py +152 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_summary_part_done.py +152 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_summary_text_delta.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_summary_text_done.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_text_delta.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_reasoning_text_done.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_refusal_delta.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_refusal_done.py +139 -0
- ogx_open_client/models/open_ai_response_object_stream_response_web_search_call_completed.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_web_search_call_in_progress.py +135 -0
- ogx_open_client/models/open_ai_response_object_stream_response_web_search_call_searching.py +135 -0
- ogx_open_client/models/open_ai_response_object_with_input.py +425 -0
- ogx_open_client/models/open_ai_response_output.py +702 -0
- ogx_open_client/models/open_ai_response_output_item.py +702 -0
- ogx_open_client/models/open_ai_response_output_message_content.py +396 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text.py +162 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text_input.py +162 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text_input_open_ai_response_content_part_refusal.py +396 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text_open_ai_response_content_part_refusal.py +396 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text_output.py +162 -0
- ogx_open_client/models/open_ai_response_output_message_content_output_text_output_open_ai_response_content_part_refusal.py +396 -0
- ogx_open_client/models/open_ai_response_output_message_file_search_tool_call.py +153 -0
- ogx_open_client/models/open_ai_response_output_message_file_search_tool_call_results.py +127 -0
- ogx_open_client/models/open_ai_response_output_message_function_tool_call.py +149 -0
- ogx_open_client/models/open_ai_response_output_message_mcp_call.py +151 -0
- ogx_open_client/models/open_ai_response_output_message_mcp_list_tools.py +146 -0
- ogx_open_client/models/open_ai_response_output_message_reasoning_content.py +131 -0
- ogx_open_client/models/open_ai_response_output_message_reasoning_item.py +179 -0
- ogx_open_client/models/open_ai_response_output_message_reasoning_summary.py +131 -0
- ogx_open_client/models/open_ai_response_output_message_web_search_tool_call.py +153 -0
- ogx_open_client/models/open_ai_response_output_message_web_search_tool_call_input.py +153 -0
- ogx_open_client/models/open_ai_response_output_message_web_search_tool_call_output.py +153 -0
- ogx_open_client/models/open_ai_response_prompt.py +151 -0
- ogx_open_client/models/open_ai_response_reasoning.py +168 -0
- ogx_open_client/models/open_ai_response_text.py +154 -0
- ogx_open_client/models/open_ai_response_text_format.py +157 -0
- ogx_open_client/models/open_ai_response_tool.py +516 -0
- ogx_open_client/models/open_ai_response_tool_mcp.py +151 -0
- ogx_open_client/models/open_ai_response_usage.py +153 -0
- ogx_open_client/models/open_ai_response_usage_input_tokens_details.py +119 -0
- ogx_open_client/models/open_ai_response_usage_output_tokens_details.py +119 -0
- ogx_open_client/models/open_ai_search_vector_store_request.py +171 -0
- ogx_open_client/models/open_ai_system_message_param.py +151 -0
- ogx_open_client/models/open_ai_token_log_prob.py +146 -0
- ogx_open_client/models/open_ai_tool_message_param.py +146 -0
- ogx_open_client/models/open_ai_top_log_prob.py +128 -0
- ogx_open_client/models/open_ai_update_vector_store_file_request.py +119 -0
- ogx_open_client/models/open_ai_update_vector_store_request.py +151 -0
- ogx_open_client/models/open_ai_user_message_param.py +151 -0
- ogx_open_client/models/open_ai_user_message_param_input.py +151 -0
- ogx_open_client/models/open_ai_user_message_param_input5_variants.py +549 -0
- ogx_open_client/models/open_ai_user_message_param_output.py +151 -0
- ogx_open_client/models/open_ai_user_message_param_output5_variants.py +549 -0
- ogx_open_client/models/open_aijson_schema.py +140 -0
- ogx_open_client/models/order.py +43 -0
- ogx_open_client/models/output_tokens_details.py +132 -0
- ogx_open_client/models/paginated_response.py +145 -0
- ogx_open_client/models/param_type.py +753 -0
- ogx_open_client/models/process_file_request.py +151 -0
- ogx_open_client/models/process_file_response.py +149 -0
- ogx_open_client/models/prompt.py +133 -0
- ogx_open_client/models/provider_info.py +127 -0
- ogx_open_client/models/provider_spec.py +169 -0
- ogx_open_client/models/query_chunks_request.py +141 -0
- ogx_open_client/models/query_chunks_response.py +149 -0
- ogx_open_client/models/register_model_request.py +155 -0
- ogx_open_client/models/remote_provider_spec.py +178 -0
- ogx_open_client/models/rerank_data.py +122 -0
- ogx_open_client/models/rerank_request.py +155 -0
- ogx_open_client/models/rerank_response.py +147 -0
- ogx_open_client/models/response_format.py +396 -0
- ogx_open_client/models/response_item_include.py +48 -0
- ogx_open_client/models/response_retrieve_item_v1_conversations_conversation_id_items_item_id_get.py +849 -0
- ogx_open_client/models/response_stream_options.py +119 -0
- ogx_open_client/models/response_truncation.py +43 -0
- ogx_open_client/models/retrieve_batch_request.py +119 -0
- ogx_open_client/models/retrieve_file_content_request.py +119 -0
- ogx_open_client/models/retrieve_file_request.py +119 -0
- ogx_open_client/models/retrieve_item_request.py +121 -0
- ogx_open_client/models/route_info.py +123 -0
- ogx_open_client/models/sampling_params.py +154 -0
- ogx_open_client/models/sampling_strategy.py +447 -0
- ogx_open_client/models/score_request.py +136 -0
- ogx_open_client/models/scoring_result.py +124 -0
- ogx_open_client/models/search_ranking_options.py +160 -0
- ogx_open_client/models/service_tier.py +45 -0
- ogx_open_client/models/set_default_version_body_request.py +119 -0
- ogx_open_client/models/set_default_version_request.py +121 -0
- ogx_open_client/models/string4_variants.py +415 -0
- ogx_open_client/models/string4_variants1.py +416 -0
- ogx_open_client/models/string_approval_filter.py +222 -0
- ogx_open_client/models/string_list_anthropic_text_block.py +272 -0
- ogx_open_client/models/string_list_anthropic_text_block1.py +272 -0
- ogx_open_client/models/string_list_anthropic_text_block_anthropic_image_block.py +266 -0
- ogx_open_client/models/string_list_google_input_turn.py +266 -0
- ogx_open_client/models/string_list_google_text_content_google_function_call_content_google_function_response_content.py +266 -0
- ogx_open_client/models/string_list_image_content_item_input_text_content_item.py +280 -0
- ogx_open_client/models/string_list_image_content_item_input_text_content_item1.py +280 -0
- ogx_open_client/models/string_list_image_content_item_output_text_content_item.py +280 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item.py +286 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item1.py +280 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item2.py +286 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item3.py +280 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item4.py +280 -0
- ogx_open_client/models/string_list_image_content_item_text_content_item5.py +280 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param.py +272 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param1.py +266 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param2.py +266 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param3.py +266 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param4.py +272 -0
- ogx_open_client/models/string_list_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param_open_ai_file.py +266 -0
- ogx_open_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file.py +266 -0
- ogx_open_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_input_open_ai_response_content_part_refusal.py +342 -0
- ogx_open_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_open_ai_response_content_part_refusal.py +342 -0
- ogx_open_client/models/string_list_open_ai_response_input_message_content_text_open_ai_response_input_message_content_image_open_ai_response_input_message_content_file_list_open_ai_response_output_message_content_output_text_output_open_ai_response_content_part_refusal.py +342 -0
- ogx_open_client/models/string_list_open_ai_response_message_union_open_ai_response_input_function_tool_call_output.py +272 -0
- ogx_open_client/models/string_list_open_ai_response_message_union_open_ai_response_input_function_tool_call_output1.py +266 -0
- ogx_open_client/models/string_list_string.py +271 -0
- ogx_open_client/models/string_list_string1.py +265 -0
- ogx_open_client/models/string_list_string2.py +265 -0
- ogx_open_client/models/string_number_boolean.py +225 -0
- ogx_open_client/models/string_number_boolean1.py +224 -0
- ogx_open_client/models/string_object.py +271 -0
- ogx_open_client/models/string_object1.py +271 -0
- ogx_open_client/models/string_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param.py +220 -0
- ogx_open_client/models/string_open_ai_chat_completion_content_part_text_param_open_ai_chat_completion_content_part_image_param1.py +220 -0
- ogx_open_client/models/string_type.py +129 -0
- ogx_open_client/models/system_message.py +144 -0
- ogx_open_client/models/text_content_item.py +131 -0
- ogx_open_client/models/text_delta.py +131 -0
- ogx_open_client/models/token_log_probs.py +119 -0
- ogx_open_client/models/tool_config.py +119 -0
- ogx_open_client/models/tool_def.py +154 -0
- ogx_open_client/models/tool_group.py +167 -0
- ogx_open_client/models/tool_group_input.py +148 -0
- ogx_open_client/models/tool_invocation_result.py +158 -0
- ogx_open_client/models/tool_response_message.py +146 -0
- ogx_open_client/models/top_k_sampling_strategy.py +132 -0
- ogx_open_client/models/top_p_sampling_strategy.py +134 -0
- ogx_open_client/models/union_type.py +129 -0
- ogx_open_client/models/unregister_model_request.py +119 -0
- ogx_open_client/models/update_conversation_request.py +119 -0
- ogx_open_client/models/update_prompt_body_request.py +130 -0
- ogx_open_client/models/update_prompt_request.py +132 -0
- ogx_open_client/models/upload_file_request.py +140 -0
- ogx_open_client/models/url.py +119 -0
- ogx_open_client/models/urlor_data.py +144 -0
- ogx_open_client/models/user_message.py +164 -0
- ogx_open_client/models/vector_store_chunking_strategy.py +453 -0
- ogx_open_client/models/vector_store_chunking_strategy_auto.py +129 -0
- ogx_open_client/models/vector_store_chunking_strategy_auto_vector_store_chunking_strategy_static_vector_store_chunking_strategy_contextual.py +453 -0
- ogx_open_client/models/vector_store_chunking_strategy_auto_vector_store_chunking_strategy_static_vector_store_chunking_strategy_contextual1.py +447 -0
- ogx_open_client/models/vector_store_chunking_strategy_contextual.py +144 -0
- ogx_open_client/models/vector_store_chunking_strategy_contextual_config.py +145 -0
- ogx_open_client/models/vector_store_chunking_strategy_static.py +144 -0
- ogx_open_client/models/vector_store_chunking_strategy_static_config.py +122 -0
- ogx_open_client/models/vector_store_content.py +162 -0
- ogx_open_client/models/vector_store_create_request.py +167 -0
- ogx_open_client/models/vector_store_delete_response.py +133 -0
- ogx_open_client/models/vector_store_expiration_after.py +129 -0
- ogx_open_client/models/vector_store_file_batch_file_entry.py +164 -0
- ogx_open_client/models/vector_store_file_batch_object.py +159 -0
- ogx_open_client/models/vector_store_file_content_response.py +151 -0
- ogx_open_client/models/vector_store_file_counts.py +127 -0
- ogx_open_client/models/vector_store_file_delete_response.py +133 -0
- ogx_open_client/models/vector_store_file_last_error.py +128 -0
- ogx_open_client/models/vector_store_file_object.py +206 -0
- ogx_open_client/models/vector_store_file_status.py +45 -0
- ogx_open_client/models/vector_store_files_list_in_batch_response.py +148 -0
- ogx_open_client/models/vector_store_list_files_response.py +148 -0
- ogx_open_client/models/vector_store_list_response.py +148 -0
- ogx_open_client/models/vector_store_modify_request.py +151 -0
- ogx_open_client/models/vector_store_object.py +202 -0
- ogx_open_client/models/vector_store_search_request.py +151 -0
- ogx_open_client/models/vector_store_search_response.py +161 -0
- ogx_open_client/models/vector_store_search_response_page.py +153 -0
- ogx_open_client/models/vector_store_status.py +44 -0
- ogx_open_client/models/version_info.py +119 -0
- ogx_open_client/models/web_search_action_find.py +133 -0
- ogx_open_client/models/web_search_action_open_page.py +136 -0
- ogx_open_client/models/web_search_action_search.py +156 -0
- ogx_open_client/models/web_search_action_search_web_search_action_open_page_web_search_action_find.py +224 -0
- ogx_open_client/models/web_search_action_search_web_search_action_open_page_web_search_action_find1.py +224 -0
- ogx_open_client/models/web_search_filters.py +141 -0
- ogx_open_client/models/web_search_source.py +131 -0
- ogx_open_client/models/web_search_user_location.py +157 -0
- ogx_open_client/ogx_client.py +309 -0
- ogx_open_client/py.typed +0 -0
- ogx_open_client/rest.py +255 -0
- ogx_open_client/stream.py +183 -0
- ogx_open_client-1.0.3.dev0.dist-info/METADATA +723 -0
- ogx_open_client-1.0.3.dev0.dist-info/RECORD +1199 -0
- ogx_open_client-1.0.3.dev0.dist-info/WHEEL +5 -0
- ogx_open_client-1.0.3.dev0.dist-info/top_level.txt +2 -0
ogx_client/api_client.py
ADDED
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# Copyright (c) The OGX Contributors.
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
#
|
|
6
|
+
# This source code is licensed under the terms described in the LICENSE file in
|
|
7
|
+
# the root directory of this source tree.
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
OGX Specification - Stable & Experimental APIs
|
|
11
|
+
|
|
12
|
+
This is the specification of the OGX that provides a set of endpoints and their corresponding interfaces that are tailored to best leverage Llama Models. **🔗 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features.
|
|
13
|
+
|
|
14
|
+
The version of the OpenAPI document: v1
|
|
15
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
16
|
+
|
|
17
|
+
Do not edit the class manually.
|
|
18
|
+
""" # noqa: E501
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import datetime
|
|
23
|
+
from dateutil.parser import parse
|
|
24
|
+
from enum import Enum
|
|
25
|
+
import decimal
|
|
26
|
+
import json
|
|
27
|
+
import mimetypes
|
|
28
|
+
import os
|
|
29
|
+
import re
|
|
30
|
+
import tempfile
|
|
31
|
+
import uuid
|
|
32
|
+
|
|
33
|
+
from urllib.parse import quote
|
|
34
|
+
from pydantic import SecretStr
|
|
35
|
+
|
|
36
|
+
from ogx_client.configuration import Configuration
|
|
37
|
+
from ogx_client.api_response import ApiResponse, T as ApiResponseT
|
|
38
|
+
import ogx_client.models
|
|
39
|
+
from ogx_client import rest
|
|
40
|
+
from ogx_client.exceptions import (
|
|
41
|
+
ApiValueError,
|
|
42
|
+
ApiException,
|
|
43
|
+
BadRequestException,
|
|
44
|
+
UnauthorizedException,
|
|
45
|
+
ForbiddenException,
|
|
46
|
+
NotFoundException,
|
|
47
|
+
ServiceException
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
RequestSerialized = tuple[str, str, dict[str, str], str | None, list[str]]
|
|
51
|
+
|
|
52
|
+
class ApiClient:
|
|
53
|
+
"""Generic API client for OpenAPI client library builds.
|
|
54
|
+
|
|
55
|
+
OpenAPI generic API client. This client handles the client-
|
|
56
|
+
server communication, and is invariant across implementations. Specifics of
|
|
57
|
+
the methods and models for each application are generated from the OpenAPI
|
|
58
|
+
templates.
|
|
59
|
+
|
|
60
|
+
:param configuration: .Configuration object for this client
|
|
61
|
+
:param header_name: a header to pass when making calls to the API.
|
|
62
|
+
:param header_value: a header value to pass when making calls to
|
|
63
|
+
the API.
|
|
64
|
+
:param cookie: a cookie to include in the header when making calls
|
|
65
|
+
to the API
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
|
|
69
|
+
NATIVE_TYPES_MAPPING = {
|
|
70
|
+
'int': int,
|
|
71
|
+
'long': int, # TODO remove as only py3 is supported?
|
|
72
|
+
'float': float,
|
|
73
|
+
'str': str,
|
|
74
|
+
'bool': bool,
|
|
75
|
+
'date': datetime.date,
|
|
76
|
+
'datetime': datetime.datetime,
|
|
77
|
+
'decimal': decimal.Decimal,
|
|
78
|
+
'object': object,
|
|
79
|
+
}
|
|
80
|
+
_pool = None
|
|
81
|
+
|
|
82
|
+
def __init__(
|
|
83
|
+
self,
|
|
84
|
+
configuration=None,
|
|
85
|
+
header_name=None,
|
|
86
|
+
header_value=None,
|
|
87
|
+
cookie=None
|
|
88
|
+
) -> None:
|
|
89
|
+
# use default configuration if none is provided
|
|
90
|
+
if configuration is None:
|
|
91
|
+
configuration = Configuration.get_default()
|
|
92
|
+
self.configuration = configuration
|
|
93
|
+
|
|
94
|
+
self.rest_client = rest.RESTClientObject(configuration)
|
|
95
|
+
self.default_headers = {}
|
|
96
|
+
if header_name is not None:
|
|
97
|
+
self.default_headers[header_name] = header_value
|
|
98
|
+
self.cookie = cookie
|
|
99
|
+
# Set default User-Agent.
|
|
100
|
+
self.user_agent = 'OpenAPI-Generator/1.0.3.dev0/python'
|
|
101
|
+
self.client_side_validation = configuration.client_side_validation
|
|
102
|
+
|
|
103
|
+
def __enter__(self):
|
|
104
|
+
return self
|
|
105
|
+
|
|
106
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
107
|
+
self.rest_client.close()
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def user_agent(self):
|
|
111
|
+
"""User agent for this API client"""
|
|
112
|
+
return self.default_headers['User-Agent']
|
|
113
|
+
|
|
114
|
+
@user_agent.setter
|
|
115
|
+
def user_agent(self, value):
|
|
116
|
+
self.default_headers['User-Agent'] = value
|
|
117
|
+
|
|
118
|
+
def set_default_header(self, header_name, header_value):
|
|
119
|
+
self.default_headers[header_name] = header_value
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
_default = None
|
|
123
|
+
|
|
124
|
+
@classmethod
|
|
125
|
+
def get_default(cls):
|
|
126
|
+
"""Return new instance of ApiClient.
|
|
127
|
+
|
|
128
|
+
This method returns newly created, based on default constructor,
|
|
129
|
+
object of ApiClient class or returns a copy of default
|
|
130
|
+
ApiClient.
|
|
131
|
+
|
|
132
|
+
:return: The ApiClient object.
|
|
133
|
+
"""
|
|
134
|
+
if cls._default is None:
|
|
135
|
+
cls._default = ApiClient()
|
|
136
|
+
return cls._default
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def set_default(cls, default):
|
|
140
|
+
"""Set default instance of ApiClient.
|
|
141
|
+
|
|
142
|
+
It stores default ApiClient.
|
|
143
|
+
|
|
144
|
+
:param default: object of ApiClient.
|
|
145
|
+
"""
|
|
146
|
+
cls._default = default
|
|
147
|
+
|
|
148
|
+
def param_serialize(
|
|
149
|
+
self,
|
|
150
|
+
method,
|
|
151
|
+
resource_path,
|
|
152
|
+
path_params=None,
|
|
153
|
+
query_params=None,
|
|
154
|
+
header_params=None,
|
|
155
|
+
body=None,
|
|
156
|
+
post_params=None,
|
|
157
|
+
files=None, auth_settings=None,
|
|
158
|
+
collection_formats=None,
|
|
159
|
+
_host=None,
|
|
160
|
+
_request_auth=None
|
|
161
|
+
) -> RequestSerialized:
|
|
162
|
+
|
|
163
|
+
"""Builds the HTTP request params needed by the request.
|
|
164
|
+
:param method: Method to call.
|
|
165
|
+
:param resource_path: Path to method endpoint.
|
|
166
|
+
:param path_params: Path parameters in the url.
|
|
167
|
+
:param query_params: Query parameters in the url.
|
|
168
|
+
:param header_params: Header parameters to be
|
|
169
|
+
placed in the request header.
|
|
170
|
+
:param body: Request body.
|
|
171
|
+
:param post_params dict: Request post form parameters,
|
|
172
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
173
|
+
:param auth_settings list: Auth Settings names for the request.
|
|
174
|
+
:param files dict: key -> filename, value -> filepath,
|
|
175
|
+
for `multipart/form-data`.
|
|
176
|
+
:param collection_formats: dict of collection formats for path, query,
|
|
177
|
+
header, and post parameters.
|
|
178
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
179
|
+
request; this effectively ignores the authentication
|
|
180
|
+
in the spec for a single request.
|
|
181
|
+
:return: tuple of form (path, http_method, query_params, header_params,
|
|
182
|
+
body, post_params, files)
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
config = self.configuration
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = header_params or {}
|
|
189
|
+
header_params.update(self.default_headers)
|
|
190
|
+
if self.cookie:
|
|
191
|
+
header_params['Cookie'] = self.cookie
|
|
192
|
+
if header_params:
|
|
193
|
+
header_params = self.sanitize_for_serialization(header_params)
|
|
194
|
+
header_params = dict(
|
|
195
|
+
self.parameters_to_tuples(header_params,collection_formats)
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
# path parameters
|
|
199
|
+
if path_params:
|
|
200
|
+
path_params = self.sanitize_for_serialization(path_params)
|
|
201
|
+
path_params = self.parameters_to_tuples(
|
|
202
|
+
path_params,
|
|
203
|
+
collection_formats
|
|
204
|
+
)
|
|
205
|
+
for k, v in path_params:
|
|
206
|
+
# specified safe chars, encode everything
|
|
207
|
+
resource_path = resource_path.replace(
|
|
208
|
+
'{%s}' % k,
|
|
209
|
+
quote(str(v), safe=config.safe_chars_for_path_param)
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
# post parameters
|
|
213
|
+
if post_params or files:
|
|
214
|
+
post_params = post_params if post_params else []
|
|
215
|
+
post_params = self.sanitize_for_serialization(post_params)
|
|
216
|
+
post_params = self.parameters_to_tuples(
|
|
217
|
+
post_params,
|
|
218
|
+
collection_formats
|
|
219
|
+
)
|
|
220
|
+
if files:
|
|
221
|
+
post_params.extend(self.files_parameters(files))
|
|
222
|
+
|
|
223
|
+
# auth setting
|
|
224
|
+
self.update_params_for_auth(
|
|
225
|
+
header_params,
|
|
226
|
+
query_params,
|
|
227
|
+
auth_settings,
|
|
228
|
+
resource_path,
|
|
229
|
+
method,
|
|
230
|
+
body,
|
|
231
|
+
request_auth=_request_auth
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
# body
|
|
235
|
+
if body is not None:
|
|
236
|
+
body = self.sanitize_for_serialization(body)
|
|
237
|
+
|
|
238
|
+
# request url
|
|
239
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
|
240
|
+
url = self.configuration.host + resource_path
|
|
241
|
+
else:
|
|
242
|
+
# use server/host defined in path or operation instead
|
|
243
|
+
url = _host + resource_path
|
|
244
|
+
|
|
245
|
+
# query parameters
|
|
246
|
+
if query_params:
|
|
247
|
+
query_params = self.sanitize_for_serialization(query_params)
|
|
248
|
+
url_query = self.parameters_to_url_query(
|
|
249
|
+
query_params,
|
|
250
|
+
collection_formats
|
|
251
|
+
)
|
|
252
|
+
url += "?" + url_query
|
|
253
|
+
|
|
254
|
+
return method, url, header_params, body, post_params
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def call_api(
|
|
258
|
+
self,
|
|
259
|
+
method,
|
|
260
|
+
url,
|
|
261
|
+
header_params=None,
|
|
262
|
+
body=None,
|
|
263
|
+
post_params=None,
|
|
264
|
+
_request_timeout=None
|
|
265
|
+
) -> rest.RESTResponse:
|
|
266
|
+
"""Makes the HTTP request (synchronous)
|
|
267
|
+
:param method: Method to call.
|
|
268
|
+
:param url: Path to method endpoint.
|
|
269
|
+
:param header_params: Header parameters to be
|
|
270
|
+
placed in the request header.
|
|
271
|
+
:param body: Request body.
|
|
272
|
+
:param post_params dict: Request post form parameters,
|
|
273
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
274
|
+
:param _request_timeout: timeout setting for this request.
|
|
275
|
+
:return: RESTResponse
|
|
276
|
+
"""
|
|
277
|
+
|
|
278
|
+
try:
|
|
279
|
+
# perform request and return response
|
|
280
|
+
response_data = self.rest_client.request(
|
|
281
|
+
method, url,
|
|
282
|
+
headers=header_params,
|
|
283
|
+
body=body, post_params=post_params,
|
|
284
|
+
_request_timeout=_request_timeout
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
except ApiException as e:
|
|
288
|
+
raise e
|
|
289
|
+
|
|
290
|
+
return response_data
|
|
291
|
+
|
|
292
|
+
def response_deserialize(
|
|
293
|
+
self,
|
|
294
|
+
response_data: rest.RESTResponse,
|
|
295
|
+
response_types_map: dict[str, ApiResponseT] | None=None
|
|
296
|
+
) -> ApiResponse[ApiResponseT]:
|
|
297
|
+
"""Deserializes response into an object.
|
|
298
|
+
:param response_data: RESTResponse object to be deserialized.
|
|
299
|
+
:param response_types_map: dict of response types.
|
|
300
|
+
:return: ApiResponse
|
|
301
|
+
"""
|
|
302
|
+
|
|
303
|
+
msg = "RESTResponse.read() must be called before passing it to response_deserialize()"
|
|
304
|
+
assert response_data.data is not None, msg
|
|
305
|
+
|
|
306
|
+
response_type = response_types_map.get(str(response_data.status), None)
|
|
307
|
+
if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
|
|
308
|
+
# if not found, look for '1XX', '2XX', etc.
|
|
309
|
+
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
|
310
|
+
|
|
311
|
+
# deserialize response data
|
|
312
|
+
response_text = None
|
|
313
|
+
return_data = None
|
|
314
|
+
try:
|
|
315
|
+
if response_type == "bytearray":
|
|
316
|
+
return_data = response_data.data
|
|
317
|
+
elif response_type == "file":
|
|
318
|
+
return_data = self.__deserialize_file(response_data)
|
|
319
|
+
elif response_type is not None:
|
|
320
|
+
match = None
|
|
321
|
+
content_type = response_data.getheader('content-type')
|
|
322
|
+
if content_type is not None:
|
|
323
|
+
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
|
324
|
+
encoding = match.group(1) if match else "utf-8"
|
|
325
|
+
response_text = response_data.data.decode(encoding)
|
|
326
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
|
327
|
+
finally:
|
|
328
|
+
if not 200 <= response_data.status <= 299:
|
|
329
|
+
raise ApiException.from_response(
|
|
330
|
+
http_resp=response_data,
|
|
331
|
+
body=response_text,
|
|
332
|
+
data=return_data,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
return ApiResponse(
|
|
336
|
+
status_code = response_data.status,
|
|
337
|
+
data = return_data,
|
|
338
|
+
headers = response_data.getheaders(),
|
|
339
|
+
raw_data = response_data.data
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
def sanitize_for_serialization(self, obj):
|
|
343
|
+
"""Builds a JSON POST object.
|
|
344
|
+
|
|
345
|
+
If obj is None, return None.
|
|
346
|
+
If obj is SecretStr, return obj.get_secret_value()
|
|
347
|
+
If obj is str, int, long, float, bool, return directly.
|
|
348
|
+
If obj is datetime.datetime, datetime.date
|
|
349
|
+
convert to string in iso8601 format.
|
|
350
|
+
If obj is decimal.Decimal return string representation.
|
|
351
|
+
If obj is list, sanitize each element in the list.
|
|
352
|
+
If obj is dict, return the dict.
|
|
353
|
+
If obj is OpenAPI model, return the properties dict.
|
|
354
|
+
|
|
355
|
+
:param obj: The data to serialize.
|
|
356
|
+
:return: The serialized form of data.
|
|
357
|
+
"""
|
|
358
|
+
if obj is None:
|
|
359
|
+
return None
|
|
360
|
+
elif isinstance(obj, Enum):
|
|
361
|
+
return obj.value
|
|
362
|
+
elif isinstance(obj, SecretStr):
|
|
363
|
+
return obj.get_secret_value()
|
|
364
|
+
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
|
365
|
+
return obj
|
|
366
|
+
elif isinstance(obj, uuid.UUID):
|
|
367
|
+
return str(obj)
|
|
368
|
+
elif isinstance(obj, list):
|
|
369
|
+
return [
|
|
370
|
+
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
|
371
|
+
]
|
|
372
|
+
elif isinstance(obj, tuple):
|
|
373
|
+
return tuple(
|
|
374
|
+
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
|
375
|
+
)
|
|
376
|
+
elif isinstance(obj, datetime.datetime | datetime.date):
|
|
377
|
+
return obj.isoformat()
|
|
378
|
+
elif isinstance(obj, decimal.Decimal):
|
|
379
|
+
return str(obj)
|
|
380
|
+
|
|
381
|
+
elif isinstance(obj, dict):
|
|
382
|
+
obj_dict = obj
|
|
383
|
+
else:
|
|
384
|
+
# Convert model obj to dict except
|
|
385
|
+
# attributes `openapi_types`, `attribute_map`
|
|
386
|
+
# and attributes which value is not None.
|
|
387
|
+
# Convert attribute name to json key in
|
|
388
|
+
# model definition for request.
|
|
389
|
+
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
|
390
|
+
obj_dict = obj.to_dict()
|
|
391
|
+
# Handle Pydantic models that return None from to_dict()
|
|
392
|
+
if obj_dict is None:
|
|
393
|
+
obj_dict = {}
|
|
394
|
+
# Handle oneOf wrappers that return primitives (str, int, etc.) from to_dict()
|
|
395
|
+
elif isinstance(obj_dict, self.PRIMITIVE_TYPES):
|
|
396
|
+
return obj_dict
|
|
397
|
+
else:
|
|
398
|
+
obj_dict = obj.__dict__
|
|
399
|
+
|
|
400
|
+
if isinstance(obj_dict, list):
|
|
401
|
+
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
|
|
402
|
+
return self.sanitize_for_serialization(obj_dict)
|
|
403
|
+
|
|
404
|
+
return {
|
|
405
|
+
key: self.sanitize_for_serialization(val)
|
|
406
|
+
for key, val in obj_dict.items()
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
def deserialize(self, response_text: str, response_type: str, content_type: str | None):
|
|
410
|
+
"""Deserializes response into an object.
|
|
411
|
+
|
|
412
|
+
:param response: RESTResponse object to be deserialized.
|
|
413
|
+
:param response_type: class literal for
|
|
414
|
+
deserialized object, or string of class name.
|
|
415
|
+
:param content_type: content type of response.
|
|
416
|
+
|
|
417
|
+
:return: deserialized object.
|
|
418
|
+
"""
|
|
419
|
+
|
|
420
|
+
# fetch data from response object
|
|
421
|
+
if content_type is None:
|
|
422
|
+
try:
|
|
423
|
+
data = json.loads(response_text)
|
|
424
|
+
except ValueError:
|
|
425
|
+
data = response_text
|
|
426
|
+
elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
|
427
|
+
if response_text == "":
|
|
428
|
+
data = ""
|
|
429
|
+
else:
|
|
430
|
+
data = json.loads(response_text)
|
|
431
|
+
elif re.match(r'^(text\/[a-z.+-]+|application/octet-stream)\s*(;|$)', content_type, re.IGNORECASE):
|
|
432
|
+
data = response_text
|
|
433
|
+
else:
|
|
434
|
+
raise ApiException(
|
|
435
|
+
status=0,
|
|
436
|
+
reason="Unsupported content type: {0}".format(content_type)
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
# Handle error responses that are wrapped in an "error" key
|
|
440
|
+
# Server may return {"error": {"detail": ...}} but spec expects {"detail": ...}
|
|
441
|
+
if response_type == "Error" and isinstance(data, dict) and "error" in data:
|
|
442
|
+
data = data["error"]
|
|
443
|
+
|
|
444
|
+
return self.__deserialize(data, response_type)
|
|
445
|
+
|
|
446
|
+
def __deserialize(self, data, klass):
|
|
447
|
+
"""Deserializes dict, list, str into an object.
|
|
448
|
+
|
|
449
|
+
:param data: dict, list or str.
|
|
450
|
+
:param klass: class literal, or string of class name.
|
|
451
|
+
|
|
452
|
+
:return: object.
|
|
453
|
+
"""
|
|
454
|
+
if data is None:
|
|
455
|
+
return None
|
|
456
|
+
|
|
457
|
+
if isinstance(klass, str):
|
|
458
|
+
if klass.startswith('List['):
|
|
459
|
+
m = re.match(r'List\[(.*)]', klass)
|
|
460
|
+
assert m is not None, "Malformed List type definition"
|
|
461
|
+
sub_kls = m.group(1)
|
|
462
|
+
return [self.__deserialize(sub_data, sub_kls)
|
|
463
|
+
for sub_data in data]
|
|
464
|
+
|
|
465
|
+
if klass.startswith('Dict['):
|
|
466
|
+
m = re.match(r'Dict\[([^,]*), (.*)]', klass)
|
|
467
|
+
assert m is not None, "Malformed Dict type definition"
|
|
468
|
+
sub_kls = m.group(2)
|
|
469
|
+
return {k: self.__deserialize(v, sub_kls)
|
|
470
|
+
for k, v in data.items()}
|
|
471
|
+
|
|
472
|
+
# convert str to class
|
|
473
|
+
if klass in self.NATIVE_TYPES_MAPPING:
|
|
474
|
+
klass = self.NATIVE_TYPES_MAPPING[klass]
|
|
475
|
+
else:
|
|
476
|
+
klass = getattr(ogx_client.models, klass)
|
|
477
|
+
|
|
478
|
+
if klass in self.PRIMITIVE_TYPES:
|
|
479
|
+
return self.__deserialize_primitive(data, klass)
|
|
480
|
+
elif klass is object:
|
|
481
|
+
return self.__deserialize_object(data)
|
|
482
|
+
elif klass is datetime.date:
|
|
483
|
+
return self.__deserialize_date(data)
|
|
484
|
+
elif klass is datetime.datetime:
|
|
485
|
+
return self.__deserialize_datetime(data)
|
|
486
|
+
elif klass is decimal.Decimal:
|
|
487
|
+
return decimal.Decimal(data)
|
|
488
|
+
elif issubclass(klass, Enum):
|
|
489
|
+
return self.__deserialize_enum(data, klass)
|
|
490
|
+
else:
|
|
491
|
+
return self.__deserialize_model(data, klass)
|
|
492
|
+
|
|
493
|
+
def parameters_to_tuples(self, params, collection_formats):
|
|
494
|
+
"""Get parameters as list of tuples, formatting collections.
|
|
495
|
+
|
|
496
|
+
:param params: Parameters as dict or list of two-tuples
|
|
497
|
+
:param dict collection_formats: Parameter collection formats
|
|
498
|
+
:return: Parameters as list of tuples, collections formatted
|
|
499
|
+
"""
|
|
500
|
+
new_params: list[tuple[str, str]] = []
|
|
501
|
+
if collection_formats is None:
|
|
502
|
+
collection_formats = {}
|
|
503
|
+
for k, v in params.items() if isinstance(params, dict) else params:
|
|
504
|
+
if k in collection_formats:
|
|
505
|
+
collection_format = collection_formats[k]
|
|
506
|
+
if collection_format == 'multi':
|
|
507
|
+
new_params.extend((k, value) for value in v)
|
|
508
|
+
else:
|
|
509
|
+
if collection_format == 'ssv':
|
|
510
|
+
delimiter = ' '
|
|
511
|
+
elif collection_format == 'tsv':
|
|
512
|
+
delimiter = '\t'
|
|
513
|
+
elif collection_format == 'pipes':
|
|
514
|
+
delimiter = '|'
|
|
515
|
+
else: # csv is the default
|
|
516
|
+
delimiter = ','
|
|
517
|
+
new_params.append(
|
|
518
|
+
(k, delimiter.join(str(value) for value in v)))
|
|
519
|
+
else:
|
|
520
|
+
new_params.append((k, v))
|
|
521
|
+
return new_params
|
|
522
|
+
|
|
523
|
+
def parameters_to_url_query(self, params, collection_formats):
|
|
524
|
+
"""Get parameters as list of tuples, formatting collections.
|
|
525
|
+
|
|
526
|
+
:param params: Parameters as dict or list of two-tuples
|
|
527
|
+
:param dict collection_formats: Parameter collection formats
|
|
528
|
+
:return: URL query string (e.g. a=Hello%20World&b=123)
|
|
529
|
+
"""
|
|
530
|
+
new_params: list[tuple[str, str]] = []
|
|
531
|
+
if collection_formats is None:
|
|
532
|
+
collection_formats = {}
|
|
533
|
+
for k, v in params.items() if isinstance(params, dict) else params:
|
|
534
|
+
if isinstance(v, bool):
|
|
535
|
+
v = str(v).lower()
|
|
536
|
+
if isinstance(v, int | float):
|
|
537
|
+
v = str(v)
|
|
538
|
+
if isinstance(v, dict):
|
|
539
|
+
v = json.dumps(v)
|
|
540
|
+
|
|
541
|
+
if k in collection_formats:
|
|
542
|
+
collection_format = collection_formats[k]
|
|
543
|
+
if collection_format == 'multi':
|
|
544
|
+
new_params.extend((k, quote(str(value))) for value in v)
|
|
545
|
+
else:
|
|
546
|
+
if collection_format == 'ssv':
|
|
547
|
+
delimiter = ' '
|
|
548
|
+
elif collection_format == 'tsv':
|
|
549
|
+
delimiter = '\t'
|
|
550
|
+
elif collection_format == 'pipes':
|
|
551
|
+
delimiter = '|'
|
|
552
|
+
else: # csv is the default
|
|
553
|
+
delimiter = ','
|
|
554
|
+
new_params.append(
|
|
555
|
+
(k, delimiter.join(quote(str(value)) for value in v))
|
|
556
|
+
)
|
|
557
|
+
else:
|
|
558
|
+
new_params.append((k, quote(str(v))))
|
|
559
|
+
|
|
560
|
+
return "&".join(["=".join(map(str, item)) for item in new_params])
|
|
561
|
+
|
|
562
|
+
def files_parameters(
|
|
563
|
+
self,
|
|
564
|
+
files: dict[str, str | bytes | list[str] | list[bytes] | tuple[str, bytes]],
|
|
565
|
+
):
|
|
566
|
+
"""Builds form parameters.
|
|
567
|
+
|
|
568
|
+
:param files: File parameters.
|
|
569
|
+
:return: Form parameters with files.
|
|
570
|
+
"""
|
|
571
|
+
params = []
|
|
572
|
+
for k, v in files.items():
|
|
573
|
+
if isinstance(v, str):
|
|
574
|
+
with open(v, 'rb') as f:
|
|
575
|
+
filename = os.path.basename(f.name)
|
|
576
|
+
filedata = f.read()
|
|
577
|
+
elif isinstance(v, bytes):
|
|
578
|
+
filename = k
|
|
579
|
+
filedata = v
|
|
580
|
+
elif isinstance(v, tuple):
|
|
581
|
+
filename, filedata = v
|
|
582
|
+
elif isinstance(v, list):
|
|
583
|
+
for file_param in v:
|
|
584
|
+
params.extend(self.files_parameters({k: file_param}))
|
|
585
|
+
continue
|
|
586
|
+
elif hasattr(v, 'read'):
|
|
587
|
+
# File-like object (BytesIO, file handle, etc.)
|
|
588
|
+
filename = getattr(v, 'name', k)
|
|
589
|
+
if hasattr(filename, '__fspath__'):
|
|
590
|
+
# Handle PathLike objects
|
|
591
|
+
filename = os.fspath(filename)
|
|
592
|
+
if not isinstance(filename, str):
|
|
593
|
+
filename = k
|
|
594
|
+
# Extract just the basename if it's a full path
|
|
595
|
+
if os.path.sep in filename or (os.path.altsep and os.path.altsep in filename):
|
|
596
|
+
filename = os.path.basename(filename)
|
|
597
|
+
filedata = v.read()
|
|
598
|
+
else:
|
|
599
|
+
raise ValueError("Unsupported file value")
|
|
600
|
+
mimetype = (
|
|
601
|
+
mimetypes.guess_type(filename)[0]
|
|
602
|
+
or 'application/octet-stream'
|
|
603
|
+
)
|
|
604
|
+
params.append(
|
|
605
|
+
tuple([k, tuple([filename, filedata, mimetype])])
|
|
606
|
+
)
|
|
607
|
+
return params
|
|
608
|
+
|
|
609
|
+
def select_header_accept(self, accepts: list[str]) -> str | None:
|
|
610
|
+
"""Returns `Accept` based on an array of accepts provided.
|
|
611
|
+
|
|
612
|
+
:param accepts: List of headers.
|
|
613
|
+
:return: Accept (e.g. application/json).
|
|
614
|
+
"""
|
|
615
|
+
if not accepts:
|
|
616
|
+
return None
|
|
617
|
+
|
|
618
|
+
for accept in accepts:
|
|
619
|
+
if re.search('json', accept, re.IGNORECASE):
|
|
620
|
+
return accept
|
|
621
|
+
|
|
622
|
+
return accepts[0]
|
|
623
|
+
|
|
624
|
+
def select_header_content_type(self, content_types):
|
|
625
|
+
"""Returns `Content-Type` based on an array of content_types provided.
|
|
626
|
+
|
|
627
|
+
:param content_types: List of content-types.
|
|
628
|
+
:return: Content-Type (e.g. application/json).
|
|
629
|
+
"""
|
|
630
|
+
if not content_types:
|
|
631
|
+
return None
|
|
632
|
+
|
|
633
|
+
for content_type in content_types:
|
|
634
|
+
if re.search('json', content_type, re.IGNORECASE):
|
|
635
|
+
return content_type
|
|
636
|
+
|
|
637
|
+
return content_types[0]
|
|
638
|
+
|
|
639
|
+
def update_params_for_auth(
|
|
640
|
+
self,
|
|
641
|
+
headers,
|
|
642
|
+
queries,
|
|
643
|
+
auth_settings,
|
|
644
|
+
resource_path,
|
|
645
|
+
method,
|
|
646
|
+
body,
|
|
647
|
+
request_auth=None
|
|
648
|
+
) -> None:
|
|
649
|
+
"""Updates header and query params based on authentication setting.
|
|
650
|
+
|
|
651
|
+
:param headers: Header parameters dict to be updated.
|
|
652
|
+
:param queries: Query parameters tuple list to be updated.
|
|
653
|
+
:param auth_settings: Authentication setting identifiers list.
|
|
654
|
+
:resource_path: A string representation of the HTTP request resource path.
|
|
655
|
+
:method: A string representation of the HTTP request method.
|
|
656
|
+
:body: A object representing the body of the HTTP request.
|
|
657
|
+
The object type is the return value of sanitize_for_serialization().
|
|
658
|
+
:param request_auth: if set, the provided settings will
|
|
659
|
+
override the token in the configuration.
|
|
660
|
+
"""
|
|
661
|
+
if not auth_settings:
|
|
662
|
+
return
|
|
663
|
+
|
|
664
|
+
if request_auth:
|
|
665
|
+
self._apply_auth_params(
|
|
666
|
+
headers,
|
|
667
|
+
queries,
|
|
668
|
+
resource_path,
|
|
669
|
+
method,
|
|
670
|
+
body,
|
|
671
|
+
request_auth
|
|
672
|
+
)
|
|
673
|
+
else:
|
|
674
|
+
for auth in auth_settings:
|
|
675
|
+
auth_setting = self.configuration.auth_settings().get(auth)
|
|
676
|
+
if auth_setting:
|
|
677
|
+
self._apply_auth_params(
|
|
678
|
+
headers,
|
|
679
|
+
queries,
|
|
680
|
+
resource_path,
|
|
681
|
+
method,
|
|
682
|
+
body,
|
|
683
|
+
auth_setting
|
|
684
|
+
)
|
|
685
|
+
|
|
686
|
+
def _apply_auth_params(
|
|
687
|
+
self,
|
|
688
|
+
headers,
|
|
689
|
+
queries,
|
|
690
|
+
resource_path,
|
|
691
|
+
method,
|
|
692
|
+
body,
|
|
693
|
+
auth_setting
|
|
694
|
+
) -> None:
|
|
695
|
+
"""Updates the request parameters based on a single auth_setting
|
|
696
|
+
|
|
697
|
+
:param headers: Header parameters dict to be updated.
|
|
698
|
+
:param queries: Query parameters tuple list to be updated.
|
|
699
|
+
:resource_path: A string representation of the HTTP request resource path.
|
|
700
|
+
:method: A string representation of the HTTP request method.
|
|
701
|
+
:body: A object representing the body of the HTTP request.
|
|
702
|
+
The object type is the return value of sanitize_for_serialization().
|
|
703
|
+
:param auth_setting: auth settings for the endpoint
|
|
704
|
+
"""
|
|
705
|
+
if auth_setting['in'] == 'cookie':
|
|
706
|
+
headers['Cookie'] = auth_setting['value']
|
|
707
|
+
elif auth_setting['in'] == 'header':
|
|
708
|
+
if auth_setting['type'] != 'http-signature':
|
|
709
|
+
headers[auth_setting['key']] = auth_setting['value']
|
|
710
|
+
elif auth_setting['in'] == 'query':
|
|
711
|
+
queries.append((auth_setting['key'], auth_setting['value']))
|
|
712
|
+
else:
|
|
713
|
+
raise ApiValueError(
|
|
714
|
+
'Authentication token must be in `query` or `header`'
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
def __deserialize_file(self, response):
|
|
718
|
+
"""Deserializes body to file
|
|
719
|
+
|
|
720
|
+
Saves response body into a file in a temporary folder,
|
|
721
|
+
using the filename from the `Content-Disposition` header if provided.
|
|
722
|
+
|
|
723
|
+
handle file downloading
|
|
724
|
+
save response body into a tmp file and return the instance
|
|
725
|
+
|
|
726
|
+
:param response: RESTResponse.
|
|
727
|
+
:return: file path.
|
|
728
|
+
"""
|
|
729
|
+
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
|
|
730
|
+
os.close(fd)
|
|
731
|
+
os.remove(path)
|
|
732
|
+
|
|
733
|
+
content_disposition = response.getheader("Content-Disposition")
|
|
734
|
+
if content_disposition:
|
|
735
|
+
m = re.search(
|
|
736
|
+
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
|
|
737
|
+
content_disposition
|
|
738
|
+
)
|
|
739
|
+
assert m is not None, "Unexpected 'content-disposition' header value"
|
|
740
|
+
filename = m.group(1)
|
|
741
|
+
path = os.path.join(os.path.dirname(path), filename)
|
|
742
|
+
|
|
743
|
+
with open(path, "wb") as f:
|
|
744
|
+
f.write(response.data)
|
|
745
|
+
|
|
746
|
+
return path
|
|
747
|
+
|
|
748
|
+
def __deserialize_primitive(self, data, klass):
|
|
749
|
+
"""Deserializes string to primitive type.
|
|
750
|
+
|
|
751
|
+
:param data: str.
|
|
752
|
+
:param klass: class literal.
|
|
753
|
+
|
|
754
|
+
:return: int, long, float, str, bool.
|
|
755
|
+
"""
|
|
756
|
+
try:
|
|
757
|
+
return klass(data)
|
|
758
|
+
except UnicodeEncodeError:
|
|
759
|
+
return str(data)
|
|
760
|
+
except TypeError:
|
|
761
|
+
return data
|
|
762
|
+
|
|
763
|
+
def __deserialize_object(self, value):
|
|
764
|
+
"""Return an original value.
|
|
765
|
+
|
|
766
|
+
:return: object.
|
|
767
|
+
"""
|
|
768
|
+
return value
|
|
769
|
+
|
|
770
|
+
def __deserialize_date(self, string):
|
|
771
|
+
"""Deserializes string to date.
|
|
772
|
+
|
|
773
|
+
:param string: str.
|
|
774
|
+
:return: date.
|
|
775
|
+
"""
|
|
776
|
+
try:
|
|
777
|
+
return parse(string).date()
|
|
778
|
+
except ImportError:
|
|
779
|
+
return string
|
|
780
|
+
except ValueError:
|
|
781
|
+
raise rest.ApiException(
|
|
782
|
+
status=0,
|
|
783
|
+
reason="Failed to parse `{0}` as date object".format(string)
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
def __deserialize_datetime(self, string):
|
|
787
|
+
"""Deserializes string to datetime.
|
|
788
|
+
|
|
789
|
+
The string should be in iso8601 datetime format.
|
|
790
|
+
|
|
791
|
+
:param string: str.
|
|
792
|
+
:return: datetime.
|
|
793
|
+
"""
|
|
794
|
+
try:
|
|
795
|
+
return parse(string)
|
|
796
|
+
except ImportError:
|
|
797
|
+
return string
|
|
798
|
+
except ValueError:
|
|
799
|
+
raise rest.ApiException(
|
|
800
|
+
status=0,
|
|
801
|
+
reason=(
|
|
802
|
+
"Failed to parse `{0}` as datetime object"
|
|
803
|
+
.format(string)
|
|
804
|
+
)
|
|
805
|
+
)
|
|
806
|
+
|
|
807
|
+
def __deserialize_enum(self, data, klass):
|
|
808
|
+
"""Deserializes primitive type to enum.
|
|
809
|
+
|
|
810
|
+
:param data: primitive type.
|
|
811
|
+
:param klass: class literal.
|
|
812
|
+
:return: enum value.
|
|
813
|
+
"""
|
|
814
|
+
try:
|
|
815
|
+
return klass(data)
|
|
816
|
+
except ValueError:
|
|
817
|
+
raise rest.ApiException(
|
|
818
|
+
status=0,
|
|
819
|
+
reason=(
|
|
820
|
+
"Failed to parse `{0}` as `{1}`"
|
|
821
|
+
.format(data, klass)
|
|
822
|
+
)
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
def __deserialize_model(self, data, klass):
|
|
826
|
+
"""Deserializes list or dict to model.
|
|
827
|
+
|
|
828
|
+
:param data: dict, list.
|
|
829
|
+
:param klass: class literal.
|
|
830
|
+
:return: model object.
|
|
831
|
+
"""
|
|
832
|
+
|
|
833
|
+
return klass.from_dict(data)
|