quantcdn-client 4.8.0__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.
- quantcdn/__init__.py +341 -0
- quantcdn/__version__.py +2 -0
- quantcdn/api/__init__.py +32 -0
- quantcdn/api/ai_agents_api.py +1831 -0
- quantcdn/api/ai_custom_tools_api.py +894 -0
- quantcdn/api/ai_inference_api.py +1224 -0
- quantcdn/api/ai_models_api.py +600 -0
- quantcdn/api/ai_monitoring_api.py +317 -0
- quantcdn/api/ai_sessions_api.py +1875 -0
- quantcdn/api/ai_tools_api.py +1165 -0
- quantcdn/api/ai_vector_database_api.py +1816 -0
- quantcdn/api/applications_api.py +1394 -0
- quantcdn/api/backup_management_api.py +1440 -0
- quantcdn/api/commands_api.py +901 -0
- quantcdn/api/compose_api.py +968 -0
- quantcdn/api/containers_api.py +649 -0
- quantcdn/api/crawler_schedules_api.py +1611 -0
- quantcdn/api/crawlers_api.py +2479 -0
- quantcdn/api/cron_api.py +2212 -0
- quantcdn/api/domains_api.py +1508 -0
- quantcdn/api/environments_api.py +3256 -0
- quantcdn/api/headers_api.py +932 -0
- quantcdn/api/kv_api.py +2868 -0
- quantcdn/api/organizations_api.py +556 -0
- quantcdn/api/projects_api.py +1478 -0
- quantcdn/api/purge_api.py +345 -0
- quantcdn/api/rules_api.py +13520 -0
- quantcdn/api/scaling_policy_api.py +924 -0
- quantcdn/api/ssh_access_api.py +335 -0
- quantcdn/api/variables_api.py +1255 -0
- quantcdn/api/volumes_api.py +1254 -0
- quantcdn/api_client.py +797 -0
- quantcdn/api_response.py +21 -0
- quantcdn/configuration.py +586 -0
- quantcdn/exceptions.py +216 -0
- quantcdn/models/__init__.py +297 -0
- quantcdn/models/application.py +200 -0
- quantcdn/models/application_database.py +103 -0
- quantcdn/models/application_deployment_information_inner.py +96 -0
- quantcdn/models/application_environments_inner.py +93 -0
- quantcdn/models/application_filesystem.py +89 -0
- quantcdn/models/application_image_reference.py +99 -0
- quantcdn/models/bulk_set_environment_variables_request.py +95 -0
- quantcdn/models/bulk_set_environment_variables_request_environment_inner.py +89 -0
- quantcdn/models/chat_inference200_response.py +113 -0
- quantcdn/models/chat_inference200_response_response.py +105 -0
- quantcdn/models/chat_inference200_response_response_tool_use.py +141 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of.py +101 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of1_inner.py +97 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of_result.py +89 -0
- quantcdn/models/chat_inference200_response_usage.py +91 -0
- quantcdn/models/chat_inference_request.py +122 -0
- quantcdn/models/chat_inference_request_messages_inner.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content.py +144 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner.py +165 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1_image.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1_image_source.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2_video.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2_video_source.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3_document.py +102 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3_document_source.py +87 -0
- quantcdn/models/chat_inference_request_response_format.py +99 -0
- quantcdn/models/chat_inference_request_tool_config.py +99 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner.py +91 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner_tool_spec.py +95 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner_tool_spec_input_schema.py +87 -0
- quantcdn/models/chat_inference_stream_request.py +120 -0
- quantcdn/models/chat_inference_stream_request_messages_inner.py +100 -0
- quantcdn/models/chat_inference_stream_request_messages_inner_content.py +143 -0
- quantcdn/models/chat_with_ai_agent200_response.py +93 -0
- quantcdn/models/chat_with_ai_agent200_response_response.py +97 -0
- quantcdn/models/chat_with_ai_agent200_response_response_usage.py +89 -0
- quantcdn/models/chat_with_ai_agent_request.py +93 -0
- quantcdn/models/command.py +105 -0
- quantcdn/models/compose.py +125 -0
- quantcdn/models/container.py +260 -0
- quantcdn/models/container_depends_on_inner.py +99 -0
- quantcdn/models/container_environment_inner.py +89 -0
- quantcdn/models/container_health_check.py +101 -0
- quantcdn/models/container_image_reference.py +96 -0
- quantcdn/models/container_mount_points_inner.py +91 -0
- quantcdn/models/container_origin_protection_config.py +94 -0
- quantcdn/models/container_secrets_inner.py +89 -0
- quantcdn/models/crawlers_run200_response.py +87 -0
- quantcdn/models/crawlers_run_request.py +87 -0
- quantcdn/models/create_ai_agent201_response.py +91 -0
- quantcdn/models/create_ai_agent_request.py +106 -0
- quantcdn/models/create_ai_session201_response.py +104 -0
- quantcdn/models/create_ai_session_request.py +104 -0
- quantcdn/models/create_ai_session_request_initial_messages_inner.py +99 -0
- quantcdn/models/create_application403_response.py +89 -0
- quantcdn/models/create_application_request.py +144 -0
- quantcdn/models/create_application_request_database.py +103 -0
- quantcdn/models/create_application_request_environment_inner.py +89 -0
- quantcdn/models/create_application_request_filesystem.py +89 -0
- quantcdn/models/create_backup202_response.py +91 -0
- quantcdn/models/create_backup_request.py +87 -0
- quantcdn/models/create_command_request.py +87 -0
- quantcdn/models/create_cron_job_request.py +112 -0
- quantcdn/models/create_custom_tool201_response.py +91 -0
- quantcdn/models/create_custom_tool_request.py +98 -0
- quantcdn/models/create_environment403_response.py +89 -0
- quantcdn/models/create_environment_request.py +130 -0
- quantcdn/models/create_environment_request_environment_inner.py +89 -0
- quantcdn/models/create_vector_collection201_response.py +95 -0
- quantcdn/models/create_vector_collection201_response_collection.py +95 -0
- quantcdn/models/create_vector_collection_request.py +93 -0
- quantcdn/models/create_volume_request.py +101 -0
- quantcdn/models/cron.py +91 -0
- quantcdn/models/cron_run.py +156 -0
- quantcdn/models/delete_ai_agent200_response.py +89 -0
- quantcdn/models/delete_ai_session200_response.py +87 -0
- quantcdn/models/delete_backup200_response.py +89 -0
- quantcdn/models/delete_custom_tool200_response.py +89 -0
- quantcdn/models/delete_vector_collection200_response.py +89 -0
- quantcdn/models/download_backup200_response.py +92 -0
- quantcdn/models/embeddings200_response.py +101 -0
- quantcdn/models/embeddings200_response_embeddings.py +143 -0
- quantcdn/models/embeddings200_response_usage.py +89 -0
- quantcdn/models/embeddings_request.py +107 -0
- quantcdn/models/embeddings_request_input.py +143 -0
- quantcdn/models/environment.py +108 -0
- quantcdn/models/environment_response.py +171 -0
- quantcdn/models/environment_summary.py +109 -0
- quantcdn/models/extend_ai_session200_response.py +92 -0
- quantcdn/models/extend_ai_session_request.py +88 -0
- quantcdn/models/get_ai_agent200_response.py +91 -0
- quantcdn/models/get_ai_agent200_response_agent.py +112 -0
- quantcdn/models/get_ai_model200_response.py +116 -0
- quantcdn/models/get_ai_model200_response_capabilities.py +95 -0
- quantcdn/models/get_ai_model200_response_pricing.py +91 -0
- quantcdn/models/get_ai_model404_response.py +89 -0
- quantcdn/models/get_ai_session200_response.py +96 -0
- quantcdn/models/get_ai_tool_execution_status200_response.py +107 -0
- quantcdn/models/get_ai_tool_execution_status200_response_result.py +89 -0
- quantcdn/models/get_ai_tool_execution_status404_response.py +89 -0
- quantcdn/models/get_ai_usage_stats200_response.py +104 -0
- quantcdn/models/get_ai_usage_stats200_response_by_model_value.py +89 -0
- quantcdn/models/get_ecr_login_credentials200_response.py +93 -0
- quantcdn/models/get_environment_logs200_response.py +102 -0
- quantcdn/models/get_environment_logs200_response_log_events_inner.py +89 -0
- quantcdn/models/get_ssh_access_credentials200_response.py +107 -0
- quantcdn/models/get_ssh_access_credentials200_response_credentials.py +94 -0
- quantcdn/models/get_vector_collection200_response.py +91 -0
- quantcdn/models/get_vector_collection200_response_collection.py +102 -0
- quantcdn/models/image_generation200_response.py +91 -0
- quantcdn/models/image_generation_request.py +152 -0
- quantcdn/models/image_generation_request_background_removal_params.py +87 -0
- quantcdn/models/image_generation_request_color_guided_generation_params.py +94 -0
- quantcdn/models/image_generation_request_image_generation_config.py +108 -0
- quantcdn/models/image_generation_request_image_variation_params.py +94 -0
- quantcdn/models/image_generation_request_in_painting_params.py +96 -0
- quantcdn/models/image_generation_request_out_painting_params.py +107 -0
- quantcdn/models/image_generation_request_text_to_image_params.py +118 -0
- quantcdn/models/kv_items_create200_response.py +91 -0
- quantcdn/models/kv_items_delete200_response.py +89 -0
- quantcdn/models/kv_items_show200_response.py +93 -0
- quantcdn/models/kv_items_show200_response_value.py +143 -0
- quantcdn/models/list_ai_agents200_response.py +95 -0
- quantcdn/models/list_ai_agents200_response_agents_inner.py +106 -0
- quantcdn/models/list_ai_models200_response.py +97 -0
- quantcdn/models/list_ai_models200_response_models_inner.py +97 -0
- quantcdn/models/list_ai_models200_response_models_inner_capabilities.py +95 -0
- quantcdn/models/list_ai_sessions200_response_inner.py +96 -0
- quantcdn/models/list_ai_tool_executions200_response.py +101 -0
- quantcdn/models/list_ai_tool_executions200_response_executions_inner.py +96 -0
- quantcdn/models/list_ai_tool_names200_response.py +89 -0
- quantcdn/models/list_ai_tools200_response.py +97 -0
- quantcdn/models/list_ai_tools200_response_tools_inner.py +91 -0
- quantcdn/models/list_ai_tools200_response_tools_inner_tool_spec.py +95 -0
- quantcdn/models/list_ai_tools200_response_tools_inner_tool_spec_input_schema.py +87 -0
- quantcdn/models/list_backups200_response.py +106 -0
- quantcdn/models/list_backups200_response_backups_inner.py +112 -0
- quantcdn/models/list_backups422_response.py +87 -0
- quantcdn/models/list_custom_tools200_response.py +97 -0
- quantcdn/models/list_custom_tools200_response_tools_inner.py +98 -0
- quantcdn/models/list_vector_collections200_response.py +97 -0
- quantcdn/models/list_vector_collections200_response_collections_inner.py +98 -0
- quantcdn/models/organizations_list200_response_inner.py +89 -0
- quantcdn/models/patch_environment_compose202_response.py +107 -0
- quantcdn/models/patch_environment_compose202_response_spot_configuration.py +89 -0
- quantcdn/models/patch_environment_compose400_response.py +89 -0
- quantcdn/models/patch_environment_compose_request.py +153 -0
- quantcdn/models/patch_environment_compose_request_spot_configuration.py +97 -0
- quantcdn/models/purge_create_request.py +93 -0
- quantcdn/models/query_vector_collection200_response.py +101 -0
- quantcdn/models/query_vector_collection200_response_results_inner.py +95 -0
- quantcdn/models/query_vector_collection200_response_results_inner_metadata.py +91 -0
- quantcdn/models/query_vector_collection_request.py +90 -0
- quantcdn/models/scaling_policy.py +103 -0
- quantcdn/models/spot_configuration.py +94 -0
- quantcdn/models/sync_operation.py +99 -0
- quantcdn/models/sync_to_environment_request.py +87 -0
- quantcdn/models/update_ai_agent200_response.py +91 -0
- quantcdn/models/update_ai_agent_request.py +104 -0
- quantcdn/models/update_ai_session200_response.py +96 -0
- quantcdn/models/update_ai_session_request.py +111 -0
- quantcdn/models/update_ai_session_request_new_messages_inner.py +99 -0
- quantcdn/models/update_cron_job_request.py +120 -0
- quantcdn/models/update_environment_request.py +106 -0
- quantcdn/models/update_environment_state_request.py +89 -0
- quantcdn/models/update_environment_variable_request.py +87 -0
- quantcdn/models/upload_vector_documents200_response.py +93 -0
- quantcdn/models/upload_vector_documents_request.py +95 -0
- quantcdn/models/upload_vector_documents_request_documents_inner.py +93 -0
- quantcdn/models/upload_vector_documents_request_documents_inner_metadata.py +93 -0
- quantcdn/models/v1_content_item.py +97 -0
- quantcdn/models/v1_content_list_response.py +101 -0
- quantcdn/models/v1_content_request.py +110 -0
- quantcdn/models/v1_delete_response.py +99 -0
- quantcdn/models/v1_error.py +89 -0
- quantcdn/models/v1_form_submission_item.py +97 -0
- quantcdn/models/v1_form_submission_list_response.py +101 -0
- quantcdn/models/v1_get_metric_series_response.py +93 -0
- quantcdn/models/v1_get_metric_series_response_data.py +162 -0
- quantcdn/models/v1_get_metrics_response.py +93 -0
- quantcdn/models/v1_get_metrics_response_data.py +163 -0
- quantcdn/models/v1_global_meta_response.py +101 -0
- quantcdn/models/v1_global_meta_response_global_meta.py +87 -0
- quantcdn/models/v1_info.py +99 -0
- quantcdn/models/v1_meta.py +113 -0
- quantcdn/models/v1_metric_day_stats.py +93 -0
- quantcdn/models/v1_metric_minute_stats.py +93 -0
- quantcdn/models/v1_metric_month_stats.py +93 -0
- quantcdn/models/v1_ping_response.py +89 -0
- quantcdn/models/v1_proxy_item.py +95 -0
- quantcdn/models/v1_proxy_list_response.py +101 -0
- quantcdn/models/v1_redirect_item.py +97 -0
- quantcdn/models/v1_redirect_list_response.py +101 -0
- quantcdn/models/v1_redirect_request.py +111 -0
- quantcdn/models/v1_redirect_response.py +121 -0
- quantcdn/models/v1_revision.py +115 -0
- quantcdn/models/v1_revisions_response.py +107 -0
- quantcdn/models/v1_search_hit.py +97 -0
- quantcdn/models/v1_search_items_response.py +97 -0
- quantcdn/models/v1_search_mutation_response.py +91 -0
- quantcdn/models/v1_search_record.py +93 -0
- quantcdn/models/v1_search_response.py +89 -0
- quantcdn/models/v1_series_point_day.py +89 -0
- quantcdn/models/v1_series_point_month.py +89 -0
- quantcdn/models/v1_transition.py +99 -0
- quantcdn/models/v1_upload_response.py +89 -0
- quantcdn/models/v1_url_meta_request.py +87 -0
- quantcdn/models/v1_url_meta_response.py +91 -0
- quantcdn/models/v1_waf_log_item.py +107 -0
- quantcdn/models/v1_waf_log_list_response.py +101 -0
- quantcdn/models/v2_crawler.py +165 -0
- quantcdn/models/v2_crawler_assets.py +97 -0
- quantcdn/models/v2_crawler_assets_network_intercept.py +91 -0
- quantcdn/models/v2_crawler_assets_parser.py +87 -0
- quantcdn/models/v2_crawler_request.py +142 -0
- quantcdn/models/v2_crawler_run.py +114 -0
- quantcdn/models/v2_crawler_schedule.py +104 -0
- quantcdn/models/v2_crawler_schedule_request.py +89 -0
- quantcdn/models/v2_crawler_sitemap_inner.py +89 -0
- quantcdn/models/v2_custom_header_request.py +87 -0
- quantcdn/models/v2_domain.py +121 -0
- quantcdn/models/v2_domain_dns_go_live_records_inner.py +98 -0
- quantcdn/models/v2_domain_dns_validation_records_inner.py +91 -0
- quantcdn/models/v2_domain_request.py +87 -0
- quantcdn/models/v2_error.py +89 -0
- quantcdn/models/v2_organization.py +100 -0
- quantcdn/models/v2_organization_request.py +89 -0
- quantcdn/models/v2_project.py +95 -0
- quantcdn/models/v2_project_request.py +101 -0
- quantcdn/models/v2_rule.py +121 -0
- quantcdn/models/v2_rule_auth.py +127 -0
- quantcdn/models/v2_rule_auth_action.py +89 -0
- quantcdn/models/v2_rule_auth_request.py +119 -0
- quantcdn/models/v2_rule_bot_challenge.py +127 -0
- quantcdn/models/v2_rule_bot_challenge_action.py +91 -0
- quantcdn/models/v2_rule_bot_challenge_request.py +121 -0
- quantcdn/models/v2_rule_content_filter.py +127 -0
- quantcdn/models/v2_rule_content_filter_action.py +87 -0
- quantcdn/models/v2_rule_content_filter_request.py +117 -0
- quantcdn/models/v2_rule_custom_response.py +127 -0
- quantcdn/models/v2_rule_custom_response_action.py +89 -0
- quantcdn/models/v2_rule_custom_response_request.py +123 -0
- quantcdn/models/v2_rule_function.py +127 -0
- quantcdn/models/v2_rule_function_action.py +87 -0
- quantcdn/models/v2_rule_function_request.py +117 -0
- quantcdn/models/v2_rule_header.py +127 -0
- quantcdn/models/v2_rule_header_action.py +87 -0
- quantcdn/models/v2_rule_header_request.py +117 -0
- quantcdn/models/v2_rule_proxy.py +127 -0
- quantcdn/models/v2_rule_proxy_action.py +195 -0
- quantcdn/models/v2_rule_proxy_action_notify_config.py +87 -0
- quantcdn/models/v2_rule_proxy_action_quant_cloud_selection.py +93 -0
- quantcdn/models/v2_rule_proxy_request.py +189 -0
- quantcdn/models/v2_rule_redirect.py +127 -0
- quantcdn/models/v2_rule_redirect_action.py +89 -0
- quantcdn/models/v2_rule_redirect_request.py +119 -0
- quantcdn/models/v2_rule_request.py +115 -0
- quantcdn/models/v2_rule_serve_static.py +127 -0
- quantcdn/models/v2_rule_serve_static_action.py +87 -0
- quantcdn/models/v2_rule_serve_static_request.py +117 -0
- quantcdn/models/v2_secret_store.py +89 -0
- quantcdn/models/v2_secret_store_request.py +87 -0
- quantcdn/models/v2_store.py +89 -0
- quantcdn/models/v2_store_item.py +89 -0
- quantcdn/models/v2_store_item_request.py +91 -0
- quantcdn/models/v2_store_item_update_request.py +89 -0
- quantcdn/models/v2_store_items_list_response.py +94 -0
- quantcdn/models/v2_store_request.py +87 -0
- quantcdn/models/validate_compose200_response.py +96 -0
- quantcdn/models/validate_compose422_response.py +87 -0
- quantcdn/models/validate_compose_request.py +102 -0
- quantcdn/models/variable.py +89 -0
- quantcdn/models/volume.py +101 -0
- quantcdn/models/waf_config.py +140 -0
- quantcdn/models/waf_config_block_lists.py +93 -0
- quantcdn/models/waf_config_httpbl.py +97 -0
- quantcdn/models/waf_config_thresholds_inner.py +131 -0
- quantcdn/py.typed +0 -0
- quantcdn/rest.py +258 -0
- quantcdn_client-4.8.0.dist-info/METADATA +23 -0
- quantcdn_client-4.8.0.dist-info/RECORD +323 -0
- quantcdn_client-4.8.0.dist-info/WHEEL +5 -0
- quantcdn_client-4.8.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1224 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from quantcdn.models.chat_inference200_response import ChatInference200Response
|
|
22
|
+
from quantcdn.models.chat_inference_request import ChatInferenceRequest
|
|
23
|
+
from quantcdn.models.chat_inference_stream_request import ChatInferenceStreamRequest
|
|
24
|
+
from quantcdn.models.embeddings200_response import Embeddings200Response
|
|
25
|
+
from quantcdn.models.embeddings_request import EmbeddingsRequest
|
|
26
|
+
from quantcdn.models.image_generation200_response import ImageGeneration200Response
|
|
27
|
+
from quantcdn.models.image_generation_request import ImageGenerationRequest
|
|
28
|
+
|
|
29
|
+
from quantcdn.api_client import ApiClient, RequestSerialized
|
|
30
|
+
from quantcdn.api_response import ApiResponse
|
|
31
|
+
from quantcdn.rest import RESTResponseType
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AIInferenceApi:
|
|
35
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
36
|
+
Ref: https://openapi-generator.tech
|
|
37
|
+
|
|
38
|
+
Do not edit the class manually.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, api_client=None) -> None:
|
|
42
|
+
if api_client is None:
|
|
43
|
+
api_client = ApiClient.get_default()
|
|
44
|
+
self.api_client = api_client
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@validate_call
|
|
48
|
+
def chat_inference(
|
|
49
|
+
self,
|
|
50
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
51
|
+
chat_inference_request: Annotated[ChatInferenceRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
52
|
+
_request_timeout: Union[
|
|
53
|
+
None,
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
55
|
+
Tuple[
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
57
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
58
|
+
]
|
|
59
|
+
] = None,
|
|
60
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
61
|
+
_content_type: Optional[StrictStr] = None,
|
|
62
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
63
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
64
|
+
) -> ChatInference200Response:
|
|
65
|
+
"""Chat inference via API Gateway (buffered responses) with multimodal support
|
|
66
|
+
|
|
67
|
+
Sends requests to the AI API Gateway endpoint which buffers responses. Supports text, images, videos, and documents via base64 encoding. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * * **Response Patterns:** * - **Text-only**: Returns simple text response when no tools requested * - **Single tool**: Returns `toolUse` object when AI requests one tool * - **Multiple tools**: Returns `toolUse` array when AI requests multiple tools * - **Auto-execute sync**: Automatically executes tool and returns final text response * - **Auto-execute async**: Returns toolUse with `executionId` and `status` for polling
|
|
68
|
+
|
|
69
|
+
:param organisation: The organisation ID (required)
|
|
70
|
+
:type organisation: str
|
|
71
|
+
:param chat_inference_request: Chat request with optional multimodal content blocks (required)
|
|
72
|
+
:type chat_inference_request: ChatInferenceRequest
|
|
73
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
74
|
+
number provided, it will be total request
|
|
75
|
+
timeout. It can also be a pair (tuple) of
|
|
76
|
+
(connection, read) timeouts.
|
|
77
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
78
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
79
|
+
request; this effectively ignores the
|
|
80
|
+
authentication in the spec for a single request.
|
|
81
|
+
:type _request_auth: dict, optional
|
|
82
|
+
:param _content_type: force content-type for the request.
|
|
83
|
+
:type _content_type: str, Optional
|
|
84
|
+
:param _headers: set to override the headers for a single
|
|
85
|
+
request; this effectively ignores the headers
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _headers: dict, optional
|
|
88
|
+
:param _host_index: set to override the host_index for a single
|
|
89
|
+
request; this effectively ignores the host_index
|
|
90
|
+
in the spec for a single request.
|
|
91
|
+
:type _host_index: int, optional
|
|
92
|
+
:return: Returns the result object.
|
|
93
|
+
""" # noqa: E501
|
|
94
|
+
|
|
95
|
+
_param = self._chat_inference_serialize(
|
|
96
|
+
organisation=organisation,
|
|
97
|
+
chat_inference_request=chat_inference_request,
|
|
98
|
+
_request_auth=_request_auth,
|
|
99
|
+
_content_type=_content_type,
|
|
100
|
+
_headers=_headers,
|
|
101
|
+
_host_index=_host_index
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
105
|
+
'200': "ChatInference200Response",
|
|
106
|
+
'500': None,
|
|
107
|
+
}
|
|
108
|
+
response_data = self.api_client.call_api(
|
|
109
|
+
*_param,
|
|
110
|
+
_request_timeout=_request_timeout
|
|
111
|
+
)
|
|
112
|
+
response_data.read()
|
|
113
|
+
return self.api_client.response_deserialize(
|
|
114
|
+
response_data=response_data,
|
|
115
|
+
response_types_map=_response_types_map,
|
|
116
|
+
).data
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@validate_call
|
|
120
|
+
def chat_inference_with_http_info(
|
|
121
|
+
self,
|
|
122
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
123
|
+
chat_inference_request: Annotated[ChatInferenceRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
124
|
+
_request_timeout: Union[
|
|
125
|
+
None,
|
|
126
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
127
|
+
Tuple[
|
|
128
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
129
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
130
|
+
]
|
|
131
|
+
] = None,
|
|
132
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
133
|
+
_content_type: Optional[StrictStr] = None,
|
|
134
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
135
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
136
|
+
) -> ApiResponse[ChatInference200Response]:
|
|
137
|
+
"""Chat inference via API Gateway (buffered responses) with multimodal support
|
|
138
|
+
|
|
139
|
+
Sends requests to the AI API Gateway endpoint which buffers responses. Supports text, images, videos, and documents via base64 encoding. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * * **Response Patterns:** * - **Text-only**: Returns simple text response when no tools requested * - **Single tool**: Returns `toolUse` object when AI requests one tool * - **Multiple tools**: Returns `toolUse` array when AI requests multiple tools * - **Auto-execute sync**: Automatically executes tool and returns final text response * - **Auto-execute async**: Returns toolUse with `executionId` and `status` for polling
|
|
140
|
+
|
|
141
|
+
:param organisation: The organisation ID (required)
|
|
142
|
+
:type organisation: str
|
|
143
|
+
:param chat_inference_request: Chat request with optional multimodal content blocks (required)
|
|
144
|
+
:type chat_inference_request: ChatInferenceRequest
|
|
145
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
146
|
+
number provided, it will be total request
|
|
147
|
+
timeout. It can also be a pair (tuple) of
|
|
148
|
+
(connection, read) timeouts.
|
|
149
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
150
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
151
|
+
request; this effectively ignores the
|
|
152
|
+
authentication in the spec for a single request.
|
|
153
|
+
:type _request_auth: dict, optional
|
|
154
|
+
:param _content_type: force content-type for the request.
|
|
155
|
+
:type _content_type: str, Optional
|
|
156
|
+
:param _headers: set to override the headers for a single
|
|
157
|
+
request; this effectively ignores the headers
|
|
158
|
+
in the spec for a single request.
|
|
159
|
+
:type _headers: dict, optional
|
|
160
|
+
:param _host_index: set to override the host_index for a single
|
|
161
|
+
request; this effectively ignores the host_index
|
|
162
|
+
in the spec for a single request.
|
|
163
|
+
:type _host_index: int, optional
|
|
164
|
+
:return: Returns the result object.
|
|
165
|
+
""" # noqa: E501
|
|
166
|
+
|
|
167
|
+
_param = self._chat_inference_serialize(
|
|
168
|
+
organisation=organisation,
|
|
169
|
+
chat_inference_request=chat_inference_request,
|
|
170
|
+
_request_auth=_request_auth,
|
|
171
|
+
_content_type=_content_type,
|
|
172
|
+
_headers=_headers,
|
|
173
|
+
_host_index=_host_index
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
177
|
+
'200': "ChatInference200Response",
|
|
178
|
+
'500': None,
|
|
179
|
+
}
|
|
180
|
+
response_data = self.api_client.call_api(
|
|
181
|
+
*_param,
|
|
182
|
+
_request_timeout=_request_timeout
|
|
183
|
+
)
|
|
184
|
+
response_data.read()
|
|
185
|
+
return self.api_client.response_deserialize(
|
|
186
|
+
response_data=response_data,
|
|
187
|
+
response_types_map=_response_types_map,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@validate_call
|
|
192
|
+
def chat_inference_without_preload_content(
|
|
193
|
+
self,
|
|
194
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
195
|
+
chat_inference_request: Annotated[ChatInferenceRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
196
|
+
_request_timeout: Union[
|
|
197
|
+
None,
|
|
198
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
199
|
+
Tuple[
|
|
200
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
201
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
202
|
+
]
|
|
203
|
+
] = None,
|
|
204
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
205
|
+
_content_type: Optional[StrictStr] = None,
|
|
206
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
207
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
208
|
+
) -> RESTResponseType:
|
|
209
|
+
"""Chat inference via API Gateway (buffered responses) with multimodal support
|
|
210
|
+
|
|
211
|
+
Sends requests to the AI API Gateway endpoint which buffers responses. Supports text, images, videos, and documents via base64 encoding. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * * **Response Patterns:** * - **Text-only**: Returns simple text response when no tools requested * - **Single tool**: Returns `toolUse` object when AI requests one tool * - **Multiple tools**: Returns `toolUse` array when AI requests multiple tools * - **Auto-execute sync**: Automatically executes tool and returns final text response * - **Auto-execute async**: Returns toolUse with `executionId` and `status` for polling
|
|
212
|
+
|
|
213
|
+
:param organisation: The organisation ID (required)
|
|
214
|
+
:type organisation: str
|
|
215
|
+
:param chat_inference_request: Chat request with optional multimodal content blocks (required)
|
|
216
|
+
:type chat_inference_request: ChatInferenceRequest
|
|
217
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
218
|
+
number provided, it will be total request
|
|
219
|
+
timeout. It can also be a pair (tuple) of
|
|
220
|
+
(connection, read) timeouts.
|
|
221
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
222
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
223
|
+
request; this effectively ignores the
|
|
224
|
+
authentication in the spec for a single request.
|
|
225
|
+
:type _request_auth: dict, optional
|
|
226
|
+
:param _content_type: force content-type for the request.
|
|
227
|
+
:type _content_type: str, Optional
|
|
228
|
+
:param _headers: set to override the headers for a single
|
|
229
|
+
request; this effectively ignores the headers
|
|
230
|
+
in the spec for a single request.
|
|
231
|
+
:type _headers: dict, optional
|
|
232
|
+
:param _host_index: set to override the host_index for a single
|
|
233
|
+
request; this effectively ignores the host_index
|
|
234
|
+
in the spec for a single request.
|
|
235
|
+
:type _host_index: int, optional
|
|
236
|
+
:return: Returns the result object.
|
|
237
|
+
""" # noqa: E501
|
|
238
|
+
|
|
239
|
+
_param = self._chat_inference_serialize(
|
|
240
|
+
organisation=organisation,
|
|
241
|
+
chat_inference_request=chat_inference_request,
|
|
242
|
+
_request_auth=_request_auth,
|
|
243
|
+
_content_type=_content_type,
|
|
244
|
+
_headers=_headers,
|
|
245
|
+
_host_index=_host_index
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
249
|
+
'200': "ChatInference200Response",
|
|
250
|
+
'500': None,
|
|
251
|
+
}
|
|
252
|
+
response_data = self.api_client.call_api(
|
|
253
|
+
*_param,
|
|
254
|
+
_request_timeout=_request_timeout
|
|
255
|
+
)
|
|
256
|
+
return response_data.response
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def _chat_inference_serialize(
|
|
260
|
+
self,
|
|
261
|
+
organisation,
|
|
262
|
+
chat_inference_request,
|
|
263
|
+
_request_auth,
|
|
264
|
+
_content_type,
|
|
265
|
+
_headers,
|
|
266
|
+
_host_index,
|
|
267
|
+
) -> RequestSerialized:
|
|
268
|
+
|
|
269
|
+
_host = None
|
|
270
|
+
|
|
271
|
+
_collection_formats: Dict[str, str] = {
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
_path_params: Dict[str, str] = {}
|
|
275
|
+
_query_params: List[Tuple[str, str]] = []
|
|
276
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
277
|
+
_form_params: List[Tuple[str, str]] = []
|
|
278
|
+
_files: Dict[
|
|
279
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
280
|
+
] = {}
|
|
281
|
+
_body_params: Optional[bytes] = None
|
|
282
|
+
|
|
283
|
+
# process the path parameters
|
|
284
|
+
if organisation is not None:
|
|
285
|
+
_path_params['organisation'] = organisation
|
|
286
|
+
# process the query parameters
|
|
287
|
+
# process the header parameters
|
|
288
|
+
# process the form parameters
|
|
289
|
+
# process the body parameter
|
|
290
|
+
if chat_inference_request is not None:
|
|
291
|
+
_body_params = chat_inference_request
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
# set the HTTP header `Accept`
|
|
295
|
+
if 'Accept' not in _header_params:
|
|
296
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
297
|
+
[
|
|
298
|
+
'application/json'
|
|
299
|
+
]
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
# set the HTTP header `Content-Type`
|
|
303
|
+
if _content_type:
|
|
304
|
+
_header_params['Content-Type'] = _content_type
|
|
305
|
+
else:
|
|
306
|
+
_default_content_type = (
|
|
307
|
+
self.api_client.select_header_content_type(
|
|
308
|
+
[
|
|
309
|
+
'application/json'
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
)
|
|
313
|
+
if _default_content_type is not None:
|
|
314
|
+
_header_params['Content-Type'] = _default_content_type
|
|
315
|
+
|
|
316
|
+
# authentication setting
|
|
317
|
+
_auth_settings: List[str] = [
|
|
318
|
+
'BearerAuth'
|
|
319
|
+
]
|
|
320
|
+
|
|
321
|
+
return self.api_client.param_serialize(
|
|
322
|
+
method='POST',
|
|
323
|
+
resource_path='/api/v3/organizations/{organisation}/ai/chat',
|
|
324
|
+
path_params=_path_params,
|
|
325
|
+
query_params=_query_params,
|
|
326
|
+
header_params=_header_params,
|
|
327
|
+
body=_body_params,
|
|
328
|
+
post_params=_form_params,
|
|
329
|
+
files=_files,
|
|
330
|
+
auth_settings=_auth_settings,
|
|
331
|
+
collection_formats=_collection_formats,
|
|
332
|
+
_host=_host,
|
|
333
|
+
_request_auth=_request_auth
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
@validate_call
|
|
340
|
+
def chat_inference_stream(
|
|
341
|
+
self,
|
|
342
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
343
|
+
chat_inference_stream_request: Annotated[ChatInferenceStreamRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
344
|
+
_request_timeout: Union[
|
|
345
|
+
None,
|
|
346
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
347
|
+
Tuple[
|
|
348
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
349
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
350
|
+
]
|
|
351
|
+
] = None,
|
|
352
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
353
|
+
_content_type: Optional[StrictStr] = None,
|
|
354
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
355
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
356
|
+
) -> str:
|
|
357
|
+
"""Chat inference via streaming endpoint (true HTTP streaming) with multimodal support
|
|
358
|
+
|
|
359
|
+
Streams responses from the AI streaming subdomain using Server-Sent Events (SSE). Tokens are streamed in real-time as they are generated. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * - Streaming works with all content types (text, image, video, document)
|
|
360
|
+
|
|
361
|
+
:param organisation: The organisation ID (required)
|
|
362
|
+
:type organisation: str
|
|
363
|
+
:param chat_inference_stream_request: Chat request with optional multimodal content blocks (required)
|
|
364
|
+
:type chat_inference_stream_request: ChatInferenceStreamRequest
|
|
365
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
366
|
+
number provided, it will be total request
|
|
367
|
+
timeout. It can also be a pair (tuple) of
|
|
368
|
+
(connection, read) timeouts.
|
|
369
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
370
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
371
|
+
request; this effectively ignores the
|
|
372
|
+
authentication in the spec for a single request.
|
|
373
|
+
:type _request_auth: dict, optional
|
|
374
|
+
:param _content_type: force content-type for the request.
|
|
375
|
+
:type _content_type: str, Optional
|
|
376
|
+
:param _headers: set to override the headers for a single
|
|
377
|
+
request; this effectively ignores the headers
|
|
378
|
+
in the spec for a single request.
|
|
379
|
+
:type _headers: dict, optional
|
|
380
|
+
:param _host_index: set to override the host_index for a single
|
|
381
|
+
request; this effectively ignores the host_index
|
|
382
|
+
in the spec for a single request.
|
|
383
|
+
:type _host_index: int, optional
|
|
384
|
+
:return: Returns the result object.
|
|
385
|
+
""" # noqa: E501
|
|
386
|
+
|
|
387
|
+
_param = self._chat_inference_stream_serialize(
|
|
388
|
+
organisation=organisation,
|
|
389
|
+
chat_inference_stream_request=chat_inference_stream_request,
|
|
390
|
+
_request_auth=_request_auth,
|
|
391
|
+
_content_type=_content_type,
|
|
392
|
+
_headers=_headers,
|
|
393
|
+
_host_index=_host_index
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
397
|
+
'200': "str",
|
|
398
|
+
'500': None,
|
|
399
|
+
}
|
|
400
|
+
response_data = self.api_client.call_api(
|
|
401
|
+
*_param,
|
|
402
|
+
_request_timeout=_request_timeout
|
|
403
|
+
)
|
|
404
|
+
response_data.read()
|
|
405
|
+
return self.api_client.response_deserialize(
|
|
406
|
+
response_data=response_data,
|
|
407
|
+
response_types_map=_response_types_map,
|
|
408
|
+
).data
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
@validate_call
|
|
412
|
+
def chat_inference_stream_with_http_info(
|
|
413
|
+
self,
|
|
414
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
415
|
+
chat_inference_stream_request: Annotated[ChatInferenceStreamRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
416
|
+
_request_timeout: Union[
|
|
417
|
+
None,
|
|
418
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
419
|
+
Tuple[
|
|
420
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
421
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
422
|
+
]
|
|
423
|
+
] = None,
|
|
424
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
425
|
+
_content_type: Optional[StrictStr] = None,
|
|
426
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
427
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
428
|
+
) -> ApiResponse[str]:
|
|
429
|
+
"""Chat inference via streaming endpoint (true HTTP streaming) with multimodal support
|
|
430
|
+
|
|
431
|
+
Streams responses from the AI streaming subdomain using Server-Sent Events (SSE). Tokens are streamed in real-time as they are generated. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * - Streaming works with all content types (text, image, video, document)
|
|
432
|
+
|
|
433
|
+
:param organisation: The organisation ID (required)
|
|
434
|
+
:type organisation: str
|
|
435
|
+
:param chat_inference_stream_request: Chat request with optional multimodal content blocks (required)
|
|
436
|
+
:type chat_inference_stream_request: ChatInferenceStreamRequest
|
|
437
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
438
|
+
number provided, it will be total request
|
|
439
|
+
timeout. It can also be a pair (tuple) of
|
|
440
|
+
(connection, read) timeouts.
|
|
441
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
442
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
443
|
+
request; this effectively ignores the
|
|
444
|
+
authentication in the spec for a single request.
|
|
445
|
+
:type _request_auth: dict, optional
|
|
446
|
+
:param _content_type: force content-type for the request.
|
|
447
|
+
:type _content_type: str, Optional
|
|
448
|
+
:param _headers: set to override the headers for a single
|
|
449
|
+
request; this effectively ignores the headers
|
|
450
|
+
in the spec for a single request.
|
|
451
|
+
:type _headers: dict, optional
|
|
452
|
+
:param _host_index: set to override the host_index for a single
|
|
453
|
+
request; this effectively ignores the host_index
|
|
454
|
+
in the spec for a single request.
|
|
455
|
+
:type _host_index: int, optional
|
|
456
|
+
:return: Returns the result object.
|
|
457
|
+
""" # noqa: E501
|
|
458
|
+
|
|
459
|
+
_param = self._chat_inference_stream_serialize(
|
|
460
|
+
organisation=organisation,
|
|
461
|
+
chat_inference_stream_request=chat_inference_stream_request,
|
|
462
|
+
_request_auth=_request_auth,
|
|
463
|
+
_content_type=_content_type,
|
|
464
|
+
_headers=_headers,
|
|
465
|
+
_host_index=_host_index
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
469
|
+
'200': "str",
|
|
470
|
+
'500': None,
|
|
471
|
+
}
|
|
472
|
+
response_data = self.api_client.call_api(
|
|
473
|
+
*_param,
|
|
474
|
+
_request_timeout=_request_timeout
|
|
475
|
+
)
|
|
476
|
+
response_data.read()
|
|
477
|
+
return self.api_client.response_deserialize(
|
|
478
|
+
response_data=response_data,
|
|
479
|
+
response_types_map=_response_types_map,
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
@validate_call
|
|
484
|
+
def chat_inference_stream_without_preload_content(
|
|
485
|
+
self,
|
|
486
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
487
|
+
chat_inference_stream_request: Annotated[ChatInferenceStreamRequest, Field(description="Chat request with optional multimodal content blocks")],
|
|
488
|
+
_request_timeout: Union[
|
|
489
|
+
None,
|
|
490
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
491
|
+
Tuple[
|
|
492
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
493
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
494
|
+
]
|
|
495
|
+
] = None,
|
|
496
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
497
|
+
_content_type: Optional[StrictStr] = None,
|
|
498
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
499
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
500
|
+
) -> RESTResponseType:
|
|
501
|
+
"""Chat inference via streaming endpoint (true HTTP streaming) with multimodal support
|
|
502
|
+
|
|
503
|
+
Streams responses from the AI streaming subdomain using Server-Sent Events (SSE). Tokens are streamed in real-time as they are generated. * * **Multimodal Support:** * - **Text**: Simple string content * - **Images**: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB) * - **Videos**: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB) * - **Documents**: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB) * * **Supported Models:** * - Amazon Nova Lite, Micro, Pro (all support multimodal) * - Claude models (text only) * * **Usage Tips:** * - Use base64 encoding for images/videos < 5-10MB * - Place media before text prompts for best results * - Label multiple media files (e.g., 'Image 1:', 'Image 2:') * - Maximum 25MB total payload size * - Streaming works with all content types (text, image, video, document)
|
|
504
|
+
|
|
505
|
+
:param organisation: The organisation ID (required)
|
|
506
|
+
:type organisation: str
|
|
507
|
+
:param chat_inference_stream_request: Chat request with optional multimodal content blocks (required)
|
|
508
|
+
:type chat_inference_stream_request: ChatInferenceStreamRequest
|
|
509
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
510
|
+
number provided, it will be total request
|
|
511
|
+
timeout. It can also be a pair (tuple) of
|
|
512
|
+
(connection, read) timeouts.
|
|
513
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
514
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
515
|
+
request; this effectively ignores the
|
|
516
|
+
authentication in the spec for a single request.
|
|
517
|
+
:type _request_auth: dict, optional
|
|
518
|
+
:param _content_type: force content-type for the request.
|
|
519
|
+
:type _content_type: str, Optional
|
|
520
|
+
:param _headers: set to override the headers for a single
|
|
521
|
+
request; this effectively ignores the headers
|
|
522
|
+
in the spec for a single request.
|
|
523
|
+
:type _headers: dict, optional
|
|
524
|
+
:param _host_index: set to override the host_index for a single
|
|
525
|
+
request; this effectively ignores the host_index
|
|
526
|
+
in the spec for a single request.
|
|
527
|
+
:type _host_index: int, optional
|
|
528
|
+
:return: Returns the result object.
|
|
529
|
+
""" # noqa: E501
|
|
530
|
+
|
|
531
|
+
_param = self._chat_inference_stream_serialize(
|
|
532
|
+
organisation=organisation,
|
|
533
|
+
chat_inference_stream_request=chat_inference_stream_request,
|
|
534
|
+
_request_auth=_request_auth,
|
|
535
|
+
_content_type=_content_type,
|
|
536
|
+
_headers=_headers,
|
|
537
|
+
_host_index=_host_index
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
541
|
+
'200': "str",
|
|
542
|
+
'500': None,
|
|
543
|
+
}
|
|
544
|
+
response_data = self.api_client.call_api(
|
|
545
|
+
*_param,
|
|
546
|
+
_request_timeout=_request_timeout
|
|
547
|
+
)
|
|
548
|
+
return response_data.response
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
def _chat_inference_stream_serialize(
|
|
552
|
+
self,
|
|
553
|
+
organisation,
|
|
554
|
+
chat_inference_stream_request,
|
|
555
|
+
_request_auth,
|
|
556
|
+
_content_type,
|
|
557
|
+
_headers,
|
|
558
|
+
_host_index,
|
|
559
|
+
) -> RequestSerialized:
|
|
560
|
+
|
|
561
|
+
_host = None
|
|
562
|
+
|
|
563
|
+
_collection_formats: Dict[str, str] = {
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
_path_params: Dict[str, str] = {}
|
|
567
|
+
_query_params: List[Tuple[str, str]] = []
|
|
568
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
569
|
+
_form_params: List[Tuple[str, str]] = []
|
|
570
|
+
_files: Dict[
|
|
571
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
572
|
+
] = {}
|
|
573
|
+
_body_params: Optional[bytes] = None
|
|
574
|
+
|
|
575
|
+
# process the path parameters
|
|
576
|
+
if organisation is not None:
|
|
577
|
+
_path_params['organisation'] = organisation
|
|
578
|
+
# process the query parameters
|
|
579
|
+
# process the header parameters
|
|
580
|
+
# process the form parameters
|
|
581
|
+
# process the body parameter
|
|
582
|
+
if chat_inference_stream_request is not None:
|
|
583
|
+
_body_params = chat_inference_stream_request
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
# set the HTTP header `Accept`
|
|
587
|
+
if 'Accept' not in _header_params:
|
|
588
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
589
|
+
[
|
|
590
|
+
'text/event-stream'
|
|
591
|
+
]
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
# set the HTTP header `Content-Type`
|
|
595
|
+
if _content_type:
|
|
596
|
+
_header_params['Content-Type'] = _content_type
|
|
597
|
+
else:
|
|
598
|
+
_default_content_type = (
|
|
599
|
+
self.api_client.select_header_content_type(
|
|
600
|
+
[
|
|
601
|
+
'application/json'
|
|
602
|
+
]
|
|
603
|
+
)
|
|
604
|
+
)
|
|
605
|
+
if _default_content_type is not None:
|
|
606
|
+
_header_params['Content-Type'] = _default_content_type
|
|
607
|
+
|
|
608
|
+
# authentication setting
|
|
609
|
+
_auth_settings: List[str] = [
|
|
610
|
+
'BearerAuth'
|
|
611
|
+
]
|
|
612
|
+
|
|
613
|
+
return self.api_client.param_serialize(
|
|
614
|
+
method='POST',
|
|
615
|
+
resource_path='/api/v3/organizations/{organisation}/ai/chat/stream',
|
|
616
|
+
path_params=_path_params,
|
|
617
|
+
query_params=_query_params,
|
|
618
|
+
header_params=_header_params,
|
|
619
|
+
body=_body_params,
|
|
620
|
+
post_params=_form_params,
|
|
621
|
+
files=_files,
|
|
622
|
+
auth_settings=_auth_settings,
|
|
623
|
+
collection_formats=_collection_formats,
|
|
624
|
+
_host=_host,
|
|
625
|
+
_request_auth=_request_auth
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
@validate_call
|
|
632
|
+
def embeddings(
|
|
633
|
+
self,
|
|
634
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
635
|
+
embeddings_request: Annotated[EmbeddingsRequest, Field(description="Embedding request with single or multiple texts")],
|
|
636
|
+
_request_timeout: Union[
|
|
637
|
+
None,
|
|
638
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
639
|
+
Tuple[
|
|
640
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
641
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
642
|
+
]
|
|
643
|
+
] = None,
|
|
644
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
645
|
+
_content_type: Optional[StrictStr] = None,
|
|
646
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
647
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
648
|
+
) -> Embeddings200Response:
|
|
649
|
+
"""Generate text embeddings for semantic search and RAG applications
|
|
650
|
+
|
|
651
|
+
Generates vector embeddings for text content using embedding models. Used for semantic search, document similarity, and RAG applications. * * **Features:** * - Single text or batch processing (up to 100 texts) * - Configurable dimensions (256, 512, 1024, 8192 for Titan v2) * - Optional normalization to unit length * - Usage tracking for billing * * **Use Cases:** * - Semantic search across documents * - Similarity matching for content recommendations * - RAG (Retrieval-Augmented Generation) pipelines * - Clustering and classification * * **Available Embedding Models:** * - amazon.titan-embed-text-v2:0 (default, supports 256-8192 dimensions) * - amazon.titan-embed-text-v1:0 (1536 dimensions fixed)
|
|
652
|
+
|
|
653
|
+
:param organisation: The organisation ID (required)
|
|
654
|
+
:type organisation: str
|
|
655
|
+
:param embeddings_request: Embedding request with single or multiple texts (required)
|
|
656
|
+
:type embeddings_request: EmbeddingsRequest
|
|
657
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
658
|
+
number provided, it will be total request
|
|
659
|
+
timeout. It can also be a pair (tuple) of
|
|
660
|
+
(connection, read) timeouts.
|
|
661
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
662
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
663
|
+
request; this effectively ignores the
|
|
664
|
+
authentication in the spec for a single request.
|
|
665
|
+
:type _request_auth: dict, optional
|
|
666
|
+
:param _content_type: force content-type for the request.
|
|
667
|
+
:type _content_type: str, Optional
|
|
668
|
+
:param _headers: set to override the headers for a single
|
|
669
|
+
request; this effectively ignores the headers
|
|
670
|
+
in the spec for a single request.
|
|
671
|
+
:type _headers: dict, optional
|
|
672
|
+
:param _host_index: set to override the host_index for a single
|
|
673
|
+
request; this effectively ignores the host_index
|
|
674
|
+
in the spec for a single request.
|
|
675
|
+
:type _host_index: int, optional
|
|
676
|
+
:return: Returns the result object.
|
|
677
|
+
""" # noqa: E501
|
|
678
|
+
|
|
679
|
+
_param = self._embeddings_serialize(
|
|
680
|
+
organisation=organisation,
|
|
681
|
+
embeddings_request=embeddings_request,
|
|
682
|
+
_request_auth=_request_auth,
|
|
683
|
+
_content_type=_content_type,
|
|
684
|
+
_headers=_headers,
|
|
685
|
+
_host_index=_host_index
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
689
|
+
'200': "Embeddings200Response",
|
|
690
|
+
'400': None,
|
|
691
|
+
'403': None,
|
|
692
|
+
'500': None,
|
|
693
|
+
}
|
|
694
|
+
response_data = self.api_client.call_api(
|
|
695
|
+
*_param,
|
|
696
|
+
_request_timeout=_request_timeout
|
|
697
|
+
)
|
|
698
|
+
response_data.read()
|
|
699
|
+
return self.api_client.response_deserialize(
|
|
700
|
+
response_data=response_data,
|
|
701
|
+
response_types_map=_response_types_map,
|
|
702
|
+
).data
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
@validate_call
|
|
706
|
+
def embeddings_with_http_info(
|
|
707
|
+
self,
|
|
708
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
709
|
+
embeddings_request: Annotated[EmbeddingsRequest, Field(description="Embedding request with single or multiple texts")],
|
|
710
|
+
_request_timeout: Union[
|
|
711
|
+
None,
|
|
712
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
713
|
+
Tuple[
|
|
714
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
715
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
716
|
+
]
|
|
717
|
+
] = None,
|
|
718
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
719
|
+
_content_type: Optional[StrictStr] = None,
|
|
720
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
721
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
722
|
+
) -> ApiResponse[Embeddings200Response]:
|
|
723
|
+
"""Generate text embeddings for semantic search and RAG applications
|
|
724
|
+
|
|
725
|
+
Generates vector embeddings for text content using embedding models. Used for semantic search, document similarity, and RAG applications. * * **Features:** * - Single text or batch processing (up to 100 texts) * - Configurable dimensions (256, 512, 1024, 8192 for Titan v2) * - Optional normalization to unit length * - Usage tracking for billing * * **Use Cases:** * - Semantic search across documents * - Similarity matching for content recommendations * - RAG (Retrieval-Augmented Generation) pipelines * - Clustering and classification * * **Available Embedding Models:** * - amazon.titan-embed-text-v2:0 (default, supports 256-8192 dimensions) * - amazon.titan-embed-text-v1:0 (1536 dimensions fixed)
|
|
726
|
+
|
|
727
|
+
:param organisation: The organisation ID (required)
|
|
728
|
+
:type organisation: str
|
|
729
|
+
:param embeddings_request: Embedding request with single or multiple texts (required)
|
|
730
|
+
:type embeddings_request: EmbeddingsRequest
|
|
731
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
732
|
+
number provided, it will be total request
|
|
733
|
+
timeout. It can also be a pair (tuple) of
|
|
734
|
+
(connection, read) timeouts.
|
|
735
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
736
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
737
|
+
request; this effectively ignores the
|
|
738
|
+
authentication in the spec for a single request.
|
|
739
|
+
:type _request_auth: dict, optional
|
|
740
|
+
:param _content_type: force content-type for the request.
|
|
741
|
+
:type _content_type: str, Optional
|
|
742
|
+
:param _headers: set to override the headers for a single
|
|
743
|
+
request; this effectively ignores the headers
|
|
744
|
+
in the spec for a single request.
|
|
745
|
+
:type _headers: dict, optional
|
|
746
|
+
:param _host_index: set to override the host_index for a single
|
|
747
|
+
request; this effectively ignores the host_index
|
|
748
|
+
in the spec for a single request.
|
|
749
|
+
:type _host_index: int, optional
|
|
750
|
+
:return: Returns the result object.
|
|
751
|
+
""" # noqa: E501
|
|
752
|
+
|
|
753
|
+
_param = self._embeddings_serialize(
|
|
754
|
+
organisation=organisation,
|
|
755
|
+
embeddings_request=embeddings_request,
|
|
756
|
+
_request_auth=_request_auth,
|
|
757
|
+
_content_type=_content_type,
|
|
758
|
+
_headers=_headers,
|
|
759
|
+
_host_index=_host_index
|
|
760
|
+
)
|
|
761
|
+
|
|
762
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
763
|
+
'200': "Embeddings200Response",
|
|
764
|
+
'400': None,
|
|
765
|
+
'403': None,
|
|
766
|
+
'500': None,
|
|
767
|
+
}
|
|
768
|
+
response_data = self.api_client.call_api(
|
|
769
|
+
*_param,
|
|
770
|
+
_request_timeout=_request_timeout
|
|
771
|
+
)
|
|
772
|
+
response_data.read()
|
|
773
|
+
return self.api_client.response_deserialize(
|
|
774
|
+
response_data=response_data,
|
|
775
|
+
response_types_map=_response_types_map,
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
@validate_call
|
|
780
|
+
def embeddings_without_preload_content(
|
|
781
|
+
self,
|
|
782
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
783
|
+
embeddings_request: Annotated[EmbeddingsRequest, Field(description="Embedding request with single or multiple texts")],
|
|
784
|
+
_request_timeout: Union[
|
|
785
|
+
None,
|
|
786
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
787
|
+
Tuple[
|
|
788
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
789
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
790
|
+
]
|
|
791
|
+
] = None,
|
|
792
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
793
|
+
_content_type: Optional[StrictStr] = None,
|
|
794
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
795
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
796
|
+
) -> RESTResponseType:
|
|
797
|
+
"""Generate text embeddings for semantic search and RAG applications
|
|
798
|
+
|
|
799
|
+
Generates vector embeddings for text content using embedding models. Used for semantic search, document similarity, and RAG applications. * * **Features:** * - Single text or batch processing (up to 100 texts) * - Configurable dimensions (256, 512, 1024, 8192 for Titan v2) * - Optional normalization to unit length * - Usage tracking for billing * * **Use Cases:** * - Semantic search across documents * - Similarity matching for content recommendations * - RAG (Retrieval-Augmented Generation) pipelines * - Clustering and classification * * **Available Embedding Models:** * - amazon.titan-embed-text-v2:0 (default, supports 256-8192 dimensions) * - amazon.titan-embed-text-v1:0 (1536 dimensions fixed)
|
|
800
|
+
|
|
801
|
+
:param organisation: The organisation ID (required)
|
|
802
|
+
:type organisation: str
|
|
803
|
+
:param embeddings_request: Embedding request with single or multiple texts (required)
|
|
804
|
+
:type embeddings_request: EmbeddingsRequest
|
|
805
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
806
|
+
number provided, it will be total request
|
|
807
|
+
timeout. It can also be a pair (tuple) of
|
|
808
|
+
(connection, read) timeouts.
|
|
809
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
810
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
811
|
+
request; this effectively ignores the
|
|
812
|
+
authentication in the spec for a single request.
|
|
813
|
+
:type _request_auth: dict, optional
|
|
814
|
+
:param _content_type: force content-type for the request.
|
|
815
|
+
:type _content_type: str, Optional
|
|
816
|
+
:param _headers: set to override the headers for a single
|
|
817
|
+
request; this effectively ignores the headers
|
|
818
|
+
in the spec for a single request.
|
|
819
|
+
:type _headers: dict, optional
|
|
820
|
+
:param _host_index: set to override the host_index for a single
|
|
821
|
+
request; this effectively ignores the host_index
|
|
822
|
+
in the spec for a single request.
|
|
823
|
+
:type _host_index: int, optional
|
|
824
|
+
:return: Returns the result object.
|
|
825
|
+
""" # noqa: E501
|
|
826
|
+
|
|
827
|
+
_param = self._embeddings_serialize(
|
|
828
|
+
organisation=organisation,
|
|
829
|
+
embeddings_request=embeddings_request,
|
|
830
|
+
_request_auth=_request_auth,
|
|
831
|
+
_content_type=_content_type,
|
|
832
|
+
_headers=_headers,
|
|
833
|
+
_host_index=_host_index
|
|
834
|
+
)
|
|
835
|
+
|
|
836
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
837
|
+
'200': "Embeddings200Response",
|
|
838
|
+
'400': None,
|
|
839
|
+
'403': None,
|
|
840
|
+
'500': None,
|
|
841
|
+
}
|
|
842
|
+
response_data = self.api_client.call_api(
|
|
843
|
+
*_param,
|
|
844
|
+
_request_timeout=_request_timeout
|
|
845
|
+
)
|
|
846
|
+
return response_data.response
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
def _embeddings_serialize(
|
|
850
|
+
self,
|
|
851
|
+
organisation,
|
|
852
|
+
embeddings_request,
|
|
853
|
+
_request_auth,
|
|
854
|
+
_content_type,
|
|
855
|
+
_headers,
|
|
856
|
+
_host_index,
|
|
857
|
+
) -> RequestSerialized:
|
|
858
|
+
|
|
859
|
+
_host = None
|
|
860
|
+
|
|
861
|
+
_collection_formats: Dict[str, str] = {
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
_path_params: Dict[str, str] = {}
|
|
865
|
+
_query_params: List[Tuple[str, str]] = []
|
|
866
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
867
|
+
_form_params: List[Tuple[str, str]] = []
|
|
868
|
+
_files: Dict[
|
|
869
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
870
|
+
] = {}
|
|
871
|
+
_body_params: Optional[bytes] = None
|
|
872
|
+
|
|
873
|
+
# process the path parameters
|
|
874
|
+
if organisation is not None:
|
|
875
|
+
_path_params['organisation'] = organisation
|
|
876
|
+
# process the query parameters
|
|
877
|
+
# process the header parameters
|
|
878
|
+
# process the form parameters
|
|
879
|
+
# process the body parameter
|
|
880
|
+
if embeddings_request is not None:
|
|
881
|
+
_body_params = embeddings_request
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
# set the HTTP header `Accept`
|
|
885
|
+
if 'Accept' not in _header_params:
|
|
886
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
887
|
+
[
|
|
888
|
+
'application/json'
|
|
889
|
+
]
|
|
890
|
+
)
|
|
891
|
+
|
|
892
|
+
# set the HTTP header `Content-Type`
|
|
893
|
+
if _content_type:
|
|
894
|
+
_header_params['Content-Type'] = _content_type
|
|
895
|
+
else:
|
|
896
|
+
_default_content_type = (
|
|
897
|
+
self.api_client.select_header_content_type(
|
|
898
|
+
[
|
|
899
|
+
'application/json'
|
|
900
|
+
]
|
|
901
|
+
)
|
|
902
|
+
)
|
|
903
|
+
if _default_content_type is not None:
|
|
904
|
+
_header_params['Content-Type'] = _default_content_type
|
|
905
|
+
|
|
906
|
+
# authentication setting
|
|
907
|
+
_auth_settings: List[str] = [
|
|
908
|
+
'BearerAuth'
|
|
909
|
+
]
|
|
910
|
+
|
|
911
|
+
return self.api_client.param_serialize(
|
|
912
|
+
method='POST',
|
|
913
|
+
resource_path='/api/v3/organizations/{organisation}/ai/embeddings',
|
|
914
|
+
path_params=_path_params,
|
|
915
|
+
query_params=_query_params,
|
|
916
|
+
header_params=_header_params,
|
|
917
|
+
body=_body_params,
|
|
918
|
+
post_params=_form_params,
|
|
919
|
+
files=_files,
|
|
920
|
+
auth_settings=_auth_settings,
|
|
921
|
+
collection_formats=_collection_formats,
|
|
922
|
+
_host=_host,
|
|
923
|
+
_request_auth=_request_auth
|
|
924
|
+
)
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
@validate_call
|
|
930
|
+
def image_generation(
|
|
931
|
+
self,
|
|
932
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
933
|
+
image_generation_request: Annotated[ImageGenerationRequest, Field(description="Image generation request")],
|
|
934
|
+
_request_timeout: Union[
|
|
935
|
+
None,
|
|
936
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
937
|
+
Tuple[
|
|
938
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
939
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
940
|
+
]
|
|
941
|
+
] = None,
|
|
942
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
943
|
+
_content_type: Optional[StrictStr] = None,
|
|
944
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
945
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
946
|
+
) -> ImageGeneration200Response:
|
|
947
|
+
"""Generate images with Amazon Nova Canvas
|
|
948
|
+
|
|
949
|
+
Generates images using Amazon Nova Canvas image generation model. * * **Region Restriction:** Nova Canvas is ONLY available in: * - `us-east-1` (US East, N. Virginia) * - `ap-northeast-1` (Asia Pacific, Tokyo) * - `eu-west-1` (Europe, Ireland) * ❌ NOT available in `ap-southeast-2` (Sydney) * * **Supported Task Types:** * - **TEXT_IMAGE**: Basic text-to-image generation * - **TEXT_IMAGE with Conditioning**: Layout-guided generation using edge detection or segmentation * - **COLOR_GUIDED_GENERATION**: Generate images with specific color palettes * - **IMAGE_VARIATION**: Create variations of existing images * - **INPAINTING**: Fill masked areas in images * - **OUTPAINTING**: Extend images beyond their borders * - **BACKGROUND_REMOVAL**: Remove backgrounds from images * - **VIRTUAL_TRY_ON**: Try on garments/objects on people * * **Quality Options:** * - **standard**: Faster generation, lower cost * - **premium**: Higher quality, slower generation * * **Timeout:** Image generation can take up to 5 minutes
|
|
950
|
+
|
|
951
|
+
:param organisation: The organisation ID (required)
|
|
952
|
+
:type organisation: str
|
|
953
|
+
:param image_generation_request: Image generation request (required)
|
|
954
|
+
:type image_generation_request: ImageGenerationRequest
|
|
955
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
956
|
+
number provided, it will be total request
|
|
957
|
+
timeout. It can also be a pair (tuple) of
|
|
958
|
+
(connection, read) timeouts.
|
|
959
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
960
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
961
|
+
request; this effectively ignores the
|
|
962
|
+
authentication in the spec for a single request.
|
|
963
|
+
:type _request_auth: dict, optional
|
|
964
|
+
:param _content_type: force content-type for the request.
|
|
965
|
+
:type _content_type: str, Optional
|
|
966
|
+
:param _headers: set to override the headers for a single
|
|
967
|
+
request; this effectively ignores the headers
|
|
968
|
+
in the spec for a single request.
|
|
969
|
+
:type _headers: dict, optional
|
|
970
|
+
:param _host_index: set to override the host_index for a single
|
|
971
|
+
request; this effectively ignores the host_index
|
|
972
|
+
in the spec for a single request.
|
|
973
|
+
:type _host_index: int, optional
|
|
974
|
+
:return: Returns the result object.
|
|
975
|
+
""" # noqa: E501
|
|
976
|
+
|
|
977
|
+
_param = self._image_generation_serialize(
|
|
978
|
+
organisation=organisation,
|
|
979
|
+
image_generation_request=image_generation_request,
|
|
980
|
+
_request_auth=_request_auth,
|
|
981
|
+
_content_type=_content_type,
|
|
982
|
+
_headers=_headers,
|
|
983
|
+
_host_index=_host_index
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
987
|
+
'200': "ImageGeneration200Response",
|
|
988
|
+
'400': None,
|
|
989
|
+
'403': None,
|
|
990
|
+
'500': None,
|
|
991
|
+
}
|
|
992
|
+
response_data = self.api_client.call_api(
|
|
993
|
+
*_param,
|
|
994
|
+
_request_timeout=_request_timeout
|
|
995
|
+
)
|
|
996
|
+
response_data.read()
|
|
997
|
+
return self.api_client.response_deserialize(
|
|
998
|
+
response_data=response_data,
|
|
999
|
+
response_types_map=_response_types_map,
|
|
1000
|
+
).data
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
@validate_call
|
|
1004
|
+
def image_generation_with_http_info(
|
|
1005
|
+
self,
|
|
1006
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
1007
|
+
image_generation_request: Annotated[ImageGenerationRequest, Field(description="Image generation request")],
|
|
1008
|
+
_request_timeout: Union[
|
|
1009
|
+
None,
|
|
1010
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1011
|
+
Tuple[
|
|
1012
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1013
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1014
|
+
]
|
|
1015
|
+
] = None,
|
|
1016
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1017
|
+
_content_type: Optional[StrictStr] = None,
|
|
1018
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1019
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1020
|
+
) -> ApiResponse[ImageGeneration200Response]:
|
|
1021
|
+
"""Generate images with Amazon Nova Canvas
|
|
1022
|
+
|
|
1023
|
+
Generates images using Amazon Nova Canvas image generation model. * * **Region Restriction:** Nova Canvas is ONLY available in: * - `us-east-1` (US East, N. Virginia) * - `ap-northeast-1` (Asia Pacific, Tokyo) * - `eu-west-1` (Europe, Ireland) * ❌ NOT available in `ap-southeast-2` (Sydney) * * **Supported Task Types:** * - **TEXT_IMAGE**: Basic text-to-image generation * - **TEXT_IMAGE with Conditioning**: Layout-guided generation using edge detection or segmentation * - **COLOR_GUIDED_GENERATION**: Generate images with specific color palettes * - **IMAGE_VARIATION**: Create variations of existing images * - **INPAINTING**: Fill masked areas in images * - **OUTPAINTING**: Extend images beyond their borders * - **BACKGROUND_REMOVAL**: Remove backgrounds from images * - **VIRTUAL_TRY_ON**: Try on garments/objects on people * * **Quality Options:** * - **standard**: Faster generation, lower cost * - **premium**: Higher quality, slower generation * * **Timeout:** Image generation can take up to 5 minutes
|
|
1024
|
+
|
|
1025
|
+
:param organisation: The organisation ID (required)
|
|
1026
|
+
:type organisation: str
|
|
1027
|
+
:param image_generation_request: Image generation request (required)
|
|
1028
|
+
:type image_generation_request: ImageGenerationRequest
|
|
1029
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1030
|
+
number provided, it will be total request
|
|
1031
|
+
timeout. It can also be a pair (tuple) of
|
|
1032
|
+
(connection, read) timeouts.
|
|
1033
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1034
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1035
|
+
request; this effectively ignores the
|
|
1036
|
+
authentication in the spec for a single request.
|
|
1037
|
+
:type _request_auth: dict, optional
|
|
1038
|
+
:param _content_type: force content-type for the request.
|
|
1039
|
+
:type _content_type: str, Optional
|
|
1040
|
+
:param _headers: set to override the headers for a single
|
|
1041
|
+
request; this effectively ignores the headers
|
|
1042
|
+
in the spec for a single request.
|
|
1043
|
+
:type _headers: dict, optional
|
|
1044
|
+
:param _host_index: set to override the host_index for a single
|
|
1045
|
+
request; this effectively ignores the host_index
|
|
1046
|
+
in the spec for a single request.
|
|
1047
|
+
:type _host_index: int, optional
|
|
1048
|
+
:return: Returns the result object.
|
|
1049
|
+
""" # noqa: E501
|
|
1050
|
+
|
|
1051
|
+
_param = self._image_generation_serialize(
|
|
1052
|
+
organisation=organisation,
|
|
1053
|
+
image_generation_request=image_generation_request,
|
|
1054
|
+
_request_auth=_request_auth,
|
|
1055
|
+
_content_type=_content_type,
|
|
1056
|
+
_headers=_headers,
|
|
1057
|
+
_host_index=_host_index
|
|
1058
|
+
)
|
|
1059
|
+
|
|
1060
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1061
|
+
'200': "ImageGeneration200Response",
|
|
1062
|
+
'400': None,
|
|
1063
|
+
'403': None,
|
|
1064
|
+
'500': None,
|
|
1065
|
+
}
|
|
1066
|
+
response_data = self.api_client.call_api(
|
|
1067
|
+
*_param,
|
|
1068
|
+
_request_timeout=_request_timeout
|
|
1069
|
+
)
|
|
1070
|
+
response_data.read()
|
|
1071
|
+
return self.api_client.response_deserialize(
|
|
1072
|
+
response_data=response_data,
|
|
1073
|
+
response_types_map=_response_types_map,
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
@validate_call
|
|
1078
|
+
def image_generation_without_preload_content(
|
|
1079
|
+
self,
|
|
1080
|
+
organisation: Annotated[StrictStr, Field(description="The organisation ID")],
|
|
1081
|
+
image_generation_request: Annotated[ImageGenerationRequest, Field(description="Image generation request")],
|
|
1082
|
+
_request_timeout: Union[
|
|
1083
|
+
None,
|
|
1084
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1085
|
+
Tuple[
|
|
1086
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1087
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1088
|
+
]
|
|
1089
|
+
] = None,
|
|
1090
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1091
|
+
_content_type: Optional[StrictStr] = None,
|
|
1092
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1093
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1094
|
+
) -> RESTResponseType:
|
|
1095
|
+
"""Generate images with Amazon Nova Canvas
|
|
1096
|
+
|
|
1097
|
+
Generates images using Amazon Nova Canvas image generation model. * * **Region Restriction:** Nova Canvas is ONLY available in: * - `us-east-1` (US East, N. Virginia) * - `ap-northeast-1` (Asia Pacific, Tokyo) * - `eu-west-1` (Europe, Ireland) * ❌ NOT available in `ap-southeast-2` (Sydney) * * **Supported Task Types:** * - **TEXT_IMAGE**: Basic text-to-image generation * - **TEXT_IMAGE with Conditioning**: Layout-guided generation using edge detection or segmentation * - **COLOR_GUIDED_GENERATION**: Generate images with specific color palettes * - **IMAGE_VARIATION**: Create variations of existing images * - **INPAINTING**: Fill masked areas in images * - **OUTPAINTING**: Extend images beyond their borders * - **BACKGROUND_REMOVAL**: Remove backgrounds from images * - **VIRTUAL_TRY_ON**: Try on garments/objects on people * * **Quality Options:** * - **standard**: Faster generation, lower cost * - **premium**: Higher quality, slower generation * * **Timeout:** Image generation can take up to 5 minutes
|
|
1098
|
+
|
|
1099
|
+
:param organisation: The organisation ID (required)
|
|
1100
|
+
:type organisation: str
|
|
1101
|
+
:param image_generation_request: Image generation request (required)
|
|
1102
|
+
:type image_generation_request: ImageGenerationRequest
|
|
1103
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1104
|
+
number provided, it will be total request
|
|
1105
|
+
timeout. It can also be a pair (tuple) of
|
|
1106
|
+
(connection, read) timeouts.
|
|
1107
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1108
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1109
|
+
request; this effectively ignores the
|
|
1110
|
+
authentication in the spec for a single request.
|
|
1111
|
+
:type _request_auth: dict, optional
|
|
1112
|
+
:param _content_type: force content-type for the request.
|
|
1113
|
+
:type _content_type: str, Optional
|
|
1114
|
+
:param _headers: set to override the headers for a single
|
|
1115
|
+
request; this effectively ignores the headers
|
|
1116
|
+
in the spec for a single request.
|
|
1117
|
+
:type _headers: dict, optional
|
|
1118
|
+
:param _host_index: set to override the host_index for a single
|
|
1119
|
+
request; this effectively ignores the host_index
|
|
1120
|
+
in the spec for a single request.
|
|
1121
|
+
:type _host_index: int, optional
|
|
1122
|
+
:return: Returns the result object.
|
|
1123
|
+
""" # noqa: E501
|
|
1124
|
+
|
|
1125
|
+
_param = self._image_generation_serialize(
|
|
1126
|
+
organisation=organisation,
|
|
1127
|
+
image_generation_request=image_generation_request,
|
|
1128
|
+
_request_auth=_request_auth,
|
|
1129
|
+
_content_type=_content_type,
|
|
1130
|
+
_headers=_headers,
|
|
1131
|
+
_host_index=_host_index
|
|
1132
|
+
)
|
|
1133
|
+
|
|
1134
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1135
|
+
'200': "ImageGeneration200Response",
|
|
1136
|
+
'400': None,
|
|
1137
|
+
'403': None,
|
|
1138
|
+
'500': None,
|
|
1139
|
+
}
|
|
1140
|
+
response_data = self.api_client.call_api(
|
|
1141
|
+
*_param,
|
|
1142
|
+
_request_timeout=_request_timeout
|
|
1143
|
+
)
|
|
1144
|
+
return response_data.response
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
def _image_generation_serialize(
|
|
1148
|
+
self,
|
|
1149
|
+
organisation,
|
|
1150
|
+
image_generation_request,
|
|
1151
|
+
_request_auth,
|
|
1152
|
+
_content_type,
|
|
1153
|
+
_headers,
|
|
1154
|
+
_host_index,
|
|
1155
|
+
) -> RequestSerialized:
|
|
1156
|
+
|
|
1157
|
+
_host = None
|
|
1158
|
+
|
|
1159
|
+
_collection_formats: Dict[str, str] = {
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
_path_params: Dict[str, str] = {}
|
|
1163
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1164
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1165
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1166
|
+
_files: Dict[
|
|
1167
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1168
|
+
] = {}
|
|
1169
|
+
_body_params: Optional[bytes] = None
|
|
1170
|
+
|
|
1171
|
+
# process the path parameters
|
|
1172
|
+
if organisation is not None:
|
|
1173
|
+
_path_params['organisation'] = organisation
|
|
1174
|
+
# process the query parameters
|
|
1175
|
+
# process the header parameters
|
|
1176
|
+
# process the form parameters
|
|
1177
|
+
# process the body parameter
|
|
1178
|
+
if image_generation_request is not None:
|
|
1179
|
+
_body_params = image_generation_request
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
# set the HTTP header `Accept`
|
|
1183
|
+
if 'Accept' not in _header_params:
|
|
1184
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1185
|
+
[
|
|
1186
|
+
'application/json'
|
|
1187
|
+
]
|
|
1188
|
+
)
|
|
1189
|
+
|
|
1190
|
+
# set the HTTP header `Content-Type`
|
|
1191
|
+
if _content_type:
|
|
1192
|
+
_header_params['Content-Type'] = _content_type
|
|
1193
|
+
else:
|
|
1194
|
+
_default_content_type = (
|
|
1195
|
+
self.api_client.select_header_content_type(
|
|
1196
|
+
[
|
|
1197
|
+
'application/json'
|
|
1198
|
+
]
|
|
1199
|
+
)
|
|
1200
|
+
)
|
|
1201
|
+
if _default_content_type is not None:
|
|
1202
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1203
|
+
|
|
1204
|
+
# authentication setting
|
|
1205
|
+
_auth_settings: List[str] = [
|
|
1206
|
+
'BearerAuth'
|
|
1207
|
+
]
|
|
1208
|
+
|
|
1209
|
+
return self.api_client.param_serialize(
|
|
1210
|
+
method='POST',
|
|
1211
|
+
resource_path='/api/v3/organizations/{organisation}/ai/image-generation',
|
|
1212
|
+
path_params=_path_params,
|
|
1213
|
+
query_params=_query_params,
|
|
1214
|
+
header_params=_header_params,
|
|
1215
|
+
body=_body_params,
|
|
1216
|
+
post_params=_form_params,
|
|
1217
|
+
files=_files,
|
|
1218
|
+
auth_settings=_auth_settings,
|
|
1219
|
+
collection_formats=_collection_formats,
|
|
1220
|
+
_host=_host,
|
|
1221
|
+
_request_auth=_request_auth
|
|
1222
|
+
)
|
|
1223
|
+
|
|
1224
|
+
|