Source code for openapi_client.api.ai_api

# coding: utf-8

"""
    Amorphic Data Platform

    Amorphic Data Platform - API Definition documentation

    The version of the OpenAPI document: 0.3.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictInt, StrictStr, field_validator
from typing import Any, Dict, Optional
from typing_extensions import Annotated
from openapi_client.models.ai_chats_config import AIChatsConfig
from openapi_client.models.ai_model_details import AIModelDetails
from openapi_client.models.ai_models_list_response import AIModelsListResponse
from openapi_client.models.add_resources_to_knowledge_base200_response import AddResourcesToKnowledgeBase200Response
from openapi_client.models.chat_details_response import ChatDetailsResponse
from openapi_client.models.chat_file_upload_request import ChatFileUploadRequest
from openapi_client.models.chat_file_upload_response import ChatFileUploadResponse
from openapi_client.models.chat_files_response import ChatFilesResponse
from openapi_client.models.chat_list_response import ChatListResponse
from openapi_client.models.chat_messages_response import ChatMessagesResponse
from openapi_client.models.component_guard_rail_config_request import ComponentGuardRailConfigRequest
from openapi_client.models.component_guard_rail_configurations_response import ComponentGuardRailConfigurationsResponse
from openapi_client.models.create_agent_request_body import CreateAgentRequestBody
from openapi_client.models.get_agent_details_response import GetAgentDetailsResponse
from openapi_client.models.guard_rail_chat_request import GuardRailChatRequest
from openapi_client.models.guard_rail_chat_response import GuardRailChatResponse
from openapi_client.models.guard_rail_create_request import GuardRailCreateRequest
from openapi_client.models.guard_rail_detail import GuardRailDetail
from openapi_client.models.guard_rail_list_response import GuardRailListResponse
from openapi_client.models.guard_rail_update_request import GuardRailUpdateRequest
from openapi_client.models.knowledge_base_create_request import KnowledgeBaseCreateRequest
from openapi_client.models.knowledge_base_detail import KnowledgeBaseDetail
from openapi_client.models.knowledge_base_list_response import KnowledgeBaseListResponse
from openapi_client.models.knowledge_base_query_response import KnowledgeBaseQueryResponse
from openapi_client.models.knowledge_base_update_request import KnowledgeBaseUpdateRequest
from openapi_client.models.list_agents_response import ListAgentsResponse
from openapi_client.models.message import Message
from openapi_client.models.message_status import MessageStatus
from openapi_client.models.note_create_request import NoteCreateRequest
from openapi_client.models.note_details_response import NoteDetailsResponse
from openapi_client.models.note_update_request import NoteUpdateRequest
from openapi_client.models.note_update_response import NoteUpdateResponse
from openapi_client.models.notes_create_response import NotesCreateResponse
from openapi_client.models.notes_list_response import NotesListResponse
from openapi_client.models.query_body import QueryBody
from openapi_client.models.resource_addition_request import ResourceAdditionRequest
from openapi_client.models.resource_ids import ResourceIds
from openapi_client.models.runs_response import RunsResponse
from openapi_client.models.source_update_request import SourceUpdateRequest
from openapi_client.models.status import Status
from openapi_client.models.update_agent_request_body import UpdateAgentRequestBody
from openapi_client.models.update_ai_model_configurations_request import UpdateAiModelConfigurationsRequest
from openapi_client.models.update_chat_request import UpdateChatRequest

from openapi_client.api_client import ApiClient, RequestSerialized
from openapi_client.api_response import ApiResponse
from openapi_client.rest import RESTResponseType


class AIApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


[docs] @validate_call def add_resources_to_knowledge_base( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to add resources to.")], content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[ResourceAdditionRequest, Field(description="Details of the resource to add.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AddResourcesToKnowledgeBase200Response: """Add resources to a knowledge base Adds resources (e.g., datasets, domains) to an existing knowledge base. :param id: The unique identifier of the knowledge base to add resources to. (required) :type id: str :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Details of the resource to add. (required) :type input_details: ResourceAdditionRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._add_resources_to_knowledge_base_serialize( id=id, content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AddResourcesToKnowledgeBase200Response", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def add_resources_to_knowledge_base_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to add resources to.")], content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[ResourceAdditionRequest, Field(description="Details of the resource to add.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AddResourcesToKnowledgeBase200Response]: """Add resources to a knowledge base Adds resources (e.g., datasets, domains) to an existing knowledge base. :param id: The unique identifier of the knowledge base to add resources to. (required) :type id: str :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Details of the resource to add. (required) :type input_details: ResourceAdditionRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._add_resources_to_knowledge_base_serialize( id=id, content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AddResourcesToKnowledgeBase200Response", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def add_resources_to_knowledge_base_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to add resources to.")], content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[ResourceAdditionRequest, Field(description="Details of the resource to add.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Add resources to a knowledge base Adds resources (e.g., datasets, domains) to an existing knowledge base. :param id: The unique identifier of the knowledge base to add resources to. (required) :type id: str :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Details of the resource to add. (required) :type input_details: ResourceAdditionRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._add_resources_to_knowledge_base_serialize( id=id, content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AddResourcesToKnowledgeBase200Response", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _add_resources_to_knowledge_base_serialize( self, id, content_type, role_id, input_details, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if input_details is not None: _body_params = input_details # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/knowledgebases/{id}/resources', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def chat_with_ai_guard_rail( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to use for chat protection.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], chat_request: Annotated[GuardRailChatRequest, Field(description="Chat request containing model configuration, guard rail settings, and input text.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GuardRailChatResponse: """Chat with guard rail protection Sends a chat message through the specified guard rail for content filtering and safety checks. :param id: The unique identifier of the guard rail to use for chat protection. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param chat_request: Chat request containing model configuration, guard rail settings, and input text. (required) :type chat_request: GuardRailChatRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._chat_with_ai_guard_rail_serialize( id=id, role_id=role_id, chat_request=chat_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailChatResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def chat_with_ai_guard_rail_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to use for chat protection.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], chat_request: Annotated[GuardRailChatRequest, Field(description="Chat request containing model configuration, guard rail settings, and input text.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GuardRailChatResponse]: """Chat with guard rail protection Sends a chat message through the specified guard rail for content filtering and safety checks. :param id: The unique identifier of the guard rail to use for chat protection. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param chat_request: Chat request containing model configuration, guard rail settings, and input text. (required) :type chat_request: GuardRailChatRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._chat_with_ai_guard_rail_serialize( id=id, role_id=role_id, chat_request=chat_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailChatResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def chat_with_ai_guard_rail_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to use for chat protection.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], chat_request: Annotated[GuardRailChatRequest, Field(description="Chat request containing model configuration, guard rail settings, and input text.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Chat with guard rail protection Sends a chat message through the specified guard rail for content filtering and safety checks. :param id: The unique identifier of the guard rail to use for chat protection. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param chat_request: Chat request containing model configuration, guard rail settings, and input text. (required) :type chat_request: GuardRailChatRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._chat_with_ai_guard_rail_serialize( id=id, role_id=role_id, chat_request=chat_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailChatResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _chat_with_ai_guard_rail_serialize( self, id, role_id, chat_request, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if chat_request is not None: _body_params = chat_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/guard-rails/{id}/chat', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def configure_component_guard_rails( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], component_config_request: Annotated[ComponentGuardRailConfigRequest, Field(description="Configuration specifying which guard rails are allowed for the component.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Configure guard rails for a specific component Configures which guard rails are allowed for a specific component (e.g., agent, knowledge_base). :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param component_config_request: Configuration specifying which guard rails are allowed for the component. (required) :type component_config_request: ComponentGuardRailConfigRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._configure_component_guard_rails_serialize( role_id=role_id, component=component, component_config_request=component_config_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def configure_component_guard_rails_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], component_config_request: Annotated[ComponentGuardRailConfigRequest, Field(description="Configuration specifying which guard rails are allowed for the component.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Configure guard rails for a specific component Configures which guard rails are allowed for a specific component (e.g., agent, knowledge_base). :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param component_config_request: Configuration specifying which guard rails are allowed for the component. (required) :type component_config_request: ComponentGuardRailConfigRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._configure_component_guard_rails_serialize( role_id=role_id, component=component, component_config_request=component_config_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def configure_component_guard_rails_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], component_config_request: Annotated[ComponentGuardRailConfigRequest, Field(description="Configuration specifying which guard rails are allowed for the component.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Configure guard rails for a specific component Configures which guard rails are allowed for a specific component (e.g., agent, knowledge_base). :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param component_config_request: Configuration specifying which guard rails are allowed for the component. (required) :type component_config_request: ComponentGuardRailConfigRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._configure_component_guard_rails_serialize( role_id=role_id, component=component, component_config_request=component_config_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _configure_component_guard_rails_serialize( self, role_id, component, component_config_request, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if component is not None: _query_params.append(('component', component)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if component_config_request is not None: _body_params = component_config_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/guard-rails/component-configurations', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_agent( self, role_id: StrictStr, agent_create_input: CreateAgentRequestBody, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Create a new agent Creates a new agent :param role_id: (required) :type role_id: str :param agent_create_input: (required) :type agent_create_input: CreateAgentRequestBody :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_agent_serialize( role_id=role_id, agent_create_input=agent_create_input, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_agent_with_http_info( self, role_id: StrictStr, agent_create_input: CreateAgentRequestBody, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Create a new agent Creates a new agent :param role_id: (required) :type role_id: str :param agent_create_input: (required) :type agent_create_input: CreateAgentRequestBody :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_agent_serialize( role_id=role_id, agent_create_input=agent_create_input, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_agent_without_preload_content( self, role_id: StrictStr, agent_create_input: CreateAgentRequestBody, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Create a new agent Creates a new agent :param role_id: (required) :type role_id: str :param agent_create_input: (required) :type agent_create_input: CreateAgentRequestBody :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_agent_serialize( role_id=role_id, agent_create_input=agent_create_input, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_agent_serialize( self, role_id, agent_create_input, content_type, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if agent_create_input is not None: _body_params = agent_create_input # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/agents', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_ai_chat( self, role_id: Annotated[StrictStr, Field(description="User role id")], content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Create a new chat Creates a new chat session :param role_id: User role id (required) :type role_id: str :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_serialize( role_id=role_id, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_ai_chat_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Create a new chat Creates a new chat session :param role_id: User role id (required) :type role_id: str :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_serialize( role_id=role_id, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_ai_chat_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Create a new chat Creates a new chat session :param role_id: User role id (required) :type role_id: str :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_serialize( role_id=role_id, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_ai_chat_serialize( self, role_id, content_type, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/playground/chats', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_ai_chat_file_upload_url( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_upload_request: ChatFileUploadRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ChatFileUploadResponse: """Generate presigned URL for file upload Generates a presigned URL for uploading files to a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_upload_request: (required) :type file_upload_request: ChatFileUploadRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_file_upload_url_serialize( chat_id=chat_id, role_id=role_id, file_upload_request=file_upload_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFileUploadResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_ai_chat_file_upload_url_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_upload_request: ChatFileUploadRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ChatFileUploadResponse]: """Generate presigned URL for file upload Generates a presigned URL for uploading files to a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_upload_request: (required) :type file_upload_request: ChatFileUploadRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_file_upload_url_serialize( chat_id=chat_id, role_id=role_id, file_upload_request=file_upload_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFileUploadResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_ai_chat_file_upload_url_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_upload_request: ChatFileUploadRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Generate presigned URL for file upload Generates a presigned URL for uploading files to a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_upload_request: (required) :type file_upload_request: ChatFileUploadRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_chat_file_upload_url_serialize( chat_id=chat_id, role_id=role_id, file_upload_request=file_upload_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFileUploadResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_ai_chat_file_upload_url_serialize( self, chat_id, role_id, file_upload_request, content_type, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if file_upload_request is not None: _body_params = file_upload_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/playground/chats/{chat_id}/files', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_ai_guard_rail( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailCreateRequest, Field(description="Configuration for the new guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Create a new guard rail Creates a new guard rail with the provided configuration for AI model safety and compliance. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Configuration for the new guard rail. (required) :type input_details: GuardRailCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_guard_rail_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_ai_guard_rail_with_http_info( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailCreateRequest, Field(description="Configuration for the new guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Create a new guard rail Creates a new guard rail with the provided configuration for AI model safety and compliance. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Configuration for the new guard rail. (required) :type input_details: GuardRailCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_guard_rail_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_ai_guard_rail_without_preload_content( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailCreateRequest, Field(description="Configuration for the new guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Create a new guard rail Creates a new guard rail with the provided configuration for AI model safety and compliance. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Configuration for the new guard rail. (required) :type input_details: GuardRailCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_guard_rail_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_ai_guard_rail_serialize( self, content_type, role_id, input_details, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if input_details is not None: _body_params = input_details # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/guard-rails', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_ai_note( self, role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteCreateRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> NotesCreateResponse: """Create a new note Creates a new note :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteCreateRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_note_serialize( role_id=role_id, note_request=note_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesCreateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_ai_note_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteCreateRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[NotesCreateResponse]: """Create a new note Creates a new note :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteCreateRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_note_serialize( role_id=role_id, note_request=note_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesCreateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_ai_note_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteCreateRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Create a new note Creates a new note :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteCreateRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_ai_note_serialize( role_id=role_id, note_request=note_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesCreateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_ai_note_serialize( self, role_id, note_request, content_type, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if note_request is not None: _body_params = note_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/playground/notes', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def create_knowledge_base( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[KnowledgeBaseCreateRequest, Field(description="Metadata for the new knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Create a new knowledge base Creates a new knowledge base with the provided metadata in Bedrock and DynamoDB. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Metadata for the new knowledge base. (required) :type input_details: KnowledgeBaseCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_knowledge_base_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def create_knowledge_base_with_http_info( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[KnowledgeBaseCreateRequest, Field(description="Metadata for the new knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Create a new knowledge base Creates a new knowledge base with the provided metadata in Bedrock and DynamoDB. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Metadata for the new knowledge base. (required) :type input_details: KnowledgeBaseCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_knowledge_base_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def create_knowledge_base_without_preload_content( self, content_type: StrictStr, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[KnowledgeBaseCreateRequest, Field(description="Metadata for the new knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Create a new knowledge base Creates a new knowledge base with the provided metadata in Bedrock and DynamoDB. :param content_type: (required) :type content_type: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Metadata for the new knowledge base. (required) :type input_details: KnowledgeBaseCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._create_knowledge_base_serialize( content_type=content_type, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _create_knowledge_base_serialize( self, content_type, role_id, input_details, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if input_details is not None: _body_params = input_details # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/knowledgebases', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_agent( self, id: StrictStr, role_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete the ai agent Delete the ai agent :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_agent_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_agent_with_http_info( self, id: StrictStr, role_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete the ai agent Delete the ai agent :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_agent_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_agent_without_preload_content( self, id: StrictStr, role_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete the ai agent Delete the ai agent :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_agent_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_agent_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/agents/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_ai_chat( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a chat Deletes a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_ai_chat_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a chat Deletes a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_ai_chat_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a chat Deletes a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_ai_chat_serialize( self, chat_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/playground/chats/{chat_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_ai_chat_file( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_name: Annotated[StrictStr, Field(description="Name of the file to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a file Deletes a file associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_name: Name of the file to delete (required) :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_file_serialize( chat_id=chat_id, role_id=role_id, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_ai_chat_file_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_name: Annotated[StrictStr, Field(description="Name of the file to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a file Deletes a file associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_name: Name of the file to delete (required) :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_file_serialize( chat_id=chat_id, role_id=role_id, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_ai_chat_file_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], file_name: Annotated[StrictStr, Field(description="Name of the file to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a file Deletes a file associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param file_name: Name of the file to delete (required) :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_chat_file_serialize( chat_id=chat_id, role_id=role_id, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_ai_chat_file_serialize( self, chat_id, role_id, file_name, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters if file_name is not None: _query_params.append(('file_name', file_name)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/playground/chats/{chat_id}/files', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_ai_guard_rail( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a guard rail Deletes a guard rail and its associated resources. :param id: The unique identifier of the guard rail to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_ai_guard_rail_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a guard rail Deletes a guard rail and its associated resources. :param id: The unique identifier of the guard rail to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_ai_guard_rail_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a guard rail Deletes a guard rail and its associated resources. :param id: The unique identifier of the guard rail to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_ai_guard_rail_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/guard-rails/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_ai_note( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a note Deletes a note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_ai_note_with_http_info( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a note Deletes a note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_ai_note_without_preload_content( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a note Deletes a note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_ai_note_serialize( self, note_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if note_id is not None: _path_params['note_id'] = note_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/playground/notes/{note_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_component_guard_rail_configuration( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Status: """Delete guard rail configuration for a specific component Deletes the guard rail configuration for a specific component. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_component_guard_rail_configuration_serialize( role_id=role_id, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_component_guard_rail_configuration_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Status]: """Delete guard rail configuration for a specific component Deletes the guard rail configuration for a specific component. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_component_guard_rail_configuration_serialize( role_id=role_id, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_component_guard_rail_configuration_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], component: Annotated[StrictStr, Field(description="The component type (e.g., 'agent', 'knowledge_base').")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete guard rail configuration for a specific component Deletes the guard rail configuration for a specific component. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param component: The component type (e.g., 'agent', 'knowledge_base'). (required) :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_component_guard_rail_configuration_serialize( role_id=role_id, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Status", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_component_guard_rail_configuration_serialize( self, role_id, component, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if component is not None: _query_params.append(('component', component)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/guard-rails/component-configurations', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_knowledge_base( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a knowledge base Deletes a knowledge base and its associated resources (Aurora table, Bedrock KB, DynamoDB entries, and fileloads status). :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_knowledge_base_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a knowledge base Deletes a knowledge base and its associated resources (Aurora table, Bedrock KB, DynamoDB entries, and fileloads status). :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_knowledge_base_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a knowledge base Deletes a knowledge base and its associated resources (Aurora table, Bedrock KB, DynamoDB entries, and fileloads status). :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_knowledge_base_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/knowledgebases/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def delete_knowledge_base_resource( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Delete a resource of a knowledge base Deletes a resource :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param resource_id: The unique identifier of the datasource to delete. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def delete_knowledge_base_resource_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Delete a resource of a knowledge base Deletes a resource :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param resource_id: The unique identifier of the datasource to delete. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def delete_knowledge_base_resource_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to delete.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to delete.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Delete a resource of a knowledge base Deletes a resource :param id: The unique identifier of the knowledge base to delete. (required) :type id: str :param resource_id: The unique identifier of the datasource to delete. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._delete_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _delete_knowledge_base_resource_serialize( self, id, resource_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id if resource_id is not None: _path_params['resource_id'] = resource_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='DELETE', resource_path='/ai/knowledgebases/{id}/resources/{resource_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_agent_details( self, id: StrictStr, role_id: StrictStr, projection_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, start_time: Optional[StrictStr] = None, end_time: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GetAgentDetailsResponse: """Get ai agent details Returns an ai agent's details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param projection_expression: :type projection_expression: str :param action: :type action: str :param start_time: :type start_time: str :param end_time: :type end_time: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_agent_details_serialize( id=id, role_id=role_id, projection_expression=projection_expression, action=action, start_time=start_time, end_time=end_time, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GetAgentDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_agent_details_with_http_info( self, id: StrictStr, role_id: StrictStr, projection_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, start_time: Optional[StrictStr] = None, end_time: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GetAgentDetailsResponse]: """Get ai agent details Returns an ai agent's details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param projection_expression: :type projection_expression: str :param action: :type action: str :param start_time: :type start_time: str :param end_time: :type end_time: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_agent_details_serialize( id=id, role_id=role_id, projection_expression=projection_expression, action=action, start_time=start_time, end_time=end_time, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GetAgentDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_agent_details_without_preload_content( self, id: StrictStr, role_id: StrictStr, projection_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, start_time: Optional[StrictStr] = None, end_time: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get ai agent details Returns an ai agent's details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param projection_expression: :type projection_expression: str :param action: :type action: str :param start_time: :type start_time: str :param end_time: :type end_time: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_agent_details_serialize( id=id, role_id=role_id, projection_expression=projection_expression, action=action, start_time=start_time, end_time=end_time, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GetAgentDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_agent_details_serialize( self, id, role_id, projection_expression, action, start_time, end_time, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters if projection_expression is not None: _query_params.append(('projectionExpression', projection_expression)) if action is not None: _query_params.append(('action', action)) if start_time is not None: _query_params.append(('start-time', start_time)) if end_time is not None: _query_params.append(('end-time', end_time)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/agents/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_chat( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ChatDetailsResponse: """Get chat details Returns details of a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_chat_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ChatDetailsResponse]: """Get chat details Returns details of a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_chat_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get chat details Returns details of a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_serialize( chat_id=chat_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_chat_serialize( self, chat_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/chats/{chat_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_chat_config( self, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AIChatsConfig: """Get chat config Retrieves the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_config_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIChatsConfig", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_chat_config_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AIChatsConfig]: """Get chat config Retrieves the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_config_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIChatsConfig", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_chat_config_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get chat config Retrieves the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_chat_config_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIChatsConfig", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_chat_config_serialize( self, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/chats/config', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_guard_rail( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GuardRailDetail: """Get details of a specific guard rail Retrieves comprehensive details for a single guard rail by its ID. :param id: The unique identifier of the guard rail. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_guard_rail_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GuardRailDetail]: """Get details of a specific guard rail Retrieves comprehensive details for a single guard rail by its ID. :param id: The unique identifier of the guard rail. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_guard_rail_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get details of a specific guard rail Retrieves comprehensive details for a single guard rail by its ID. :param id: The unique identifier of the guard rail. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_guard_rail_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_guard_rail_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/guard-rails/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_knowledge_base( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> KnowledgeBaseDetail: """Get details of a specific knowledge base Retrieves comprehensive details for a single knowledge base by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_knowledge_base_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[KnowledgeBaseDetail]: """Get details of a specific knowledge base Retrieves comprehensive details for a single knowledge base by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_knowledge_base_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get details of a specific knowledge base Retrieves comprehensive details for a single knowledge base by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_knowledge_base_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_knowledge_base_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/knowledgebases/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_model_details( self, model_id: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AIModelDetails: """Get model details Retrieve details of a particular model :param model_id: (required) :type model_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_model_details_serialize( model_id=model_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelDetails", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_model_details_with_http_info( self, model_id: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AIModelDetails]: """Get model details Retrieve details of a particular model :param model_id: (required) :type model_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_model_details_serialize( model_id=model_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelDetails", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_model_details_without_preload_content( self, model_id: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get model details Retrieve details of a particular model :param model_id: (required) :type model_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_model_details_serialize( model_id=model_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelDetails", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_model_details_serialize( self, model_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if model_id is not None: _path_params['model_id'] = model_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/models/{model_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_ai_note( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> NoteDetailsResponse: """Get a note Retrieves details of a specific note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_ai_note_with_http_info( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[NoteDetailsResponse]: """Get a note Retrieves details of a specific note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_ai_note_without_preload_content( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get a note Retrieves details of a specific note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_ai_note_serialize( note_id=note_id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteDetailsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_ai_note_serialize( self, note_id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if note_id is not None: _path_params['note_id'] = note_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/notes/{note_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_default_ai_guard_rail( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GuardRailDetail: """Get default guard rail Retrieves the default guard rail configuration. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_default_ai_guard_rail_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_default_ai_guard_rail_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GuardRailDetail]: """Get default guard rail Retrieves the default guard rail configuration. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_default_ai_guard_rail_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_default_ai_guard_rail_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get default guard rail Retrieves the default guard rail configuration. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_default_ai_guard_rail_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailDetail", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_default_ai_guard_rail_serialize( self, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/guard-rails/default', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_knowledge_base_resource_details( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base resource.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], action: Annotated[Optional[StrictStr], Field(description="The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'.")] = None, limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, offset: Annotated[Optional[StrictStr], Field(description="The offset to start from.")] = None, sortorder: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Dict[str, object]: """Get details of a specific knowledge base resource Retrieves comprehensive details for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param resource_id: The unique identifier of the knowledge base resource. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param action: The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'. :type action: str :param limit: The maximum number of results to return. :type limit: int :param offset: The offset to start from. :type offset: str :param sortorder: :type sortorder: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_resource_details_serialize( id=id, resource_id=resource_id, role_id=role_id, action=action, limit=limit, offset=offset, sortorder=sortorder, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Dict[str, object]", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_knowledge_base_resource_details_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base resource.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], action: Annotated[Optional[StrictStr], Field(description="The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'.")] = None, limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, offset: Annotated[Optional[StrictStr], Field(description="The offset to start from.")] = None, sortorder: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Dict[str, object]]: """Get details of a specific knowledge base resource Retrieves comprehensive details for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param resource_id: The unique identifier of the knowledge base resource. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param action: The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'. :type action: str :param limit: The maximum number of results to return. :type limit: int :param offset: The offset to start from. :type offset: str :param sortorder: :type sortorder: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_resource_details_serialize( id=id, resource_id=resource_id, role_id=role_id, action=action, limit=limit, offset=offset, sortorder=sortorder, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Dict[str, object]", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_knowledge_base_resource_details_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base resource.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], action: Annotated[Optional[StrictStr], Field(description="The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'.")] = None, limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, offset: Annotated[Optional[StrictStr], Field(description="The offset to start from.")] = None, sortorder: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get details of a specific knowledge base resource Retrieves comprehensive details for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param resource_id: The unique identifier of the knowledge base resource. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param action: The action to perform on the knowledge base resource. Either 'file_status' or 'get_metrics'. :type action: str :param limit: The maximum number of results to return. :type limit: int :param offset: The offset to start from. :type offset: str :param sortorder: :type sortorder: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_resource_details_serialize( id=id, resource_id=resource_id, role_id=role_id, action=action, limit=limit, offset=offset, sortorder=sortorder, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Dict[str, object]", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_knowledge_base_resource_details_serialize( self, id, resource_id, role_id, action, limit, offset, sortorder, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id if resource_id is not None: _path_params['resource_id'] = resource_id # process the query parameters if action is not None: _query_params.append(('action', action)) if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) if sortorder is not None: _query_params.append(('sortorder', sortorder)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/knowledgebases/{id}/resources/{resource_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def get_knowledge_base_run_metrics( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RunsResponse: """Get details of the runs associated with the KnowledgeBase Retrieves comprehensive details of the runs for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_run_metrics_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "RunsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def get_knowledge_base_run_metrics_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[RunsResponse]: """Get details of the runs associated with the KnowledgeBase Retrieves comprehensive details of the runs for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_run_metrics_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "RunsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def get_knowledge_base_run_metrics_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Get details of the runs associated with the KnowledgeBase Retrieves comprehensive details of the runs for a single knowledge base resource by its ID. :param id: The unique identifier of the knowledge base. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._get_knowledge_base_run_metrics_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "RunsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _get_knowledge_base_run_metrics_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/knowledgebases/{id}/runs', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_agents( self, role_id: StrictStr, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, projection_expression: Optional[StrictStr] = None, filter_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, agent_id: Annotated[Optional[StrictStr], Field(description="Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ListAgentsResponse: """List all ai agents user has access to Returns a list of ai agents of which the user is owner or has viewer access :param role_id: (required) :type role_id: str :param limit: :type limit: str :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param projection_expression: :type projection_expression: str :param filter_expression: :type filter_expression: str :param action: :type action: str :param agent_id: Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation :type agent_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_agents_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, action=action, agent_id=agent_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ListAgentsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_agents_with_http_info( self, role_id: StrictStr, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, projection_expression: Optional[StrictStr] = None, filter_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, agent_id: Annotated[Optional[StrictStr], Field(description="Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ListAgentsResponse]: """List all ai agents user has access to Returns a list of ai agents of which the user is owner or has viewer access :param role_id: (required) :type role_id: str :param limit: :type limit: str :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param projection_expression: :type projection_expression: str :param filter_expression: :type filter_expression: str :param action: :type action: str :param agent_id: Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation :type agent_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_agents_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, action=action, agent_id=agent_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ListAgentsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_agents_without_preload_content( self, role_id: StrictStr, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, projection_expression: Optional[StrictStr] = None, filter_expression: Optional[StrictStr] = None, action: Optional[StrictStr] = None, agent_id: Annotated[Optional[StrictStr], Field(description="Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List all ai agents user has access to Returns a list of ai agents of which the user is owner or has viewer access :param role_id: (required) :type role_id: str :param limit: :type limit: str :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param projection_expression: :type projection_expression: str :param filter_expression: :type filter_expression: str :param action: :type action: str :param agent_id: Optional agent ID. Used with action=generate_presigned_url for script updates. If not provided, a new UUID will be generated for new agent creation :type agent_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_agents_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, action=action, agent_id=agent_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ListAgentsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_agents_serialize( self, role_id, limit, offset, sortorder, sortby, projection_expression, filter_expression, action, agent_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) if sortorder is not None: _query_params.append(('sortorder', sortorder)) if sortby is not None: _query_params.append(('sortby', sortby)) if projection_expression is not None: _query_params.append(('projectionExpression', projection_expression)) if filter_expression is not None: _query_params.append(('filterExpression', filter_expression)) if action is not None: _query_params.append(('action', action)) if agent_id is not None: _query_params.append(('agent_id', agent_id)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/agents', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_chat_files( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[Optional[StrictStr], Field(description="Action to perform - download for presigned URL")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to download")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ChatFilesResponse: """List chat files Returns a list of files associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - download for presigned URL :type action: str :param file_name: Name of the file to download :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_files_serialize( chat_id=chat_id, role_id=role_id, action=action, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFilesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_chat_files_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[Optional[StrictStr], Field(description="Action to perform - download for presigned URL")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to download")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ChatFilesResponse]: """List chat files Returns a list of files associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - download for presigned URL :type action: str :param file_name: Name of the file to download :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_files_serialize( chat_id=chat_id, role_id=role_id, action=action, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFilesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_chat_files_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[Optional[StrictStr], Field(description="Action to perform - download for presigned URL")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to download")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List chat files Returns a list of files associated with a chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - download for presigned URL :type action: str :param file_name: Name of the file to download :type file_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_files_serialize( chat_id=chat_id, role_id=role_id, action=action, file_name=file_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatFilesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_chat_files_serialize( self, chat_id, role_id, action, file_name, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters if action is not None: _query_params.append(('action', action)) if file_name is not None: _query_params.append(('file_name', file_name)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/chats/{chat_id}/files', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_chat_messages( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], sortby: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort order")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of items to return")] = None, offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items to skip (1-based indexing)")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter expression for messages")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ChatMessagesResponse: """List chat messages Returns a paginated list of messages for a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param sortby: Field to sort by :type sortby: str :param sortorder: Sort order :type sortorder: str :param limit: Maximum number of items to return :type limit: int :param offset: Number of items to skip (1-based indexing) :type offset: int :param filter_expression: Filter expression for messages :type filter_expression: str :param projection_expression: Comma-separated list of fields to include in response :type projection_expression: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_messages_serialize( chat_id=chat_id, role_id=role_id, sortby=sortby, sortorder=sortorder, limit=limit, offset=offset, filter_expression=filter_expression, projection_expression=projection_expression, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatMessagesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_chat_messages_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], sortby: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort order")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of items to return")] = None, offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items to skip (1-based indexing)")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter expression for messages")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ChatMessagesResponse]: """List chat messages Returns a paginated list of messages for a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param sortby: Field to sort by :type sortby: str :param sortorder: Sort order :type sortorder: str :param limit: Maximum number of items to return :type limit: int :param offset: Number of items to skip (1-based indexing) :type offset: int :param filter_expression: Filter expression for messages :type filter_expression: str :param projection_expression: Comma-separated list of fields to include in response :type projection_expression: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_messages_serialize( chat_id=chat_id, role_id=role_id, sortby=sortby, sortorder=sortorder, limit=limit, offset=offset, filter_expression=filter_expression, projection_expression=projection_expression, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatMessagesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_chat_messages_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], sortby: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort order")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of items to return")] = None, offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items to skip (1-based indexing)")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter expression for messages")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List chat messages Returns a paginated list of messages for a specific chat :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param sortby: Field to sort by :type sortby: str :param sortorder: Sort order :type sortorder: str :param limit: Maximum number of items to return :type limit: int :param offset: Number of items to skip (1-based indexing) :type offset: int :param filter_expression: Filter expression for messages :type filter_expression: str :param projection_expression: Comma-separated list of fields to include in response :type projection_expression: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chat_messages_serialize( chat_id=chat_id, role_id=role_id, sortby=sortby, sortorder=sortorder, limit=limit, offset=offset, filter_expression=filter_expression, projection_expression=projection_expression, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatMessagesResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_chat_messages_serialize( self, chat_id, role_id, sortby, sortorder, limit, offset, filter_expression, projection_expression, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters if sortby is not None: _query_params.append(('sortby', sortby)) if sortorder is not None: _query_params.append(('sortorder', sortorder)) if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) if filter_expression is not None: _query_params.append(('filterExpression', filter_expression)) if projection_expression is not None: _query_params.append(('projectionExpression', projection_expression)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/chats/{chat_id}/messages', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_chats( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictInt], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ChatListResponse: """List all chats Returns a list of all chat sessions accessible to the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: int :param offset: Number of items to skip :type offset: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chats_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_chats_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictInt], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ChatListResponse]: """List all chats Returns a list of all chat sessions accessible to the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: int :param offset: Number of items to skip :type offset: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chats_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_chats_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictInt], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List all chats Returns a list of all chat sessions accessible to the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: int :param offset: Number of items to skip :type offset: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_chats_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ChatListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_chats_serialize( self, role_id, limit, offset, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/chats', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_guard_rails( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], offset: Annotated[Optional[StrictInt], Field(description="Starting position for pagination (1-based).")] = None, limit: Annotated[Optional[StrictInt], Field(description="Maximum number of items to return.")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort direction ('asc' or 'desc').")] = None, sortby: Annotated[Optional[StrictStr], Field(description="Attribute to sort by.")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of attributes to include.")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter criteria for guard rail names.")] = None, component: Annotated[Optional[StrictStr], Field(description="Component for which to list allowed guard rails.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GuardRailListResponse: """List all guard rails Retrieves a list of all guard rails accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param offset: Starting position for pagination (1-based). :type offset: int :param limit: Maximum number of items to return. :type limit: int :param sortorder: Sort direction ('asc' or 'desc'). :type sortorder: str :param sortby: Attribute to sort by. :type sortby: str :param projection_expression: Comma-separated list of attributes to include. :type projection_expression: str :param filter_expression: Filter criteria for guard rail names. :type filter_expression: str :param component: Component for which to list allowed guard rails. :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_guard_rails_serialize( role_id=role_id, offset=offset, limit=limit, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_guard_rails_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], offset: Annotated[Optional[StrictInt], Field(description="Starting position for pagination (1-based).")] = None, limit: Annotated[Optional[StrictInt], Field(description="Maximum number of items to return.")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort direction ('asc' or 'desc').")] = None, sortby: Annotated[Optional[StrictStr], Field(description="Attribute to sort by.")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of attributes to include.")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter criteria for guard rail names.")] = None, component: Annotated[Optional[StrictStr], Field(description="Component for which to list allowed guard rails.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GuardRailListResponse]: """List all guard rails Retrieves a list of all guard rails accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param offset: Starting position for pagination (1-based). :type offset: int :param limit: Maximum number of items to return. :type limit: int :param sortorder: Sort direction ('asc' or 'desc'). :type sortorder: str :param sortby: Attribute to sort by. :type sortby: str :param projection_expression: Comma-separated list of attributes to include. :type projection_expression: str :param filter_expression: Filter criteria for guard rail names. :type filter_expression: str :param component: Component for which to list allowed guard rails. :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_guard_rails_serialize( role_id=role_id, offset=offset, limit=limit, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_guard_rails_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], offset: Annotated[Optional[StrictInt], Field(description="Starting position for pagination (1-based).")] = None, limit: Annotated[Optional[StrictInt], Field(description="Maximum number of items to return.")] = None, sortorder: Annotated[Optional[StrictStr], Field(description="Sort direction ('asc' or 'desc').")] = None, sortby: Annotated[Optional[StrictStr], Field(description="Attribute to sort by.")] = None, projection_expression: Annotated[Optional[StrictStr], Field(description="Comma-separated list of attributes to include.")] = None, filter_expression: Annotated[Optional[StrictStr], Field(description="Filter criteria for guard rail names.")] = None, component: Annotated[Optional[StrictStr], Field(description="Component for which to list allowed guard rails.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List all guard rails Retrieves a list of all guard rails accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param offset: Starting position for pagination (1-based). :type offset: int :param limit: Maximum number of items to return. :type limit: int :param sortorder: Sort direction ('asc' or 'desc'). :type sortorder: str :param sortby: Attribute to sort by. :type sortby: str :param projection_expression: Comma-separated list of attributes to include. :type projection_expression: str :param filter_expression: Filter criteria for guard rail names. :type filter_expression: str :param component: Component for which to list allowed guard rails. :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_guard_rails_serialize( role_id=role_id, offset=offset, limit=limit, sortorder=sortorder, sortby=sortby, projection_expression=projection_expression, filter_expression=filter_expression, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "GuardRailListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_guard_rails_serialize( self, role_id, offset, limit, sortorder, sortby, projection_expression, filter_expression, component, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if offset is not None: _query_params.append(('offset', offset)) if limit is not None: _query_params.append(('limit', limit)) if sortorder is not None: _query_params.append(('sortorder', sortorder)) if sortby is not None: _query_params.append(('sortby', sortby)) if projection_expression is not None: _query_params.append(('projectionExpression', projection_expression)) if filter_expression is not None: _query_params.append(('filterExpression', filter_expression)) if component is not None: _query_params.append(('component', component)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/guard-rails', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_models( self, role_id: Annotated[StrictStr, Field(description="User role id")], input_modality: Annotated[Optional[StrictStr], Field(description="Filter models by input modality")] = None, output_modality: Annotated[Optional[StrictStr], Field(description="Filter models by output modality")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform - get configurations")] = None, component: Annotated[Optional[StrictStr], Field(description="Component identifier for list_by_component action")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AIModelsListResponse: """List models/view component configurations Returns a list of available AI models and their component configurations :param role_id: User role id (required) :type role_id: str :param input_modality: Filter models by input modality :type input_modality: str :param output_modality: Filter models by output modality :type output_modality: str :param action: Action to perform - get configurations :type action: str :param component: Component identifier for list_by_component action :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_models_serialize( role_id=role_id, input_modality=input_modality, output_modality=output_modality, action=action, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelsListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_models_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], input_modality: Annotated[Optional[StrictStr], Field(description="Filter models by input modality")] = None, output_modality: Annotated[Optional[StrictStr], Field(description="Filter models by output modality")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform - get configurations")] = None, component: Annotated[Optional[StrictStr], Field(description="Component identifier for list_by_component action")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AIModelsListResponse]: """List models/view component configurations Returns a list of available AI models and their component configurations :param role_id: User role id (required) :type role_id: str :param input_modality: Filter models by input modality :type input_modality: str :param output_modality: Filter models by output modality :type output_modality: str :param action: Action to perform - get configurations :type action: str :param component: Component identifier for list_by_component action :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_models_serialize( role_id=role_id, input_modality=input_modality, output_modality=output_modality, action=action, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelsListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_models_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], input_modality: Annotated[Optional[StrictStr], Field(description="Filter models by input modality")] = None, output_modality: Annotated[Optional[StrictStr], Field(description="Filter models by output modality")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform - get configurations")] = None, component: Annotated[Optional[StrictStr], Field(description="Component identifier for list_by_component action")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List models/view component configurations Returns a list of available AI models and their component configurations :param role_id: User role id (required) :type role_id: str :param input_modality: Filter models by input modality :type input_modality: str :param output_modality: Filter models by output modality :type output_modality: str :param action: Action to perform - get configurations :type action: str :param component: Component identifier for list_by_component action :type component: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_models_serialize( role_id=role_id, input_modality=input_modality, output_modality=output_modality, action=action, component=component, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "AIModelsListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_models_serialize( self, role_id, input_modality, output_modality, action, component, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if input_modality is not None: _query_params.append(('input_modality', input_modality)) if output_modality is not None: _query_params.append(('output_modality', output_modality)) if action is not None: _query_params.append(('action', action)) if component is not None: _query_params.append(('component', component)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/models', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_ai_notes( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictStr], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictStr], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> NotesListResponse: """List all notes Returns a list of all notes for the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: str :param offset: Number of items to skip :type offset: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_notes_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_ai_notes_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictStr], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictStr], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[NotesListResponse]: """List all notes Returns a list of all notes for the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: str :param offset: Number of items to skip :type offset: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_notes_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_ai_notes_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], limit: Annotated[Optional[StrictStr], Field(description="Number of items to return")] = None, offset: Annotated[Optional[StrictStr], Field(description="Number of items to skip")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List all notes Returns a list of all notes for the user :param role_id: User role id (required) :type role_id: str :param limit: Number of items to return :type limit: str :param offset: Number of items to skip :type offset: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_ai_notes_serialize( role_id=role_id, limit=limit, offset=offset, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NotesListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_ai_notes_serialize( self, role_id, limit, offset, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/playground/notes', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_component_guard_rail_configurations( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ComponentGuardRailConfigurationsResponse: """List guard rail configurations for all components Retrieves the guard rail configurations for all supported components. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_component_guard_rail_configurations_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ComponentGuardRailConfigurationsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_component_guard_rail_configurations_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ComponentGuardRailConfigurationsResponse]: """List guard rail configurations for all components Retrieves the guard rail configurations for all supported components. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_component_guard_rail_configurations_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ComponentGuardRailConfigurationsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_component_guard_rail_configurations_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List guard rail configurations for all components Retrieves the guard rail configurations for all supported components. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_component_guard_rail_configurations_serialize( role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "ComponentGuardRailConfigurationsResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_component_guard_rail_configurations_serialize( self, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/guard-rails/component-configurations', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def list_knowledge_bases( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], limit: Optional[StrictInt] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> KnowledgeBaseListResponse: """List all accessible knowledge bases Retrieves a list of all knowledge bases accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param limit: :type limit: int :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_knowledge_bases_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def list_knowledge_bases_with_http_info( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], limit: Optional[StrictInt] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[KnowledgeBaseListResponse]: """List all accessible knowledge bases Retrieves a list of all knowledge bases accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param limit: :type limit: int :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_knowledge_bases_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def list_knowledge_bases_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], limit: Optional[StrictInt] = None, offset: Optional[StrictStr] = None, sortorder: Optional[StrictStr] = None, sortby: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """List all accessible knowledge bases Retrieves a list of all knowledge bases accessible by the authenticated user. :param role_id: The role ID of the requesting user. (required) :type role_id: str :param limit: :type limit: int :param offset: :type offset: str :param sortorder: :type sortorder: str :param sortby: :type sortby: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._list_knowledge_bases_serialize( role_id=role_id, limit=limit, offset=offset, sortorder=sortorder, sortby=sortby, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseListResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _list_knowledge_bases_serialize( self, role_id, limit, offset, sortorder, sortby, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if limit is not None: _query_params.append(('limit', limit)) if offset is not None: _query_params.append(('offset', offset)) if sortorder is not None: _query_params.append(('sortorder', sortorder)) if sortby is not None: _query_params.append(('sortby', sortby)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='GET', resource_path='/ai/knowledgebases', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def query_knowledge_base( self, id: StrictStr, role_id: StrictStr, query_body: QueryBody, content_type: Optional[StrictStr] = None, resource_name: Annotated[Optional[StrictStr], Field(description="Name of the resource to query whether domain or dataset")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to query")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform on the query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> KnowledgeBaseQueryResponse: """Query the Knowledge Base User Can query the Knowledge Base :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param query_body: (required) :type query_body: QueryBody :param content_type: :type content_type: str :param resource_name: Name of the resource to query whether domain or dataset :type resource_name: str :param file_name: Name of the file to query :type file_name: str :param action: Action to perform on the query :type action: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._query_knowledge_base_serialize( id=id, role_id=role_id, query_body=query_body, content_type=content_type, resource_name=resource_name, file_name=file_name, action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseQueryResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def query_knowledge_base_with_http_info( self, id: StrictStr, role_id: StrictStr, query_body: QueryBody, content_type: Optional[StrictStr] = None, resource_name: Annotated[Optional[StrictStr], Field(description="Name of the resource to query whether domain or dataset")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to query")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform on the query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[KnowledgeBaseQueryResponse]: """Query the Knowledge Base User Can query the Knowledge Base :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param query_body: (required) :type query_body: QueryBody :param content_type: :type content_type: str :param resource_name: Name of the resource to query whether domain or dataset :type resource_name: str :param file_name: Name of the file to query :type file_name: str :param action: Action to perform on the query :type action: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._query_knowledge_base_serialize( id=id, role_id=role_id, query_body=query_body, content_type=content_type, resource_name=resource_name, file_name=file_name, action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseQueryResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def query_knowledge_base_without_preload_content( self, id: StrictStr, role_id: StrictStr, query_body: QueryBody, content_type: Optional[StrictStr] = None, resource_name: Annotated[Optional[StrictStr], Field(description="Name of the resource to query whether domain or dataset")] = None, file_name: Annotated[Optional[StrictStr], Field(description="Name of the file to query")] = None, action: Annotated[Optional[StrictStr], Field(description="Action to perform on the query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Query the Knowledge Base User Can query the Knowledge Base :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param query_body: (required) :type query_body: QueryBody :param content_type: :type content_type: str :param resource_name: Name of the resource to query whether domain or dataset :type resource_name: str :param file_name: Name of the file to query :type file_name: str :param action: Action to perform on the query :type action: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._query_knowledge_base_serialize( id=id, role_id=role_id, query_body=query_body, content_type=content_type, resource_name=resource_name, file_name=file_name, action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "KnowledgeBaseQueryResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _query_knowledge_base_serialize( self, id, role_id, query_body, content_type, resource_name, file_name, action, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters if resource_name is not None: _query_params.append(('ResourceName', resource_name)) if file_name is not None: _query_params.append(('FileName', file_name)) if action is not None: _query_params.append(('action', action)) # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if query_body is not None: _body_params = query_body # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/knowledgebases/{id}/query', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def set_ai_guard_rail_as_default( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to set as default.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Set guard rail as default Sets the specified guard rail as the default guard rail by setting the IsDefault flag to true. Only global guard rails can be set as default. :param id: The unique identifier of the guard rail to set as default. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._set_ai_guard_rail_as_default_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def set_ai_guard_rail_as_default_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to set as default.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Set guard rail as default Sets the specified guard rail as the default guard rail by setting the IsDefault flag to true. Only global guard rails can be set as default. :param id: The unique identifier of the guard rail to set as default. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._set_ai_guard_rail_as_default_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def set_ai_guard_rail_as_default_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to set as default.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Set guard rail as default Sets the specified guard rail as the default guard rail by setting the IsDefault flag to true. Only global guard rails can be set as default. :param id: The unique identifier of the guard rail to set as default. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._set_ai_guard_rail_as_default_serialize( id=id, role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _set_ai_guard_rail_as_default_serialize( self, id, role_id, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/guard-rails/{id}/default', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def sync_knowledge_base( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, resource_ids: Optional[ResourceIds] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Message: """Sync the Datasource or the complete the KnowledgeBase Sync the Files Present inside the Datasource :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param resource_ids: :type resource_ids: ResourceIds :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._sync_knowledge_base_serialize( id=id, role_id=role_id, content_type=content_type, resource_ids=resource_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Message", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def sync_knowledge_base_with_http_info( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, resource_ids: Optional[ResourceIds] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Message]: """Sync the Datasource or the complete the KnowledgeBase Sync the Files Present inside the Datasource :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param resource_ids: :type resource_ids: ResourceIds :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._sync_knowledge_base_serialize( id=id, role_id=role_id, content_type=content_type, resource_ids=resource_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Message", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def sync_knowledge_base_without_preload_content( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, resource_ids: Optional[ResourceIds] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Sync the Datasource or the complete the KnowledgeBase Sync the Files Present inside the Datasource :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param resource_ids: :type resource_ids: ResourceIds :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._sync_knowledge_base_serialize( id=id, role_id=role_id, content_type=content_type, resource_ids=resource_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "Message", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _sync_knowledge_base_serialize( self, id, role_id, content_type, resource_ids, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if resource_ids is not None: _body_params = resource_ids # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='POST', resource_path='/ai/knowledgebases/{id}/sync', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_agent_details( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, action: Optional[StrictStr] = None, update_agent_request_body: Optional[UpdateAgentRequestBody] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update ai agent details Updates ai agent details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param action: :type action: str :param update_agent_request_body: :type update_agent_request_body: UpdateAgentRequestBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_agent_details_serialize( id=id, role_id=role_id, content_type=content_type, action=action, update_agent_request_body=update_agent_request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_agent_details_with_http_info( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, action: Optional[StrictStr] = None, update_agent_request_body: Optional[UpdateAgentRequestBody] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update ai agent details Updates ai agent details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param action: :type action: str :param update_agent_request_body: :type update_agent_request_body: UpdateAgentRequestBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_agent_details_serialize( id=id, role_id=role_id, content_type=content_type, action=action, update_agent_request_body=update_agent_request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_agent_details_without_preload_content( self, id: StrictStr, role_id: StrictStr, content_type: Optional[StrictStr] = None, action: Optional[StrictStr] = None, update_agent_request_body: Optional[UpdateAgentRequestBody] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update ai agent details Updates ai agent details :param id: (required) :type id: str :param role_id: (required) :type role_id: str :param content_type: :type content_type: str :param action: :type action: str :param update_agent_request_body: :type update_agent_request_body: UpdateAgentRequestBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_agent_details_serialize( id=id, role_id=role_id, content_type=content_type, action=action, update_agent_request_body=update_agent_request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_agent_details_serialize( self, id, role_id, content_type, action, update_agent_request_body, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters if action is not None: _query_params.append(('action', action)) # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if update_agent_request_body is not None: _body_params = update_agent_request_body # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/agents/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_chat( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[StrictStr, Field(description="Action to perform - update or summarize")], update_chat_request: UpdateChatRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update chat details Updates a chat's title, trigger chat summarization, or update keywords :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - update or summarize (required) :type action: str :param update_chat_request: (required) :type update_chat_request: UpdateChatRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_serialize( chat_id=chat_id, role_id=role_id, action=action, update_chat_request=update_chat_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_chat_with_http_info( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[StrictStr, Field(description="Action to perform - update or summarize")], update_chat_request: UpdateChatRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update chat details Updates a chat's title, trigger chat summarization, or update keywords :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - update or summarize (required) :type action: str :param update_chat_request: (required) :type update_chat_request: UpdateChatRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_serialize( chat_id=chat_id, role_id=role_id, action=action, update_chat_request=update_chat_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_chat_without_preload_content( self, chat_id: Annotated[StrictStr, Field(description="Chat ID")], role_id: Annotated[StrictStr, Field(description="User role id")], action: Annotated[StrictStr, Field(description="Action to perform - update or summarize")], update_chat_request: UpdateChatRequest, content_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update chat details Updates a chat's title, trigger chat summarization, or update keywords :param chat_id: Chat ID (required) :type chat_id: str :param role_id: User role id (required) :type role_id: str :param action: Action to perform - update or summarize (required) :type action: str :param update_chat_request: (required) :type update_chat_request: UpdateChatRequest :param content_type: :type content_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_serialize( chat_id=chat_id, role_id=role_id, action=action, update_chat_request=update_chat_request, content_type=content_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_chat_serialize( self, chat_id, role_id, action, update_chat_request, content_type, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if chat_id is not None: _path_params['chat_id'] = chat_id # process the query parameters if action is not None: _query_params.append(('action', action)) # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if update_chat_request is not None: _body_params = update_chat_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/playground/chats/{chat_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_chat_config( self, role_id: Annotated[StrictStr, Field(description="User role id")], config: Annotated[AIChatsConfig, Field(description="Chat configuration to set")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Set chat config Sets or updates the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param config: Chat configuration to set (required) :type config: AIChatsConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_config_serialize( role_id=role_id, config=config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_chat_config_with_http_info( self, role_id: Annotated[StrictStr, Field(description="User role id")], config: Annotated[AIChatsConfig, Field(description="Chat configuration to set")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Set chat config Sets or updates the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param config: Chat configuration to set (required) :type config: AIChatsConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_config_serialize( role_id=role_id, config=config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_chat_config_without_preload_content( self, role_id: Annotated[StrictStr, Field(description="User role id")], config: Annotated[AIChatsConfig, Field(description="Chat configuration to set")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Set chat config Sets or updates the chat configuration for the playground chats feature. :param role_id: User role id (required) :type role_id: str :param config: Chat configuration to set (required) :type config: AIChatsConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_chat_config_serialize( role_id=role_id, config=config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_chat_config_serialize( self, role_id, config, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if config is not None: _body_params = config # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/playground/chats/config', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_guard_rail( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailUpdateRequest, Field(description="Updated configuration for the guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update an existing guard rail Updates the configuration of an existing guard rail. :param id: The unique identifier of the guard rail to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Updated configuration for the guard rail. (required) :type input_details: GuardRailUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_guard_rail_serialize( id=id, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_guard_rail_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailUpdateRequest, Field(description="Updated configuration for the guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update an existing guard rail Updates the configuration of an existing guard rail. :param id: The unique identifier of the guard rail to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Updated configuration for the guard rail. (required) :type input_details: GuardRailUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_guard_rail_serialize( id=id, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_guard_rail_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the guard rail to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], input_details: Annotated[GuardRailUpdateRequest, Field(description="Updated configuration for the guard rail.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update an existing guard rail Updates the configuration of an existing guard rail. :param id: The unique identifier of the guard rail to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param input_details: Updated configuration for the guard rail. (required) :type input_details: GuardRailUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_guard_rail_serialize( id=id, role_id=role_id, input_details=input_details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_guard_rail_serialize( self, id, role_id, input_details, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if input_details is not None: _body_params = input_details # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/guard-rails/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_model( self, model_id: StrictStr, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update model status or parameters Enable/disable a model or update its default parameters :param model_id: (required) :type model_id: str :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param body: :type body: object :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_serialize( model_id=model_id, action=action, role_id=role_id, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_model_with_http_info( self, model_id: StrictStr, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update model status or parameters Enable/disable a model or update its default parameters :param model_id: (required) :type model_id: str :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param body: :type body: object :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_serialize( model_id=model_id, action=action, role_id=role_id, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_model_without_preload_content( self, model_id: StrictStr, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update model status or parameters Enable/disable a model or update its default parameters :param model_id: (required) :type model_id: str :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param body: :type body: object :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_serialize( model_id=model_id, action=action, role_id=role_id, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_model_serialize( self, model_id, action, role_id, body, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if model_id is not None: _path_params['model_id'] = model_id # process the query parameters if action is not None: _query_params.append(('action', action)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if body is not None: _body_params = body # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/models/{model_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_model_configurations( self, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], component: Optional[StrictStr] = None, body: Optional[UpdateAiModelConfigurationsRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update model configurations Update configurations for bedrock models for a specific component :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param component: :type component: str :param body: :type body: UpdateAiModelConfigurationsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_configurations_serialize( action=action, role_id=role_id, component=component, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_model_configurations_with_http_info( self, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], component: Optional[StrictStr] = None, body: Optional[UpdateAiModelConfigurationsRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update model configurations Update configurations for bedrock models for a specific component :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param component: :type component: str :param body: :type body: UpdateAiModelConfigurationsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_configurations_serialize( action=action, role_id=role_id, component=component, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_model_configurations_without_preload_content( self, action: StrictStr, role_id: Annotated[StrictStr, Field(description="User role id")], component: Optional[StrictStr] = None, body: Optional[UpdateAiModelConfigurationsRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update model configurations Update configurations for bedrock models for a specific component :param action: (required) :type action: str :param role_id: User role id (required) :type role_id: str :param component: :type component: str :param body: :type body: UpdateAiModelConfigurationsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_model_configurations_serialize( action=action, role_id=role_id, component=component, body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_model_configurations_serialize( self, action, role_id, component, body, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters if action is not None: _query_params.append(('action', action)) if component is not None: _query_params.append(('component', component)) # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if body is not None: _body_params = body # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/models', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_ai_note( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteUpdateRequest, content_type: Optional[StrictStr] = None, update_content: Annotated[Optional[StrictStr], Field(description="Update content value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> NoteUpdateResponse: """Update a note Updates an existing note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteUpdateRequest :param content_type: :type content_type: str :param update_content: Update content value :type update_content: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_note_serialize( note_id=note_id, role_id=role_id, note_request=note_request, content_type=content_type, update_content=update_content, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteUpdateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_ai_note_with_http_info( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteUpdateRequest, content_type: Optional[StrictStr] = None, update_content: Annotated[Optional[StrictStr], Field(description="Update content value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[NoteUpdateResponse]: """Update a note Updates an existing note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteUpdateRequest :param content_type: :type content_type: str :param update_content: Update content value :type update_content: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_note_serialize( note_id=note_id, role_id=role_id, note_request=note_request, content_type=content_type, update_content=update_content, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteUpdateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_ai_note_without_preload_content( self, note_id: Annotated[StrictStr, Field(description="Note ID")], role_id: Annotated[StrictStr, Field(description="User role id")], note_request: NoteUpdateRequest, content_type: Optional[StrictStr] = None, update_content: Annotated[Optional[StrictStr], Field(description="Update content value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update a note Updates an existing note :param note_id: Note ID (required) :type note_id: str :param role_id: User role id (required) :type role_id: str :param note_request: (required) :type note_request: NoteUpdateRequest :param content_type: :type content_type: str :param update_content: Update content value :type update_content: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_ai_note_serialize( note_id=note_id, role_id=role_id, note_request=note_request, content_type=content_type, update_content=update_content, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "NoteUpdateResponse", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_ai_note_serialize( self, note_id, role_id, note_request, content_type, update_content, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if note_id is not None: _path_params['note_id'] = note_id # process the query parameters if update_content is not None: _query_params.append(('update-content', update_content)) # process the header parameters if content_type is not None: _header_params['Content-Type'] = content_type if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if note_request is not None: _body_params = note_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/playground/notes/{note_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_knowledge_base( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], knowledge_base_update_request: Annotated[KnowledgeBaseUpdateRequest, Field(description="New name, description and guard rails for the knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update an existing knowledge base Updates the name, description and guard rails of an existing knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param knowledge_base_update_request: New name, description and guard rails for the knowledge base. (required) :type knowledge_base_update_request: KnowledgeBaseUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_serialize( id=id, role_id=role_id, knowledge_base_update_request=knowledge_base_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_knowledge_base_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], knowledge_base_update_request: Annotated[KnowledgeBaseUpdateRequest, Field(description="New name, description and guard rails for the knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update an existing knowledge base Updates the name, description and guard rails of an existing knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param knowledge_base_update_request: New name, description and guard rails for the knowledge base. (required) :type knowledge_base_update_request: KnowledgeBaseUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_serialize( id=id, role_id=role_id, knowledge_base_update_request=knowledge_base_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_knowledge_base_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], knowledge_base_update_request: Annotated[KnowledgeBaseUpdateRequest, Field(description="New name, description and guard rails for the knowledge base.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update an existing knowledge base Updates the name, description and guard rails of an existing knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param knowledge_base_update_request: New name, description and guard rails for the knowledge base. (required) :type knowledge_base_update_request: KnowledgeBaseUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_serialize( id=id, role_id=role_id, knowledge_base_update_request=knowledge_base_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_knowledge_base_serialize( self, id, role_id, knowledge_base_update_request, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if knowledge_base_update_request is not None: _body_params = knowledge_base_update_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/knowledgebases/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )
[docs] @validate_call def update_knowledge_base_resource( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], source_update_request: Annotated[SourceUpdateRequest, Field(description="Description of the knowledge base resource to update.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MessageStatus: """Update an existing datasource of a knowledge base resource Updates the description of an existing datasource of a knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param resource_id: The unique identifier of the datasource to update. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param source_update_request: Description of the knowledge base resource to update. (required) :type source_update_request: SourceUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, source_update_request=source_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ).data
@validate_call def update_knowledge_base_resource_with_http_info( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], source_update_request: Annotated[SourceUpdateRequest, Field(description="Description of the knowledge base resource to update.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MessageStatus]: """Update an existing datasource of a knowledge base resource Updates the description of an existing datasource of a knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param resource_id: The unique identifier of the datasource to update. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param source_update_request: Description of the knowledge base resource to update. (required) :type source_update_request: SourceUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, source_update_request=source_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, ) @validate_call def update_knowledge_base_resource_without_preload_content( self, id: Annotated[StrictStr, Field(description="The unique identifier of the knowledge base to update.")], resource_id: Annotated[StrictStr, Field(description="The unique identifier of the datasource to update.")], role_id: Annotated[StrictStr, Field(description="The role ID of the requesting user.")], source_update_request: Annotated[SourceUpdateRequest, Field(description="Description of the knowledge base resource to update.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: """Update an existing datasource of a knowledge base resource Updates the description of an existing datasource of a knowledge base. :param id: The unique identifier of the knowledge base to update. (required) :type id: str :param resource_id: The unique identifier of the datasource to update. (required) :type resource_id: str :param role_id: The role ID of the requesting user. (required) :type role_id: str :param source_update_request: Description of the knowledge base resource to update. (required) :type source_update_request: SourceUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :param _content_type: force content-type for the request. :type _content_type: str, Optional :param _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request. :type _headers: dict, optional :param _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 _param = self._update_knowledge_base_resource_serialize( id=id, resource_id=resource_id, role_id=role_id, source_update_request=source_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { '200': "MessageStatus", '400': "Error", '500': "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response def _update_knowledge_base_resource_serialize( self, id, resource_id, role_id, source_update_request, _request_auth, _content_type, _headers, _host_index, ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} _body_params: Optional[bytes] = None # process the path parameters if id is not None: _path_params['id'] = id if resource_id is not None: _path_params['resource_id'] = resource_id # process the query parameters # process the header parameters if role_id is not None: _header_params['role_id'] = role_id # process the form parameters # process the body parameter if source_update_request is not None: _body_params = source_update_request # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json' ] ) # set the HTTP header `Content-Type` if _content_type: _header_params['Content-Type'] = _content_type else: _default_content_type = ( self.api_client.select_header_content_type( [ 'application/json' ] ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ 'LambdaAuthorizer' ] return self.api_client.param_serialize( method='PUT', resource_path='/ai/knowledgebases/{id}/resources/{resource_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, _request_auth=_request_auth )