diff --git a/ibm_watson/assistant_v2.py b/ibm_watson/assistant_v2.py index 31ff57d2..23d9b197 100644 --- a/ibm_watson/assistant_v2.py +++ b/ibm_watson/assistant_v2.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2019, 2024. +# (C) Copyright IBM Corp. 2019, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 +# IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 """ The IBM® watsonx™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your @@ -61,7 +61,7 @@ def __init__( Construct a new client for the Assistant service. :param str version: Release date of the API version you want to use. - Specify dates in YYYY-MM-DD format. The current version is `2023-06-15`. + Specify dates in YYYY-MM-DD format. The current version is `2024-08-25`. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md @@ -428,17 +428,18 @@ def delete_assistant( Delete an assistant. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -498,17 +499,18 @@ def create_session( [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param RequestAnalytics analytics: (optional) An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension. @@ -574,17 +576,18 @@ def delete_session( [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str session_id: Unique identifier of the session. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -650,17 +653,18 @@ def message( session. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -759,17 +763,18 @@ def message_stateless( (including context data) managed by your application. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -870,17 +875,18 @@ def message_stream( session. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -979,17 +985,18 @@ def message_stream_stateless( (including context data) managed by your application. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -1086,9 +1093,11 @@ def bulk_classify( versions. This method is available only with Enterprise with Data Isolation plans. - :param str skill_id: Unique identifier of the skill. To find the skill ID - in the watsonx Assistant user interface, open the skill settings and click - **API Details**. + :param str skill_id: Unique identifier of the skill. To find the action or + dialog skill ID in the watsonx Assistant user interface, open the skill + settings and click **API Details**. To find the search skill ID, use the + Get environment API to retrieve the skill references for an environment and + it will include the search skill info, if available. :param List[BulkClassifyUtterance] input: An array of input utterances to classify. :param dict headers: A `dict` containing the request headers @@ -1166,17 +1175,18 @@ def list_logs( about using pagination, see [Pagination](#pagination). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str sort: (optional) How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, prefix the parameter value with a minus sign (`-`). @@ -1314,17 +1324,18 @@ def list_environments( List the environments associated with an assistant. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param int page_limit: (optional) The number of records to return in each page of results. :param bool include_count: (optional) Whether to include information about @@ -1397,17 +1408,18 @@ def get_environment( [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -1476,17 +1488,18 @@ def update_environment( [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str environment_id: Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the @@ -1576,17 +1589,18 @@ def create_release( called a *version*.). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str description: (optional) The description of the release. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -1652,17 +1666,18 @@ def list_releases( interface, a release is called a *version*.). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param int page_limit: (optional) The number of records to return in each page of results. :param bool include_count: (optional) Whether to include information about @@ -1737,17 +1752,18 @@ def get_release( has completed, the request returns the release data. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str release: Unique identifier of the release. :param bool include_audit: (optional) Whether to include the audit properties (`created` and `updated` timestamps) in the response. @@ -1806,17 +1822,18 @@ def delete_release( *version*.). :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str release: Unique identifier of the release. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -1875,17 +1892,18 @@ def deploy_release( part of the release become active in the environment. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str release: Unique identifier of the release. :param str environment_id: The environment ID of the environment where the release is to be deployed. @@ -1964,17 +1982,18 @@ def create_release_export( (/scope) of the release. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str release: Unique identifier of the release. :param bool include_audit: (optional) Whether to include the audit properties (`created` and `updated` timestamps) in the response. @@ -2049,17 +2068,18 @@ def download_release_export( skill update endpoints.. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param str release: Unique identifier of the release. :param str accept: (optional) The type of the response: application/json or application/octet-stream. @@ -2138,17 +2158,18 @@ def create_release_import( Status" endpoint. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param BinaryIO body: Request body is an Octet-stream of the artifact Zip file that is being imported. :param bool include_audit: (optional) Whether to include the audit @@ -2212,17 +2233,18 @@ def get_release_import_status( until the status of the import has either succeeded or failed. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param bool include_audit: (optional) Whether to include the audit properties (`created` and `updated` timestamps) in the response. :param dict headers: A `dict` containing the request headers @@ -2280,20 +2302,23 @@ def get_skill( Get information about a skill. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. - :param str skill_id: Unique identifier of the skill. To find the skill ID - in the watsonx Assistant user interface, open the skill settings and click - **API Details**. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. + :param str skill_id: Unique identifier of the skill. To find the action or + dialog skill ID in the watsonx Assistant user interface, open the skill + settings and click **API Details**. To find the search skill ID, use the + Get environment API to retrieve the skill references for an environment and + it will include the search skill info, if available. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Skill` object @@ -2356,20 +2381,23 @@ def update_skill( **status** property. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. - :param str skill_id: Unique identifier of the skill. To find the skill ID - in the watsonx Assistant user interface, open the skill settings and click - **API Details**. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. + :param str skill_id: Unique identifier of the skill. To find the action or + dialog skill ID in the watsonx Assistant user interface, open the skill + settings and click **API Details**. To find the search skill ID, use the + Get environment API to retrieve the skill references for an environment and + it will include the search skill info, if available. :param str name: (optional) The name of the skill. This string cannot contain carriage return, newline, or tab characters. :param str description: (optional) The description of the skill. This @@ -2447,8 +2475,9 @@ def export_skills( Export skills. Asynchronously export the action skill and dialog skill (if enabled) for the - assistant. Use this method to save all skill data so that you can import it to a - different assistant using the **Import skills** method. + assistant. Use this method to save all skill data from the draft environment so + that you can import it to a different assistant using the **Import skills** + method. Use `assistant_id` instead of `environment_id` to call this endpoint. A successful call to this method only initiates an asynchronous export. The exported JSON data is not available until processing completes. After the initial request is submitted, you can poll the status of the operation @@ -2461,17 +2490,18 @@ def export_skills( Remember that the usual rate limits apply. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param bool include_audit: (optional) Whether to include the audit properties (`created` and `updated` timestamps) in the response. :param dict headers: A `dict` containing the request headers @@ -2527,7 +2557,8 @@ def import_skills( Import skills. Asynchronously import skills into an existing assistant from a previously exported - file. + file. This method only imports assistants into a draft environment. Use + `assistant_id` instead of `environment_id` to call this endpoint. The request body for this method should contain the response data that was received from a previous call to the **Export skills** method, without modification. @@ -2537,17 +2568,18 @@ def import_skills( skills import** method. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param List[SkillImport] assistant_skills: An array of objects describing the skills for the assistant. Included in responses only if **status**=`Available`. @@ -2622,17 +2654,18 @@ def import_skills_status( using the **Import skills** method. :param str assistant_id: The assistant ID or the environment ID of the - environment where the assistant is deployed, depending on the type of - request: - - For message, session, and log requests, specify the environment ID of + environment where the assistant is deployed. + Set the value for this ID depending on the type of request: + - For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed. - - For all other requests, specify the assistant ID of the assistant. - To find the environment ID or assistant ID in the watsonx Assistant user - interface, open the assistant settings and scroll to the **Environments** - section. - **Note:** If you are using the classic Watson Assistant experience, always - use the assistant ID. To find the assistant ID in the user interface, open - the assistant settings and click API Details. + - For all other requests, specify the assistant ID of the assistant. + To get the **assistant ID** and **environment ID** in the watsonx + Assistant interface, open the **Assistant settings** page, and scroll to + the **Assistant IDs and API details** section and click **View Details**. + **Note:** If you are using the classic Watson Assistant experience, always + use the assistant ID. + To find the **assistant ID** in the user interface, open the **Assistant + settings** and click **API Details**. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `SkillsAsyncRequestStatus` object @@ -3794,6 +3827,111 @@ def __ne__(self, other: 'ChannelTransferTargetChat') -> bool: return not self == other +class ClientAction: + """ + ClientAction. + + :param str name: (optional) The name of the client action. + :param str result_variable: (optional) The name of the variable that the results + are stored in. + :param str type: (optional) The type of turn event. + :param str skill: (optional) The skill that is requesting the action. Included + only if **type**=`client`. + :param dict parameters: (optional) An object containing arbitrary variables that + are included in the turn event. + """ + + def __init__( + self, + *, + name: Optional[str] = None, + result_variable: Optional[str] = None, + type: Optional[str] = None, + skill: Optional[str] = None, + parameters: Optional[dict] = None, + ) -> None: + """ + Initialize a ClientAction object. + + :param str name: (optional) The name of the client action. + :param str result_variable: (optional) The name of the variable that the + results are stored in. + :param str type: (optional) The type of turn event. + :param str skill: (optional) The skill that is requesting the action. + Included only if **type**=`client`. + :param dict parameters: (optional) An object containing arbitrary variables + that are included in the turn event. + """ + self.name = name + self.result_variable = result_variable + self.type = type + self.skill = skill + self.parameters = parameters + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClientAction': + """Initialize a ClientAction object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + if (result_variable := _dict.get('result_variable')) is not None: + args['result_variable'] = result_variable + if (type := _dict.get('type')) is not None: + args['type'] = type + if (skill := _dict.get('skill')) is not None: + args['skill'] = skill + if (parameters := _dict.get('parameters')) is not None: + args['parameters'] = parameters + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClientAction object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, + 'result_variable') and self.result_variable is not None: + _dict['result_variable'] = self.result_variable + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'skill') and self.skill is not None: + _dict['skill'] = self.skill + if hasattr(self, 'parameters') and self.parameters is not None: + _dict['parameters'] = self.parameters + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ClientAction object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClientAction') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ClientAction') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class SkillEnum(str, Enum): + """ + The skill that is requesting the action. Included only if **type**=`client`. + """ + + MAIN_SKILL = 'main skill' + ACTIONS_SKILL = 'actions skill' + + class CreateAssistantReleaseImportResponse: """ CreateAssistantReleaseImportResponse. @@ -5223,52 +5361,119 @@ class TypeEnum(str, Enum): SEARCH = 'search' -class IntegrationReference: +class FinalResponse: """ - IntegrationReference. + Message final response content. - :param str integration_id: (optional) The integration ID of the integration. - :param str type: (optional) The type of the integration. + :param FinalResponseOutput output: (optional) Assistant output to be rendered or + processed by the client. + :param MessageContext context: (optional) Context data for the conversation. You + can use this property to access context variables. The context is stored by the + assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: (optional) A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier for + each individual end user who accesses the application. For user-based plans, + this user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. + :param MessageOutput masked_output: (optional) Assistant output to be rendered + or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes the + input text. All private data is masked or removed. """ def __init__( self, *, - integration_id: Optional[str] = None, - type: Optional[str] = None, + output: Optional['FinalResponseOutput'] = None, + context: Optional['MessageContext'] = None, + user_id: Optional[str] = None, + masked_output: Optional['MessageOutput'] = None, + masked_input: Optional['MessageInput'] = None, ) -> None: """ - Initialize a IntegrationReference object. + Initialize a FinalResponse object. - :param str integration_id: (optional) The integration ID of the - integration. - :param str type: (optional) The type of the integration. + :param FinalResponseOutput output: (optional) Assistant output to be + rendered or processed by the client. + :param MessageContext context: (optional) Context data for the + conversation. You can use this property to access context variables. The + context is stored by the assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: (optional) A string value that identifies the user who + is interacting with the assistant. The client must provide a unique + identifier for each individual end user who accesses the application. For + user-based plans, this user ID is used to identify unique users for billing + purposes. This string cannot contain carriage return, newline, or tab + characters. If no value is specified in the input, **user_id** is + automatically set to the value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. + :param MessageOutput masked_output: (optional) Assistant output to be + rendered or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes + the input text. All private data is masked or removed. """ - self.integration_id = integration_id - self.type = type + self.output = output + self.context = context + self.user_id = user_id + self.masked_output = masked_output + self.masked_input = masked_input @classmethod - def from_dict(cls, _dict: Dict) -> 'IntegrationReference': - """Initialize a IntegrationReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FinalResponse': + """Initialize a FinalResponse object from a json dictionary.""" args = {} - if (integration_id := _dict.get('integration_id')) is not None: - args['integration_id'] = integration_id - if (type := _dict.get('type')) is not None: - args['type'] = type + if (output := _dict.get('output')) is not None: + args['output'] = FinalResponseOutput.from_dict(output) + if (context := _dict.get('context')) is not None: + args['context'] = MessageContext.from_dict(context) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id + if (masked_output := _dict.get('masked_output')) is not None: + args['masked_output'] = MessageOutput.from_dict(masked_output) + if (masked_input := _dict.get('masked_input')) is not None: + args['masked_input'] = MessageInput.from_dict(masked_input) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IntegrationReference object from a json dictionary.""" + """Initialize a FinalResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'integration_id') and self.integration_id is not None: - _dict['integration_id'] = self.integration_id - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output + else: + _dict['output'] = self.output.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id + if hasattr(self, 'masked_output') and self.masked_output is not None: + if isinstance(self.masked_output, dict): + _dict['masked_output'] = self.masked_output + else: + _dict['masked_output'] = self.masked_output.to_dict() + if hasattr(self, 'masked_input') and self.masked_input is not None: + if isinstance(self.masked_input, dict): + _dict['masked_input'] = self.masked_input + else: + _dict['masked_input'] = self.masked_input.to_dict() return _dict def _to_dict(self): @@ -5276,190 +5481,196 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IntegrationReference object.""" + """Return a `str` version of this FinalResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IntegrationReference') -> bool: + def __eq__(self, other: 'FinalResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IntegrationReference') -> bool: + def __ne__(self, other: 'FinalResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Log: +class FinalResponseOutput: """ - Log. + Assistant output to be rendered or processed by the client. - :param str log_id: A unique identifier for the logged event. - :param LogRequest request: A message request formatted for the watsonx Assistant - service. - :param LogResponse response: A response from the watsonx Assistant service. - :param str assistant_id: Unique identifier of the assistant. - :param str session_id: The ID of the session the message was part of. - :param str skill_id: The unique identifier of the skill that responded to the - message. - :param str snapshot: The name of the snapshot (dialog skill version) that - responded to the message (for example, `draft`). - :param str request_timestamp: The timestamp for receipt of the message. - :param str response_timestamp: The timestamp for the system response to the - message. - :param str language: The language of the assistant to which the message request - was made. - :param str customer_id: (optional) The customer ID specified for the message, if - any. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any + channel. It is the responsibility of the client application to implement the + supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents recognized in + the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities identified + in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects describing + any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom properties + included in the response. This object includes any arbitrary properties defined + in the dialog JSON editor as part of the dialog node output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. + :param MessageStreamMetadata streaming_metadata: Contains meta-information about + the item(s) being streamed. """ def __init__( self, - log_id: str, - request: 'LogRequest', - response: 'LogResponse', - assistant_id: str, - session_id: str, - skill_id: str, - snapshot: str, - request_timestamp: str, - response_timestamp: str, - language: str, + streaming_metadata: 'MessageStreamMetadata', *, - customer_id: Optional[str] = None, + generic: Optional[List['RuntimeResponseGeneric']] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + actions: Optional[List['DialogNodeAction']] = None, + debug: Optional['MessageOutputDebug'] = None, + user_defined: Optional[dict] = None, + spelling: Optional['MessageOutputSpelling'] = None, + llm_metadata: Optional[List['MessageOutputLLMMetadata']] = None, ) -> None: """ - Initialize a Log object. + Initialize a FinalResponseOutput object. - :param str log_id: A unique identifier for the logged event. - :param LogRequest request: A message request formatted for the watsonx - Assistant service. - :param LogResponse response: A response from the watsonx Assistant service. - :param str assistant_id: Unique identifier of the assistant. - :param str session_id: The ID of the session the message was part of. - :param str skill_id: The unique identifier of the skill that responded to - the message. - :param str snapshot: The name of the snapshot (dialog skill version) that - responded to the message (for example, `draft`). - :param str request_timestamp: The timestamp for receipt of the message. - :param str response_timestamp: The timestamp for the system response to the - message. - :param str language: The language of the assistant to which the message - request was made. - :param str customer_id: (optional) The customer ID specified for the - message, if any. - """ - self.log_id = log_id - self.request = request - self.response = response - self.assistant_id = assistant_id - self.session_id = session_id - self.skill_id = skill_id - self.snapshot = snapshot - self.request_timestamp = request_timestamp - self.response_timestamp = response_timestamp - self.language = language - self.customer_id = customer_id + :param MessageStreamMetadata streaming_metadata: Contains meta-information + about the item(s) being streamed. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for + any channel. It is the responsibility of the client application to + implement the supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents + recognized in the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities + identified in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects + describing any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom + properties included in the response. This object includes any arbitrary + properties defined in the dialog JSON editor as part of the dialog node + output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. + """ + self.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions + self.debug = debug + self.user_defined = user_defined + self.spelling = spelling + self.llm_metadata = llm_metadata + self.streaming_metadata = streaming_metadata @classmethod - def from_dict(cls, _dict: Dict) -> 'Log': - """Initialize a Log object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FinalResponseOutput': + """Initialize a FinalResponseOutput object from a json dictionary.""" args = {} - if (log_id := _dict.get('log_id')) is not None: - args['log_id'] = log_id - else: - raise ValueError( - 'Required property \'log_id\' not present in Log JSON') - if (request := _dict.get('request')) is not None: - args['request'] = LogRequest.from_dict(request) - else: - raise ValueError( - 'Required property \'request\' not present in Log JSON') - if (response := _dict.get('response')) is not None: - args['response'] = LogResponse.from_dict(response) - else: - raise ValueError( - 'Required property \'response\' not present in Log JSON') - if (assistant_id := _dict.get('assistant_id')) is not None: - args['assistant_id'] = assistant_id - else: - raise ValueError( - 'Required property \'assistant_id\' not present in Log JSON') - if (session_id := _dict.get('session_id')) is not None: - args['session_id'] = session_id - else: - raise ValueError( - 'Required property \'session_id\' not present in Log JSON') - if (skill_id := _dict.get('skill_id')) is not None: - args['skill_id'] = skill_id - else: - raise ValueError( - 'Required property \'skill_id\' not present in Log JSON') - if (snapshot := _dict.get('snapshot')) is not None: - args['snapshot'] = snapshot - else: - raise ValueError( - 'Required property \'snapshot\' not present in Log JSON') - if (request_timestamp := _dict.get('request_timestamp')) is not None: - args['request_timestamp'] = request_timestamp - else: - raise ValueError( - 'Required property \'request_timestamp\' not present in Log JSON' - ) - if (response_timestamp := _dict.get('response_timestamp')) is not None: - args['response_timestamp'] = response_timestamp + if (generic := _dict.get('generic')) is not None: + args['generic'] = [ + RuntimeResponseGeneric.from_dict(v) for v in generic + ] + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (actions := _dict.get('actions')) is not None: + args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] + if (debug := _dict.get('debug')) is not None: + args['debug'] = MessageOutputDebug.from_dict(debug) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (llm_metadata := _dict.get('llm_metadata')) is not None: + args['llm_metadata'] = [ + MessageOutputLLMMetadata.from_dict(v) for v in llm_metadata + ] + if (streaming_metadata := _dict.get('streaming_metadata')) is not None: + args['streaming_metadata'] = MessageStreamMetadata.from_dict( + streaming_metadata) else: raise ValueError( - 'Required property \'response_timestamp\' not present in Log JSON' + 'Required property \'streaming_metadata\' not present in FinalResponseOutput JSON' ) - if (language := _dict.get('language')) is not None: - args['language'] = language - else: - raise ValueError( - 'Required property \'language\' not present in Log JSON') - if (customer_id := _dict.get('customer_id')) is not None: - args['customer_id'] = customer_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Log object from a json dictionary.""" + """Initialize a FinalResponseOutput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'log_id') and self.log_id is not None: - _dict['log_id'] = self.log_id - if hasattr(self, 'request') and self.request is not None: - if isinstance(self.request, dict): - _dict['request'] = self.request + if hasattr(self, 'generic') and self.generic is not None: + generic_list = [] + for v in self.generic: + if isinstance(v, dict): + generic_list.append(v) + else: + generic_list.append(v.to_dict()) + _dict['generic'] = generic_list + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'actions') and self.actions is not None: + actions_list = [] + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) + else: + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'debug') and self.debug is not None: + if isinstance(self.debug, dict): + _dict['debug'] = self.debug else: - _dict['request'] = self.request.to_dict() - if hasattr(self, 'response') and self.response is not None: - if isinstance(self.response, dict): - _dict['response'] = self.response + _dict['debug'] = self.debug.to_dict() + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling else: - _dict['response'] = self.response.to_dict() - if hasattr(self, 'assistant_id') and self.assistant_id is not None: - _dict['assistant_id'] = self.assistant_id - if hasattr(self, 'session_id') and self.session_id is not None: - _dict['session_id'] = self.session_id - if hasattr(self, 'skill_id') and self.skill_id is not None: - _dict['skill_id'] = self.skill_id - if hasattr(self, 'snapshot') and self.snapshot is not None: - _dict['snapshot'] = self.snapshot - if hasattr(self, - 'request_timestamp') and self.request_timestamp is not None: - _dict['request_timestamp'] = self.request_timestamp + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'llm_metadata') and self.llm_metadata is not None: + llm_metadata_list = [] + for v in self.llm_metadata: + if isinstance(v, dict): + llm_metadata_list.append(v) + else: + llm_metadata_list.append(v.to_dict()) + _dict['llm_metadata'] = llm_metadata_list if hasattr( self, - 'response_timestamp') and self.response_timestamp is not None: - _dict['response_timestamp'] = self.response_timestamp - if hasattr(self, 'language') and self.language is not None: - _dict['language'] = self.language - if hasattr(self, 'customer_id') and self.customer_id is not None: - _dict['customer_id'] = self.customer_id + 'streaming_metadata') and self.streaming_metadata is not None: + if isinstance(self.streaming_metadata, dict): + _dict['streaming_metadata'] = self.streaming_metadata + else: + _dict['streaming_metadata'] = self.streaming_metadata.to_dict() return _dict def _to_dict(self): @@ -5467,151 +5678,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Log object.""" + """Return a `str` version of this FinalResponseOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Log') -> bool: + def __eq__(self, other: 'FinalResponseOutput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Log') -> bool: + def __ne__(self, other: 'FinalResponseOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogCollection: +class GenerativeAITask: """ - LogCollection. + GenerativeAITask. - :param List[Log] logs: An array of objects describing log events. - :param LogPagination pagination: The pagination data for the returned objects. - For more information about using pagination, see [Pagination](#pagination). """ - def __init__( - self, - logs: List['Log'], - pagination: 'LogPagination', - ) -> None: + def __init__(self,) -> None: """ - Initialize a LogCollection object. + Initialize a GenerativeAITask object. - :param List[Log] logs: An array of objects describing log events. - :param LogPagination pagination: The pagination data for the returned - objects. For more information about using pagination, see - [Pagination](#pagination). """ - self.logs = logs - self.pagination = pagination + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'GenerativeAITaskContentGroundedAnswering', + 'GenerativeAITaskGeneralPurposeAnswering' + ])) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'LogCollection': - """Initialize a LogCollection object from a json dictionary.""" - args = {} - if (logs := _dict.get('logs')) is not None: - args['logs'] = [Log.from_dict(v) for v in logs] - else: - raise ValueError( - 'Required property \'logs\' not present in LogCollection JSON') - if (pagination := _dict.get('pagination')) is not None: - args['pagination'] = LogPagination.from_dict(pagination) - else: - raise ValueError( - 'Required property \'pagination\' not present in LogCollection JSON' - ) - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'GenerativeAITask': + """Initialize a GenerativeAITask object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'GenerativeAITask'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join([ + 'GenerativeAITaskContentGroundedAnswering', + 'GenerativeAITaskGeneralPurposeAnswering' + ])) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a LogCollection object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'logs') and self.logs is not None: - logs_list = [] - for v in self.logs: - if isinstance(v, dict): - logs_list.append(v) - else: - logs_list.append(v.to_dict()) - _dict['logs'] = logs_list - if hasattr(self, 'pagination') and self.pagination is not None: - if isinstance(self.pagination, dict): - _dict['pagination'] = self.pagination - else: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this LogCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LogCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'LogCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class LogMessageSource: - """ - An object that identifies the dialog element that generated the error message. - - """ - - def __init__(self,) -> None: - """ - Initialize a LogMessageSource object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'LogMessageSourceDialogNode', 'LogMessageSourceAction', - 'LogMessageSourceStep', 'LogMessageSourceHandler' - ])) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LogMessageSource': - """Initialize a LogMessageSource object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'LogMessageSource'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join([ - 'LogMessageSourceDialogNode', 'LogMessageSourceAction', - 'LogMessageSourceStep', 'LogMessageSourceHandler' - ])) - raise Exception(msg) - - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a LogMessageSource object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a GenerativeAITask object from a json dictionary.""" return cls.from_dict(_dict) @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} - mapping['dialog_node'] = 'LogMessageSourceDialogNode' - mapping['action'] = 'LogMessageSourceAction' - mapping['step'] = 'LogMessageSourceStep' - mapping['handler'] = 'LogMessageSourceHandler' - disc_value = _dict.get('type') + mapping[ + 'content_grounded_answering'] = 'GenerativeAITaskContentGroundedAnswering' + mapping[ + 'general_purpose_answering'] = 'GenerativeAITaskGeneralPurposeAnswering' + disc_value = _dict.get('task') if disc_value is None: raise ValueError( - 'Discriminator property \'type\' not found in LogMessageSource JSON' + 'Discriminator property \'task\' not found in GenerativeAITask JSON' ) class_name = mapping.get(disc_value, disc_value) try: @@ -5623,63 +5750,87 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: raise TypeError('%s is not a discriminator class' % class_name) -class LogPagination: +class GenerativeAITaskConfidenceScores: """ - The pagination data for the returned objects. For more information about using - pagination, see [Pagination](#pagination). + The confidence scores for determining whether to show the generated response or an “I + don't know” response. - :param str next_url: (optional) The URL that will return the next page of - results, if any. - :param int matched: (optional) Reserved for future use. - :param str next_cursor: (optional) A token identifying the next page of results. + :param float pre_gen: (optional) The confidence score based on user query and + search results. + :param float pre_gen_threshold: (optional) The pre_gen confidence score + threshold. If the pre_gen score is below this threshold, it shows an “I don't + know” response instead of the generated response. Shown in the conversational + search skill UI as the “Retrieval Confidence threshold”. + :param float post_gen: (optional) The confidence score based on user query, + search results, and the generated response. + :param float post_gen_threshold: (optional) The post_gen confidence score + threshold. If the post_gen score is below this threshold, it shows an “I don't + know” response instead of the generated response. Shown in the conversational + search skill UI as the “Response Confidence threshold”. """ def __init__( self, *, - next_url: Optional[str] = None, - matched: Optional[int] = None, - next_cursor: Optional[str] = None, + pre_gen: Optional[float] = None, + pre_gen_threshold: Optional[float] = None, + post_gen: Optional[float] = None, + post_gen_threshold: Optional[float] = None, ) -> None: """ - Initialize a LogPagination object. - - :param str next_url: (optional) The URL that will return the next page of - results, if any. - :param int matched: (optional) Reserved for future use. - :param str next_cursor: (optional) A token identifying the next page of - results. - """ - self.next_url = next_url - self.matched = matched - self.next_cursor = next_cursor - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LogPagination': - """Initialize a LogPagination object from a json dictionary.""" + Initialize a GenerativeAITaskConfidenceScores object. + + :param float pre_gen: (optional) The confidence score based on user query + and search results. + :param float pre_gen_threshold: (optional) The pre_gen confidence score + threshold. If the pre_gen score is below this threshold, it shows an “I + don't know” response instead of the generated response. Shown in the + conversational search skill UI as the “Retrieval Confidence threshold”. + :param float post_gen: (optional) The confidence score based on user query, + search results, and the generated response. + :param float post_gen_threshold: (optional) The post_gen confidence score + threshold. If the post_gen score is below this threshold, it shows an “I + don't know” response instead of the generated response. Shown in the + conversational search skill UI as the “Response Confidence threshold”. + """ + self.pre_gen = pre_gen + self.pre_gen_threshold = pre_gen_threshold + self.post_gen = post_gen + self.post_gen_threshold = post_gen_threshold + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GenerativeAITaskConfidenceScores': + """Initialize a GenerativeAITaskConfidenceScores object from a json dictionary.""" args = {} - if (next_url := _dict.get('next_url')) is not None: - args['next_url'] = next_url - if (matched := _dict.get('matched')) is not None: - args['matched'] = matched - if (next_cursor := _dict.get('next_cursor')) is not None: - args['next_cursor'] = next_cursor + if (pre_gen := _dict.get('pre_gen')) is not None: + args['pre_gen'] = pre_gen + if (pre_gen_threshold := _dict.get('pre_gen_threshold')) is not None: + args['pre_gen_threshold'] = pre_gen_threshold + if (post_gen := _dict.get('post_gen')) is not None: + args['post_gen'] = post_gen + if (post_gen_threshold := _dict.get('post_gen_threshold')) is not None: + args['post_gen_threshold'] = post_gen_threshold return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogPagination object from a json dictionary.""" + """Initialize a GenerativeAITaskConfidenceScores object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'next_url') and self.next_url is not None: - _dict['next_url'] = self.next_url - if hasattr(self, 'matched') and self.matched is not None: - _dict['matched'] = self.matched - if hasattr(self, 'next_cursor') and self.next_cursor is not None: - _dict['next_cursor'] = self.next_cursor + if hasattr(self, 'pre_gen') and self.pre_gen is not None: + _dict['pre_gen'] = self.pre_gen + if hasattr(self, + 'pre_gen_threshold') and self.pre_gen_threshold is not None: + _dict['pre_gen_threshold'] = self.pre_gen_threshold + if hasattr(self, 'post_gen') and self.post_gen is not None: + _dict['post_gen'] = self.post_gen + if hasattr( + self, + 'post_gen_threshold') and self.post_gen_threshold is not None: + _dict['post_gen_threshold'] = self.post_gen_threshold return _dict def _to_dict(self): @@ -5687,109 +5838,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogPagination object.""" + """Return a `str` version of this GenerativeAITaskConfidenceScores object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogPagination') -> bool: + def __eq__(self, other: 'GenerativeAITaskConfidenceScores') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogPagination') -> bool: + def __ne__(self, other: 'GenerativeAITaskConfidenceScores') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogRequest: +class IntegrationReference: """ - A message request formatted for the watsonx Assistant service. + IntegrationReference. - :param LogRequestInput input: (optional) An input object that includes the input - text. All private data is masked or removed. - :param MessageContext context: (optional) Context data for the conversation. You - can use this property to set or modify context variables, which can also be - accessed by dialog nodes. The context is stored by the assistant on a - per-session basis. - **Note:** The total size of the context data stored for a stateful session - cannot exceed 100KB. - :param str user_id: (optional) A string value that identifies the user who is - interacting with the assistant. The client must provide a unique identifier for - each individual end user who accesses the application. For user-based plans, - this user ID is used to identify unique users for billing purposes. This string - cannot contain carriage return, newline, or tab characters. If no value is - specified in the input, **user_id** is automatically set to the value of - **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the global - system context. If **user_id** is specified in both locations, the value - specified at the root is used. + :param str integration_id: (optional) The integration ID of the integration. + :param str type: (optional) The type of the integration. """ def __init__( self, *, - input: Optional['LogRequestInput'] = None, - context: Optional['MessageContext'] = None, - user_id: Optional[str] = None, + integration_id: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a LogRequest object. + Initialize a IntegrationReference object. - :param LogRequestInput input: (optional) An input object that includes the - input text. All private data is masked or removed. - :param MessageContext context: (optional) Context data for the - conversation. You can use this property to set or modify context variables, - which can also be accessed by dialog nodes. The context is stored by the - assistant on a per-session basis. - **Note:** The total size of the context data stored for a stateful session - cannot exceed 100KB. - :param str user_id: (optional) A string value that identifies the user who - is interacting with the assistant. The client must provide a unique - identifier for each individual end user who accesses the application. For - user-based plans, this user ID is used to identify unique users for billing - purposes. This string cannot contain carriage return, newline, or tab - characters. If no value is specified in the input, **user_id** is - automatically set to the value of **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the - global system context. If **user_id** is specified in both locations, the - value specified at the root is used. + :param str integration_id: (optional) The integration ID of the + integration. + :param str type: (optional) The type of the integration. """ - self.input = input - self.context = context - self.user_id = user_id + self.integration_id = integration_id + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LogRequest': - """Initialize a LogRequest object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IntegrationReference': + """Initialize a IntegrationReference object from a json dictionary.""" args = {} - if (input := _dict.get('input')) is not None: - args['input'] = LogRequestInput.from_dict(input) - if (context := _dict.get('context')) is not None: - args['context'] = MessageContext.from_dict(context) - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id + if (integration_id := _dict.get('integration_id')) is not None: + args['integration_id'] = integration_id + if (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogRequest object from a json dictionary.""" + """Initialize a IntegrationReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'input') and self.input is not None: - if isinstance(self.input, dict): - _dict['input'] = self.input - else: - _dict['input'] = self.input.to_dict() - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'user_id') and self.user_id is not None: - _dict['user_id'] = self.user_id + if hasattr(self, 'integration_id') and self.integration_id is not None: + _dict['integration_id'] = self.integration_id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -5797,175 +5905,190 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogRequest object.""" + """Return a `str` version of this IntegrationReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogRequest') -> bool: + def __eq__(self, other: 'IntegrationReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogRequest') -> bool: + def __ne__(self, other: 'IntegrationReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogRequestInput: +class Log: """ - An input object that includes the input text. All private data is masked or removed. + Log. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating - the user input. Include intents from the previous response to continue using - those intents rather than trying to recognize intents in the new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating - the message. Include entities from the previous response to continue using those - entities rather than detecting entities in the new input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the Segment - extension. - :param MessageInputOptions options: (optional) Optional properties that control - how the assistant responds. + :param str log_id: A unique identifier for the logged event. + :param LogRequest request: A message request formatted for the watsonx Assistant + service. + :param LogResponse response: A response from the watsonx Assistant service. + :param str assistant_id: Unique identifier of the assistant. + :param str session_id: The ID of the session the message was part of. + :param str skill_id: The unique identifier of the skill that responded to the + message. + :param str snapshot: The name of the snapshot (dialog skill version) that + responded to the message (for example, `draft`). + :param str request_timestamp: The timestamp for receipt of the message. + :param str response_timestamp: The timestamp for the system response to the + message. + :param str language: The language of the assistant to which the message request + was made. + :param str customer_id: (optional) The customer ID specified for the message, if + any. """ def __init__( self, + log_id: str, + request: 'LogRequest', + response: 'LogResponse', + assistant_id: str, + session_id: str, + skill_id: str, + snapshot: str, + request_timestamp: str, + response_timestamp: str, + language: str, *, - message_type: Optional[str] = None, - text: Optional[str] = None, - intents: Optional[List['RuntimeIntent']] = None, - entities: Optional[List['RuntimeEntity']] = None, - suggestion_id: Optional[str] = None, - attachments: Optional[List['MessageInputAttachment']] = None, - analytics: Optional['RequestAnalytics'] = None, - options: Optional['MessageInputOptions'] = None, + customer_id: Optional[str] = None, ) -> None: """ - Initialize a LogRequestInput object. + Initialize a Log object. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill - is bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when - evaluating the user input. Include intents from the previous response to - continue using those intents rather than trying to recognize intents in the - new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when - evaluating the message. Include entities from the previous response to - continue using those entities rather than detecting entities in the new - input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the - Segment extension. - :param MessageInputOptions options: (optional) Optional properties that - control how the assistant responds. + :param str log_id: A unique identifier for the logged event. + :param LogRequest request: A message request formatted for the watsonx + Assistant service. + :param LogResponse response: A response from the watsonx Assistant service. + :param str assistant_id: Unique identifier of the assistant. + :param str session_id: The ID of the session the message was part of. + :param str skill_id: The unique identifier of the skill that responded to + the message. + :param str snapshot: The name of the snapshot (dialog skill version) that + responded to the message (for example, `draft`). + :param str request_timestamp: The timestamp for receipt of the message. + :param str response_timestamp: The timestamp for the system response to the + message. + :param str language: The language of the assistant to which the message + request was made. + :param str customer_id: (optional) The customer ID specified for the + message, if any. """ - self.message_type = message_type - self.text = text - self.intents = intents - self.entities = entities - self.suggestion_id = suggestion_id - self.attachments = attachments - self.analytics = analytics - self.options = options + self.log_id = log_id + self.request = request + self.response = response + self.assistant_id = assistant_id + self.session_id = session_id + self.skill_id = skill_id + self.snapshot = snapshot + self.request_timestamp = request_timestamp + self.response_timestamp = response_timestamp + self.language = language + self.customer_id = customer_id @classmethod - def from_dict(cls, _dict: Dict) -> 'LogRequestInput': - """Initialize a LogRequestInput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Log': + """Initialize a Log object from a json dictionary.""" args = {} - if (message_type := _dict.get('message_type')) is not None: - args['message_type'] = message_type - if (text := _dict.get('text')) is not None: - args['text'] = text - if (intents := _dict.get('intents')) is not None: - args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] - if (entities := _dict.get('entities')) is not None: - args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] - if (suggestion_id := _dict.get('suggestion_id')) is not None: - args['suggestion_id'] = suggestion_id - if (attachments := _dict.get('attachments')) is not None: - args['attachments'] = [ - MessageInputAttachment.from_dict(v) for v in attachments - ] - if (analytics := _dict.get('analytics')) is not None: - args['analytics'] = RequestAnalytics.from_dict(analytics) - if (options := _dict.get('options')) is not None: - args['options'] = MessageInputOptions.from_dict(options) + if (log_id := _dict.get('log_id')) is not None: + args['log_id'] = log_id + else: + raise ValueError( + 'Required property \'log_id\' not present in Log JSON') + if (request := _dict.get('request')) is not None: + args['request'] = LogRequest.from_dict(request) + else: + raise ValueError( + 'Required property \'request\' not present in Log JSON') + if (response := _dict.get('response')) is not None: + args['response'] = LogResponse.from_dict(response) + else: + raise ValueError( + 'Required property \'response\' not present in Log JSON') + if (assistant_id := _dict.get('assistant_id')) is not None: + args['assistant_id'] = assistant_id + else: + raise ValueError( + 'Required property \'assistant_id\' not present in Log JSON') + if (session_id := _dict.get('session_id')) is not None: + args['session_id'] = session_id + else: + raise ValueError( + 'Required property \'session_id\' not present in Log JSON') + if (skill_id := _dict.get('skill_id')) is not None: + args['skill_id'] = skill_id + else: + raise ValueError( + 'Required property \'skill_id\' not present in Log JSON') + if (snapshot := _dict.get('snapshot')) is not None: + args['snapshot'] = snapshot + else: + raise ValueError( + 'Required property \'snapshot\' not present in Log JSON') + if (request_timestamp := _dict.get('request_timestamp')) is not None: + args['request_timestamp'] = request_timestamp + else: + raise ValueError( + 'Required property \'request_timestamp\' not present in Log JSON' + ) + if (response_timestamp := _dict.get('response_timestamp')) is not None: + args['response_timestamp'] = response_timestamp + else: + raise ValueError( + 'Required property \'response_timestamp\' not present in Log JSON' + ) + if (language := _dict.get('language')) is not None: + args['language'] = language + else: + raise ValueError( + 'Required property \'language\' not present in Log JSON') + if (customer_id := _dict.get('customer_id')) is not None: + args['customer_id'] = customer_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogRequestInput object from a json dictionary.""" + """Initialize a Log object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message_type') and self.message_type is not None: - _dict['message_type'] = self.message_type - if hasattr(self, 'text') and self.text is not None: - _dict['text'] = self.text - if hasattr(self, 'intents') and self.intents is not None: - intents_list = [] - for v in self.intents: - if isinstance(v, dict): - intents_list.append(v) - else: - intents_list.append(v.to_dict()) - _dict['intents'] = intents_list - if hasattr(self, 'entities') and self.entities is not None: - entities_list = [] - for v in self.entities: - if isinstance(v, dict): - entities_list.append(v) - else: - entities_list.append(v.to_dict()) - _dict['entities'] = entities_list - if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: - _dict['suggestion_id'] = self.suggestion_id - if hasattr(self, 'attachments') and self.attachments is not None: - attachments_list = [] - for v in self.attachments: - if isinstance(v, dict): - attachments_list.append(v) - else: - attachments_list.append(v.to_dict()) - _dict['attachments'] = attachments_list - if hasattr(self, 'analytics') and self.analytics is not None: - if isinstance(self.analytics, dict): - _dict['analytics'] = self.analytics + if hasattr(self, 'log_id') and self.log_id is not None: + _dict['log_id'] = self.log_id + if hasattr(self, 'request') and self.request is not None: + if isinstance(self.request, dict): + _dict['request'] = self.request else: - _dict['analytics'] = self.analytics.to_dict() - if hasattr(self, 'options') and self.options is not None: - if isinstance(self.options, dict): - _dict['options'] = self.options + _dict['request'] = self.request.to_dict() + if hasattr(self, 'response') and self.response is not None: + if isinstance(self.response, dict): + _dict['response'] = self.response else: - _dict['options'] = self.options.to_dict() + _dict['response'] = self.response.to_dict() + if hasattr(self, 'assistant_id') and self.assistant_id is not None: + _dict['assistant_id'] = self.assistant_id + if hasattr(self, 'session_id') and self.session_id is not None: + _dict['session_id'] = self.session_id + if hasattr(self, 'skill_id') and self.skill_id is not None: + _dict['skill_id'] = self.skill_id + if hasattr(self, 'snapshot') and self.snapshot is not None: + _dict['snapshot'] = self.snapshot + if hasattr(self, + 'request_timestamp') and self.request_timestamp is not None: + _dict['request_timestamp'] = self.request_timestamp + if hasattr( + self, + 'response_timestamp') and self.response_timestamp is not None: + _dict['response_timestamp'] = self.response_timestamp + if hasattr(self, 'language') and self.language is not None: + _dict['language'] = self.language + if hasattr(self, 'customer_id') and self.customer_id is not None: + _dict['customer_id'] = self.customer_id return _dict def _to_dict(self): @@ -5973,126 +6096,83 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogRequestInput object.""" + """Return a `str` version of this Log object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogRequestInput') -> bool: + def __eq__(self, other: 'Log') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogRequestInput') -> bool: + def __ne__(self, other: 'Log') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MessageTypeEnum(str, Enum): - """ - The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is configured - for the assistant. - """ - - TEXT = 'text' - SEARCH = 'search' +class LogCollection: + """ + LogCollection. -class LogResponse: - """ - A response from the watsonx Assistant service. - - :param LogResponseOutput output: Assistant output to be rendered or processed by - the client. All private data is masked or removed. - :param MessageContext context: (optional) Context data for the conversation. You - can use this property to access context variables. The context is stored by the - assistant on a per-session basis. - **Note:** The context is included in message responses only if - **return_context**=`true` in the message request. Full context is always - included in logs. - :param str user_id: A string value that identifies the user who is interacting - with the assistant. The client must provide a unique identifier for each - individual end user who accesses the application. For user-based plans, this - user ID is used to identify unique users for billing purposes. This string - cannot contain carriage return, newline, or tab characters. If no value is - specified in the input, **user_id** is automatically set to the value of - **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the global - system context. + :param List[Log] logs: An array of objects describing log events. + :param LogPagination pagination: The pagination data for the returned objects. + For more information about using pagination, see [Pagination](#pagination). """ def __init__( self, - output: 'LogResponseOutput', - user_id: str, - *, - context: Optional['MessageContext'] = None, + logs: List['Log'], + pagination: 'LogPagination', ) -> None: """ - Initialize a LogResponse object. + Initialize a LogCollection object. - :param LogResponseOutput output: Assistant output to be rendered or - processed by the client. All private data is masked or removed. - :param str user_id: A string value that identifies the user who is - interacting with the assistant. The client must provide a unique identifier - for each individual end user who accesses the application. For user-based - plans, this user ID is used to identify unique users for billing purposes. - This string cannot contain carriage return, newline, or tab characters. If - no value is specified in the input, **user_id** is automatically set to the - value of **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the - global system context. - :param MessageContext context: (optional) Context data for the - conversation. You can use this property to access context variables. The - context is stored by the assistant on a per-session basis. - **Note:** The context is included in message responses only if - **return_context**=`true` in the message request. Full context is always - included in logs. + :param List[Log] logs: An array of objects describing log events. + :param LogPagination pagination: The pagination data for the returned + objects. For more information about using pagination, see + [Pagination](#pagination). """ - self.output = output - self.context = context - self.user_id = user_id + self.logs = logs + self.pagination = pagination @classmethod - def from_dict(cls, _dict: Dict) -> 'LogResponse': - """Initialize a LogResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogCollection': + """Initialize a LogCollection object from a json dictionary.""" args = {} - if (output := _dict.get('output')) is not None: - args['output'] = LogResponseOutput.from_dict(output) + if (logs := _dict.get('logs')) is not None: + args['logs'] = [Log.from_dict(v) for v in logs] else: raise ValueError( - 'Required property \'output\' not present in LogResponse JSON') - if (context := _dict.get('context')) is not None: - args['context'] = MessageContext.from_dict(context) - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id + 'Required property \'logs\' not present in LogCollection JSON') + if (pagination := _dict.get('pagination')) is not None: + args['pagination'] = LogPagination.from_dict(pagination) else: raise ValueError( - 'Required property \'user_id\' not present in LogResponse JSON') + 'Required property \'pagination\' not present in LogCollection JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogResponse object from a json dictionary.""" + """Initialize a LogCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'output') and self.output is not None: - if isinstance(self.output, dict): - _dict['output'] = self.output - else: - _dict['output'] = self.output.to_dict() - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context + if hasattr(self, 'logs') and self.logs is not None: + logs_list = [] + for v in self.logs: + if isinstance(v, dict): + logs_list.append(v) + else: + logs_list.append(v.to_dict()) + _dict['logs'] = logs_list + if hasattr(self, 'pagination') and self.pagination is not None: + if isinstance(self.pagination, dict): + _dict['pagination'] = self.pagination else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'user_id') and self.user_id is not None: - _dict['user_id'] = self.user_id + _dict['pagination'] = self.pagination.to_dict() return _dict def _to_dict(self): @@ -6100,157 +6180,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogResponse object.""" + """Return a `str` version of this LogCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogResponse') -> bool: + def __eq__(self, other: 'LogCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogResponse') -> bool: + def __ne__(self, other: 'LogCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogResponseOutput: +class LogMessageSource: """ - Assistant output to be rendered or processed by the client. All private data is masked - or removed. + An object that identifies the dialog element that generated the error message. - :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any - channel. It is the responsibility of the client application to implement the - supported response types. - :param List[RuntimeIntent] intents: (optional) An array of intents recognized in - the user input, sorted in descending order of confidence. - :param List[RuntimeEntity] entities: (optional) An array of entities identified - in the user input. - :param List[DialogNodeAction] actions: (optional) An array of objects describing - any actions requested by the dialog node. - :param MessageOutputDebug debug: (optional) Additional detailed information - about a message response and how it was generated. - :param dict user_defined: (optional) An object containing any custom properties - included in the response. This object includes any arbitrary properties defined - in the dialog JSON editor as part of the dialog node output. - :param MessageOutputSpelling spelling: (optional) Properties describing any - spelling corrections in the user input that was received. + """ + + def __init__(self,) -> None: + """ + Initialize a LogMessageSource object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'LogMessageSourceDialogNode', 'LogMessageSourceAction', + 'LogMessageSourceStep', 'LogMessageSourceHandler' + ])) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LogMessageSource': + """Initialize a LogMessageSource object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'LogMessageSource'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join([ + 'LogMessageSourceDialogNode', 'LogMessageSourceAction', + 'LogMessageSourceStep', 'LogMessageSourceHandler' + ])) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a LogMessageSource object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['dialog_node'] = 'LogMessageSourceDialogNode' + mapping['action'] = 'LogMessageSourceAction' + mapping['step'] = 'LogMessageSourceStep' + mapping['handler'] = 'LogMessageSourceHandler' + disc_value = _dict.get('type') + if disc_value is None: + raise ValueError( + 'Discriminator property \'type\' not found in LogMessageSource JSON' + ) + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + +class LogPagination: + """ + The pagination data for the returned objects. For more information about using + pagination, see [Pagination](#pagination). + + :param str next_url: (optional) The URL that will return the next page of + results, if any. + :param int matched: (optional) Reserved for future use. + :param str next_cursor: (optional) A token identifying the next page of results. """ def __init__( self, *, - generic: Optional[List['RuntimeResponseGeneric']] = None, - intents: Optional[List['RuntimeIntent']] = None, - entities: Optional[List['RuntimeEntity']] = None, - actions: Optional[List['DialogNodeAction']] = None, - debug: Optional['MessageOutputDebug'] = None, - user_defined: Optional[dict] = None, - spelling: Optional['MessageOutputSpelling'] = None, + next_url: Optional[str] = None, + matched: Optional[int] = None, + next_cursor: Optional[str] = None, ) -> None: """ - Initialize a LogResponseOutput object. + Initialize a LogPagination object. - :param List[RuntimeResponseGeneric] generic: (optional) Output intended for - any channel. It is the responsibility of the client application to - implement the supported response types. - :param List[RuntimeIntent] intents: (optional) An array of intents - recognized in the user input, sorted in descending order of confidence. - :param List[RuntimeEntity] entities: (optional) An array of entities - identified in the user input. - :param List[DialogNodeAction] actions: (optional) An array of objects - describing any actions requested by the dialog node. - :param MessageOutputDebug debug: (optional) Additional detailed information - about a message response and how it was generated. - :param dict user_defined: (optional) An object containing any custom - properties included in the response. This object includes any arbitrary - properties defined in the dialog JSON editor as part of the dialog node - output. - :param MessageOutputSpelling spelling: (optional) Properties describing any - spelling corrections in the user input that was received. + :param str next_url: (optional) The URL that will return the next page of + results, if any. + :param int matched: (optional) Reserved for future use. + :param str next_cursor: (optional) A token identifying the next page of + results. """ - self.generic = generic - self.intents = intents - self.entities = entities - self.actions = actions - self.debug = debug - self.user_defined = user_defined - self.spelling = spelling + self.next_url = next_url + self.matched = matched + self.next_cursor = next_cursor @classmethod - def from_dict(cls, _dict: Dict) -> 'LogResponseOutput': - """Initialize a LogResponseOutput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogPagination': + """Initialize a LogPagination object from a json dictionary.""" args = {} - if (generic := _dict.get('generic')) is not None: - args['generic'] = [ - RuntimeResponseGeneric.from_dict(v) for v in generic - ] - if (intents := _dict.get('intents')) is not None: - args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] - if (entities := _dict.get('entities')) is not None: - args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] - if (actions := _dict.get('actions')) is not None: - args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] - if (debug := _dict.get('debug')) is not None: - args['debug'] = MessageOutputDebug.from_dict(debug) - if (user_defined := _dict.get('user_defined')) is not None: - args['user_defined'] = user_defined - if (spelling := _dict.get('spelling')) is not None: - args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (next_url := _dict.get('next_url')) is not None: + args['next_url'] = next_url + if (matched := _dict.get('matched')) is not None: + args['matched'] = matched + if (next_cursor := _dict.get('next_cursor')) is not None: + args['next_cursor'] = next_cursor return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogResponseOutput object from a json dictionary.""" + """Initialize a LogPagination object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'generic') and self.generic is not None: - generic_list = [] - for v in self.generic: - if isinstance(v, dict): - generic_list.append(v) - else: - generic_list.append(v.to_dict()) - _dict['generic'] = generic_list - if hasattr(self, 'intents') and self.intents is not None: - intents_list = [] - for v in self.intents: - if isinstance(v, dict): - intents_list.append(v) - else: - intents_list.append(v.to_dict()) - _dict['intents'] = intents_list - if hasattr(self, 'entities') and self.entities is not None: - entities_list = [] - for v in self.entities: - if isinstance(v, dict): - entities_list.append(v) - else: - entities_list.append(v.to_dict()) - _dict['entities'] = entities_list - if hasattr(self, 'actions') and self.actions is not None: - actions_list = [] - for v in self.actions: - if isinstance(v, dict): - actions_list.append(v) - else: - actions_list.append(v.to_dict()) - _dict['actions'] = actions_list - if hasattr(self, 'debug') and self.debug is not None: - if isinstance(self.debug, dict): - _dict['debug'] = self.debug - else: - _dict['debug'] = self.debug.to_dict() - if hasattr(self, 'user_defined') and self.user_defined is not None: - _dict['user_defined'] = self.user_defined - if hasattr(self, 'spelling') and self.spelling is not None: - if isinstance(self.spelling, dict): - _dict['spelling'] = self.spelling - else: - _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'next_url') and self.next_url is not None: + _dict['next_url'] = self.next_url + if hasattr(self, 'matched') and self.matched is not None: + _dict['matched'] = self.matched + if hasattr(self, 'next_cursor') and self.next_cursor is not None: + _dict['next_cursor'] = self.next_cursor return _dict def _to_dict(self): @@ -6258,87 +6316,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogResponseOutput object.""" + """Return a `str` version of this LogPagination object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogResponseOutput') -> bool: + def __eq__(self, other: 'LogPagination') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogResponseOutput') -> bool: + def __ne__(self, other: 'LogPagination') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContext: +class LogRequest: """ - MessageContext. + A message request formatted for the watsonx Assistant service. - :param MessageContextGlobal global_: (optional) Session context data that is - shared by all skills used by the assistant. - :param MessageContextSkills skills: (optional) Context data specific to - particular skills used by the assistant. - :param dict integrations: (optional) An object containing context data that is - specific to particular integrations. For more information, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). + :param LogRequestInput input: (optional) An input object that includes the input + text. All private data is masked or removed. + :param MessageContext context: (optional) Context data for the conversation. You + can use this property to set or modify context variables, which can also be + accessed by dialog nodes. The context is stored by the assistant on a + per-session basis. + **Note:** The total size of the context data stored for a stateful session + cannot exceed 100KB. + :param str user_id: (optional) A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier for + each individual end user who accesses the application. For user-based plans, + this user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. If **user_id** is specified in both locations, the value + specified at the root is used. """ def __init__( self, *, - global_: Optional['MessageContextGlobal'] = None, - skills: Optional['MessageContextSkills'] = None, - integrations: Optional[dict] = None, + input: Optional['LogRequestInput'] = None, + context: Optional['MessageContext'] = None, + user_id: Optional[str] = None, ) -> None: """ - Initialize a MessageContext object. + Initialize a LogRequest object. - :param MessageContextGlobal global_: (optional) Session context data that - is shared by all skills used by the assistant. - :param MessageContextSkills skills: (optional) Context data specific to - particular skills used by the assistant. - :param dict integrations: (optional) An object containing context data that - is specific to particular integrations. For more information, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). + :param LogRequestInput input: (optional) An input object that includes the + input text. All private data is masked or removed. + :param MessageContext context: (optional) Context data for the + conversation. You can use this property to set or modify context variables, + which can also be accessed by dialog nodes. The context is stored by the + assistant on a per-session basis. + **Note:** The total size of the context data stored for a stateful session + cannot exceed 100KB. + :param str user_id: (optional) A string value that identifies the user who + is interacting with the assistant. The client must provide a unique + identifier for each individual end user who accesses the application. For + user-based plans, this user ID is used to identify unique users for billing + purposes. This string cannot contain carriage return, newline, or tab + characters. If no value is specified in the input, **user_id** is + automatically set to the value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. If **user_id** is specified in both locations, the + value specified at the root is used. """ - self.global_ = global_ - self.skills = skills - self.integrations = integrations + self.input = input + self.context = context + self.user_id = user_id @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContext': - """Initialize a MessageContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogRequest': + """Initialize a LogRequest object from a json dictionary.""" args = {} - if (global_ := _dict.get('global')) is not None: - args['global_'] = MessageContextGlobal.from_dict(global_) - if (skills := _dict.get('skills')) is not None: - args['skills'] = MessageContextSkills.from_dict(skills) - if (integrations := _dict.get('integrations')) is not None: - args['integrations'] = integrations + if (input := _dict.get('input')) is not None: + args['input'] = LogRequestInput.from_dict(input) + if (context := _dict.get('context')) is not None: + args['context'] = MessageContext.from_dict(context) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContext object from a json dictionary.""" + """Initialize a LogRequest object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'global_') and self.global_ is not None: - if isinstance(self.global_, dict): - _dict['global'] = self.global_ + if hasattr(self, 'input') and self.input is not None: + if isinstance(self.input, dict): + _dict['input'] = self.input else: - _dict['global'] = self.global_.to_dict() - if hasattr(self, 'skills') and self.skills is not None: - if isinstance(self.skills, dict): - _dict['skills'] = self.skills + _dict['input'] = self.input.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context else: - _dict['skills'] = self.skills.to_dict() - if hasattr(self, 'integrations') and self.integrations is not None: - _dict['integrations'] = self.integrations + _dict['context'] = self.context.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id return _dict def _to_dict(self): @@ -6346,101 +6426,175 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContext object.""" + """Return a `str` version of this LogRequest object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContext') -> bool: + def __eq__(self, other: 'LogRequest') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContext') -> bool: + def __ne__(self, other: 'LogRequest') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextActionSkill: +class LogRequestInput: """ - Context variables that are used by the action skill. Private variables are persisted, - but not shown. + An input object that includes the input text. All private data is masked or removed. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data used by - the skill. - :param dict action_variables: (optional) An object containing action variables. - Action variables can be accessed only by steps in the same action, and do not - persist after the action ends. - :param dict skill_variables: (optional) An object containing skill variables. - (In the watsonx Assistant user interface, skill variables are called _session - variables_.) Skill variables can be accessed by any action and persist for the - duration of the session. + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating + the user input. Include intents from the previous response to continue using + those intents rather than trying to recognize intents in the new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating + the message. Include entities from the previous response to continue using those + entities rather than detecting entities in the new input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the Segment + extension. + :param MessageInputOptions options: (optional) Optional properties that control + how the assistant responds. """ def __init__( self, *, - user_defined: Optional[dict] = None, - system: Optional['MessageContextSkillSystem'] = None, - action_variables: Optional[dict] = None, - skill_variables: Optional[dict] = None, + message_type: Optional[str] = None, + text: Optional[str] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + suggestion_id: Optional[str] = None, + attachments: Optional[List['MessageInputAttachment']] = None, + analytics: Optional['RequestAnalytics'] = None, + options: Optional['MessageInputOptions'] = None, ) -> None: """ - Initialize a MessageContextActionSkill object. + Initialize a LogRequestInput object. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data - used by the skill. - :param dict action_variables: (optional) An object containing action - variables. Action variables can be accessed only by steps in the same - action, and do not persist after the action ends. - :param dict skill_variables: (optional) An object containing skill - variables. (In the watsonx Assistant user interface, skill variables are - called _session variables_.) Skill variables can be accessed by any action - and persist for the duration of the session. + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill + is bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when + evaluating the user input. Include intents from the previous response to + continue using those intents rather than trying to recognize intents in the + new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when + evaluating the message. Include entities from the previous response to + continue using those entities rather than detecting entities in the new + input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the + Segment extension. + :param MessageInputOptions options: (optional) Optional properties that + control how the assistant responds. """ - self.user_defined = user_defined - self.system = system - self.action_variables = action_variables - self.skill_variables = skill_variables - - @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextActionSkill': - """Initialize a MessageContextActionSkill object from a json dictionary.""" + self.message_type = message_type + self.text = text + self.intents = intents + self.entities = entities + self.suggestion_id = suggestion_id + self.attachments = attachments + self.analytics = analytics + self.options = options + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LogRequestInput': + """Initialize a LogRequestInput object from a json dictionary.""" args = {} - if (user_defined := _dict.get('user_defined')) is not None: - args['user_defined'] = user_defined - if (system := _dict.get('system')) is not None: - args['system'] = MessageContextSkillSystem.from_dict(system) - if (action_variables := _dict.get('action_variables')) is not None: - args['action_variables'] = action_variables - if (skill_variables := _dict.get('skill_variables')) is not None: - args['skill_variables'] = skill_variables + if (message_type := _dict.get('message_type')) is not None: + args['message_type'] = message_type + if (text := _dict.get('text')) is not None: + args['text'] = text + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (suggestion_id := _dict.get('suggestion_id')) is not None: + args['suggestion_id'] = suggestion_id + if (attachments := _dict.get('attachments')) is not None: + args['attachments'] = [ + MessageInputAttachment.from_dict(v) for v in attachments + ] + if (analytics := _dict.get('analytics')) is not None: + args['analytics'] = RequestAnalytics.from_dict(analytics) + if (options := _dict.get('options')) is not None: + args['options'] = MessageInputOptions.from_dict(options) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextActionSkill object from a json dictionary.""" + """Initialize a LogRequestInput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'user_defined') and self.user_defined is not None: - _dict['user_defined'] = self.user_defined - if hasattr(self, 'system') and self.system is not None: - if isinstance(self.system, dict): - _dict['system'] = self.system + if hasattr(self, 'message_type') and self.message_type is not None: + _dict['message_type'] = self.message_type + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: + _dict['suggestion_id'] = self.suggestion_id + if hasattr(self, 'attachments') and self.attachments is not None: + attachments_list = [] + for v in self.attachments: + if isinstance(v, dict): + attachments_list.append(v) + else: + attachments_list.append(v.to_dict()) + _dict['attachments'] = attachments_list + if hasattr(self, 'analytics') and self.analytics is not None: + if isinstance(self.analytics, dict): + _dict['analytics'] = self.analytics else: - _dict['system'] = self.system.to_dict() - if hasattr(self, - 'action_variables') and self.action_variables is not None: - _dict['action_variables'] = self.action_variables - if hasattr(self, - 'skill_variables') and self.skill_variables is not None: - _dict['skill_variables'] = self.skill_variables + _dict['analytics'] = self.analytics.to_dict() + if hasattr(self, 'options') and self.options is not None: + if isinstance(self.options, dict): + _dict['options'] = self.options + else: + _dict['options'] = self.options.to_dict() return _dict def _to_dict(self): @@ -6448,72 +6602,126 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextActionSkill object.""" + """Return a `str` version of this LogRequestInput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextActionSkill') -> bool: + def __eq__(self, other: 'LogRequestInput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextActionSkill') -> bool: + def __ne__(self, other: 'LogRequestInput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class MessageTypeEnum(str, Enum): + """ + The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is configured + for the assistant. + """ + + TEXT = 'text' + SEARCH = 'search' -class MessageContextDialogSkill: + +class LogResponse: """ - Context variables that are used by the dialog skill. + A response from the watsonx Assistant service. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data used by - the skill. + :param LogResponseOutput output: Assistant output to be rendered or processed by + the client. All private data is masked or removed. + :param MessageContext context: (optional) Context data for the conversation. You + can use this property to access context variables. The context is stored by the + assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: A string value that identifies the user who is interacting + with the assistant. The client must provide a unique identifier for each + individual end user who accesses the application. For user-based plans, this + user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. """ def __init__( self, + output: 'LogResponseOutput', + user_id: str, *, - user_defined: Optional[dict] = None, - system: Optional['MessageContextSkillSystem'] = None, + context: Optional['MessageContext'] = None, ) -> None: """ - Initialize a MessageContextDialogSkill object. + Initialize a LogResponse object. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data - used by the skill. + :param LogResponseOutput output: Assistant output to be rendered or + processed by the client. All private data is masked or removed. + :param str user_id: A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier + for each individual end user who accesses the application. For user-based + plans, this user ID is used to identify unique users for billing purposes. + This string cannot contain carriage return, newline, or tab characters. If + no value is specified in the input, **user_id** is automatically set to the + value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. + :param MessageContext context: (optional) Context data for the + conversation. You can use this property to access context variables. The + context is stored by the assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. """ - self.user_defined = user_defined - self.system = system + self.output = output + self.context = context + self.user_id = user_id @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextDialogSkill': - """Initialize a MessageContextDialogSkill object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogResponse': + """Initialize a LogResponse object from a json dictionary.""" args = {} - if (user_defined := _dict.get('user_defined')) is not None: - args['user_defined'] = user_defined - if (system := _dict.get('system')) is not None: - args['system'] = MessageContextSkillSystem.from_dict(system) + if (output := _dict.get('output')) is not None: + args['output'] = LogResponseOutput.from_dict(output) + else: + raise ValueError( + 'Required property \'output\' not present in LogResponse JSON') + if (context := _dict.get('context')) is not None: + args['context'] = MessageContext.from_dict(context) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id + else: + raise ValueError( + 'Required property \'user_id\' not present in LogResponse JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextDialogSkill object from a json dictionary.""" + """Initialize a LogResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'user_defined') and self.user_defined is not None: - _dict['user_defined'] = self.user_defined - if hasattr(self, 'system') and self.system is not None: - if isinstance(self.system, dict): - _dict['system'] = self.system + if hasattr(self, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output else: - _dict['system'] = self.system.to_dict() + _dict['output'] = self.output.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id return _dict def _to_dict(self): @@ -6521,70 +6729,177 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextDialogSkill object.""" + """Return a `str` version of this LogResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextDialogSkill') -> bool: + def __eq__(self, other: 'LogResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextDialogSkill') -> bool: + def __ne__(self, other: 'LogResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextGlobal: +class LogResponseOutput: """ - Session context data that is shared by all skills used by the assistant. + Assistant output to be rendered or processed by the client. All private data is masked + or removed. - :param MessageContextGlobalSystem system: (optional) Built-in system properties - that apply to all skills used by the assistant. - :param str session_id: (optional) The session ID. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any + channel. It is the responsibility of the client application to implement the + supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents recognized in + the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities identified + in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects describing + any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom properties + included in the response. This object includes any arbitrary properties defined + in the dialog JSON editor as part of the dialog node output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. """ def __init__( self, *, - system: Optional['MessageContextGlobalSystem'] = None, - session_id: Optional[str] = None, + generic: Optional[List['RuntimeResponseGeneric']] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + actions: Optional[List['DialogNodeAction']] = None, + debug: Optional['MessageOutputDebug'] = None, + user_defined: Optional[dict] = None, + spelling: Optional['MessageOutputSpelling'] = None, + llm_metadata: Optional[List['MessageOutputLLMMetadata']] = None, ) -> None: """ - Initialize a MessageContextGlobal object. - - :param MessageContextGlobalSystem system: (optional) Built-in system - properties that apply to all skills used by the assistant. - """ - self.system = system - self.session_id = session_id + Initialize a LogResponseOutput object. + + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for + any channel. It is the responsibility of the client application to + implement the supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents + recognized in the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities + identified in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects + describing any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom + properties included in the response. This object includes any arbitrary + properties defined in the dialog JSON editor as part of the dialog node + output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. + """ + self.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions + self.debug = debug + self.user_defined = user_defined + self.spelling = spelling + self.llm_metadata = llm_metadata @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextGlobal': - """Initialize a MessageContextGlobal object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogResponseOutput': + """Initialize a LogResponseOutput object from a json dictionary.""" args = {} - if (system := _dict.get('system')) is not None: - args['system'] = MessageContextGlobalSystem.from_dict(system) - if (session_id := _dict.get('session_id')) is not None: - args['session_id'] = session_id + if (generic := _dict.get('generic')) is not None: + args['generic'] = [ + RuntimeResponseGeneric.from_dict(v) for v in generic + ] + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (actions := _dict.get('actions')) is not None: + args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] + if (debug := _dict.get('debug')) is not None: + args['debug'] = MessageOutputDebug.from_dict(debug) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (llm_metadata := _dict.get('llm_metadata')) is not None: + args['llm_metadata'] = [ + MessageOutputLLMMetadata.from_dict(v) for v in llm_metadata + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextGlobal object from a json dictionary.""" + """Initialize a LogResponseOutput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'system') and self.system is not None: - if isinstance(self.system, dict): - _dict['system'] = self.system + if hasattr(self, 'generic') and self.generic is not None: + generic_list = [] + for v in self.generic: + if isinstance(v, dict): + generic_list.append(v) + else: + generic_list.append(v.to_dict()) + _dict['generic'] = generic_list + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'actions') and self.actions is not None: + actions_list = [] + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) + else: + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'debug') and self.debug is not None: + if isinstance(self.debug, dict): + _dict['debug'] = self.debug else: - _dict['system'] = self.system.to_dict() - if hasattr(self, 'session_id') and getattr(self, - 'session_id') is not None: - _dict['session_id'] = getattr(self, 'session_id') + _dict['debug'] = self.debug.to_dict() + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling + else: + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'llm_metadata') and self.llm_metadata is not None: + llm_metadata_list = [] + for v in self.llm_metadata: + if isinstance(v, dict): + llm_metadata_list.append(v) + else: + llm_metadata_list.append(v.to_dict()) + _dict['llm_metadata'] = llm_metadata_list return _dict def _to_dict(self): @@ -6592,196 +6907,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextGlobal object.""" + """Return a `str` version of this LogResponseOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextGlobal') -> bool: + def __eq__(self, other: 'LogResponseOutput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextGlobal') -> bool: + def __ne__(self, other: 'LogResponseOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextGlobalSystem: +class MessageContext: """ - Built-in system properties that apply to all skills used by the assistant. + MessageContext. - :param str timezone: (optional) The user time zone. The assistant uses the time - zone to correctly resolve relative time references. - :param str user_id: (optional) A string value that identifies the user who is - interacting with the assistant. The client must provide a unique identifier for - each individual end user who accesses the application. For user-based plans, - this user ID is used to identify unique users for billing purposes. This string - cannot contain carriage return, newline, or tab characters. If no value is - specified in the input, **user_id** is automatically set to the value of - **context.global.session_id**. - **Note:** This property is the same as the **user_id** property at the root of - the message body. If **user_id** is specified in both locations in a message - request, the value specified at the root is used. - :param int turn_count: (optional) A counter that is automatically incremented - with each turn of the conversation. A value of 1 indicates that this is the the - first turn of a new conversation, which can affect the behavior of some skills - (for example, triggering the start node of a dialog). - :param str locale: (optional) The language code for localization in the user - input. The specified locale overrides the default for the assistant, and is used - for interpreting entity values in user input such as date values. For example, - `04/03/2018` might be interpreted either as April 3 or March 4, depending on the - locale. - This property is included only if the new system entities are enabled for the - skill. - :param str reference_time: (optional) The base time for interpreting any - relative time mentions in the user input. The specified time overrides the - current server time, and is used to calculate times mentioned in relative terms - such as `now` or `tomorrow`. This can be useful for simulating past or future - times for testing purposes, or when analyzing documents such as news articles. - This value must be a UTC time value formatted according to ISO 8601 (for - example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). - This property is included only if the new system entities are enabled for the - skill. - :param str session_start_time: (optional) The time at which the session started. - With the stateful `message` method, the start time is always present, and is set - by the service based on the time the session was created. With the stateless - `message` method, the start time is set by the service in the response to the - first message, and should be returned as part of the context with each - subsequent message in the session. - This value is a UTC time value formatted according to ISO 8601 (for example, - `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). - :param str state: (optional) An encoded string that represents the configuration - state of the assistant at the beginning of the conversation. If you are using - the stateless `message` method, save this value and then send it in the context - of the subsequent message request to avoid disruptions if there are - configuration changes during the conversation (such as a change to a skill the - assistant uses). - :param bool skip_user_input: (optional) For internal use only. + :param MessageContextGlobal global_: (optional) Session context data that is + shared by all skills used by the assistant. + :param MessageContextSkills skills: (optional) Context data specific to + particular skills used by the assistant. + :param dict integrations: (optional) An object containing context data that is + specific to particular integrations. For more information, see the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). """ def __init__( self, *, - timezone: Optional[str] = None, - user_id: Optional[str] = None, - turn_count: Optional[int] = None, - locale: Optional[str] = None, - reference_time: Optional[str] = None, - session_start_time: Optional[str] = None, - state: Optional[str] = None, - skip_user_input: Optional[bool] = None, + global_: Optional['MessageContextGlobal'] = None, + skills: Optional['MessageContextSkills'] = None, + integrations: Optional[dict] = None, ) -> None: """ - Initialize a MessageContextGlobalSystem object. + Initialize a MessageContext object. - :param str timezone: (optional) The user time zone. The assistant uses the - time zone to correctly resolve relative time references. - :param str user_id: (optional) A string value that identifies the user who - is interacting with the assistant. The client must provide a unique - identifier for each individual end user who accesses the application. For - user-based plans, this user ID is used to identify unique users for billing - purposes. This string cannot contain carriage return, newline, or tab - characters. If no value is specified in the input, **user_id** is - automatically set to the value of **context.global.session_id**. - **Note:** This property is the same as the **user_id** property at the root - of the message body. If **user_id** is specified in both locations in a - message request, the value specified at the root is used. - :param int turn_count: (optional) A counter that is automatically - incremented with each turn of the conversation. A value of 1 indicates that - this is the the first turn of a new conversation, which can affect the - behavior of some skills (for example, triggering the start node of a - dialog). - :param str locale: (optional) The language code for localization in the - user input. The specified locale overrides the default for the assistant, - and is used for interpreting entity values in user input such as date - values. For example, `04/03/2018` might be interpreted either as April 3 or - March 4, depending on the locale. - This property is included only if the new system entities are enabled for - the skill. - :param str reference_time: (optional) The base time for interpreting any - relative time mentions in the user input. The specified time overrides the - current server time, and is used to calculate times mentioned in relative - terms such as `now` or `tomorrow`. This can be useful for simulating past - or future times for testing purposes, or when analyzing documents such as - news articles. - This value must be a UTC time value formatted according to ISO 8601 (for - example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). - This property is included only if the new system entities are enabled for - the skill. - :param str session_start_time: (optional) The time at which the session - started. With the stateful `message` method, the start time is always - present, and is set by the service based on the time the session was - created. With the stateless `message` method, the start time is set by the - service in the response to the first message, and should be returned as - part of the context with each subsequent message in the session. - This value is a UTC time value formatted according to ISO 8601 (for - example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). - :param str state: (optional) An encoded string that represents the - configuration state of the assistant at the beginning of the conversation. - If you are using the stateless `message` method, save this value and then - send it in the context of the subsequent message request to avoid - disruptions if there are configuration changes during the conversation - (such as a change to a skill the assistant uses). - :param bool skip_user_input: (optional) For internal use only. + :param MessageContextGlobal global_: (optional) Session context data that + is shared by all skills used by the assistant. + :param MessageContextSkills skills: (optional) Context data specific to + particular skills used by the assistant. + :param dict integrations: (optional) An object containing context data that + is specific to particular integrations. For more information, see the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). """ - self.timezone = timezone - self.user_id = user_id - self.turn_count = turn_count - self.locale = locale - self.reference_time = reference_time - self.session_start_time = session_start_time - self.state = state - self.skip_user_input = skip_user_input + self.global_ = global_ + self.skills = skills + self.integrations = integrations @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalSystem': - """Initialize a MessageContextGlobalSystem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContext': + """Initialize a MessageContext object from a json dictionary.""" args = {} - if (timezone := _dict.get('timezone')) is not None: - args['timezone'] = timezone - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id - if (turn_count := _dict.get('turn_count')) is not None: - args['turn_count'] = turn_count - if (locale := _dict.get('locale')) is not None: - args['locale'] = locale - if (reference_time := _dict.get('reference_time')) is not None: - args['reference_time'] = reference_time - if (session_start_time := _dict.get('session_start_time')) is not None: - args['session_start_time'] = session_start_time - if (state := _dict.get('state')) is not None: - args['state'] = state - if (skip_user_input := _dict.get('skip_user_input')) is not None: - args['skip_user_input'] = skip_user_input + if (global_ := _dict.get('global')) is not None: + args['global_'] = MessageContextGlobal.from_dict(global_) + if (skills := _dict.get('skills')) is not None: + args['skills'] = MessageContextSkills.from_dict(skills) + if (integrations := _dict.get('integrations')) is not None: + args['integrations'] = integrations return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextGlobalSystem object from a json dictionary.""" + """Initialize a MessageContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'timezone') and self.timezone is not None: - _dict['timezone'] = self.timezone - if hasattr(self, 'user_id') and self.user_id is not None: - _dict['user_id'] = self.user_id - if hasattr(self, 'turn_count') and self.turn_count is not None: - _dict['turn_count'] = self.turn_count - if hasattr(self, 'locale') and self.locale is not None: - _dict['locale'] = self.locale - if hasattr(self, 'reference_time') and self.reference_time is not None: - _dict['reference_time'] = self.reference_time - if hasattr( - self, - 'session_start_time') and self.session_start_time is not None: - _dict['session_start_time'] = self.session_start_time - if hasattr(self, 'state') and self.state is not None: - _dict['state'] = self.state - if hasattr(self, - 'skip_user_input') and self.skip_user_input is not None: - _dict['skip_user_input'] = self.skip_user_input + if hasattr(self, 'global_') and self.global_ is not None: + if isinstance(self.global_, dict): + _dict['global'] = self.global_ + else: + _dict['global'] = self.global_.to_dict() + if hasattr(self, 'skills') and self.skills is not None: + if isinstance(self.skills, dict): + _dict['skills'] = self.skills + else: + _dict['skills'] = self.skills.to_dict() + if hasattr(self, 'integrations') and self.integrations is not None: + _dict['integrations'] = self.integrations return _dict def _to_dict(self): @@ -6789,229 +6995,174 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextGlobalSystem object.""" + """Return a `str` version of this MessageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextGlobalSystem') -> bool: + def __eq__(self, other: 'MessageContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextGlobalSystem') -> bool: + def __ne__(self, other: 'MessageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LocaleEnum(str, Enum): - """ - The language code for localization in the user input. The specified locale - overrides the default for the assistant, and is used for interpreting entity - values in user input such as date values. For example, `04/03/2018` might be - interpreted either as April 3 or March 4, depending on the locale. - This property is included only if the new system entities are enabled for the - skill. - """ - - EN_US = 'en-us' - EN_CA = 'en-ca' - EN_GB = 'en-gb' - AR_AR = 'ar-ar' - CS_CZ = 'cs-cz' - DE_DE = 'de-de' - ES_ES = 'es-es' - FR_FR = 'fr-fr' - IT_IT = 'it-it' - JA_JP = 'ja-jp' - KO_KR = 'ko-kr' - NL_NL = 'nl-nl' - PT_BR = 'pt-br' - ZH_CN = 'zh-cn' - ZH_TW = 'zh-tw' - -class MessageContextSkillSystem: +class MessageContextActionSkill: """ - System context data used by the skill. - - :param str state: (optional) An encoded string that represents the current - conversation state. By saving this value and then sending it in the context of a - subsequent message request, you can return to an earlier point in the - conversation. If you are using stateful sessions, you can also use a stored - state value to restore a paused conversation whose session is expired. + Context variables that are used by the action skill. Private variables are persisted, + but not shown. - This type supports additional properties of type object. For internal use only. + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data used by + the skill. + :param dict action_variables: (optional) An object containing action variables. + Action variables can be accessed only by steps in the same action, and do not + persist after the action ends. + :param dict skill_variables: (optional) An object containing skill variables. + (In the watsonx Assistant user interface, skill variables are called _session + variables_.) Skill variables can be accessed by any action and persist for the + duration of the session. """ - # The set of defined properties for the class - _properties = frozenset(['state']) - def __init__( self, *, - state: Optional[str] = None, - **kwargs: Optional[object], + user_defined: Optional[dict] = None, + system: Optional['MessageContextSkillSystem'] = None, + action_variables: Optional[dict] = None, + skill_variables: Optional[dict] = None, ) -> None: """ - Initialize a MessageContextSkillSystem object. + Initialize a MessageContextActionSkill object. - :param str state: (optional) An encoded string that represents the current - conversation state. By saving this value and then sending it in the context - of a subsequent message request, you can return to an earlier point in the - conversation. If you are using stateful sessions, you can also use a stored - state value to restore a paused conversation whose session is expired. - :param object **kwargs: (optional) For internal use only. + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data + used by the skill. + :param dict action_variables: (optional) An object containing action + variables. Action variables can be accessed only by steps in the same + action, and do not persist after the action ends. + :param dict skill_variables: (optional) An object containing skill + variables. (In the watsonx Assistant user interface, skill variables are + called _session variables_.) Skill variables can be accessed by any action + and persist for the duration of the session. """ - self.state = state - for k, v in kwargs.items(): - if k not in MessageContextSkillSystem._properties: - if not isinstance(v, object): - raise ValueError( - 'Value for additional property {} must be of type object' - .format(k)) - setattr(self, k, v) - else: - raise ValueError( - 'Property {} cannot be specified as an additional property'. - format(k)) + self.user_defined = user_defined + self.system = system + self.action_variables = action_variables + self.skill_variables = skill_variables @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextSkillSystem': - """Initialize a MessageContextSkillSystem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextActionSkill': + """Initialize a MessageContextActionSkill object from a json dictionary.""" args = {} - if (state := _dict.get('state')) is not None: - args['state'] = state - for k, v in _dict.items(): - if k not in cls._properties: - if not isinstance(v, object): - raise ValueError( - 'Value for additional property {} must be of type object' - .format(k)) - args[k] = v + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (system := _dict.get('system')) is not None: + args['system'] = MessageContextSkillSystem.from_dict(system) + if (action_variables := _dict.get('action_variables')) is not None: + args['action_variables'] = action_variables + if (skill_variables := _dict.get('skill_variables')) is not None: + args['skill_variables'] = skill_variables return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextSkillSystem object from a json dictionary.""" + """Initialize a MessageContextActionSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'state') and self.state is not None: - _dict['state'] = self.state - for k in [ - _k for _k in vars(self).keys() - if _k not in MessageContextSkillSystem._properties - ]: - _dict[k] = getattr(self, k) + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'system') and self.system is not None: + if isinstance(self.system, dict): + _dict['system'] = self.system + else: + _dict['system'] = self.system.to_dict() + if hasattr(self, + 'action_variables') and self.action_variables is not None: + _dict['action_variables'] = self.action_variables + if hasattr(self, + 'skill_variables') and self.skill_variables is not None: + _dict['skill_variables'] = self.skill_variables return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() - def get_properties(self) -> Dict: - """Return the additional properties from this instance of MessageContextSkillSystem in the form of a dict.""" - _dict = {} - for k in [ - _k for _k in vars(self).keys() - if _k not in MessageContextSkillSystem._properties - ]: - _dict[k] = getattr(self, k) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of additional properties in this instance of MessageContextSkillSystem""" - for k in [ - _k for _k in vars(self).keys() - if _k not in MessageContextSkillSystem._properties - ]: - delattr(self, k) - for k, v in _dict.items(): - if k not in MessageContextSkillSystem._properties: - if not isinstance(v, object): - raise ValueError( - 'Value for additional property {} must be of type object' - .format(k)) - setattr(self, k, v) - else: - raise ValueError( - 'Property {} cannot be specified as an additional property'. - format(k)) - def __str__(self) -> str: - """Return a `str` version of this MessageContextSkillSystem object.""" + """Return a `str` version of this MessageContextActionSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkillSystem') -> bool: + def __eq__(self, other: 'MessageContextActionSkill') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextSkillSystem') -> bool: + def __ne__(self, other: 'MessageContextActionSkill') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextSkills: +class MessageContextDialogSkill: """ - Context data specific to particular skills used by the assistant. + Context variables that are used by the dialog skill. - :param MessageContextDialogSkill main_skill: (optional) Context variables that - are used by the dialog skill. - :param MessageContextActionSkill actions_skill: (optional) Context variables - that are used by the action skill. Private variables are persisted, but not - shown. + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data used by + the skill. """ def __init__( self, *, - main_skill: Optional['MessageContextDialogSkill'] = None, - actions_skill: Optional['MessageContextActionSkill'] = None, + user_defined: Optional[dict] = None, + system: Optional['MessageContextSkillSystem'] = None, ) -> None: """ - Initialize a MessageContextSkills object. + Initialize a MessageContextDialogSkill object. - :param MessageContextDialogSkill main_skill: (optional) Context variables - that are used by the dialog skill. - :param MessageContextActionSkill actions_skill: (optional) Context - variables that are used by the action skill. Private variables are - persisted, but not shown. - """ - self.main_skill = main_skill - self.actions_skill = actions_skill + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data + used by the skill. + """ + self.user_defined = user_defined + self.system = system @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextSkills': - """Initialize a MessageContextSkills object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextDialogSkill': + """Initialize a MessageContextDialogSkill object from a json dictionary.""" args = {} - if (main_skill := _dict.get('main skill')) is not None: - args['main_skill'] = MessageContextDialogSkill.from_dict(main_skill) - if (actions_skill := _dict.get('actions skill')) is not None: - args['actions_skill'] = MessageContextActionSkill.from_dict( - actions_skill) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (system := _dict.get('system')) is not None: + args['system'] = MessageContextSkillSystem.from_dict(system) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextSkills object from a json dictionary.""" + """Initialize a MessageContextDialogSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'main_skill') and self.main_skill is not None: - if isinstance(self.main_skill, dict): - _dict['main skill'] = self.main_skill - else: - _dict['main skill'] = self.main_skill.to_dict() - if hasattr(self, 'actions_skill') and self.actions_skill is not None: - if isinstance(self.actions_skill, dict): - _dict['actions skill'] = self.actions_skill + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'system') and self.system is not None: + if isinstance(self.system, dict): + _dict['system'] = self.system else: - _dict['actions skill'] = self.actions_skill.to_dict() + _dict['system'] = self.system.to_dict() return _dict def _to_dict(self): @@ -7019,175 +7170,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextSkills object.""" + """Return a `str` version of this MessageContextDialogSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkills') -> bool: + def __eq__(self, other: 'MessageContextDialogSkill') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageContextSkills') -> bool: + def __ne__(self, other: 'MessageContextDialogSkill') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageInput: +class MessageContextGlobal: """ - An input object that includes the input text. + Session context data that is shared by all skills used by the assistant. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating - the user input. Include intents from the previous response to continue using - those intents rather than trying to recognize intents in the new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating - the message. Include entities from the previous response to continue using those - entities rather than detecting entities in the new input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the Segment - extension. - :param MessageInputOptions options: (optional) Optional properties that control - how the assistant responds. + :param MessageContextGlobalSystem system: (optional) Built-in system properties + that apply to all skills used by the assistant. + :param str session_id: (optional) The session ID. """ def __init__( self, *, - message_type: Optional[str] = None, - text: Optional[str] = None, - intents: Optional[List['RuntimeIntent']] = None, - entities: Optional[List['RuntimeEntity']] = None, - suggestion_id: Optional[str] = None, - attachments: Optional[List['MessageInputAttachment']] = None, - analytics: Optional['RequestAnalytics'] = None, - options: Optional['MessageInputOptions'] = None, + system: Optional['MessageContextGlobalSystem'] = None, + session_id: Optional[str] = None, ) -> None: """ - Initialize a MessageInput object. + Initialize a MessageContextGlobal object. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill - is bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when - evaluating the user input. Include intents from the previous response to - continue using those intents rather than trying to recognize intents in the - new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when - evaluating the message. Include entities from the previous response to - continue using those entities rather than detecting entities in the new - input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the - Segment extension. - :param MessageInputOptions options: (optional) Optional properties that - control how the assistant responds. + :param MessageContextGlobalSystem system: (optional) Built-in system + properties that apply to all skills used by the assistant. """ - self.message_type = message_type - self.text = text - self.intents = intents - self.entities = entities - self.suggestion_id = suggestion_id - self.attachments = attachments - self.analytics = analytics - self.options = options + self.system = system + self.session_id = session_id @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageInput': - """Initialize a MessageInput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextGlobal': + """Initialize a MessageContextGlobal object from a json dictionary.""" args = {} - if (message_type := _dict.get('message_type')) is not None: - args['message_type'] = message_type - if (text := _dict.get('text')) is not None: - args['text'] = text - if (intents := _dict.get('intents')) is not None: - args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] - if (entities := _dict.get('entities')) is not None: - args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] - if (suggestion_id := _dict.get('suggestion_id')) is not None: - args['suggestion_id'] = suggestion_id - if (attachments := _dict.get('attachments')) is not None: - args['attachments'] = [ - MessageInputAttachment.from_dict(v) for v in attachments - ] - if (analytics := _dict.get('analytics')) is not None: - args['analytics'] = RequestAnalytics.from_dict(analytics) - if (options := _dict.get('options')) is not None: - args['options'] = MessageInputOptions.from_dict(options) + if (system := _dict.get('system')) is not None: + args['system'] = MessageContextGlobalSystem.from_dict(system) + if (session_id := _dict.get('session_id')) is not None: + args['session_id'] = session_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInput object from a json dictionary.""" + """Initialize a MessageContextGlobal object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message_type') and self.message_type is not None: - _dict['message_type'] = self.message_type - if hasattr(self, 'text') and self.text is not None: - _dict['text'] = self.text - if hasattr(self, 'intents') and self.intents is not None: - intents_list = [] - for v in self.intents: - if isinstance(v, dict): - intents_list.append(v) - else: - intents_list.append(v.to_dict()) - _dict['intents'] = intents_list - if hasattr(self, 'entities') and self.entities is not None: - entities_list = [] - for v in self.entities: - if isinstance(v, dict): - entities_list.append(v) - else: - entities_list.append(v.to_dict()) - _dict['entities'] = entities_list - if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: - _dict['suggestion_id'] = self.suggestion_id - if hasattr(self, 'attachments') and self.attachments is not None: - attachments_list = [] - for v in self.attachments: - if isinstance(v, dict): - attachments_list.append(v) - else: - attachments_list.append(v.to_dict()) - _dict['attachments'] = attachments_list - if hasattr(self, 'analytics') and self.analytics is not None: - if isinstance(self.analytics, dict): - _dict['analytics'] = self.analytics - else: - _dict['analytics'] = self.analytics.to_dict() - if hasattr(self, 'options') and self.options is not None: - if isinstance(self.options, dict): - _dict['options'] = self.options + if hasattr(self, 'system') and self.system is not None: + if isinstance(self.system, dict): + _dict['system'] = self.system else: - _dict['options'] = self.options.to_dict() + _dict['system'] = self.system.to_dict() + if hasattr(self, 'session_id') and getattr(self, + 'session_id') is not None: + _dict['session_id'] = getattr(self, 'session_id') return _dict def _to_dict(self): @@ -7195,84 +7241,196 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageInput object.""" + """Return a `str` version of this MessageContextGlobal object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInput') -> bool: + def __eq__(self, other: 'MessageContextGlobal') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageInput') -> bool: + def __ne__(self, other: 'MessageContextGlobal') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MessageTypeEnum(str, Enum): - """ - The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is configured - for the assistant. - """ - - TEXT = 'text' - SEARCH = 'search' - - -class MessageInputAttachment: - """ - A reference to a media file to be sent as an attachment with the message. - :param str url: The URL of the media file. - :param str media_type: (optional) The media content type (such as a MIME type) - of the attachment. +class MessageContextGlobalSystem: """ + Built-in system properties that apply to all skills used by the assistant. - def __init__( - self, - url: str, - *, - media_type: Optional[str] = None, - ) -> None: - """ - Initialize a MessageInputAttachment object. - - :param str url: The URL of the media file. - :param str media_type: (optional) The media content type (such as a MIME - type) of the attachment. - """ - self.url = url - self.media_type = media_type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageInputAttachment': - """Initialize a MessageInputAttachment object from a json dictionary.""" - args = {} - if (url := _dict.get('url')) is not None: - args['url'] = url - else: - raise ValueError( - 'Required property \'url\' not present in MessageInputAttachment JSON' - ) - if (media_type := _dict.get('media_type')) is not None: - args['media_type'] = media_type + :param str timezone: (optional) The user time zone. The assistant uses the time + zone to correctly resolve relative time references. + :param str user_id: (optional) A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier for + each individual end user who accesses the application. For user-based plans, + this user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property at the root of + the message body. If **user_id** is specified in both locations in a message + request, the value specified at the root is used. + :param int turn_count: (optional) A counter that is automatically incremented + with each turn of the conversation. A value of 1 indicates that this is the the + first turn of a new conversation, which can affect the behavior of some skills + (for example, triggering the start node of a dialog). + :param str locale: (optional) The language code for localization in the user + input. The specified locale overrides the default for the assistant, and is used + for interpreting entity values in user input such as date values. For example, + `04/03/2018` might be interpreted either as April 3 or March 4, depending on the + locale. + This property is included only if the new system entities are enabled for the + skill. + :param str reference_time: (optional) The base time for interpreting any + relative time mentions in the user input. The specified time overrides the + current server time, and is used to calculate times mentioned in relative terms + such as `now` or `tomorrow`. This can be useful for simulating past or future + times for testing purposes, or when analyzing documents such as news articles. + This value must be a UTC time value formatted according to ISO 8601 (for + example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). + This property is included only if the new system entities are enabled for the + skill. + :param str session_start_time: (optional) The time at which the session started. + With the stateful `message` method, the start time is always present, and is set + by the service based on the time the session was created. With the stateless + `message` method, the start time is set by the service in the response to the + first message, and should be returned as part of the context with each + subsequent message in the session. + This value is a UTC time value formatted according to ISO 8601 (for example, + `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). + :param str state: (optional) An encoded string that represents the configuration + state of the assistant at the beginning of the conversation. If you are using + the stateless `message` method, save this value and then send it in the context + of the subsequent message request to avoid disruptions if there are + configuration changes during the conversation (such as a change to a skill the + assistant uses). + :param bool skip_user_input: (optional) For internal use only. + """ + + def __init__( + self, + *, + timezone: Optional[str] = None, + user_id: Optional[str] = None, + turn_count: Optional[int] = None, + locale: Optional[str] = None, + reference_time: Optional[str] = None, + session_start_time: Optional[str] = None, + state: Optional[str] = None, + skip_user_input: Optional[bool] = None, + ) -> None: + """ + Initialize a MessageContextGlobalSystem object. + + :param str timezone: (optional) The user time zone. The assistant uses the + time zone to correctly resolve relative time references. + :param str user_id: (optional) A string value that identifies the user who + is interacting with the assistant. The client must provide a unique + identifier for each individual end user who accesses the application. For + user-based plans, this user ID is used to identify unique users for billing + purposes. This string cannot contain carriage return, newline, or tab + characters. If no value is specified in the input, **user_id** is + automatically set to the value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property at the root + of the message body. If **user_id** is specified in both locations in a + message request, the value specified at the root is used. + :param int turn_count: (optional) A counter that is automatically + incremented with each turn of the conversation. A value of 1 indicates that + this is the the first turn of a new conversation, which can affect the + behavior of some skills (for example, triggering the start node of a + dialog). + :param str locale: (optional) The language code for localization in the + user input. The specified locale overrides the default for the assistant, + and is used for interpreting entity values in user input such as date + values. For example, `04/03/2018` might be interpreted either as April 3 or + March 4, depending on the locale. + This property is included only if the new system entities are enabled for + the skill. + :param str reference_time: (optional) The base time for interpreting any + relative time mentions in the user input. The specified time overrides the + current server time, and is used to calculate times mentioned in relative + terms such as `now` or `tomorrow`. This can be useful for simulating past + or future times for testing purposes, or when analyzing documents such as + news articles. + This value must be a UTC time value formatted according to ISO 8601 (for + example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). + This property is included only if the new system entities are enabled for + the skill. + :param str session_start_time: (optional) The time at which the session + started. With the stateful `message` method, the start time is always + present, and is set by the service based on the time the session was + created. With the stateless `message` method, the start time is set by the + service in the response to the first message, and should be returned as + part of the context with each subsequent message in the session. + This value is a UTC time value formatted according to ISO 8601 (for + example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). + :param str state: (optional) An encoded string that represents the + configuration state of the assistant at the beginning of the conversation. + If you are using the stateless `message` method, save this value and then + send it in the context of the subsequent message request to avoid + disruptions if there are configuration changes during the conversation + (such as a change to a skill the assistant uses). + :param bool skip_user_input: (optional) For internal use only. + """ + self.timezone = timezone + self.user_id = user_id + self.turn_count = turn_count + self.locale = locale + self.reference_time = reference_time + self.session_start_time = session_start_time + self.state = state + self.skip_user_input = skip_user_input + + @classmethod + def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalSystem': + """Initialize a MessageContextGlobalSystem object from a json dictionary.""" + args = {} + if (timezone := _dict.get('timezone')) is not None: + args['timezone'] = timezone + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id + if (turn_count := _dict.get('turn_count')) is not None: + args['turn_count'] = turn_count + if (locale := _dict.get('locale')) is not None: + args['locale'] = locale + if (reference_time := _dict.get('reference_time')) is not None: + args['reference_time'] = reference_time + if (session_start_time := _dict.get('session_start_time')) is not None: + args['session_start_time'] = session_start_time + if (state := _dict.get('state')) is not None: + args['state'] = state + if (skip_user_input := _dict.get('skip_user_input')) is not None: + args['skip_user_input'] = skip_user_input return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInputAttachment object from a json dictionary.""" + """Initialize a MessageContextGlobalSystem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'media_type') and self.media_type is not None: - _dict['media_type'] = self.media_type + if hasattr(self, 'timezone') and self.timezone is not None: + _dict['timezone'] = self.timezone + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id + if hasattr(self, 'turn_count') and self.turn_count is not None: + _dict['turn_count'] = self.turn_count + if hasattr(self, 'locale') and self.locale is not None: + _dict['locale'] = self.locale + if hasattr(self, 'reference_time') and self.reference_time is not None: + _dict['reference_time'] = self.reference_time + if hasattr( + self, + 'session_start_time') and self.session_start_time is not None: + _dict['session_start_time'] = self.session_start_time + if hasattr(self, 'state') and self.state is not None: + _dict['state'] = self.state + if hasattr(self, + 'skip_user_input') and self.skip_user_input is not None: + _dict['skip_user_input'] = self.skip_user_input return _dict def _to_dict(self): @@ -7280,242 +7438,229 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageInputAttachment object.""" + """Return a `str` version of this MessageContextGlobalSystem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInputAttachment') -> bool: + def __eq__(self, other: 'MessageContextGlobalSystem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageInputAttachment') -> bool: + def __ne__(self, other: 'MessageContextGlobalSystem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LocaleEnum(str, Enum): + """ + The language code for localization in the user input. The specified locale + overrides the default for the assistant, and is used for interpreting entity + values in user input such as date values. For example, `04/03/2018` might be + interpreted either as April 3 or March 4, depending on the locale. + This property is included only if the new system entities are enabled for the + skill. + """ -class MessageInputOptions: + EN_US = 'en-us' + EN_CA = 'en-ca' + EN_GB = 'en-gb' + AR_AR = 'ar-ar' + CS_CZ = 'cs-cz' + DE_DE = 'de-de' + ES_ES = 'es-es' + FR_FR = 'fr-fr' + IT_IT = 'it-it' + JA_JP = 'ja-jp' + KO_KR = 'ko-kr' + NL_NL = 'nl-nl' + PT_BR = 'pt-br' + ZH_CN = 'zh-cn' + ZH_TW = 'zh-tw' + + +class MessageContextSkillSystem: """ - Optional properties that control how the assistant responds. + System context data used by the skill. - :param bool restart: (optional) Whether to restart dialog processing at the root - of the dialog, regardless of any previously visited nodes. **Note:** This does - not affect `turn_count` or any other context variables. - :param bool alternate_intents: (optional) Whether to return more than one - intent. Set to `true` to return all matching intents. - :param bool async_callout: (optional) Whether custom extension callouts are - executed asynchronously. Asynchronous execution means the response to the - extension callout will be processed on the subsequent message call, the initial - message response signals to the client that the operation may be long running. - With synchronous execution the custom extension is executed and returns the - response in a single message turn. **Note:** **async_callout** defaults to true - for API versions earlier than 2023-06-15. - :param MessageInputOptionsSpelling spelling: (optional) Spelling correction - options for the message. Any options specified on an individual message override - the settings configured for the skill. - :param bool debug: (optional) Whether to return additional diagnostic - information. Set to `true` to return additional information in the - `output.debug` property. If you also specify **return_context**=`true`, the - returned skill context includes the `system.state` property. - :param bool return_context: (optional) Whether to return session context with - the response. If you specify `true`, the response includes the `context` - property. If you also specify **debug**=`true`, the returned skill context - includes the `system.state` property. - :param bool export: (optional) Whether to return session context, including full - conversation state. If you specify `true`, the response includes the `context` - property, and the skill context includes the `system.state` property. - **Note:** If **export**=`true`, the context is returned regardless of the value - of **return_context**. + :param str state: (optional) An encoded string that represents the current + conversation state. By saving this value and then sending it in the context of a + subsequent message request, you can return to an earlier point in the + conversation. If you are using stateful sessions, you can also use a stored + state value to restore a paused conversation whose session is expired. + + This type supports additional properties of type object. For internal use only. """ + # The set of defined properties for the class + _properties = frozenset(['state']) + def __init__( self, *, - restart: Optional[bool] = None, - alternate_intents: Optional[bool] = None, - async_callout: Optional[bool] = None, - spelling: Optional['MessageInputOptionsSpelling'] = None, - debug: Optional[bool] = None, - return_context: Optional[bool] = None, - export: Optional[bool] = None, + state: Optional[str] = None, + **kwargs: Optional[object], ) -> None: """ - Initialize a MessageInputOptions object. + Initialize a MessageContextSkillSystem object. - :param bool restart: (optional) Whether to restart dialog processing at the - root of the dialog, regardless of any previously visited nodes. **Note:** - This does not affect `turn_count` or any other context variables. - :param bool alternate_intents: (optional) Whether to return more than one - intent. Set to `true` to return all matching intents. - :param bool async_callout: (optional) Whether custom extension callouts are - executed asynchronously. Asynchronous execution means the response to the - extension callout will be processed on the subsequent message call, the - initial message response signals to the client that the operation may be - long running. With synchronous execution the custom extension is executed - and returns the response in a single message turn. **Note:** - **async_callout** defaults to true for API versions earlier than - 2023-06-15. - :param MessageInputOptionsSpelling spelling: (optional) Spelling correction - options for the message. Any options specified on an individual message - override the settings configured for the skill. - :param bool debug: (optional) Whether to return additional diagnostic - information. Set to `true` to return additional information in the - `output.debug` property. If you also specify **return_context**=`true`, the - returned skill context includes the `system.state` property. - :param bool return_context: (optional) Whether to return session context - with the response. If you specify `true`, the response includes the - `context` property. If you also specify **debug**=`true`, the returned - skill context includes the `system.state` property. - :param bool export: (optional) Whether to return session context, including - full conversation state. If you specify `true`, the response includes the - `context` property, and the skill context includes the `system.state` - property. - **Note:** If **export**=`true`, the context is returned regardless of the - value of **return_context**. + :param str state: (optional) An encoded string that represents the current + conversation state. By saving this value and then sending it in the context + of a subsequent message request, you can return to an earlier point in the + conversation. If you are using stateful sessions, you can also use a stored + state value to restore a paused conversation whose session is expired. + :param object **kwargs: (optional) For internal use only. """ - self.restart = restart - self.alternate_intents = alternate_intents - self.async_callout = async_callout - self.spelling = spelling - self.debug = debug - self.return_context = return_context - self.export = export + self.state = state + for k, v in kwargs.items(): + if k not in MessageContextSkillSystem._properties: + if not isinstance(v, object): + raise ValueError( + 'Value for additional property {} must be of type object' + .format(k)) + setattr(self, k, v) + else: + raise ValueError( + 'Property {} cannot be specified as an additional property'. + format(k)) @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageInputOptions': - """Initialize a MessageInputOptions object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextSkillSystem': + """Initialize a MessageContextSkillSystem object from a json dictionary.""" args = {} - if (restart := _dict.get('restart')) is not None: - args['restart'] = restart - if (alternate_intents := _dict.get('alternate_intents')) is not None: - args['alternate_intents'] = alternate_intents - if (async_callout := _dict.get('async_callout')) is not None: - args['async_callout'] = async_callout - if (spelling := _dict.get('spelling')) is not None: - args['spelling'] = MessageInputOptionsSpelling.from_dict(spelling) - if (debug := _dict.get('debug')) is not None: - args['debug'] = debug - if (return_context := _dict.get('return_context')) is not None: - args['return_context'] = return_context - if (export := _dict.get('export')) is not None: - args['export'] = export + if (state := _dict.get('state')) is not None: + args['state'] = state + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, object): + raise ValueError( + 'Value for additional property {} must be of type object' + .format(k)) + args[k] = v return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInputOptions object from a json dictionary.""" + """Initialize a MessageContextSkillSystem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'restart') and self.restart is not None: - _dict['restart'] = self.restart - if hasattr(self, - 'alternate_intents') and self.alternate_intents is not None: - _dict['alternate_intents'] = self.alternate_intents - if hasattr(self, 'async_callout') and self.async_callout is not None: - _dict['async_callout'] = self.async_callout - if hasattr(self, 'spelling') and self.spelling is not None: - if isinstance(self.spelling, dict): - _dict['spelling'] = self.spelling - else: - _dict['spelling'] = self.spelling.to_dict() - if hasattr(self, 'debug') and self.debug is not None: - _dict['debug'] = self.debug - if hasattr(self, 'return_context') and self.return_context is not None: - _dict['return_context'] = self.return_context - if hasattr(self, 'export') and self.export is not None: - _dict['export'] = self.export + if hasattr(self, 'state') and self.state is not None: + _dict['state'] = self.state + for k in [ + _k for _k in vars(self).keys() + if _k not in MessageContextSkillSystem._properties + ]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() + def get_properties(self) -> Dict: + """Return the additional properties from this instance of MessageContextSkillSystem in the form of a dict.""" + _dict = {} + for k in [ + _k for _k in vars(self).keys() + if _k not in MessageContextSkillSystem._properties + ]: + _dict[k] = getattr(self, k) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of additional properties in this instance of MessageContextSkillSystem""" + for k in [ + _k for _k in vars(self).keys() + if _k not in MessageContextSkillSystem._properties + ]: + delattr(self, k) + for k, v in _dict.items(): + if k not in MessageContextSkillSystem._properties: + if not isinstance(v, object): + raise ValueError( + 'Value for additional property {} must be of type object' + .format(k)) + setattr(self, k, v) + else: + raise ValueError( + 'Property {} cannot be specified as an additional property'. + format(k)) + def __str__(self) -> str: - """Return a `str` version of this MessageInputOptions object.""" + """Return a `str` version of this MessageContextSkillSystem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInputOptions') -> bool: + def __eq__(self, other: 'MessageContextSkillSystem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageInputOptions') -> bool: + def __ne__(self, other: 'MessageContextSkillSystem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageInputOptionsSpelling: +class MessageContextSkills: """ - Spelling correction options for the message. Any options specified on an individual - message override the settings configured for the skill. + Context data specific to particular skills used by the assistant. - :param bool suggestions: (optional) Whether to use spelling correction when - processing the input. If spelling correction is used and **auto_correct** is - `true`, any spelling corrections are automatically applied to the user input. If - **auto_correct** is `false`, any suggested corrections are returned in the - **output.spelling** property. - This property overrides the value of the **spelling_suggestions** property in - the workspace settings for the skill. - :param bool auto_correct: (optional) Whether to use autocorrection when - processing the input. If this property is `true`, any corrections are - automatically applied to the user input, and the original text is returned in - the **output.spelling** property of the message response. This property - overrides the value of the **spelling_auto_correct** property in the workspace - settings for the skill. + :param MessageContextDialogSkill main_skill: (optional) Context variables that + are used by the dialog skill. + :param MessageContextActionSkill actions_skill: (optional) Context variables + that are used by the action skill. Private variables are persisted, but not + shown. """ def __init__( self, *, - suggestions: Optional[bool] = None, - auto_correct: Optional[bool] = None, + main_skill: Optional['MessageContextDialogSkill'] = None, + actions_skill: Optional['MessageContextActionSkill'] = None, ) -> None: """ - Initialize a MessageInputOptionsSpelling object. + Initialize a MessageContextSkills object. - :param bool suggestions: (optional) Whether to use spelling correction when - processing the input. If spelling correction is used and **auto_correct** - is `true`, any spelling corrections are automatically applied to the user - input. If **auto_correct** is `false`, any suggested corrections are - returned in the **output.spelling** property. - This property overrides the value of the **spelling_suggestions** property - in the workspace settings for the skill. - :param bool auto_correct: (optional) Whether to use autocorrection when - processing the input. If this property is `true`, any corrections are - automatically applied to the user input, and the original text is returned - in the **output.spelling** property of the message response. This property - overrides the value of the **spelling_auto_correct** property in the - workspace settings for the skill. + :param MessageContextDialogSkill main_skill: (optional) Context variables + that are used by the dialog skill. + :param MessageContextActionSkill actions_skill: (optional) Context + variables that are used by the action skill. Private variables are + persisted, but not shown. """ - self.suggestions = suggestions - self.auto_correct = auto_correct + self.main_skill = main_skill + self.actions_skill = actions_skill @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageInputOptionsSpelling': - """Initialize a MessageInputOptionsSpelling object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextSkills': + """Initialize a MessageContextSkills object from a json dictionary.""" args = {} - if (suggestions := _dict.get('suggestions')) is not None: - args['suggestions'] = suggestions - if (auto_correct := _dict.get('auto_correct')) is not None: - args['auto_correct'] = auto_correct + if (main_skill := _dict.get('main skill')) is not None: + args['main_skill'] = MessageContextDialogSkill.from_dict(main_skill) + if (actions_skill := _dict.get('actions skill')) is not None: + args['actions_skill'] = MessageContextActionSkill.from_dict( + actions_skill) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInputOptionsSpelling object from a json dictionary.""" + """Initialize a MessageContextSkills object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'suggestions') and self.suggestions is not None: - _dict['suggestions'] = self.suggestions - if hasattr(self, 'auto_correct') and self.auto_correct is not None: - _dict['auto_correct'] = self.auto_correct + if hasattr(self, 'main_skill') and self.main_skill is not None: + if isinstance(self.main_skill, dict): + _dict['main skill'] = self.main_skill + else: + _dict['main skill'] = self.main_skill.to_dict() + if hasattr(self, 'actions_skill') and self.actions_skill is not None: + if isinstance(self.actions_skill, dict): + _dict['actions skill'] = self.actions_skill + else: + _dict['actions skill'] = self.actions_skill.to_dict() return _dict def _to_dict(self): @@ -7523,120 +7668,139 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageInputOptionsSpelling object.""" + """Return a `str` version of this MessageContextSkills object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInputOptionsSpelling') -> bool: + def __eq__(self, other: 'MessageContextSkills') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageInputOptionsSpelling') -> bool: + def __ne__(self, other: 'MessageContextSkills') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageOutput: - """ - Assistant output to be rendered or processed by the client. - - :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any - channel. It is the responsibility of the client application to implement the - supported response types. - :param List[RuntimeIntent] intents: (optional) An array of intents recognized in - the user input, sorted in descending order of confidence. - :param List[RuntimeEntity] entities: (optional) An array of entities identified - in the user input. - :param List[DialogNodeAction] actions: (optional) An array of objects describing - any actions requested by the dialog node. - :param MessageOutputDebug debug: (optional) Additional detailed information - about a message response and how it was generated. - :param dict user_defined: (optional) An object containing any custom properties - included in the response. This object includes any arbitrary properties defined - in the dialog JSON editor as part of the dialog node output. - :param MessageOutputSpelling spelling: (optional) Properties describing any - spelling corrections in the user input that was received. +class MessageInput: """ + An input object that includes the input text. - def __init__( - self, - *, - generic: Optional[List['RuntimeResponseGeneric']] = None, - intents: Optional[List['RuntimeIntent']] = None, - entities: Optional[List['RuntimeEntity']] = None, - actions: Optional[List['DialogNodeAction']] = None, - debug: Optional['MessageOutputDebug'] = None, - user_defined: Optional[dict] = None, - spelling: Optional['MessageOutputSpelling'] = None, + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating + the user input. Include intents from the previous response to continue using + those intents rather than trying to recognize intents in the new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating + the message. Include entities from the previous response to continue using those + entities rather than detecting entities in the new input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the Segment + extension. + :param MessageInputOptions options: (optional) Optional properties that control + how the assistant responds. + """ + + def __init__( + self, + *, + message_type: Optional[str] = None, + text: Optional[str] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + suggestion_id: Optional[str] = None, + attachments: Optional[List['MessageInputAttachment']] = None, + analytics: Optional['RequestAnalytics'] = None, + options: Optional['MessageInputOptions'] = None, ) -> None: """ - Initialize a MessageOutput object. + Initialize a MessageInput object. - :param List[RuntimeResponseGeneric] generic: (optional) Output intended for - any channel. It is the responsibility of the client application to - implement the supported response types. - :param List[RuntimeIntent] intents: (optional) An array of intents - recognized in the user input, sorted in descending order of confidence. - :param List[RuntimeEntity] entities: (optional) An array of entities - identified in the user input. - :param List[DialogNodeAction] actions: (optional) An array of objects - describing any actions requested by the dialog node. - :param MessageOutputDebug debug: (optional) Additional detailed information - about a message response and how it was generated. - :param dict user_defined: (optional) An object containing any custom - properties included in the response. This object includes any arbitrary - properties defined in the dialog JSON editor as part of the dialog node - output. - :param MessageOutputSpelling spelling: (optional) Properties describing any - spelling corrections in the user input that was received. + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill + is bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when + evaluating the user input. Include intents from the previous response to + continue using those intents rather than trying to recognize intents in the + new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when + evaluating the message. Include entities from the previous response to + continue using those entities rather than detecting entities in the new + input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the + Segment extension. + :param MessageInputOptions options: (optional) Optional properties that + control how the assistant responds. """ - self.generic = generic + self.message_type = message_type + self.text = text self.intents = intents self.entities = entities - self.actions = actions - self.debug = debug - self.user_defined = user_defined - self.spelling = spelling + self.suggestion_id = suggestion_id + self.attachments = attachments + self.analytics = analytics + self.options = options @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutput': - """Initialize a MessageOutput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageInput': + """Initialize a MessageInput object from a json dictionary.""" args = {} - if (generic := _dict.get('generic')) is not None: - args['generic'] = [ - RuntimeResponseGeneric.from_dict(v) for v in generic - ] + if (message_type := _dict.get('message_type')) is not None: + args['message_type'] = message_type + if (text := _dict.get('text')) is not None: + args['text'] = text if (intents := _dict.get('intents')) is not None: args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] if (entities := _dict.get('entities')) is not None: args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] - if (actions := _dict.get('actions')) is not None: - args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] - if (debug := _dict.get('debug')) is not None: - args['debug'] = MessageOutputDebug.from_dict(debug) - if (user_defined := _dict.get('user_defined')) is not None: - args['user_defined'] = user_defined - if (spelling := _dict.get('spelling')) is not None: - args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (suggestion_id := _dict.get('suggestion_id')) is not None: + args['suggestion_id'] = suggestion_id + if (attachments := _dict.get('attachments')) is not None: + args['attachments'] = [ + MessageInputAttachment.from_dict(v) for v in attachments + ] + if (analytics := _dict.get('analytics')) is not None: + args['analytics'] = RequestAnalytics.from_dict(analytics) + if (options := _dict.get('options')) is not None: + args['options'] = MessageInputOptions.from_dict(options) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutput object from a json dictionary.""" + """Initialize a MessageInput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'generic') and self.generic is not None: - generic_list = [] - for v in self.generic: - if isinstance(v, dict): - generic_list.append(v) - else: - generic_list.append(v.to_dict()) - _dict['generic'] = generic_list + if hasattr(self, 'message_type') and self.message_type is not None: + _dict['message_type'] = self.message_type + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text if hasattr(self, 'intents') and self.intents is not None: intents_list = [] for v in self.intents: @@ -7653,26 +7817,26 @@ def to_dict(self) -> Dict: else: entities_list.append(v.to_dict()) _dict['entities'] = entities_list - if hasattr(self, 'actions') and self.actions is not None: - actions_list = [] - for v in self.actions: + if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: + _dict['suggestion_id'] = self.suggestion_id + if hasattr(self, 'attachments') and self.attachments is not None: + attachments_list = [] + for v in self.attachments: if isinstance(v, dict): - actions_list.append(v) + attachments_list.append(v) else: - actions_list.append(v.to_dict()) - _dict['actions'] = actions_list - if hasattr(self, 'debug') and self.debug is not None: - if isinstance(self.debug, dict): - _dict['debug'] = self.debug + attachments_list.append(v.to_dict()) + _dict['attachments'] = attachments_list + if hasattr(self, 'analytics') and self.analytics is not None: + if isinstance(self.analytics, dict): + _dict['analytics'] = self.analytics else: - _dict['debug'] = self.debug.to_dict() - if hasattr(self, 'user_defined') and self.user_defined is not None: - _dict['user_defined'] = self.user_defined - if hasattr(self, 'spelling') and self.spelling is not None: - if isinstance(self.spelling, dict): - _dict['spelling'] = self.spelling + _dict['analytics'] = self.analytics.to_dict() + if hasattr(self, 'options') and self.options is not None: + if isinstance(self.options, dict): + _dict['options'] = self.options else: - _dict['spelling'] = self.spelling.to_dict() + _dict['options'] = self.options.to_dict() return _dict def _to_dict(self): @@ -7680,133 +7844,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutput object.""" + """Return a `str` version of this MessageInput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutput') -> bool: + def __eq__(self, other: 'MessageInput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageOutput') -> bool: + def __ne__(self, other: 'MessageInput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class MessageTypeEnum(str, Enum): + """ + The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is configured + for the assistant. + """ -class MessageOutputDebug: + TEXT = 'text' + SEARCH = 'search' + + +class MessageInputAttachment: """ - Additional detailed information about a message response and how it was generated. + A reference to a media file to be sent as an attachment with the message. - :param List[DialogNodeVisited] nodes_visited: (optional) An array of objects - containing detailed diagnostic information about dialog nodes that were visited - during processing of the input message. - :param List[DialogLogMessage] log_messages: (optional) An array of up to 50 - messages logged with the request. - :param bool branch_exited: (optional) Assistant sets this to true when this - message response concludes or interrupts a dialog. - :param str branch_exited_reason: (optional) When `branch_exited` is set to - `true` by the assistant, the `branch_exited_reason` specifies whether the dialog - completed by itself or got interrupted. - :param List[MessageOutputDebugTurnEvent] turn_events: (optional) An array of - objects containing detailed diagnostic information about dialog nodes and - actions that were visited during processing of the input message. - This property is present only if the assistant has an action skill. + :param str url: The URL of the media file. + :param str media_type: (optional) The media content type (such as a MIME type) + of the attachment. """ def __init__( self, + url: str, *, - nodes_visited: Optional[List['DialogNodeVisited']] = None, - log_messages: Optional[List['DialogLogMessage']] = None, - branch_exited: Optional[bool] = None, - branch_exited_reason: Optional[str] = None, - turn_events: Optional[List['MessageOutputDebugTurnEvent']] = None, + media_type: Optional[str] = None, ) -> None: """ - Initialize a MessageOutputDebug object. + Initialize a MessageInputAttachment object. - :param List[DialogNodeVisited] nodes_visited: (optional) An array of - objects containing detailed diagnostic information about dialog nodes that - were visited during processing of the input message. - :param List[DialogLogMessage] log_messages: (optional) An array of up to 50 - messages logged with the request. - :param bool branch_exited: (optional) Assistant sets this to true when this - message response concludes or interrupts a dialog. - :param str branch_exited_reason: (optional) When `branch_exited` is set to - `true` by the assistant, the `branch_exited_reason` specifies whether the - dialog completed by itself or got interrupted. - :param List[MessageOutputDebugTurnEvent] turn_events: (optional) An array - of objects containing detailed diagnostic information about dialog nodes - and actions that were visited during processing of the input message. - This property is present only if the assistant has an action skill. + :param str url: The URL of the media file. + :param str media_type: (optional) The media content type (such as a MIME + type) of the attachment. """ - self.nodes_visited = nodes_visited - self.log_messages = log_messages - self.branch_exited = branch_exited - self.branch_exited_reason = branch_exited_reason - self.turn_events = turn_events + self.url = url + self.media_type = media_type @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutputDebug': - """Initialize a MessageOutputDebug object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageInputAttachment': + """Initialize a MessageInputAttachment object from a json dictionary.""" args = {} - if (nodes_visited := _dict.get('nodes_visited')) is not None: - args['nodes_visited'] = [ - DialogNodeVisited.from_dict(v) for v in nodes_visited - ] - if (log_messages := _dict.get('log_messages')) is not None: - args['log_messages'] = [ - DialogLogMessage.from_dict(v) for v in log_messages - ] - if (branch_exited := _dict.get('branch_exited')) is not None: - args['branch_exited'] = branch_exited - if (branch_exited_reason := - _dict.get('branch_exited_reason')) is not None: - args['branch_exited_reason'] = branch_exited_reason - if (turn_events := _dict.get('turn_events')) is not None: - args['turn_events'] = [ - MessageOutputDebugTurnEvent.from_dict(v) for v in turn_events - ] + if (url := _dict.get('url')) is not None: + args['url'] = url + else: + raise ValueError( + 'Required property \'url\' not present in MessageInputAttachment JSON' + ) + if (media_type := _dict.get('media_type')) is not None: + args['media_type'] = media_type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebug object from a json dictionary.""" + """Initialize a MessageInputAttachment object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: - nodes_visited_list = [] - for v in self.nodes_visited: - if isinstance(v, dict): - nodes_visited_list.append(v) - else: - nodes_visited_list.append(v.to_dict()) - _dict['nodes_visited'] = nodes_visited_list - if hasattr(self, 'log_messages') and self.log_messages is not None: - log_messages_list = [] - for v in self.log_messages: - if isinstance(v, dict): - log_messages_list.append(v) - else: - log_messages_list.append(v.to_dict()) - _dict['log_messages'] = log_messages_list - if hasattr(self, 'branch_exited') and self.branch_exited is not None: - _dict['branch_exited'] = self.branch_exited - if hasattr(self, 'branch_exited_reason' - ) and self.branch_exited_reason is not None: - _dict['branch_exited_reason'] = self.branch_exited_reason - if hasattr(self, 'turn_events') and self.turn_events is not None: - turn_events_list = [] - for v in self.turn_events: - if isinstance(v, dict): - turn_events_list.append(v) - else: - turn_events_list.append(v.to_dict()) - _dict['turn_events'] = turn_events_list + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'media_type') and self.media_type is not None: + _dict['media_type'] = self.media_type return _dict def _to_dict(self): @@ -7814,173 +7929,153 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebug object.""" + """Return a `str` version of this MessageInputAttachment object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutputDebug') -> bool: + def __eq__(self, other: 'MessageInputAttachment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageOutputDebug') -> bool: + def __ne__(self, other: 'MessageInputAttachment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class BranchExitedReasonEnum(str, Enum): - """ - When `branch_exited` is set to `true` by the assistant, the `branch_exited_reason` - specifies whether the dialog completed by itself or got interrupted. - """ - - COMPLETED = 'completed' - FALLBACK = 'fallback' - - -class MessageOutputDebugTurnEvent: - """ - MessageOutputDebugTurnEvent. - - """ - - def __init__(self,) -> None: - """ - Initialize a MessageOutputDebugTurnEvent object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'MessageOutputDebugTurnEventTurnEventActionVisited', - 'MessageOutputDebugTurnEventTurnEventActionFinished', - 'MessageOutputDebugTurnEventTurnEventStepVisited', - 'MessageOutputDebugTurnEventTurnEventStepAnswered', - 'MessageOutputDebugTurnEventTurnEventHandlerVisited', - 'MessageOutputDebugTurnEventTurnEventCallout', - 'MessageOutputDebugTurnEventTurnEventSearch', - 'MessageOutputDebugTurnEventTurnEventNodeVisited' - ])) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutputDebugTurnEvent': - """Initialize a MessageOutputDebugTurnEvent object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'MessageOutputDebugTurnEvent'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join([ - 'MessageOutputDebugTurnEventTurnEventActionVisited', - 'MessageOutputDebugTurnEventTurnEventActionFinished', - 'MessageOutputDebugTurnEventTurnEventStepVisited', - 'MessageOutputDebugTurnEventTurnEventStepAnswered', - 'MessageOutputDebugTurnEventTurnEventHandlerVisited', - 'MessageOutputDebugTurnEventTurnEventCallout', - 'MessageOutputDebugTurnEventTurnEventSearch', - 'MessageOutputDebugTurnEventTurnEventNodeVisited' - ])) - raise Exception(msg) - - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a MessageOutputDebugTurnEvent object from a json dictionary.""" - return cls.from_dict(_dict) - - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping[ - 'action_visited'] = 'MessageOutputDebugTurnEventTurnEventActionVisited' - mapping[ - 'action_finished'] = 'MessageOutputDebugTurnEventTurnEventActionFinished' - mapping[ - 'step_visited'] = 'MessageOutputDebugTurnEventTurnEventStepVisited' - mapping[ - 'step_answered'] = 'MessageOutputDebugTurnEventTurnEventStepAnswered' - mapping[ - 'handler_visited'] = 'MessageOutputDebugTurnEventTurnEventHandlerVisited' - mapping['callout'] = 'MessageOutputDebugTurnEventTurnEventCallout' - mapping['search'] = 'MessageOutputDebugTurnEventTurnEventSearch' - mapping[ - 'node_visited'] = 'MessageOutputDebugTurnEventTurnEventNodeVisited' - disc_value = _dict.get('event') - if disc_value is None: - raise ValueError( - 'Discriminator property \'event\' not found in MessageOutputDebugTurnEvent JSON' - ) - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - -class MessageOutputSpelling: +class MessageInputOptions: """ - Properties describing any spelling corrections in the user input that was received. + Optional properties that control how the assistant responds. - :param str text: (optional) The user input text that was used to generate the - response. If spelling autocorrection is enabled, this text reflects any spelling - corrections that were applied. - :param str original_text: (optional) The original user input text. This property - is returned only if autocorrection is enabled and the user input was corrected. - :param str suggested_text: (optional) Any suggested corrections of the input - text. This property is returned only if spelling correction is enabled and - autocorrection is disabled. + :param bool restart: (optional) Whether to restart dialog processing at the root + of the dialog, regardless of any previously visited nodes. **Note:** This does + not affect `turn_count` or any other context variables. + :param bool alternate_intents: (optional) Whether to return more than one + intent. Set to `true` to return all matching intents. + :param bool async_callout: (optional) Whether custom extension callouts are + executed asynchronously. Asynchronous execution means the response to the + extension callout will be processed on the subsequent message call, the initial + message response signals to the client that the operation may be long running. + With synchronous execution the custom extension is executed and returns the + response in a single message turn. **Note:** **async_callout** defaults to true + for API versions earlier than 2023-06-15. + :param MessageInputOptionsSpelling spelling: (optional) Spelling correction + options for the message. Any options specified on an individual message override + the settings configured for the skill. + :param bool debug: (optional) Whether to return additional diagnostic + information. Set to `true` to return additional information in the + `output.debug` property. If you also specify **return_context**=`true`, the + returned skill context includes the `system.state` property. + :param bool return_context: (optional) Whether to return session context with + the response. If you specify `true`, the response includes the `context` + property. If you also specify **debug**=`true`, the returned skill context + includes the `system.state` property. + :param bool export: (optional) Whether to return session context, including full + conversation state. If you specify `true`, the response includes the `context` + property, and the skill context includes the `system.state` property. + **Note:** If **export**=`true`, the context is returned regardless of the value + of **return_context**. """ def __init__( self, *, - text: Optional[str] = None, - original_text: Optional[str] = None, - suggested_text: Optional[str] = None, + restart: Optional[bool] = None, + alternate_intents: Optional[bool] = None, + async_callout: Optional[bool] = None, + spelling: Optional['MessageInputOptionsSpelling'] = None, + debug: Optional[bool] = None, + return_context: Optional[bool] = None, + export: Optional[bool] = None, ) -> None: """ - Initialize a MessageOutputSpelling object. + Initialize a MessageInputOptions object. - :param str text: (optional) The user input text that was used to generate - the response. If spelling autocorrection is enabled, this text reflects any - spelling corrections that were applied. - :param str original_text: (optional) The original user input text. This - property is returned only if autocorrection is enabled and the user input - was corrected. - :param str suggested_text: (optional) Any suggested corrections of the - input text. This property is returned only if spelling correction is - enabled and autocorrection is disabled. + :param bool restart: (optional) Whether to restart dialog processing at the + root of the dialog, regardless of any previously visited nodes. **Note:** + This does not affect `turn_count` or any other context variables. + :param bool alternate_intents: (optional) Whether to return more than one + intent. Set to `true` to return all matching intents. + :param bool async_callout: (optional) Whether custom extension callouts are + executed asynchronously. Asynchronous execution means the response to the + extension callout will be processed on the subsequent message call, the + initial message response signals to the client that the operation may be + long running. With synchronous execution the custom extension is executed + and returns the response in a single message turn. **Note:** + **async_callout** defaults to true for API versions earlier than + 2023-06-15. + :param MessageInputOptionsSpelling spelling: (optional) Spelling correction + options for the message. Any options specified on an individual message + override the settings configured for the skill. + :param bool debug: (optional) Whether to return additional diagnostic + information. Set to `true` to return additional information in the + `output.debug` property. If you also specify **return_context**=`true`, the + returned skill context includes the `system.state` property. + :param bool return_context: (optional) Whether to return session context + with the response. If you specify `true`, the response includes the + `context` property. If you also specify **debug**=`true`, the returned + skill context includes the `system.state` property. + :param bool export: (optional) Whether to return session context, including + full conversation state. If you specify `true`, the response includes the + `context` property, and the skill context includes the `system.state` + property. + **Note:** If **export**=`true`, the context is returned regardless of the + value of **return_context**. """ - self.text = text - self.original_text = original_text - self.suggested_text = suggested_text + self.restart = restart + self.alternate_intents = alternate_intents + self.async_callout = async_callout + self.spelling = spelling + self.debug = debug + self.return_context = return_context + self.export = export @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutputSpelling': - """Initialize a MessageOutputSpelling object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageInputOptions': + """Initialize a MessageInputOptions object from a json dictionary.""" args = {} - if (text := _dict.get('text')) is not None: - args['text'] = text - if (original_text := _dict.get('original_text')) is not None: - args['original_text'] = original_text - if (suggested_text := _dict.get('suggested_text')) is not None: - args['suggested_text'] = suggested_text + if (restart := _dict.get('restart')) is not None: + args['restart'] = restart + if (alternate_intents := _dict.get('alternate_intents')) is not None: + args['alternate_intents'] = alternate_intents + if (async_callout := _dict.get('async_callout')) is not None: + args['async_callout'] = async_callout + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageInputOptionsSpelling.from_dict(spelling) + if (debug := _dict.get('debug')) is not None: + args['debug'] = debug + if (return_context := _dict.get('return_context')) is not None: + args['return_context'] = return_context + if (export := _dict.get('export')) is not None: + args['export'] = export return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputSpelling object from a json dictionary.""" + """Initialize a MessageInputOptions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'text') and self.text is not None: - _dict['text'] = self.text - if hasattr(self, 'original_text') and self.original_text is not None: - _dict['original_text'] = self.original_text - if hasattr(self, 'suggested_text') and self.suggested_text is not None: - _dict['suggested_text'] = self.suggested_text + if hasattr(self, 'restart') and self.restart is not None: + _dict['restart'] = self.restart + if hasattr(self, + 'alternate_intents') and self.alternate_intents is not None: + _dict['alternate_intents'] = self.alternate_intents + if hasattr(self, 'async_callout') and self.async_callout is not None: + _dict['async_callout'] = self.async_callout + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling + else: + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'debug') and self.debug is not None: + _dict['debug'] = self.debug + if hasattr(self, 'return_context') and self.return_context is not None: + _dict['return_context'] = self.return_context + if hasattr(self, 'export') and self.export is not None: + _dict['export'] = self.export return _dict def _to_dict(self): @@ -7988,59 +8083,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputSpelling object.""" + """Return a `str` version of this MessageInputOptions object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutputSpelling') -> bool: + def __eq__(self, other: 'MessageInputOptions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MessageOutputSpelling') -> bool: + def __ne__(self, other: 'MessageInputOptions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Metadata: +class MessageInputOptionsSpelling: """ - Contains meta-information about the item(s) being streamed. + Spelling correction options for the message. Any options specified on an individual + message override the settings configured for the skill. - :param int id: (optional) Identifies the index and sequence of the current - streamed response item. + :param bool suggestions: (optional) Whether to use spelling correction when + processing the input. If spelling correction is used and **auto_correct** is + `true`, any spelling corrections are automatically applied to the user input. If + **auto_correct** is `false`, any suggested corrections are returned in the + **output.spelling** property. + This property overrides the value of the **spelling_suggestions** property in + the workspace settings for the skill. + :param bool auto_correct: (optional) Whether to use autocorrection when + processing the input. If this property is `true`, any corrections are + automatically applied to the user input, and the original text is returned in + the **output.spelling** property of the message response. This property + overrides the value of the **spelling_auto_correct** property in the workspace + settings for the skill. """ def __init__( self, *, - id: Optional[int] = None, + suggestions: Optional[bool] = None, + auto_correct: Optional[bool] = None, ) -> None: """ - Initialize a Metadata object. + Initialize a MessageInputOptionsSpelling object. - :param int id: (optional) Identifies the index and sequence of the current - streamed response item. + :param bool suggestions: (optional) Whether to use spelling correction when + processing the input. If spelling correction is used and **auto_correct** + is `true`, any spelling corrections are automatically applied to the user + input. If **auto_correct** is `false`, any suggested corrections are + returned in the **output.spelling** property. + This property overrides the value of the **spelling_suggestions** property + in the workspace settings for the skill. + :param bool auto_correct: (optional) Whether to use autocorrection when + processing the input. If this property is `true`, any corrections are + automatically applied to the user input, and the original text is returned + in the **output.spelling** property of the message response. This property + overrides the value of the **spelling_auto_correct** property in the + workspace settings for the skill. """ - self.id = id + self.suggestions = suggestions + self.auto_correct = auto_correct @classmethod - def from_dict(cls, _dict: Dict) -> 'Metadata': - """Initialize a Metadata object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageInputOptionsSpelling': + """Initialize a MessageInputOptionsSpelling object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id + if (suggestions := _dict.get('suggestions')) is not None: + args['suggestions'] = suggestions + if (auto_correct := _dict.get('auto_correct')) is not None: + args['auto_correct'] = auto_correct return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Metadata object from a json dictionary.""" + """Initialize a MessageInputOptionsSpelling object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'suggestions') and self.suggestions is not None: + _dict['suggestions'] = self.suggestions + if hasattr(self, 'auto_correct') and self.auto_correct is not None: + _dict['auto_correct'] = self.auto_correct return _dict def _to_dict(self): @@ -8048,135 +8172,176 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Metadata object.""" + """Return a `str` version of this MessageInputOptionsSpelling object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Metadata') -> bool: + def __eq__(self, other: 'MessageInputOptionsSpelling') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Metadata') -> bool: + def __ne__(self, other: 'MessageInputOptionsSpelling') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MonitorAssistantReleaseImportArtifactResponse: +class MessageOutput: """ - MonitorAssistantReleaseImportArtifactResponse. + Assistant output to be rendered or processed by the client. - :param str status: (optional) The current status of the release import process: - - **Completed**: The artifact import has completed. - - **Failed**: The asynchronous artifact import process has failed. - - **Processing**: An asynchronous operation to import the artifact is underway - and not yet completed. - :param str task_id: (optional) A unique identifier for a background asynchronous - task that is executing or has executed the operation. - :param str assistant_id: (optional) The ID of the assistant to which the release - belongs. - :param List[StatusError] status_errors: (optional) An array of messages about - errors that caused an asynchronous operation to fail. Included only if - **status**=`Failed`. - :param str status_description: (optional) The description of the failed - asynchronous operation. Included only if **status**=`Failed`. - :param List[str] skill_impact_in_draft: (optional) An array of skill types in - the draft environment which will be overridden with skills from the artifact - being imported. - :param datetime created: (optional) The timestamp for creation of the object. - :param datetime updated: (optional) The timestamp for the most recent update to - the object. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any + channel. It is the responsibility of the client application to implement the + supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents recognized in + the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities identified + in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects describing + any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom properties + included in the response. This object includes any arbitrary properties defined + in the dialog JSON editor as part of the dialog node output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. """ def __init__( self, *, - status: Optional[str] = None, - task_id: Optional[str] = None, - assistant_id: Optional[str] = None, - status_errors: Optional[List['StatusError']] = None, - status_description: Optional[str] = None, - skill_impact_in_draft: Optional[List[str]] = None, - created: Optional[datetime] = None, - updated: Optional[datetime] = None, + generic: Optional[List['RuntimeResponseGeneric']] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + actions: Optional[List['DialogNodeAction']] = None, + debug: Optional['MessageOutputDebug'] = None, + user_defined: Optional[dict] = None, + spelling: Optional['MessageOutputSpelling'] = None, + llm_metadata: Optional[List['MessageOutputLLMMetadata']] = None, ) -> None: """ - Initialize a MonitorAssistantReleaseImportArtifactResponse object. + Initialize a MessageOutput object. - :param List[str] skill_impact_in_draft: (optional) An array of skill types - in the draft environment which will be overridden with skills from the - artifact being imported. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for + any channel. It is the responsibility of the client application to + implement the supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents + recognized in the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities + identified in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects + describing any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom + properties included in the response. This object includes any arbitrary + properties defined in the dialog JSON editor as part of the dialog node + output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. """ - self.status = status - self.task_id = task_id - self.assistant_id = assistant_id - self.status_errors = status_errors - self.status_description = status_description - self.skill_impact_in_draft = skill_impact_in_draft - self.created = created - self.updated = updated + self.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions + self.debug = debug + self.user_defined = user_defined + self.spelling = spelling + self.llm_metadata = llm_metadata @classmethod - def from_dict( - cls, - _dict: Dict) -> 'MonitorAssistantReleaseImportArtifactResponse': - """Initialize a MonitorAssistantReleaseImportArtifactResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutput': + """Initialize a MessageOutput object from a json dictionary.""" args = {} - if (status := _dict.get('status')) is not None: - args['status'] = status - if (task_id := _dict.get('task_id')) is not None: - args['task_id'] = task_id - if (assistant_id := _dict.get('assistant_id')) is not None: - args['assistant_id'] = assistant_id - if (status_errors := _dict.get('status_errors')) is not None: - args['status_errors'] = [ - StatusError.from_dict(v) for v in status_errors + if (generic := _dict.get('generic')) is not None: + args['generic'] = [ + RuntimeResponseGeneric.from_dict(v) for v in generic + ] + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (actions := _dict.get('actions')) is not None: + args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] + if (debug := _dict.get('debug')) is not None: + args['debug'] = MessageOutputDebug.from_dict(debug) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (llm_metadata := _dict.get('llm_metadata')) is not None: + args['llm_metadata'] = [ + MessageOutputLLMMetadata.from_dict(v) for v in llm_metadata ] - if (status_description := _dict.get('status_description')) is not None: - args['status_description'] = status_description - if (skill_impact_in_draft := - _dict.get('skill_impact_in_draft')) is not None: - args['skill_impact_in_draft'] = skill_impact_in_draft - if (created := _dict.get('created')) is not None: - args['created'] = string_to_datetime(created) - if (updated := _dict.get('updated')) is not None: - args['updated'] = string_to_datetime(updated) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MonitorAssistantReleaseImportArtifactResponse object from a json dictionary.""" + """Initialize a MessageOutput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'status') and getattr(self, 'status') is not None: - _dict['status'] = getattr(self, 'status') - if hasattr(self, 'task_id') and getattr(self, 'task_id') is not None: - _dict['task_id'] = getattr(self, 'task_id') - if hasattr(self, 'assistant_id') and getattr( - self, 'assistant_id') is not None: - _dict['assistant_id'] = getattr(self, 'assistant_id') - if hasattr(self, 'status_errors') and getattr( - self, 'status_errors') is not None: - status_errors_list = [] - for v in getattr(self, 'status_errors'): + if hasattr(self, 'generic') and self.generic is not None: + generic_list = [] + for v in self.generic: if isinstance(v, dict): - status_errors_list.append(v) + generic_list.append(v) else: - status_errors_list.append(v.to_dict()) - _dict['status_errors'] = status_errors_list - if hasattr(self, 'status_description') and getattr( - self, 'status_description') is not None: - _dict['status_description'] = getattr(self, 'status_description') - if hasattr(self, 'skill_impact_in_draft' - ) and self.skill_impact_in_draft is not None: - _dict['skill_impact_in_draft'] = self.skill_impact_in_draft - if hasattr(self, 'created') and getattr(self, 'created') is not None: - _dict['created'] = datetime_to_string(getattr(self, 'created')) - if hasattr(self, 'updated') and getattr(self, 'updated') is not None: - _dict['updated'] = datetime_to_string(getattr(self, 'updated')) + generic_list.append(v.to_dict()) + _dict['generic'] = generic_list + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'actions') and self.actions is not None: + actions_list = [] + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) + else: + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'debug') and self.debug is not None: + if isinstance(self.debug, dict): + _dict['debug'] = self.debug + else: + _dict['debug'] = self.debug.to_dict() + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling + else: + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'llm_metadata') and self.llm_metadata is not None: + llm_metadata_list = [] + for v in self.llm_metadata: + if isinstance(v, dict): + llm_metadata_list.append(v) + else: + llm_metadata_list.append(v.to_dict()) + _dict['llm_metadata'] = llm_metadata_list return _dict def _to_dict(self): @@ -8184,134 +8349,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MonitorAssistantReleaseImportArtifactResponse object.""" + """Return a `str` version of this MessageOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'MonitorAssistantReleaseImportArtifactResponse') -> bool: + def __eq__(self, other: 'MessageOutput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, - other: 'MonitorAssistantReleaseImportArtifactResponse') -> bool: + def __ne__(self, other: 'MessageOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The current status of the release import process: - - **Completed**: The artifact import has completed. - - **Failed**: The asynchronous artifact import process has failed. - - **Processing**: An asynchronous operation to import the artifact is underway - and not yet completed. - """ - - COMPLETED = 'Completed' - FAILED = 'Failed' - PROCESSING = 'Processing' - - class SkillImpactInDraftEnum(str, Enum): - """ - The type of the skill in the draft environment. - """ - - ACTION = 'action' - DIALOG = 'dialog' - -class Pagination: +class MessageOutputDebug: """ - The pagination data for the returned objects. For more information about using - pagination, see [Pagination](#pagination). + Additional detailed information about a message response and how it was generated. - :param str refresh_url: The URL that will return the same page of results. - :param str next_url: (optional) The URL that will return the next page of - results. - :param int total: (optional) The total number of objects that satisfy the - request. This total includes all results, not just those included in the current - page. - :param int matched: (optional) Reserved for future use. - :param str refresh_cursor: (optional) A token identifying the current page of - results. - :param str next_cursor: (optional) A token identifying the next page of results. + :param List[DialogNodeVisited] nodes_visited: (optional) An array of objects + containing detailed diagnostic information about dialog nodes that were visited + during processing of the input message. + :param List[DialogLogMessage] log_messages: (optional) An array of up to 50 + messages logged with the request. + :param bool branch_exited: (optional) Assistant sets this to true when this + message response concludes or interrupts a dialog. + :param str branch_exited_reason: (optional) When `branch_exited` is set to + `true` by the assistant, the `branch_exited_reason` specifies whether the dialog + completed by itself or got interrupted. + :param List[MessageOutputDebugTurnEvent] turn_events: (optional) An array of + objects containing detailed diagnostic information about dialog nodes and + actions that were visited during processing of the input message. + This property is present only if the assistant has an action skill. """ def __init__( self, - refresh_url: str, *, - next_url: Optional[str] = None, - total: Optional[int] = None, - matched: Optional[int] = None, - refresh_cursor: Optional[str] = None, - next_cursor: Optional[str] = None, + nodes_visited: Optional[List['DialogNodeVisited']] = None, + log_messages: Optional[List['DialogLogMessage']] = None, + branch_exited: Optional[bool] = None, + branch_exited_reason: Optional[str] = None, + turn_events: Optional[List['MessageOutputDebugTurnEvent']] = None, ) -> None: """ - Initialize a Pagination object. + Initialize a MessageOutputDebug object. - :param str refresh_url: The URL that will return the same page of results. - :param str next_url: (optional) The URL that will return the next page of - results. - :param int total: (optional) The total number of objects that satisfy the - request. This total includes all results, not just those included in the - current page. - :param int matched: (optional) Reserved for future use. - :param str refresh_cursor: (optional) A token identifying the current page - of results. - :param str next_cursor: (optional) A token identifying the next page of - results. + :param List[DialogNodeVisited] nodes_visited: (optional) An array of + objects containing detailed diagnostic information about dialog nodes that + were visited during processing of the input message. + :param List[DialogLogMessage] log_messages: (optional) An array of up to 50 + messages logged with the request. + :param bool branch_exited: (optional) Assistant sets this to true when this + message response concludes or interrupts a dialog. + :param str branch_exited_reason: (optional) When `branch_exited` is set to + `true` by the assistant, the `branch_exited_reason` specifies whether the + dialog completed by itself or got interrupted. + :param List[MessageOutputDebugTurnEvent] turn_events: (optional) An array + of objects containing detailed diagnostic information about dialog nodes + and actions that were visited during processing of the input message. + This property is present only if the assistant has an action skill. """ - self.refresh_url = refresh_url - self.next_url = next_url - self.total = total - self.matched = matched - self.refresh_cursor = refresh_cursor - self.next_cursor = next_cursor + self.nodes_visited = nodes_visited + self.log_messages = log_messages + self.branch_exited = branch_exited + self.branch_exited_reason = branch_exited_reason + self.turn_events = turn_events @classmethod - def from_dict(cls, _dict: Dict) -> 'Pagination': - """Initialize a Pagination object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutputDebug': + """Initialize a MessageOutputDebug object from a json dictionary.""" args = {} - if (refresh_url := _dict.get('refresh_url')) is not None: - args['refresh_url'] = refresh_url - else: - raise ValueError( - 'Required property \'refresh_url\' not present in Pagination JSON' - ) - if (next_url := _dict.get('next_url')) is not None: - args['next_url'] = next_url - if (total := _dict.get('total')) is not None: - args['total'] = total - if (matched := _dict.get('matched')) is not None: - args['matched'] = matched - if (refresh_cursor := _dict.get('refresh_cursor')) is not None: - args['refresh_cursor'] = refresh_cursor - if (next_cursor := _dict.get('next_cursor')) is not None: - args['next_cursor'] = next_cursor + if (nodes_visited := _dict.get('nodes_visited')) is not None: + args['nodes_visited'] = [ + DialogNodeVisited.from_dict(v) for v in nodes_visited + ] + if (log_messages := _dict.get('log_messages')) is not None: + args['log_messages'] = [ + DialogLogMessage.from_dict(v) for v in log_messages + ] + if (branch_exited := _dict.get('branch_exited')) is not None: + args['branch_exited'] = branch_exited + if (branch_exited_reason := + _dict.get('branch_exited_reason')) is not None: + args['branch_exited_reason'] = branch_exited_reason + if (turn_events := _dict.get('turn_events')) is not None: + args['turn_events'] = [ + MessageOutputDebugTurnEvent.from_dict(v) for v in turn_events + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Pagination object from a json dictionary.""" + """Initialize a MessageOutputDebug object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'refresh_url') and self.refresh_url is not None: - _dict['refresh_url'] = self.refresh_url - if hasattr(self, 'next_url') and self.next_url is not None: - _dict['next_url'] = self.next_url - if hasattr(self, 'total') and self.total is not None: - _dict['total'] = self.total - if hasattr(self, 'matched') and self.matched is not None: - _dict['matched'] = self.matched - if hasattr(self, 'refresh_cursor') and self.refresh_cursor is not None: - _dict['refresh_cursor'] = self.refresh_cursor - if hasattr(self, 'next_cursor') and self.next_cursor is not None: - _dict['next_cursor'] = self.next_cursor + if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: + nodes_visited_list = [] + for v in self.nodes_visited: + if isinstance(v, dict): + nodes_visited_list.append(v) + else: + nodes_visited_list.append(v.to_dict()) + _dict['nodes_visited'] = nodes_visited_list + if hasattr(self, 'log_messages') and self.log_messages is not None: + log_messages_list = [] + for v in self.log_messages: + if isinstance(v, dict): + log_messages_list.append(v) + else: + log_messages_list.append(v.to_dict()) + _dict['log_messages'] = log_messages_list + if hasattr(self, 'branch_exited') and self.branch_exited is not None: + _dict['branch_exited'] = self.branch_exited + if hasattr(self, 'branch_exited_reason' + ) and self.branch_exited_reason is not None: + _dict['branch_exited_reason'] = self.branch_exited_reason + if hasattr(self, 'turn_events') and self.turn_events is not None: + turn_events_list = [] + for v in self.turn_events: + if isinstance(v, dict): + turn_events_list.append(v) + else: + turn_events_list.append(v.to_dict()) + _dict['turn_events'] = turn_events_list return _dict def _to_dict(self): @@ -8319,73 +8483,184 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Pagination object.""" + """Return a `str` version of this MessageOutputDebug object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Pagination') -> bool: + def __eq__(self, other: 'MessageOutputDebug') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Pagination') -> bool: + def __ne__(self, other: 'MessageOutputDebug') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class ProviderAuthenticationOAuth2: + class BranchExitedReasonEnum(str, Enum): + """ + When `branch_exited` is set to `true` by the assistant, the `branch_exited_reason` + specifies whether the dialog completed by itself or got interrupted. + """ + + COMPLETED = 'completed' + FALLBACK = 'fallback' + + +class MessageOutputDebugTurnEvent: """ - Non-private settings for oauth2 authentication. + MessageOutputDebugTurnEvent. - :param str preferred_flow: (optional) The preferred "flow" or "grant type" for - the API client to fetch an access token from the authorization server. - :param ProviderAuthenticationOAuth2Flows flows: (optional) Scenarios performed - by the API client to fetch an access token from the authorization server. + """ + + def __init__(self,) -> None: + """ + Initialize a MessageOutputDebugTurnEvent object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'MessageOutputDebugTurnEventTurnEventActionVisited', + 'MessageOutputDebugTurnEventTurnEventActionFinished', + 'MessageOutputDebugTurnEventTurnEventStepVisited', + 'MessageOutputDebugTurnEventTurnEventStepAnswered', + 'MessageOutputDebugTurnEventTurnEventHandlerVisited', + 'MessageOutputDebugTurnEventTurnEventCallout', + 'MessageOutputDebugTurnEventTurnEventSearch', + 'MessageOutputDebugTurnEventTurnEventNodeVisited', + 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd', + 'MessageOutputDebugTurnEventTurnEventManualRoute', + 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied', + 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied', + 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied', + 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled', + 'MessageOutputDebugTurnEventTurnEventClientActions' + ])) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'MessageOutputDebugTurnEvent': + """Initialize a MessageOutputDebugTurnEvent object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'MessageOutputDebugTurnEvent'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join([ + 'MessageOutputDebugTurnEventTurnEventActionVisited', + 'MessageOutputDebugTurnEventTurnEventActionFinished', + 'MessageOutputDebugTurnEventTurnEventStepVisited', + 'MessageOutputDebugTurnEventTurnEventStepAnswered', + 'MessageOutputDebugTurnEventTurnEventHandlerVisited', + 'MessageOutputDebugTurnEventTurnEventCallout', + 'MessageOutputDebugTurnEventTurnEventSearch', + 'MessageOutputDebugTurnEventTurnEventNodeVisited', + 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd', + 'MessageOutputDebugTurnEventTurnEventManualRoute', + 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied', + 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied', + 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied', + 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled', + 'MessageOutputDebugTurnEventTurnEventClientActions' + ])) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a MessageOutputDebugTurnEvent object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping[ + 'action_visited'] = 'MessageOutputDebugTurnEventTurnEventActionVisited' + mapping[ + 'action_finished'] = 'MessageOutputDebugTurnEventTurnEventActionFinished' + mapping[ + 'step_visited'] = 'MessageOutputDebugTurnEventTurnEventStepVisited' + mapping[ + 'step_answered'] = 'MessageOutputDebugTurnEventTurnEventStepAnswered' + mapping[ + 'handler_visited'] = 'MessageOutputDebugTurnEventTurnEventHandlerVisited' + mapping['callout'] = 'MessageOutputDebugTurnEventTurnEventCallout' + mapping['search'] = 'MessageOutputDebugTurnEventTurnEventSearch' + mapping[ + 'node_visited'] = 'MessageOutputDebugTurnEventTurnEventNodeVisited' + mapping[ + 'conversational_search_end'] = 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd' + mapping[ + 'manual_route'] = 'MessageOutputDebugTurnEventTurnEventManualRoute' + mapping[ + 'topic_switch_denied'] = 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied' + mapping[ + 'action_routing_denied'] = 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied' + mapping[ + 'suggestion_intents_denied'] = 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied' + mapping[ + 'generative_ai_called'] = 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled' + mapping[ + 'client_actions'] = 'MessageOutputDebugTurnEventTurnEventClientActions' + disc_value = _dict.get('event') + if disc_value is None: + raise ValueError( + 'Discriminator property \'event\' not found in MessageOutputDebugTurnEvent JSON' + ) + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + +class MessageOutputLLMMetadata: + """ + MessageOutputLLMMetadata. + + :param str task: (optional) The task that used a large language model. + :param str model_id: (optional) The id for the large language model used for the + task. """ def __init__( self, *, - preferred_flow: Optional[str] = None, - flows: Optional['ProviderAuthenticationOAuth2Flows'] = None, + task: Optional[str] = None, + model_id: Optional[str] = None, ) -> None: """ - Initialize a ProviderAuthenticationOAuth2 object. + Initialize a MessageOutputLLMMetadata object. - :param str preferred_flow: (optional) The preferred "flow" or "grant type" - for the API client to fetch an access token from the authorization server. - :param ProviderAuthenticationOAuth2Flows flows: (optional) Scenarios - performed by the API client to fetch an access token from the authorization - server. + :param str task: (optional) The task that used a large language model. + :param str model_id: (optional) The id for the large language model used + for the task. """ - self.preferred_flow = preferred_flow - self.flows = flows + self.task = task + self.model_id = model_id @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderAuthenticationOAuth2': - """Initialize a ProviderAuthenticationOAuth2 object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutputLLMMetadata': + """Initialize a MessageOutputLLMMetadata object from a json dictionary.""" args = {} - if (preferred_flow := _dict.get('preferred_flow')) is not None: - args['preferred_flow'] = preferred_flow - if (flows := _dict.get('flows')) is not None: - args['flows'] = flows + if (task := _dict.get('task')) is not None: + args['task'] = task + if (model_id := _dict.get('model_id')) is not None: + args['model_id'] = model_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderAuthenticationOAuth2 object from a json dictionary.""" + """Initialize a MessageOutputLLMMetadata object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'preferred_flow') and self.preferred_flow is not None: - _dict['preferred_flow'] = self.preferred_flow - if hasattr(self, 'flows') and self.flows is not None: - if isinstance(self.flows, dict): - _dict['flows'] = self.flows - else: - _dict['flows'] = self.flows.to_dict() + if hasattr(self, 'task') and self.task is not None: + _dict['task'] = self.task + if hasattr(self, 'model_id') and self.model_id is not None: + _dict['model_id'] = self.model_id return _dict def _to_dict(self): @@ -8393,98 +8668,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderAuthenticationOAuth2 object.""" + """Return a `str` version of this MessageOutputLLMMetadata object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderAuthenticationOAuth2') -> bool: + def __eq__(self, other: 'MessageOutputLLMMetadata') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderAuthenticationOAuth2') -> bool: + def __ne__(self, other: 'MessageOutputLLMMetadata') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class PreferredFlowEnum(str, Enum): - """ - The preferred "flow" or "grant type" for the API client to fetch an access token - from the authorization server. - """ - - PASSWORD = 'password' - CLIENT_CREDENTIALS = 'client_credentials' - AUTHORIZATION_CODE = 'authorization_code' - CUSTOM_FLOW_NAME = '<$custom_flow_name>' - - -class ProviderAuthenticationOAuth2Flows: - """ - Scenarios performed by the API client to fetch an access token from the authorization - server. - - """ - - def __init__(self,) -> None: - """ - Initialize a ProviderAuthenticationOAuth2Flows object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password', - 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials', - 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode' - ])) - raise Exception(msg) - -class ProviderAuthenticationOAuth2PasswordUsername: +class MessageOutputSpelling: """ - The username for oauth2 authentication when the preferred flow is "password". + Properties describing any spelling corrections in the user input that was received. - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param str text: (optional) The user input text that was used to generate the + response. If spelling autocorrection is enabled, this text reflects any spelling + corrections that were applied. + :param str original_text: (optional) The original user input text. This property + is returned only if autocorrection is enabled and the user input was corrected. + :param str suggested_text: (optional) Any suggested corrections of the input + text. This property is returned only if spelling correction is enabled and + autocorrection is disabled. """ def __init__( self, *, - type: Optional[str] = None, - value: Optional[str] = None, + text: Optional[str] = None, + original_text: Optional[str] = None, + suggested_text: Optional[str] = None, ) -> None: """ - Initialize a ProviderAuthenticationOAuth2PasswordUsername object. + Initialize a MessageOutputSpelling object. - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param str text: (optional) The user input text that was used to generate + the response. If spelling autocorrection is enabled, this text reflects any + spelling corrections that were applied. + :param str original_text: (optional) The original user input text. This + property is returned only if autocorrection is enabled and the user input + was corrected. + :param str suggested_text: (optional) Any suggested corrections of the + input text. This property is returned only if spelling correction is + enabled and autocorrection is disabled. """ - self.type = type - self.value = value + self.text = text + self.original_text = original_text + self.suggested_text = suggested_text @classmethod - def from_dict( - cls, _dict: Dict) -> 'ProviderAuthenticationOAuth2PasswordUsername': - """Initialize a ProviderAuthenticationOAuth2PasswordUsername object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutputSpelling': + """Initialize a MessageOutputSpelling object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - if (value := _dict.get('value')) is not None: - args['value'] = value + if (text := _dict.get('text')) is not None: + args['text'] = text + if (original_text := _dict.get('original_text')) is not None: + args['original_text'] = original_text + if (suggested_text := _dict.get('suggested_text')) is not None: + args['suggested_text'] = suggested_text return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderAuthenticationOAuth2PasswordUsername object from a json dictionary.""" + """Initialize a MessageOutputSpelling object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'original_text') and self.original_text is not None: + _dict['original_text'] = self.original_text + if hasattr(self, 'suggested_text') and self.suggested_text is not None: + _dict['suggested_text'] = self.suggested_text return _dict def _to_dict(self): @@ -8492,74 +8753,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderAuthenticationOAuth2PasswordUsername object.""" + """Return a `str` version of this MessageOutputSpelling object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'ProviderAuthenticationOAuth2PasswordUsername') -> bool: + def __eq__(self, other: 'MessageOutputSpelling') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, - other: 'ProviderAuthenticationOAuth2PasswordUsername') -> bool: + def __ne__(self, other: 'MessageOutputSpelling') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type of property observed in "value". - """ - VALUE = 'value' - - -class ProviderAuthenticationTypeAndValue: +class MessageStreamMetadata: """ - ProviderAuthenticationTypeAndValue. + Contains meta-information about the item(s) being streamed. - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param Metadata streaming_metadata: Contains meta-information about the item(s) + being streamed. """ def __init__( self, - *, - type: Optional[str] = None, - value: Optional[str] = None, + streaming_metadata: 'Metadata', ) -> None: """ - Initialize a ProviderAuthenticationTypeAndValue object. + Initialize a MessageStreamMetadata object. - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param Metadata streaming_metadata: Contains meta-information about the + item(s) being streamed. """ - self.type = type - self.value = value + self.streaming_metadata = streaming_metadata @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderAuthenticationTypeAndValue': - """Initialize a ProviderAuthenticationTypeAndValue object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageStreamMetadata': + """Initialize a MessageStreamMetadata object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - if (value := _dict.get('value')) is not None: - args['value'] = value + if (streaming_metadata := _dict.get('streaming_metadata')) is not None: + args['streaming_metadata'] = Metadata.from_dict(streaming_metadata) + else: + raise ValueError( + 'Required property \'streaming_metadata\' not present in MessageStreamMetadata JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderAuthenticationTypeAndValue object from a json dictionary.""" + """Initialize a MessageStreamMetadata object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr( + self, + 'streaming_metadata') and self.streaming_metadata is not None: + if isinstance(self.streaming_metadata, dict): + _dict['streaming_metadata'] = self.streaming_metadata + else: + _dict['streaming_metadata'] = self.streaming_metadata.to_dict() return _dict def _to_dict(self): @@ -8567,100 +8821,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderAuthenticationTypeAndValue object.""" + """Return a `str` version of this MessageStreamMetadata object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderAuthenticationTypeAndValue') -> bool: + def __eq__(self, other: 'MessageStreamMetadata') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderAuthenticationTypeAndValue') -> bool: + def __ne__(self, other: 'MessageStreamMetadata') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type of property observed in "value". + +class MessageStreamResponse: + """ + A streamed response from the watsonx Assistant service. + + """ + + def __init__(self,) -> None: """ + Initialize a MessageStreamResponse object. - VALUE = 'value' + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'MessageStreamResponseMessageStreamPartialItem', + 'MessageStreamResponseMessageStreamCompleteItem', + 'MessageStreamResponseStatefulMessageStreamFinalResponse' + ])) + raise Exception(msg) -class ProviderCollection: +class Metadata: """ - ProviderCollection. + Contains meta-information about the item(s) being streamed. - :param List[ProviderResponse] conversational_skill_providers: An array of - objects describing the conversational skill providers associated with the - instance. - :param Pagination pagination: The pagination data for the returned objects. For - more information about using pagination, see [Pagination](#pagination). + :param int id: (optional) Identifies the index and sequence of the current + streamed response item. """ def __init__( self, - conversational_skill_providers: List['ProviderResponse'], - pagination: 'Pagination', + *, + id: Optional[int] = None, ) -> None: """ - Initialize a ProviderCollection object. + Initialize a Metadata object. - :param List[ProviderResponse] conversational_skill_providers: An array of - objects describing the conversational skill providers associated with the - instance. - :param Pagination pagination: The pagination data for the returned objects. - For more information about using pagination, see [Pagination](#pagination). + :param int id: (optional) Identifies the index and sequence of the current + streamed response item. """ - self.conversational_skill_providers = conversational_skill_providers - self.pagination = pagination + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderCollection': - """Initialize a ProviderCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Metadata': + """Initialize a Metadata object from a json dictionary.""" args = {} - if (conversational_skill_providers := - _dict.get('conversational_skill_providers')) is not None: - args['conversational_skill_providers'] = [ - ProviderResponse.from_dict(v) - for v in conversational_skill_providers - ] - else: - raise ValueError( - 'Required property \'conversational_skill_providers\' not present in ProviderCollection JSON' - ) - if (pagination := _dict.get('pagination')) is not None: - args['pagination'] = Pagination.from_dict(pagination) - else: - raise ValueError( - 'Required property \'pagination\' not present in ProviderCollection JSON' - ) + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderCollection object from a json dictionary.""" + """Initialize a Metadata object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'conversational_skill_providers' - ) and self.conversational_skill_providers is not None: - conversational_skill_providers_list = [] - for v in self.conversational_skill_providers: - if isinstance(v, dict): - conversational_skill_providers_list.append(v) - else: - conversational_skill_providers_list.append(v.to_dict()) - _dict[ - 'conversational_skill_providers'] = conversational_skill_providers_list - if hasattr(self, 'pagination') and self.pagination is not None: - if isinstance(self.pagination, dict): - _dict['pagination'] = self.pagination - else: - _dict['pagination'] = self.pagination.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -8668,65 +8901,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderCollection object.""" + """Return a `str` version of this Metadata object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderCollection') -> bool: + def __eq__(self, other: 'Metadata') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderCollection') -> bool: + def __ne__(self, other: 'Metadata') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderPrivate: +class MonitorAssistantReleaseImportArtifactResponse: """ - Private information of the provider. + MonitorAssistantReleaseImportArtifactResponse. - :param ProviderPrivateAuthentication authentication: Private authentication - information of the provider. + :param str status: (optional) The current status of the release import process: + - **Completed**: The artifact import has completed. + - **Failed**: The asynchronous artifact import process has failed. + - **Processing**: An asynchronous operation to import the artifact is underway + and not yet completed. + :param str task_id: (optional) A unique identifier for a background asynchronous + task that is executing or has executed the operation. + :param str assistant_id: (optional) The ID of the assistant to which the release + belongs. + :param List[StatusError] status_errors: (optional) An array of messages about + errors that caused an asynchronous operation to fail. Included only if + **status**=`Failed`. + :param str status_description: (optional) The description of the failed + asynchronous operation. Included only if **status**=`Failed`. + :param List[str] skill_impact_in_draft: (optional) An array of skill types in + the draft environment which will be overridden with skills from the artifact + being imported. + :param datetime created: (optional) The timestamp for creation of the object. + :param datetime updated: (optional) The timestamp for the most recent update to + the object. """ def __init__( self, - authentication: 'ProviderPrivateAuthentication', + *, + status: Optional[str] = None, + task_id: Optional[str] = None, + assistant_id: Optional[str] = None, + status_errors: Optional[List['StatusError']] = None, + status_description: Optional[str] = None, + skill_impact_in_draft: Optional[List[str]] = None, + created: Optional[datetime] = None, + updated: Optional[datetime] = None, ) -> None: """ - Initialize a ProviderPrivate object. + Initialize a MonitorAssistantReleaseImportArtifactResponse object. - :param ProviderPrivateAuthentication authentication: Private authentication - information of the provider. + :param List[str] skill_impact_in_draft: (optional) An array of skill types + in the draft environment which will be overridden with skills from the + artifact being imported. """ - self.authentication = authentication + self.status = status + self.task_id = task_id + self.assistant_id = assistant_id + self.status_errors = status_errors + self.status_description = status_description + self.skill_impact_in_draft = skill_impact_in_draft + self.created = created + self.updated = updated @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderPrivate': - """Initialize a ProviderPrivate object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MonitorAssistantReleaseImportArtifactResponse': + """Initialize a MonitorAssistantReleaseImportArtifactResponse object from a json dictionary.""" args = {} - if (authentication := _dict.get('authentication')) is not None: - args['authentication'] = authentication - else: - raise ValueError( - 'Required property \'authentication\' not present in ProviderPrivate JSON' - ) + if (status := _dict.get('status')) is not None: + args['status'] = status + if (task_id := _dict.get('task_id')) is not None: + args['task_id'] = task_id + if (assistant_id := _dict.get('assistant_id')) is not None: + args['assistant_id'] = assistant_id + if (status_errors := _dict.get('status_errors')) is not None: + args['status_errors'] = [ + StatusError.from_dict(v) for v in status_errors + ] + if (status_description := _dict.get('status_description')) is not None: + args['status_description'] = status_description + if (skill_impact_in_draft := + _dict.get('skill_impact_in_draft')) is not None: + args['skill_impact_in_draft'] = skill_impact_in_draft + if (created := _dict.get('created')) is not None: + args['created'] = string_to_datetime(created) + if (updated := _dict.get('updated')) is not None: + args['updated'] = string_to_datetime(updated) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderPrivate object from a json dictionary.""" + """Initialize a MonitorAssistantReleaseImportArtifactResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'authentication') and self.authentication is not None: - if isinstance(self.authentication, dict): - _dict['authentication'] = self.authentication - else: - _dict['authentication'] = self.authentication.to_dict() + if hasattr(self, 'status') and getattr(self, 'status') is not None: + _dict['status'] = getattr(self, 'status') + if hasattr(self, 'task_id') and getattr(self, 'task_id') is not None: + _dict['task_id'] = getattr(self, 'task_id') + if hasattr(self, 'assistant_id') and getattr( + self, 'assistant_id') is not None: + _dict['assistant_id'] = getattr(self, 'assistant_id') + if hasattr(self, 'status_errors') and getattr( + self, 'status_errors') is not None: + status_errors_list = [] + for v in getattr(self, 'status_errors'): + if isinstance(v, dict): + status_errors_list.append(v) + else: + status_errors_list.append(v.to_dict()) + _dict['status_errors'] = status_errors_list + if hasattr(self, 'status_description') and getattr( + self, 'status_description') is not None: + _dict['status_description'] = getattr(self, 'status_description') + if hasattr(self, 'skill_impact_in_draft' + ) and self.skill_impact_in_draft is not None: + _dict['skill_impact_in_draft'] = self.skill_impact_in_draft + if hasattr(self, 'created') and getattr(self, 'created') is not None: + _dict['created'] = datetime_to_string(getattr(self, 'created')) + if hasattr(self, 'updated') and getattr(self, 'updated') is not None: + _dict['updated'] = datetime_to_string(getattr(self, 'updated')) return _dict def _to_dict(self): @@ -8734,108 +9037,134 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderPrivate object.""" + """Return a `str` version of this MonitorAssistantReleaseImportArtifactResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderPrivate') -> bool: + def __eq__(self, + other: 'MonitorAssistantReleaseImportArtifactResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderPrivate') -> bool: + def __ne__(self, + other: 'MonitorAssistantReleaseImportArtifactResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The current status of the release import process: + - **Completed**: The artifact import has completed. + - **Failed**: The asynchronous artifact import process has failed. + - **Processing**: An asynchronous operation to import the artifact is underway + and not yet completed. + """ -class ProviderPrivateAuthentication: - """ - Private authentication information of the provider. - - """ + COMPLETED = 'Completed' + FAILED = 'Failed' + PROCESSING = 'Processing' - def __init__(self,) -> None: + class SkillImpactInDraftEnum(str, Enum): """ - Initialize a ProviderPrivateAuthentication object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'ProviderPrivateAuthenticationBearerFlow', - 'ProviderPrivateAuthenticationBasicFlow', - 'ProviderPrivateAuthenticationOAuth2Flow' - ])) - raise Exception(msg) - - -class ProviderPrivateAuthenticationOAuth2FlowFlows: - """ - Scenarios performed by the API client to fetch an access token from the authorization - server. - - """ - - def __init__(self,) -> None: + The type of the skill in the draft environment. """ - Initialize a ProviderPrivateAuthenticationOAuth2FlowFlows object. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password', - 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials', - 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode' - ])) - raise Exception(msg) + ACTION = 'action' + DIALOG = 'dialog' -class ProviderPrivateAuthenticationOAuth2PasswordPassword: +class Pagination: """ - The password for oauth2 authentication when the preferred flow is "password". + The pagination data for the returned objects. For more information about using + pagination, see [Pagination](#pagination). - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param str refresh_url: The URL that will return the same page of results. + :param str next_url: (optional) The URL that will return the next page of + results. + :param int total: (optional) The total number of objects that satisfy the + request. This total includes all results, not just those included in the current + page. + :param int matched: (optional) Reserved for future use. + :param str refresh_cursor: (optional) A token identifying the current page of + results. + :param str next_cursor: (optional) A token identifying the next page of results. """ def __init__( self, + refresh_url: str, *, - type: Optional[str] = None, - value: Optional[str] = None, + next_url: Optional[str] = None, + total: Optional[int] = None, + matched: Optional[int] = None, + refresh_cursor: Optional[str] = None, + next_cursor: Optional[str] = None, ) -> None: """ - Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object. + Initialize a Pagination object. - :param str type: (optional) The type of property observed in "value". - :param str value: (optional) The stored information of the value. + :param str refresh_url: The URL that will return the same page of results. + :param str next_url: (optional) The URL that will return the next page of + results. + :param int total: (optional) The total number of objects that satisfy the + request. This total includes all results, not just those included in the + current page. + :param int matched: (optional) Reserved for future use. + :param str refresh_cursor: (optional) A token identifying the current page + of results. + :param str next_cursor: (optional) A token identifying the next page of + results. """ - self.type = type - self.value = value + self.refresh_url = refresh_url + self.next_url = next_url + self.total = total + self.matched = matched + self.refresh_cursor = refresh_cursor + self.next_cursor = next_cursor @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'ProviderPrivateAuthenticationOAuth2PasswordPassword': - """Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Pagination': + """Initialize a Pagination object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - if (value := _dict.get('value')) is not None: - args['value'] = value + if (refresh_url := _dict.get('refresh_url')) is not None: + args['refresh_url'] = refresh_url + else: + raise ValueError( + 'Required property \'refresh_url\' not present in Pagination JSON' + ) + if (next_url := _dict.get('next_url')) is not None: + args['next_url'] = next_url + if (total := _dict.get('total')) is not None: + args['total'] = total + if (matched := _dict.get('matched')) is not None: + args['matched'] = matched + if (refresh_cursor := _dict.get('refresh_cursor')) is not None: + args['refresh_cursor'] = refresh_cursor + if (next_cursor := _dict.get('next_cursor')) is not None: + args['next_cursor'] = next_cursor return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object from a json dictionary.""" + """Initialize a Pagination object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'refresh_url') and self.refresh_url is not None: + _dict['refresh_url'] = self.refresh_url + if hasattr(self, 'next_url') and self.next_url is not None: + _dict['next_url'] = self.next_url + if hasattr(self, 'total') and self.total is not None: + _dict['total'] = self.total + if hasattr(self, 'matched') and self.matched is not None: + _dict['matched'] = self.matched + if hasattr(self, 'refresh_cursor') and self.refresh_cursor is not None: + _dict['refresh_cursor'] = self.refresh_cursor + if hasattr(self, 'next_cursor') and self.next_cursor is not None: + _dict['next_cursor'] = self.next_cursor return _dict def _to_dict(self): @@ -8843,82 +9172,93 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderPrivateAuthenticationOAuth2PasswordPassword object.""" + """Return a `str` version of this Pagination object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'ProviderPrivateAuthenticationOAuth2PasswordPassword' - ) -> bool: + def __eq__(self, other: 'Pagination') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, other: 'ProviderPrivateAuthenticationOAuth2PasswordPassword' - ) -> bool: + def __ne__(self, other: 'Pagination') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type of property observed in "value". - """ - - VALUE = 'value' - -class ProviderResponse: +class PartialItem: """ - ProviderResponse. + Message response partial item content. - :param str provider_id: (optional) The unique identifier of the provider. - :param ProviderResponseSpecification specification: (optional) The specification - of the provider. + :param str response_type: (optional) The type of response returned by the dialog + node. The specified response type must be supported by the client application or + channel. + :param str text: The text within the partial chunk of the message stream + response. + :param Metadata streaming_metadata: Contains meta-information about the item(s) + being streamed. """ def __init__( self, + text: str, + streaming_metadata: 'Metadata', *, - provider_id: Optional[str] = None, - specification: Optional['ProviderResponseSpecification'] = None, + response_type: Optional[str] = None, ) -> None: """ - Initialize a ProviderResponse object. + Initialize a PartialItem object. - :param str provider_id: (optional) The unique identifier of the provider. - :param ProviderResponseSpecification specification: (optional) The - specification of the provider. + :param str text: The text within the partial chunk of the message stream + response. + :param Metadata streaming_metadata: Contains meta-information about the + item(s) being streamed. + :param str response_type: (optional) The type of response returned by the + dialog node. The specified response type must be supported by the client + application or channel. """ - self.provider_id = provider_id - self.specification = specification + self.response_type = response_type + self.text = text + self.streaming_metadata = streaming_metadata @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderResponse': - """Initialize a ProviderResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PartialItem': + """Initialize a PartialItem object from a json dictionary.""" args = {} - if (provider_id := _dict.get('provider_id')) is not None: - args['provider_id'] = provider_id - if (specification := _dict.get('specification')) is not None: - args['specification'] = ProviderResponseSpecification.from_dict( - specification) + if (response_type := _dict.get('response_type')) is not None: + args['response_type'] = response_type + if (text := _dict.get('text')) is not None: + args['text'] = text + else: + raise ValueError( + 'Required property \'text\' not present in PartialItem JSON') + if (streaming_metadata := _dict.get('streaming_metadata')) is not None: + args['streaming_metadata'] = Metadata.from_dict(streaming_metadata) + else: + raise ValueError( + 'Required property \'streaming_metadata\' not present in PartialItem JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderResponse object from a json dictionary.""" + """Initialize a PartialItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'provider_id') and self.provider_id is not None: - _dict['provider_id'] = self.provider_id - if hasattr(self, 'specification') and self.specification is not None: - if isinstance(self.specification, dict): - _dict['specification'] = self.specification + if hasattr(self, 'response_type') and self.response_type is not None: + _dict['response_type'] = self.response_type + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr( + self, + 'streaming_metadata') and self.streaming_metadata is not None: + if isinstance(self.streaming_metadata, dict): + _dict['streaming_metadata'] = self.streaming_metadata else: - _dict['specification'] = self.specification.to_dict() + _dict['streaming_metadata'] = self.streaming_metadata.to_dict() return _dict def _to_dict(self): @@ -8926,86 +9266,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponse object.""" + """Return a `str` version of this PartialItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderResponse') -> bool: + def __eq__(self, other: 'PartialItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderResponse') -> bool: + def __ne__(self, other: 'PartialItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderResponseSpecification: +class ProviderAuthenticationOAuth2: """ - The specification of the provider. + Non-private settings for oauth2 authentication. - :param List[ProviderResponseSpecificationServersItem] servers: (optional) An - array of objects defining all endpoints of the provider. - **Note:** Multiple array items are reserved for future use. - :param ProviderResponseSpecificationComponents components: (optional) An object - defining various reusable definitions of the provider. + :param str preferred_flow: (optional) The preferred "flow" or "grant type" for + the API client to fetch an access token from the authorization server. + :param ProviderAuthenticationOAuth2Flows flows: (optional) Scenarios performed + by the API client to fetch an access token from the authorization server. """ def __init__( self, *, - servers: Optional[ - List['ProviderResponseSpecificationServersItem']] = None, - components: Optional['ProviderResponseSpecificationComponents'] = None, + preferred_flow: Optional[str] = None, + flows: Optional['ProviderAuthenticationOAuth2Flows'] = None, ) -> None: """ - Initialize a ProviderResponseSpecification object. + Initialize a ProviderAuthenticationOAuth2 object. - :param List[ProviderResponseSpecificationServersItem] servers: (optional) - An array of objects defining all endpoints of the provider. - **Note:** Multiple array items are reserved for future use. - :param ProviderResponseSpecificationComponents components: (optional) An - object defining various reusable definitions of the provider. + :param str preferred_flow: (optional) The preferred "flow" or "grant type" + for the API client to fetch an access token from the authorization server. + :param ProviderAuthenticationOAuth2Flows flows: (optional) Scenarios + performed by the API client to fetch an access token from the authorization + server. """ - self.servers = servers - self.components = components + self.preferred_flow = preferred_flow + self.flows = flows @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderResponseSpecification': - """Initialize a ProviderResponseSpecification object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderAuthenticationOAuth2': + """Initialize a ProviderAuthenticationOAuth2 object from a json dictionary.""" args = {} - if (servers := _dict.get('servers')) is not None: - args['servers'] = [ - ProviderResponseSpecificationServersItem.from_dict(v) - for v in servers - ] - if (components := _dict.get('components')) is not None: - args[ - 'components'] = ProviderResponseSpecificationComponents.from_dict( - components) + if (preferred_flow := _dict.get('preferred_flow')) is not None: + args['preferred_flow'] = preferred_flow + if (flows := _dict.get('flows')) is not None: + args['flows'] = flows return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderResponseSpecification object from a json dictionary.""" + """Initialize a ProviderAuthenticationOAuth2 object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'servers') and self.servers is not None: - servers_list = [] - for v in self.servers: - if isinstance(v, dict): - servers_list.append(v) - else: - servers_list.append(v.to_dict()) - _dict['servers'] = servers_list - if hasattr(self, 'components') and self.components is not None: - if isinstance(self.components, dict): - _dict['components'] = self.components + if hasattr(self, 'preferred_flow') and self.preferred_flow is not None: + _dict['preferred_flow'] = self.preferred_flow + if hasattr(self, 'flows') and self.flows is not None: + if isinstance(self.flows, dict): + _dict['flows'] = self.flows else: - _dict['components'] = self.components.to_dict() + _dict['flows'] = self.flows.to_dict() return _dict def _to_dict(self): @@ -9013,68 +9340,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponseSpecification object.""" + """Return a `str` version of this ProviderAuthenticationOAuth2 object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderResponseSpecification') -> bool: + def __eq__(self, other: 'ProviderAuthenticationOAuth2') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderResponseSpecification') -> bool: + def __ne__(self, other: 'ProviderAuthenticationOAuth2') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class PreferredFlowEnum(str, Enum): + """ + The preferred "flow" or "grant type" for the API client to fetch an access token + from the authorization server. + """ + + PASSWORD = 'password' + CLIENT_CREDENTIALS = 'client_credentials' + AUTHORIZATION_CODE = 'authorization_code' + CUSTOM_FLOW_NAME = '<$custom_flow_name>' + -class ProviderResponseSpecificationComponents: +class ProviderAuthenticationOAuth2Flows: """ - An object defining various reusable definitions of the provider. + Scenarios performed by the API client to fetch an access token from the authorization + server. - :param ProviderResponseSpecificationComponentsSecuritySchemes security_schemes: - (optional) The definition of the security scheme for the provider. + """ + + def __init__(self,) -> None: + """ + Initialize a ProviderAuthenticationOAuth2Flows object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password', + 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials', + 'ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode' + ])) + raise Exception(msg) + + +class ProviderAuthenticationOAuth2PasswordUsername: + """ + The username for oauth2 authentication when the preferred flow is "password". + + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ def __init__( self, *, - security_schemes: Optional[ - 'ProviderResponseSpecificationComponentsSecuritySchemes'] = None, + type: Optional[str] = None, + value: Optional[str] = None, ) -> None: """ - Initialize a ProviderResponseSpecificationComponents object. + Initialize a ProviderAuthenticationOAuth2PasswordUsername object. - :param ProviderResponseSpecificationComponentsSecuritySchemes - security_schemes: (optional) The definition of the security scheme for the - provider. + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ - self.security_schemes = security_schemes + self.type = type + self.value = value @classmethod - def from_dict(cls, - _dict: Dict) -> 'ProviderResponseSpecificationComponents': - """Initialize a ProviderResponseSpecificationComponents object from a json dictionary.""" + def from_dict( + cls, _dict: Dict) -> 'ProviderAuthenticationOAuth2PasswordUsername': + """Initialize a ProviderAuthenticationOAuth2PasswordUsername object from a json dictionary.""" args = {} - if (security_schemes := _dict.get('securitySchemes')) is not None: - args[ - 'security_schemes'] = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict( - security_schemes) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (value := _dict.get('value')) is not None: + args['value'] = value return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderResponseSpecificationComponents object from a json dictionary.""" + """Initialize a ProviderAuthenticationOAuth2PasswordUsername object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, - 'security_schemes') and self.security_schemes is not None: - if isinstance(self.security_schemes, dict): - _dict['securitySchemes'] = self.security_schemes - else: - _dict['securitySchemes'] = self.security_schemes.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -9082,93 +9439,74 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponseSpecificationComponents object.""" + """Return a `str` version of this ProviderAuthenticationOAuth2PasswordUsername object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderResponseSpecificationComponents') -> bool: + def __eq__(self, + other: 'ProviderAuthenticationOAuth2PasswordUsername') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderResponseSpecificationComponents') -> bool: + def __ne__(self, + other: 'ProviderAuthenticationOAuth2PasswordUsername') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of property observed in "value". + """ -class ProviderResponseSpecificationComponentsSecuritySchemes: + VALUE = 'value' + + +class ProviderAuthenticationTypeAndValue: """ - The definition of the security scheme for the provider. + ProviderAuthenticationTypeAndValue. - :param str authentication_method: (optional) The authentication method required - for requests made from watsonx Assistant to the conversational skill provider. - :param ProviderResponseSpecificationComponentsSecuritySchemesBasic basic: - (optional) Non-private settings for basic access authentication. - :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings for - oauth2 authentication. + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ def __init__( self, *, - authentication_method: Optional[str] = None, - basic: Optional[ - 'ProviderResponseSpecificationComponentsSecuritySchemesBasic'] = None, - oauth2: Optional['ProviderAuthenticationOAuth2'] = None, + type: Optional[str] = None, + value: Optional[str] = None, ) -> None: """ - Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object. + Initialize a ProviderAuthenticationTypeAndValue object. - :param str authentication_method: (optional) The authentication method - required for requests made from watsonx Assistant to the conversational - skill provider. - :param ProviderResponseSpecificationComponentsSecuritySchemesBasic basic: - (optional) Non-private settings for basic access authentication. - :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings - for oauth2 authentication. + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ - self.authentication_method = authentication_method - self.basic = basic - self.oauth2 = oauth2 + self.type = type + self.value = value @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'ProviderResponseSpecificationComponentsSecuritySchemes': - """Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderAuthenticationTypeAndValue': + """Initialize a ProviderAuthenticationTypeAndValue object from a json dictionary.""" args = {} - if (authentication_method := - _dict.get('authentication_method')) is not None: - args['authentication_method'] = authentication_method - if (basic := _dict.get('basic')) is not None: - args[ - 'basic'] = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict( - basic) - if (oauth2 := _dict.get('oauth2')) is not None: - args['oauth2'] = ProviderAuthenticationOAuth2.from_dict(oauth2) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (value := _dict.get('value')) is not None: + args['value'] = value return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object from a json dictionary.""" + """Initialize a ProviderAuthenticationTypeAndValue object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'authentication_method' - ) and self.authentication_method is not None: - _dict['authentication_method'] = self.authentication_method - if hasattr(self, 'basic') and self.basic is not None: - if isinstance(self.basic, dict): - _dict['basic'] = self.basic - else: - _dict['basic'] = self.basic.to_dict() - if hasattr(self, 'oauth2') and self.oauth2 is not None: - if isinstance(self.oauth2, dict): - _dict['oauth2'] = self.oauth2 - else: - _dict['oauth2'] = self.oauth2.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -9176,81 +9514,100 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponseSpecificationComponentsSecuritySchemes object.""" + """Return a `str` version of this ProviderAuthenticationTypeAndValue object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'ProviderResponseSpecificationComponentsSecuritySchemes' - ) -> bool: + def __eq__(self, other: 'ProviderAuthenticationTypeAndValue') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, other: 'ProviderResponseSpecificationComponentsSecuritySchemes' - ) -> bool: + def __ne__(self, other: 'ProviderAuthenticationTypeAndValue') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationMethodEnum(str, Enum): + class TypeEnum(str, Enum): """ - The authentication method required for requests made from watsonx Assistant to the - conversational skill provider. + The type of property observed in "value". """ - BASIC = 'basic' - BEARER = 'bearer' - API_KEY = 'api_key' - OAUTH2 = 'oauth2' - NONE = 'none' + VALUE = 'value' -class ProviderResponseSpecificationComponentsSecuritySchemesBasic: +class ProviderCollection: """ - Non-private settings for basic access authentication. + ProviderCollection. - :param ProviderAuthenticationTypeAndValue username: (optional) The username for - basic access authentication. + :param List[ProviderResponse] conversational_skill_providers: An array of + objects describing the conversational skill providers associated with the + instance. + :param Pagination pagination: The pagination data for the returned objects. For + more information about using pagination, see [Pagination](#pagination). """ def __init__( self, - *, - username: Optional['ProviderAuthenticationTypeAndValue'] = None, + conversational_skill_providers: List['ProviderResponse'], + pagination: 'Pagination', ) -> None: """ - Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object. + Initialize a ProviderCollection object. - :param ProviderAuthenticationTypeAndValue username: (optional) The username - for basic access authentication. + :param List[ProviderResponse] conversational_skill_providers: An array of + objects describing the conversational skill providers associated with the + instance. + :param Pagination pagination: The pagination data for the returned objects. + For more information about using pagination, see [Pagination](#pagination). """ - self.username = username + self.conversational_skill_providers = conversational_skill_providers + self.pagination = pagination @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'ProviderResponseSpecificationComponentsSecuritySchemesBasic': - """Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderCollection': + """Initialize a ProviderCollection object from a json dictionary.""" args = {} - if (username := _dict.get('username')) is not None: - args['username'] = ProviderAuthenticationTypeAndValue.from_dict( - username) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'username') and self.username is not None: - if isinstance(self.username, dict): - _dict['username'] = self.username + if (conversational_skill_providers := + _dict.get('conversational_skill_providers')) is not None: + args['conversational_skill_providers'] = [ + ProviderResponse.from_dict(v) + for v in conversational_skill_providers + ] + else: + raise ValueError( + 'Required property \'conversational_skill_providers\' not present in ProviderCollection JSON' + ) + if (pagination := _dict.get('pagination')) is not None: + args['pagination'] = Pagination.from_dict(pagination) + else: + raise ValueError( + 'Required property \'pagination\' not present in ProviderCollection JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ProviderCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'conversational_skill_providers' + ) and self.conversational_skill_providers is not None: + conversational_skill_providers_list = [] + for v in self.conversational_skill_providers: + if isinstance(v, dict): + conversational_skill_providers_list.append(v) + else: + conversational_skill_providers_list.append(v.to_dict()) + _dict[ + 'conversational_skill_providers'] = conversational_skill_providers_list + if hasattr(self, 'pagination') and self.pagination is not None: + if isinstance(self.pagination, dict): + _dict['pagination'] = self.pagination else: - _dict['username'] = self.username.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict def _to_dict(self): @@ -9258,64 +9615,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponseSpecificationComponentsSecuritySchemesBasic object.""" + """Return a `str` version of this ProviderCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'ProviderResponseSpecificationComponentsSecuritySchemesBasic' - ) -> bool: + def __eq__(self, other: 'ProviderCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, - other: 'ProviderResponseSpecificationComponentsSecuritySchemesBasic' - ) -> bool: + def __ne__(self, other: 'ProviderCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderResponseSpecificationServersItem: +class ProviderPrivate: """ - ProviderResponseSpecificationServersItem. + Private information of the provider. - :param str url: (optional) The URL of the conversational skill provider. + :param ProviderPrivateAuthentication authentication: Private authentication + information of the provider. """ def __init__( self, - *, - url: Optional[str] = None, + authentication: 'ProviderPrivateAuthentication', ) -> None: """ - Initialize a ProviderResponseSpecificationServersItem object. + Initialize a ProviderPrivate object. - :param str url: (optional) The URL of the conversational skill provider. + :param ProviderPrivateAuthentication authentication: Private authentication + information of the provider. """ - self.url = url + self.authentication = authentication @classmethod - def from_dict(cls, - _dict: Dict) -> 'ProviderResponseSpecificationServersItem': - """Initialize a ProviderResponseSpecificationServersItem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderPrivate': + """Initialize a ProviderPrivate object from a json dictionary.""" args = {} - if (url := _dict.get('url')) is not None: - args['url'] = url + if (authentication := _dict.get('authentication')) is not None: + args['authentication'] = authentication + else: + raise ValueError( + 'Required property \'authentication\' not present in ProviderPrivate JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderResponseSpecificationServersItem object from a json dictionary.""" + """Initialize a ProviderPrivate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url + if hasattr(self, 'authentication') and self.authentication is not None: + if isinstance(self.authentication, dict): + _dict['authentication'] = self.authentication + else: + _dict['authentication'] = self.authentication.to_dict() return _dict def _to_dict(self): @@ -9323,87 +9681,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderResponseSpecificationServersItem object.""" + """Return a `str` version of this ProviderPrivate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderResponseSpecificationServersItem') -> bool: + def __eq__(self, other: 'ProviderPrivate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderResponseSpecificationServersItem') -> bool: + def __ne__(self, other: 'ProviderPrivate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderSpecification: +class ProviderPrivateAuthentication: """ - The specification of the provider. + Private authentication information of the provider. + + """ + + def __init__(self,) -> None: + """ + Initialize a ProviderPrivateAuthentication object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'ProviderPrivateAuthenticationBearerFlow', + 'ProviderPrivateAuthenticationBasicFlow', + 'ProviderPrivateAuthenticationOAuth2Flow' + ])) + raise Exception(msg) + + +class ProviderPrivateAuthenticationOAuth2FlowFlows: + """ + Scenarios performed by the API client to fetch an access token from the authorization + server. - :param List[ProviderSpecificationServersItem] servers: An array of objects - defining all endpoints of the provider. - **Note:** Multiple array items are reserved for future use. - :param ProviderSpecificationComponents components: (optional) An object defining - various reusable definitions of the provider. + """ + + def __init__(self,) -> None: + """ + Initialize a ProviderPrivateAuthenticationOAuth2FlowFlows object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password', + 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials', + 'ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode' + ])) + raise Exception(msg) + + +class ProviderPrivateAuthenticationOAuth2PasswordPassword: + """ + The password for oauth2 authentication when the preferred flow is "password". + + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ def __init__( self, - servers: List['ProviderSpecificationServersItem'], *, - components: Optional['ProviderSpecificationComponents'] = None, + type: Optional[str] = None, + value: Optional[str] = None, ) -> None: """ - Initialize a ProviderSpecification object. + Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object. - :param List[ProviderSpecificationServersItem] servers: An array of objects - defining all endpoints of the provider. - **Note:** Multiple array items are reserved for future use. - :param ProviderSpecificationComponents components: (optional) An object - defining various reusable definitions of the provider. + :param str type: (optional) The type of property observed in "value". + :param str value: (optional) The stored information of the value. """ - self.servers = servers - self.components = components + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderSpecification': - """Initialize a ProviderSpecification object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'ProviderPrivateAuthenticationOAuth2PasswordPassword': + """Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object from a json dictionary.""" args = {} - if (servers := _dict.get('servers')) is not None: - args['servers'] = [ - ProviderSpecificationServersItem.from_dict(v) for v in servers - ] - else: - raise ValueError( - 'Required property \'servers\' not present in ProviderSpecification JSON' - ) - if (components := _dict.get('components')) is not None: - args['components'] = ProviderSpecificationComponents.from_dict( - components) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (value := _dict.get('value')) is not None: + args['value'] = value return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderSpecification object from a json dictionary.""" + """Initialize a ProviderPrivateAuthenticationOAuth2PasswordPassword object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'servers') and self.servers is not None: - servers_list = [] - for v in self.servers: - if isinstance(v, dict): - servers_list.append(v) - else: - servers_list.append(v.to_dict()) - _dict['servers'] = servers_list - if hasattr(self, 'components') and self.components is not None: - if isinstance(self.components, dict): - _dict['components'] = self.components - else: - _dict['components'] = self.components.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -9411,55 +9790,227 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderSpecification object.""" + """Return a `str` version of this ProviderPrivateAuthenticationOAuth2PasswordPassword object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderSpecification') -> bool: + def __eq__( + self, other: 'ProviderPrivateAuthenticationOAuth2PasswordPassword' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderSpecification') -> bool: + def __ne__( + self, other: 'ProviderPrivateAuthenticationOAuth2PasswordPassword' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of property observed in "value". + """ + + VALUE = 'value' -class ProviderSpecificationComponents: + +class ProviderResponse: """ - An object defining various reusable definitions of the provider. + ProviderResponse. - :param ProviderSpecificationComponentsSecuritySchemes security_schemes: - (optional) The definition of the security scheme for the provider. + :param str provider_id: (optional) The unique identifier of the provider. + :param ProviderResponseSpecification specification: (optional) The specification + of the provider. """ def __init__( self, *, - security_schemes: Optional[ - 'ProviderSpecificationComponentsSecuritySchemes'] = None, + provider_id: Optional[str] = None, + specification: Optional['ProviderResponseSpecification'] = None, ) -> None: """ - Initialize a ProviderSpecificationComponents object. + Initialize a ProviderResponse object. - :param ProviderSpecificationComponentsSecuritySchemes security_schemes: - (optional) The definition of the security scheme for the provider. + :param str provider_id: (optional) The unique identifier of the provider. + :param ProviderResponseSpecification specification: (optional) The + specification of the provider. """ - self.security_schemes = security_schemes + self.provider_id = provider_id + self.specification = specification @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderSpecificationComponents': - """Initialize a ProviderSpecificationComponents object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderResponse': + """Initialize a ProviderResponse object from a json dictionary.""" args = {} - if (security_schemes := _dict.get('securitySchemes')) is not None: - args[ - 'security_schemes'] = ProviderSpecificationComponentsSecuritySchemes.from_dict( - security_schemes) - return cls(**args) + if (provider_id := _dict.get('provider_id')) is not None: + args['provider_id'] = provider_id + if (specification := _dict.get('specification')) is not None: + args['specification'] = ProviderResponseSpecification.from_dict( + specification) + return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderSpecificationComponents object from a json dictionary.""" + """Initialize a ProviderResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'provider_id') and self.provider_id is not None: + _dict['provider_id'] = self.provider_id + if hasattr(self, 'specification') and self.specification is not None: + if isinstance(self.specification, dict): + _dict['specification'] = self.specification + else: + _dict['specification'] = self.specification.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ProviderResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ProviderResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ProviderResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ProviderResponseSpecification: + """ + The specification of the provider. + + :param List[ProviderResponseSpecificationServersItem] servers: (optional) An + array of objects defining all endpoints of the provider. + **Note:** Multiple array items are reserved for future use. + :param ProviderResponseSpecificationComponents components: (optional) An object + defining various reusable definitions of the provider. + """ + + def __init__( + self, + *, + servers: Optional[ + List['ProviderResponseSpecificationServersItem']] = None, + components: Optional['ProviderResponseSpecificationComponents'] = None, + ) -> None: + """ + Initialize a ProviderResponseSpecification object. + + :param List[ProviderResponseSpecificationServersItem] servers: (optional) + An array of objects defining all endpoints of the provider. + **Note:** Multiple array items are reserved for future use. + :param ProviderResponseSpecificationComponents components: (optional) An + object defining various reusable definitions of the provider. + """ + self.servers = servers + self.components = components + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ProviderResponseSpecification': + """Initialize a ProviderResponseSpecification object from a json dictionary.""" + args = {} + if (servers := _dict.get('servers')) is not None: + args['servers'] = [ + ProviderResponseSpecificationServersItem.from_dict(v) + for v in servers + ] + if (components := _dict.get('components')) is not None: + args[ + 'components'] = ProviderResponseSpecificationComponents.from_dict( + components) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ProviderResponseSpecification object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'servers') and self.servers is not None: + servers_list = [] + for v in self.servers: + if isinstance(v, dict): + servers_list.append(v) + else: + servers_list.append(v.to_dict()) + _dict['servers'] = servers_list + if hasattr(self, 'components') and self.components is not None: + if isinstance(self.components, dict): + _dict['components'] = self.components + else: + _dict['components'] = self.components.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ProviderResponseSpecification object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ProviderResponseSpecification') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ProviderResponseSpecification') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ProviderResponseSpecificationComponents: + """ + An object defining various reusable definitions of the provider. + + :param ProviderResponseSpecificationComponentsSecuritySchemes security_schemes: + (optional) The definition of the security scheme for the provider. + """ + + def __init__( + self, + *, + security_schemes: Optional[ + 'ProviderResponseSpecificationComponentsSecuritySchemes'] = None, + ) -> None: + """ + Initialize a ProviderResponseSpecificationComponents object. + + :param ProviderResponseSpecificationComponentsSecuritySchemes + security_schemes: (optional) The definition of the security scheme for the + provider. + """ + self.security_schemes = security_schemes + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'ProviderResponseSpecificationComponents': + """Initialize a ProviderResponseSpecificationComponents object from a json dictionary.""" + args = {} + if (security_schemes := _dict.get('securitySchemes')) is not None: + args[ + 'security_schemes'] = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict( + security_schemes) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ProviderResponseSpecificationComponents object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -9478,28 +10029,28 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderSpecificationComponents object.""" + """Return a `str` version of this ProviderResponseSpecificationComponents object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderSpecificationComponents') -> bool: + def __eq__(self, other: 'ProviderResponseSpecificationComponents') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderSpecificationComponents') -> bool: + def __ne__(self, other: 'ProviderResponseSpecificationComponents') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderSpecificationComponentsSecuritySchemes: +class ProviderResponseSpecificationComponentsSecuritySchemes: """ The definition of the security scheme for the provider. :param str authentication_method: (optional) The authentication method required for requests made from watsonx Assistant to the conversational skill provider. - :param ProviderSpecificationComponentsSecuritySchemesBasic basic: (optional) - Non-private settings for basic access authentication. + :param ProviderResponseSpecificationComponentsSecuritySchemesBasic basic: + (optional) Non-private settings for basic access authentication. :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings for oauth2 authentication. """ @@ -9509,16 +10060,16 @@ def __init__( *, authentication_method: Optional[str] = None, basic: Optional[ - 'ProviderSpecificationComponentsSecuritySchemesBasic'] = None, + 'ProviderResponseSpecificationComponentsSecuritySchemesBasic'] = None, oauth2: Optional['ProviderAuthenticationOAuth2'] = None, ) -> None: """ - Initialize a ProviderSpecificationComponentsSecuritySchemes object. + Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object. :param str authentication_method: (optional) The authentication method required for requests made from watsonx Assistant to the conversational skill provider. - :param ProviderSpecificationComponentsSecuritySchemesBasic basic: + :param ProviderResponseSpecificationComponentsSecuritySchemesBasic basic: (optional) Non-private settings for basic access authentication. :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings for oauth2 authentication. @@ -9529,16 +10080,16 @@ def __init__( @classmethod def from_dict( - cls, - _dict: Dict) -> 'ProviderSpecificationComponentsSecuritySchemes': - """Initialize a ProviderSpecificationComponentsSecuritySchemes object from a json dictionary.""" + cls, _dict: Dict + ) -> 'ProviderResponseSpecificationComponentsSecuritySchemes': + """Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object from a json dictionary.""" args = {} if (authentication_method := _dict.get('authentication_method')) is not None: args['authentication_method'] = authentication_method if (basic := _dict.get('basic')) is not None: args[ - 'basic'] = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict( + 'basic'] = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict( basic) if (oauth2 := _dict.get('oauth2')) is not None: args['oauth2'] = ProviderAuthenticationOAuth2.from_dict(oauth2) @@ -9546,7 +10097,7 @@ def from_dict( @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderSpecificationComponentsSecuritySchemes object from a json dictionary.""" + """Initialize a ProviderResponseSpecificationComponentsSecuritySchemes object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -9572,18 +10123,20 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderSpecificationComponentsSecuritySchemes object.""" + """Return a `str` version of this ProviderResponseSpecificationComponentsSecuritySchemes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'ProviderSpecificationComponentsSecuritySchemes') -> bool: + def __eq__( + self, other: 'ProviderResponseSpecificationComponentsSecuritySchemes' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, - other: 'ProviderSpecificationComponentsSecuritySchemes') -> bool: + def __ne__( + self, other: 'ProviderResponseSpecificationComponentsSecuritySchemes' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -9600,7 +10153,7 @@ class AuthenticationMethodEnum(str, Enum): NONE = 'none' -class ProviderSpecificationComponentsSecuritySchemesBasic: +class ProviderResponseSpecificationComponentsSecuritySchemesBasic: """ Non-private settings for basic access authentication. @@ -9614,7 +10167,7 @@ def __init__( username: Optional['ProviderAuthenticationTypeAndValue'] = None, ) -> None: """ - Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object. + Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object. :param ProviderAuthenticationTypeAndValue username: (optional) The username for basic access authentication. @@ -9623,9 +10176,9 @@ def __init__( @classmethod def from_dict( - cls, _dict: Dict - ) -> 'ProviderSpecificationComponentsSecuritySchemesBasic': - """Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" + cls, _dict: Dict + ) -> 'ProviderResponseSpecificationComponentsSecuritySchemesBasic': + """Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" args = {} if (username := _dict.get('username')) is not None: args['username'] = ProviderAuthenticationTypeAndValue.from_dict( @@ -9634,7 +10187,7 @@ def from_dict( @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" + """Initialize a ProviderResponseSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -9652,11 +10205,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderSpecificationComponentsSecuritySchemesBasic object.""" + """Return a `str` version of this ProviderResponseSpecificationComponentsSecuritySchemesBasic object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: 'ProviderSpecificationComponentsSecuritySchemesBasic' + self, + other: 'ProviderResponseSpecificationComponentsSecuritySchemesBasic' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -9664,15 +10218,16 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: 'ProviderSpecificationComponentsSecuritySchemesBasic' + self, + other: 'ProviderResponseSpecificationComponentsSecuritySchemesBasic' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderSpecificationServersItem: +class ProviderResponseSpecificationServersItem: """ - ProviderSpecificationServersItem. + ProviderResponseSpecificationServersItem. :param str url: (optional) The URL of the conversational skill provider. """ @@ -9683,15 +10238,16 @@ def __init__( url: Optional[str] = None, ) -> None: """ - Initialize a ProviderSpecificationServersItem object. + Initialize a ProviderResponseSpecificationServersItem object. :param str url: (optional) The URL of the conversational skill provider. """ self.url = url @classmethod - def from_dict(cls, _dict: Dict) -> 'ProviderSpecificationServersItem': - """Initialize a ProviderSpecificationServersItem object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'ProviderResponseSpecificationServersItem': + """Initialize a ProviderResponseSpecificationServersItem object from a json dictionary.""" args = {} if (url := _dict.get('url')) is not None: args['url'] = url @@ -9699,7 +10255,7 @@ def from_dict(cls, _dict: Dict) -> 'ProviderSpecificationServersItem': @classmethod def _from_dict(cls, _dict): - """Initialize a ProviderSpecificationServersItem object from a json dictionary.""" + """Initialize a ProviderResponseSpecificationServersItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -9714,120 +10270,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProviderSpecificationServersItem object.""" + """Return a `str` version of this ProviderResponseSpecificationServersItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProviderSpecificationServersItem') -> bool: + def __eq__(self, other: 'ProviderResponseSpecificationServersItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProviderSpecificationServersItem') -> bool: + def __ne__(self, other: 'ProviderResponseSpecificationServersItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Release: +class ProviderSpecification: """ - Release. + The specification of the provider. - :param str release: (optional) The name of the release. The name is the version - number (an integer), returned as a string. - :param str description: (optional) The description of the release. - :param List[EnvironmentReference] environment_references: (optional) An array of - objects describing the environments where this release has been deployed. - :param ReleaseContent content: (optional) An object identifying the versionable - content objects (such as skill snapshots) that are included in the release. - :param str status: (optional) The current status of the release: - - **Available**: The release is available for deployment. - - **Failed**: An asynchronous publish operation has failed. - - **Processing**: An asynchronous publish operation has not yet completed. - :param datetime created: (optional) The timestamp for creation of the object. - :param datetime updated: (optional) The timestamp for the most recent update to - the object. + :param List[ProviderSpecificationServersItem] servers: An array of objects + defining all endpoints of the provider. + **Note:** Multiple array items are reserved for future use. + :param ProviderSpecificationComponents components: (optional) An object defining + various reusable definitions of the provider. """ def __init__( self, + servers: List['ProviderSpecificationServersItem'], *, - release: Optional[str] = None, - description: Optional[str] = None, - environment_references: Optional[List['EnvironmentReference']] = None, - content: Optional['ReleaseContent'] = None, - status: Optional[str] = None, - created: Optional[datetime] = None, - updated: Optional[datetime] = None, + components: Optional['ProviderSpecificationComponents'] = None, ) -> None: """ - Initialize a Release object. + Initialize a ProviderSpecification object. - :param str description: (optional) The description of the release. + :param List[ProviderSpecificationServersItem] servers: An array of objects + defining all endpoints of the provider. + **Note:** Multiple array items are reserved for future use. + :param ProviderSpecificationComponents components: (optional) An object + defining various reusable definitions of the provider. """ - self.release = release - self.description = description - self.environment_references = environment_references - self.content = content - self.status = status - self.created = created - self.updated = updated + self.servers = servers + self.components = components @classmethod - def from_dict(cls, _dict: Dict) -> 'Release': - """Initialize a Release object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderSpecification': + """Initialize a ProviderSpecification object from a json dictionary.""" args = {} - if (release := _dict.get('release')) is not None: - args['release'] = release - if (description := _dict.get('description')) is not None: - args['description'] = description - if (environment_references := - _dict.get('environment_references')) is not None: - args['environment_references'] = [ - EnvironmentReference.from_dict(v) - for v in environment_references + if (servers := _dict.get('servers')) is not None: + args['servers'] = [ + ProviderSpecificationServersItem.from_dict(v) for v in servers ] - if (content := _dict.get('content')) is not None: - args['content'] = ReleaseContent.from_dict(content) - if (status := _dict.get('status')) is not None: - args['status'] = status - if (created := _dict.get('created')) is not None: - args['created'] = string_to_datetime(created) - if (updated := _dict.get('updated')) is not None: - args['updated'] = string_to_datetime(updated) + else: + raise ValueError( + 'Required property \'servers\' not present in ProviderSpecification JSON' + ) + if (components := _dict.get('components')) is not None: + args['components'] = ProviderSpecificationComponents.from_dict( + components) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Release object from a json dictionary.""" + """Initialize a ProviderSpecification object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'release') and getattr(self, 'release') is not None: - _dict['release'] = getattr(self, 'release') - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'environment_references') and getattr( - self, 'environment_references') is not None: - environment_references_list = [] - for v in getattr(self, 'environment_references'): + if hasattr(self, 'servers') and self.servers is not None: + servers_list = [] + for v in self.servers: if isinstance(v, dict): - environment_references_list.append(v) + servers_list.append(v) else: - environment_references_list.append(v.to_dict()) - _dict['environment_references'] = environment_references_list - if hasattr(self, 'content') and getattr(self, 'content') is not None: - if isinstance(getattr(self, 'content'), dict): - _dict['content'] = getattr(self, 'content') + servers_list.append(v.to_dict()) + _dict['servers'] = servers_list + if hasattr(self, 'components') and self.components is not None: + if isinstance(self.components, dict): + _dict['components'] = self.components else: - _dict['content'] = getattr(self, 'content').to_dict() - if hasattr(self, 'status') and getattr(self, 'status') is not None: - _dict['status'] = getattr(self, 'status') - if hasattr(self, 'created') and getattr(self, 'created') is not None: - _dict['created'] = datetime_to_string(getattr(self, 'created')) - if hasattr(self, 'updated') and getattr(self, 'updated') is not None: - _dict['updated'] = datetime_to_string(getattr(self, 'updated')) + _dict['components'] = self.components.to_dict() return _dict def _to_dict(self): @@ -9835,97 +10358,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Release object.""" + """Return a `str` version of this ProviderSpecification object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Release') -> bool: + def __eq__(self, other: 'ProviderSpecification') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Release') -> bool: + def __ne__(self, other: 'ProviderSpecification') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The current status of the release: - - **Available**: The release is available for deployment. - - **Failed**: An asynchronous publish operation has failed. - - **Processing**: An asynchronous publish operation has not yet completed. - """ - - AVAILABLE = 'Available' - FAILED = 'Failed' - PROCESSING = 'Processing' - -class ReleaseCollection: +class ProviderSpecificationComponents: """ - ReleaseCollection. + An object defining various reusable definitions of the provider. - :param List[Release] releases: An array of objects describing the releases - associated with an assistant. - :param Pagination pagination: The pagination data for the returned objects. For - more information about using pagination, see [Pagination](#pagination). + :param ProviderSpecificationComponentsSecuritySchemes security_schemes: + (optional) The definition of the security scheme for the provider. """ def __init__( self, - releases: List['Release'], - pagination: 'Pagination', + *, + security_schemes: Optional[ + 'ProviderSpecificationComponentsSecuritySchemes'] = None, ) -> None: """ - Initialize a ReleaseCollection object. + Initialize a ProviderSpecificationComponents object. - :param List[Release] releases: An array of objects describing the releases - associated with an assistant. - :param Pagination pagination: The pagination data for the returned objects. - For more information about using pagination, see [Pagination](#pagination). + :param ProviderSpecificationComponentsSecuritySchemes security_schemes: + (optional) The definition of the security scheme for the provider. """ - self.releases = releases - self.pagination = pagination + self.security_schemes = security_schemes @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseCollection': - """Initialize a ReleaseCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderSpecificationComponents': + """Initialize a ProviderSpecificationComponents object from a json dictionary.""" args = {} - if (releases := _dict.get('releases')) is not None: - args['releases'] = [Release.from_dict(v) for v in releases] - else: - raise ValueError( - 'Required property \'releases\' not present in ReleaseCollection JSON' - ) - if (pagination := _dict.get('pagination')) is not None: - args['pagination'] = Pagination.from_dict(pagination) - else: - raise ValueError( - 'Required property \'pagination\' not present in ReleaseCollection JSON' - ) + if (security_schemes := _dict.get('securitySchemes')) is not None: + args[ + 'security_schemes'] = ProviderSpecificationComponentsSecuritySchemes.from_dict( + security_schemes) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReleaseCollection object from a json dictionary.""" + """Initialize a ProviderSpecificationComponents object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'releases') and self.releases is not None: - releases_list = [] - for v in self.releases: - if isinstance(v, dict): - releases_list.append(v) - else: - releases_list.append(v.to_dict()) - _dict['releases'] = releases_list - if hasattr(self, 'pagination') and self.pagination is not None: - if isinstance(self.pagination, dict): - _dict['pagination'] = self.pagination + if hasattr(self, + 'security_schemes') and self.security_schemes is not None: + if isinstance(self.security_schemes, dict): + _dict['securitySchemes'] = self.security_schemes else: - _dict['pagination'] = self.pagination.to_dict() + _dict['securitySchemes'] = self.security_schemes.to_dict() return _dict def _to_dict(self): @@ -9933,144 +10425,173 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReleaseCollection object.""" + """Return a `str` version of this ProviderSpecificationComponents object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseCollection') -> bool: + def __eq__(self, other: 'ProviderSpecificationComponents') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReleaseCollection') -> bool: + def __ne__(self, other: 'ProviderSpecificationComponents') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReleaseContent: +class ProviderSpecificationComponentsSecuritySchemes: """ - An object identifying the versionable content objects (such as skill snapshots) that - are included in the release. + The definition of the security scheme for the provider. - :param List[ReleaseSkill] skills: (optional) The skill snapshots that are - included in the release. + :param str authentication_method: (optional) The authentication method required + for requests made from watsonx Assistant to the conversational skill provider. + :param ProviderSpecificationComponentsSecuritySchemesBasic basic: (optional) + Non-private settings for basic access authentication. + :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings for + oauth2 authentication. """ def __init__( self, *, - skills: Optional[List['ReleaseSkill']] = None, + authentication_method: Optional[str] = None, + basic: Optional[ + 'ProviderSpecificationComponentsSecuritySchemesBasic'] = None, + oauth2: Optional['ProviderAuthenticationOAuth2'] = None, ) -> None: """ - Initialize a ReleaseContent object. + Initialize a ProviderSpecificationComponentsSecuritySchemes object. + :param str authentication_method: (optional) The authentication method + required for requests made from watsonx Assistant to the conversational + skill provider. + :param ProviderSpecificationComponentsSecuritySchemesBasic basic: + (optional) Non-private settings for basic access authentication. + :param ProviderAuthenticationOAuth2 oauth2: (optional) Non-private settings + for oauth2 authentication. """ - self.skills = skills + self.authentication_method = authentication_method + self.basic = basic + self.oauth2 = oauth2 @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseContent': - """Initialize a ReleaseContent object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'ProviderSpecificationComponentsSecuritySchemes': + """Initialize a ProviderSpecificationComponentsSecuritySchemes object from a json dictionary.""" args = {} - if (skills := _dict.get('skills')) is not None: - args['skills'] = [ReleaseSkill.from_dict(v) for v in skills] + if (authentication_method := + _dict.get('authentication_method')) is not None: + args['authentication_method'] = authentication_method + if (basic := _dict.get('basic')) is not None: + args[ + 'basic'] = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict( + basic) + if (oauth2 := _dict.get('oauth2')) is not None: + args['oauth2'] = ProviderAuthenticationOAuth2.from_dict(oauth2) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReleaseContent object from a json dictionary.""" + """Initialize a ProviderSpecificationComponentsSecuritySchemes object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'skills') and getattr(self, 'skills') is not None: - skills_list = [] - for v in getattr(self, 'skills'): - if isinstance(v, dict): - skills_list.append(v) - else: - skills_list.append(v.to_dict()) - _dict['skills'] = skills_list - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this ReleaseContent object.""" + if hasattr(self, 'authentication_method' + ) and self.authentication_method is not None: + _dict['authentication_method'] = self.authentication_method + if hasattr(self, 'basic') and self.basic is not None: + if isinstance(self.basic, dict): + _dict['basic'] = self.basic + else: + _dict['basic'] = self.basic.to_dict() + if hasattr(self, 'oauth2') and self.oauth2 is not None: + if isinstance(self.oauth2, dict): + _dict['oauth2'] = self.oauth2 + else: + _dict['oauth2'] = self.oauth2.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ProviderSpecificationComponentsSecuritySchemes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseContent') -> bool: + def __eq__(self, + other: 'ProviderSpecificationComponentsSecuritySchemes') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReleaseContent') -> bool: + def __ne__(self, + other: 'ProviderSpecificationComponentsSecuritySchemes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AuthenticationMethodEnum(str, Enum): + """ + The authentication method required for requests made from watsonx Assistant to the + conversational skill provider. + """ + + BASIC = 'basic' + BEARER = 'bearer' + API_KEY = 'api_key' + OAUTH2 = 'oauth2' + NONE = 'none' + -class ReleaseSkill: +class ProviderSpecificationComponentsSecuritySchemesBasic: """ - ReleaseSkill. + Non-private settings for basic access authentication. - :param str skill_id: The skill ID of the skill. - :param str type: (optional) The type of the skill. - :param str snapshot: (optional) The name of the skill snapshot that is saved as - part of the release (for example, `draft` or `1`). + :param ProviderAuthenticationTypeAndValue username: (optional) The username for + basic access authentication. """ def __init__( self, - skill_id: str, *, - type: Optional[str] = None, - snapshot: Optional[str] = None, + username: Optional['ProviderAuthenticationTypeAndValue'] = None, ) -> None: """ - Initialize a ReleaseSkill object. + Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object. - :param str skill_id: The skill ID of the skill. - :param str type: (optional) The type of the skill. - :param str snapshot: (optional) The name of the skill snapshot that is - saved as part of the release (for example, `draft` or `1`). + :param ProviderAuthenticationTypeAndValue username: (optional) The username + for basic access authentication. """ - self.skill_id = skill_id - self.type = type - self.snapshot = snapshot + self.username = username @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseSkill': - """Initialize a ReleaseSkill object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'ProviderSpecificationComponentsSecuritySchemesBasic': + """Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" args = {} - if (skill_id := _dict.get('skill_id')) is not None: - args['skill_id'] = skill_id - else: - raise ValueError( - 'Required property \'skill_id\' not present in ReleaseSkill JSON' - ) - if (type := _dict.get('type')) is not None: - args['type'] = type - if (snapshot := _dict.get('snapshot')) is not None: - args['snapshot'] = snapshot + if (username := _dict.get('username')) is not None: + args['username'] = ProviderAuthenticationTypeAndValue.from_dict( + username) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReleaseSkill object from a json dictionary.""" + """Initialize a ProviderSpecificationComponentsSecuritySchemesBasic object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'skill_id') and self.skill_id is not None: - _dict['skill_id'] = self.skill_id - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'snapshot') and self.snapshot is not None: - _dict['snapshot'] = self.snapshot + if hasattr(self, 'username') and self.username is not None: + if isinstance(self.username, dict): + _dict['username'] = self.username + else: + _dict['username'] = self.username.to_dict() return _dict def _to_dict(self): @@ -10078,89 +10599,61 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReleaseSkill object.""" + """Return a `str` version of this ProviderSpecificationComponentsSecuritySchemesBasic object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseSkill') -> bool: + def __eq__( + self, other: 'ProviderSpecificationComponentsSecuritySchemesBasic' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReleaseSkill') -> bool: + def __ne__( + self, other: 'ProviderSpecificationComponentsSecuritySchemesBasic' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type of the skill. - """ - - DIALOG = 'dialog' - ACTION = 'action' - SEARCH = 'search' - -class RequestAnalytics: +class ProviderSpecificationServersItem: """ - An optional object containing analytics data. Currently, this data is used only for - events sent to the Segment extension. + ProviderSpecificationServersItem. - :param str browser: (optional) The browser that was used to send the message - that triggered the event. - :param str device: (optional) The type of device that was used to send the - message that triggered the event. - :param str page_url: (optional) The URL of the web page that was used to send - the message that triggered the event. + :param str url: (optional) The URL of the conversational skill provider. """ def __init__( self, *, - browser: Optional[str] = None, - device: Optional[str] = None, - page_url: Optional[str] = None, + url: Optional[str] = None, ) -> None: """ - Initialize a RequestAnalytics object. + Initialize a ProviderSpecificationServersItem object. - :param str browser: (optional) The browser that was used to send the - message that triggered the event. - :param str device: (optional) The type of device that was used to send the - message that triggered the event. - :param str page_url: (optional) The URL of the web page that was used to - send the message that triggered the event. + :param str url: (optional) The URL of the conversational skill provider. """ - self.browser = browser - self.device = device - self.page_url = page_url + self.url = url @classmethod - def from_dict(cls, _dict: Dict) -> 'RequestAnalytics': - """Initialize a RequestAnalytics object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProviderSpecificationServersItem': + """Initialize a ProviderSpecificationServersItem object from a json dictionary.""" args = {} - if (browser := _dict.get('browser')) is not None: - args['browser'] = browser - if (device := _dict.get('device')) is not None: - args['device'] = device - if (page_url := _dict.get('pageUrl')) is not None: - args['page_url'] = page_url + if (url := _dict.get('url')) is not None: + args['url'] = url return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RequestAnalytics object from a json dictionary.""" + """Initialize a ProviderSpecificationServersItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'browser') and self.browser is not None: - _dict['browser'] = self.browser - if hasattr(self, 'device') and self.device is not None: - _dict['device'] = self.device - if hasattr(self, 'page_url') and self.page_url is not None: - _dict['pageUrl'] = self.page_url + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url return _dict def _to_dict(self): @@ -10168,253 +10661,218 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RequestAnalytics object.""" + """Return a `str` version of this ProviderSpecificationServersItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RequestAnalytics') -> bool: + def __eq__(self, other: 'ProviderSpecificationServersItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RequestAnalytics') -> bool: + def __ne__(self, other: 'ProviderSpecificationServersItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResponseGenericChannel: +class Release: """ - ResponseGenericChannel. + Release. - :param str channel: (optional) A channel for which the response is intended. + :param str release: (optional) The name of the release. The name is the version + number (an integer), returned as a string. + :param str description: (optional) The description of the release. + :param List[EnvironmentReference] environment_references: (optional) An array of + objects describing the environments where this release has been deployed. + :param ReleaseContent content: (optional) An object identifying the versionable + content objects (such as skill snapshots) that are included in the release. + :param str status: (optional) The current status of the release: + - **Available**: The release is available for deployment. + - **Failed**: An asynchronous publish operation has failed. + - **Processing**: An asynchronous publish operation has not yet completed. + :param datetime created: (optional) The timestamp for creation of the object. + :param datetime updated: (optional) The timestamp for the most recent update to + the object. """ def __init__( self, *, - channel: Optional[str] = None, + release: Optional[str] = None, + description: Optional[str] = None, + environment_references: Optional[List['EnvironmentReference']] = None, + content: Optional['ReleaseContent'] = None, + status: Optional[str] = None, + created: Optional[datetime] = None, + updated: Optional[datetime] = None, ) -> None: """ - Initialize a ResponseGenericChannel object. + Initialize a Release object. - :param str channel: (optional) A channel for which the response is - intended. + :param str description: (optional) The description of the release. """ - self.channel = channel + self.release = release + self.description = description + self.environment_references = environment_references + self.content = content + self.status = status + self.created = created + self.updated = updated @classmethod - def from_dict(cls, _dict: Dict) -> 'ResponseGenericChannel': - """Initialize a ResponseGenericChannel object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Release': + """Initialize a Release object from a json dictionary.""" args = {} - if (channel := _dict.get('channel')) is not None: - args['channel'] = channel + if (release := _dict.get('release')) is not None: + args['release'] = release + if (description := _dict.get('description')) is not None: + args['description'] = description + if (environment_references := + _dict.get('environment_references')) is not None: + args['environment_references'] = [ + EnvironmentReference.from_dict(v) + for v in environment_references + ] + if (content := _dict.get('content')) is not None: + args['content'] = ReleaseContent.from_dict(content) + if (status := _dict.get('status')) is not None: + args['status'] = status + if (created := _dict.get('created')) is not None: + args['created'] = string_to_datetime(created) + if (updated := _dict.get('updated')) is not None: + args['updated'] = string_to_datetime(updated) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResponseGenericChannel object from a json dictionary.""" + """Initialize a Release object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'channel') and self.channel is not None: - _dict['channel'] = self.channel - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this ResponseGenericChannel object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ResponseGenericChannel') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + if hasattr(self, 'release') and getattr(self, 'release') is not None: + _dict['release'] = getattr(self, 'release') + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'environment_references') and getattr( + self, 'environment_references') is not None: + environment_references_list = [] + for v in getattr(self, 'environment_references'): + if isinstance(v, dict): + environment_references_list.append(v) + else: + environment_references_list.append(v.to_dict()) + _dict['environment_references'] = environment_references_list + if hasattr(self, 'content') and getattr(self, 'content') is not None: + if isinstance(getattr(self, 'content'), dict): + _dict['content'] = getattr(self, 'content') + else: + _dict['content'] = getattr(self, 'content').to_dict() + if hasattr(self, 'status') and getattr(self, 'status') is not None: + _dict['status'] = getattr(self, 'status') + if hasattr(self, 'created') and getattr(self, 'created') is not None: + _dict['created'] = datetime_to_string(getattr(self, 'created')) + if hasattr(self, 'updated') and getattr(self, 'updated') is not None: + _dict['updated'] = datetime_to_string(getattr(self, 'updated')) + return _dict - def __ne__(self, other: 'ResponseGenericChannel') -> bool: + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this Release object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'Release') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'Release') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The current status of the release: + - **Available**: The release is available for deployment. + - **Failed**: An asynchronous publish operation has failed. + - **Processing**: An asynchronous publish operation has not yet completed. + """ + + AVAILABLE = 'Available' + FAILED = 'Failed' + PROCESSING = 'Processing' + -class RuntimeEntity: +class ReleaseCollection: """ - The entity value that was recognized in the user input. + ReleaseCollection. - :param str entity: An entity detected in the input. - :param List[int] location: (optional) An array of zero-based character offsets - that indicate where the detected entity values begin and end in the input text. - :param str value: The term in the input text that was recognized as an entity - value. - :param float confidence: (optional) A decimal percentage that represents - confidence in the recognized entity. - :param List[CaptureGroup] groups: (optional) The recognized capture groups for - the entity, as defined by the entity pattern. - :param RuntimeEntityInterpretation interpretation: (optional) An object - containing detailed information about the entity recognized in the user input. - This property is included only if the new system entities are enabled for the - skill. - For more information about how the new system entities are interpreted, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities). - :param List[RuntimeEntityAlternative] alternatives: (optional) An array of - possible alternative values that the user might have intended instead of the - value returned in the **value** property. This property is returned only for - `@sys-time` and `@sys-date` entities when the user's input is ambiguous. - This property is included only if the new system entities are enabled for the - skill. - :param RuntimeEntityRole role: (optional) An object describing the role played - by a system entity that is specifies the beginning or end of a range recognized - in the user input. This property is included only if the new system entities are - enabled for the skill. - :param str skill: (optional) The skill that recognized the entity value. - Currently, the only possible values are `main skill` for the dialog skill (if - enabled) and `actions skill` for the action skill. - This property is present only if the assistant has both a dialog skill and an - action skill. + :param List[Release] releases: An array of objects describing the releases + associated with an assistant. + :param Pagination pagination: The pagination data for the returned objects. For + more information about using pagination, see [Pagination](#pagination). """ def __init__( self, - entity: str, - value: str, - *, - location: Optional[List[int]] = None, - confidence: Optional[float] = None, - groups: Optional[List['CaptureGroup']] = None, - interpretation: Optional['RuntimeEntityInterpretation'] = None, - alternatives: Optional[List['RuntimeEntityAlternative']] = None, - role: Optional['RuntimeEntityRole'] = None, - skill: Optional[str] = None, + releases: List['Release'], + pagination: 'Pagination', ) -> None: """ - Initialize a RuntimeEntity object. + Initialize a ReleaseCollection object. - :param str entity: An entity detected in the input. - :param str value: The term in the input text that was recognized as an - entity value. - :param List[int] location: (optional) An array of zero-based character - offsets that indicate where the detected entity values begin and end in the - input text. - :param float confidence: (optional) A decimal percentage that represents - confidence in the recognized entity. - :param List[CaptureGroup] groups: (optional) The recognized capture groups - for the entity, as defined by the entity pattern. - :param RuntimeEntityInterpretation interpretation: (optional) An object - containing detailed information about the entity recognized in the user - input. This property is included only if the new system entities are - enabled for the skill. - For more information about how the new system entities are interpreted, see - the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities). - :param List[RuntimeEntityAlternative] alternatives: (optional) An array of - possible alternative values that the user might have intended instead of - the value returned in the **value** property. This property is returned - only for `@sys-time` and `@sys-date` entities when the user's input is - ambiguous. - This property is included only if the new system entities are enabled for - the skill. - :param RuntimeEntityRole role: (optional) An object describing the role - played by a system entity that is specifies the beginning or end of a range - recognized in the user input. This property is included only if the new - system entities are enabled for the skill. - :param str skill: (optional) The skill that recognized the entity value. - Currently, the only possible values are `main skill` for the dialog skill - (if enabled) and `actions skill` for the action skill. - This property is present only if the assistant has both a dialog skill and - an action skill. + :param List[Release] releases: An array of objects describing the releases + associated with an assistant. + :param Pagination pagination: The pagination data for the returned objects. + For more information about using pagination, see [Pagination](#pagination). """ - self.entity = entity - self.location = location - self.value = value - self.confidence = confidence - self.groups = groups - self.interpretation = interpretation - self.alternatives = alternatives - self.role = role - self.skill = skill + self.releases = releases + self.pagination = pagination @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntity': - """Initialize a RuntimeEntity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseCollection': + """Initialize a ReleaseCollection object from a json dictionary.""" args = {} - if (entity := _dict.get('entity')) is not None: - args['entity'] = entity + if (releases := _dict.get('releases')) is not None: + args['releases'] = [Release.from_dict(v) for v in releases] else: raise ValueError( - 'Required property \'entity\' not present in RuntimeEntity JSON' + 'Required property \'releases\' not present in ReleaseCollection JSON' ) - if (location := _dict.get('location')) is not None: - args['location'] = location - if (value := _dict.get('value')) is not None: - args['value'] = value + if (pagination := _dict.get('pagination')) is not None: + args['pagination'] = Pagination.from_dict(pagination) else: raise ValueError( - 'Required property \'value\' not present in RuntimeEntity JSON') - if (confidence := _dict.get('confidence')) is not None: - args['confidence'] = confidence - if (groups := _dict.get('groups')) is not None: - args['groups'] = [CaptureGroup.from_dict(v) for v in groups] - if (interpretation := _dict.get('interpretation')) is not None: - args['interpretation'] = RuntimeEntityInterpretation.from_dict( - interpretation) - if (alternatives := _dict.get('alternatives')) is not None: - args['alternatives'] = [ - RuntimeEntityAlternative.from_dict(v) for v in alternatives - ] - if (role := _dict.get('role')) is not None: - args['role'] = RuntimeEntityRole.from_dict(role) - if (skill := _dict.get('skill')) is not None: - args['skill'] = skill + 'Required property \'pagination\' not present in ReleaseCollection JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RuntimeEntity object from a json dictionary.""" + """Initialize a ReleaseCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'entity') and self.entity is not None: - _dict['entity'] = self.entity - if hasattr(self, 'location') and self.location is not None: - _dict['location'] = self.location - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value - if hasattr(self, 'confidence') and self.confidence is not None: - _dict['confidence'] = self.confidence - if hasattr(self, 'groups') and self.groups is not None: - groups_list = [] - for v in self.groups: - if isinstance(v, dict): - groups_list.append(v) - else: - groups_list.append(v.to_dict()) - _dict['groups'] = groups_list - if hasattr(self, 'interpretation') and self.interpretation is not None: - if isinstance(self.interpretation, dict): - _dict['interpretation'] = self.interpretation - else: - _dict['interpretation'] = self.interpretation.to_dict() - if hasattr(self, 'alternatives') and self.alternatives is not None: - alternatives_list = [] - for v in self.alternatives: + if hasattr(self, 'releases') and self.releases is not None: + releases_list = [] + for v in self.releases: if isinstance(v, dict): - alternatives_list.append(v) + releases_list.append(v) else: - alternatives_list.append(v.to_dict()) - _dict['alternatives'] = alternatives_list - if hasattr(self, 'role') and self.role is not None: - if isinstance(self.role, dict): - _dict['role'] = self.role + releases_list.append(v.to_dict()) + _dict['releases'] = releases_list + if hasattr(self, 'pagination') and self.pagination is not None: + if isinstance(self.pagination, dict): + _dict['pagination'] = self.pagination else: - _dict['role'] = self.role.to_dict() - if hasattr(self, 'skill') and self.skill is not None: - _dict['skill'] = self.skill + _dict['pagination'] = self.pagination.to_dict() return _dict def _to_dict(self): @@ -10422,69 +10880,64 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RuntimeEntity object.""" + """Return a `str` version of this ReleaseCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntity') -> bool: + def __eq__(self, other: 'ReleaseCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RuntimeEntity') -> bool: + def __ne__(self, other: 'ReleaseCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeEntityAlternative: +class ReleaseContent: """ - An alternative value for the recognized entity. + An object identifying the versionable content objects (such as skill snapshots) that + are included in the release. - :param str value: (optional) The entity value that was recognized in the user - input. - :param float confidence: (optional) A decimal percentage that represents - confidence in the recognized entity. + :param List[ReleaseSkill] skills: (optional) The skill snapshots that are + included in the release. """ def __init__( self, *, - value: Optional[str] = None, - confidence: Optional[float] = None, + skills: Optional[List['ReleaseSkill']] = None, ) -> None: """ - Initialize a RuntimeEntityAlternative object. + Initialize a ReleaseContent object. - :param str value: (optional) The entity value that was recognized in the - user input. - :param float confidence: (optional) A decimal percentage that represents - confidence in the recognized entity. """ - self.value = value - self.confidence = confidence + self.skills = skills @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntityAlternative': - """Initialize a RuntimeEntityAlternative object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseContent': + """Initialize a ReleaseContent object from a json dictionary.""" args = {} - if (value := _dict.get('value')) is not None: - args['value'] = value - if (confidence := _dict.get('confidence')) is not None: - args['confidence'] = confidence + if (skills := _dict.get('skills')) is not None: + args['skills'] = [ReleaseSkill.from_dict(v) for v in skills] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RuntimeEntityAlternative object from a json dictionary.""" + """Initialize a ReleaseContent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value - if hasattr(self, 'confidence') and self.confidence is not None: - _dict['confidence'] = self.confidence + if hasattr(self, 'skills') and getattr(self, 'skills') is not None: + skills_list = [] + for v in getattr(self, 'skills'): + if isinstance(v, dict): + skills_list.append(v) + else: + skills_list.append(v.to_dict()) + _dict['skills'] = skills_list return _dict def _to_dict(self): @@ -10492,354 +10945,3960 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RuntimeEntityAlternative object.""" + """Return a `str` version of this ReleaseContent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityAlternative') -> bool: + def __eq__(self, other: 'ReleaseContent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RuntimeEntityAlternative') -> bool: + def __ne__(self, other: 'ReleaseContent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeEntityInterpretation: +class ReleaseSkill: """ - RuntimeEntityInterpretation. + ReleaseSkill. - :param str calendar_type: (optional) The calendar used to represent a recognized - date (for example, `Gregorian`). - :param str datetime_link: (optional) A unique identifier used to associate a - recognized time and date. If the user input contains a date and time that are - mentioned together (for example, `Today at 5`, the same **datetime_link** value - is returned for both the `@sys-date` and `@sys-time` entities). - :param str festival: (optional) A locale-specific holiday name (such as - `thanksgiving` or `christmas`). This property is included when a `@sys-date` - entity is recognized based on a holiday name in the user input. - :param str granularity: (optional) The precision or duration of a time range - specified by a recognized `@sys-time` or `@sys-date` entity. - :param str range_link: (optional) A unique identifier used to associate multiple - recognized `@sys-date`, `@sys-time`, or `@sys-number` entities that are - recognized as a range of values in the user's input (for example, `from July 4 - until July 14` or `from 20 to 25`). - :param str range_modifier: (optional) The word in the user input that indicates - that a `sys-date` or `sys-time` entity is part of an implied range where only - one date or time is specified (for example, `since` or `until`). - :param float relative_day: (optional) A recognized mention of a relative day, - represented numerically as an offset from the current date (for example, `-1` - for `yesterday` or `10` for `in ten days`). - :param float relative_month: (optional) A recognized mention of a relative - month, represented numerically as an offset from the current month (for example, - `1` for `next month` or `-3` for `three months ago`). - :param float relative_week: (optional) A recognized mention of a relative week, - represented numerically as an offset from the current week (for example, `2` for - `in two weeks` or `-1` for `last week). - :param float relative_weekend: (optional) A recognized mention of a relative - date range for a weekend, represented numerically as an offset from the current - weekend (for example, `0` for `this weekend` or `-1` for `last weekend`). - :param float relative_year: (optional) A recognized mention of a relative year, - represented numerically as an offset from the current year (for example, `1` for - `next year` or `-5` for `five years ago`). - :param float specific_day: (optional) A recognized mention of a specific date, - represented numerically as the date within the month (for example, `30` for - `June 30`.). - :param str specific_day_of_week: (optional) A recognized mention of a specific - day of the week as a lowercase string (for example, `monday`). - :param float specific_month: (optional) A recognized mention of a specific - month, represented numerically (for example, `7` for `July`). - :param float specific_quarter: (optional) A recognized mention of a specific - quarter, represented numerically (for example, `3` for `the third quarter`). - :param float specific_year: (optional) A recognized mention of a specific year - (for example, `2016`). - :param float numeric_value: (optional) A recognized numeric value, represented - as an integer or double. - :param str subtype: (optional) The type of numeric value recognized in the user - input (`integer` or `rational`). - :param str part_of_day: (optional) A recognized term for a time that was - mentioned as a part of the day in the user's input (for example, `morning` or - `afternoon`). - :param float relative_hour: (optional) A recognized mention of a relative hour, - represented numerically as an offset from the current hour (for example, `3` for - `in three hours` or `-1` for `an hour ago`). - :param float relative_minute: (optional) A recognized mention of a relative - time, represented numerically as an offset in minutes from the current time (for - example, `5` for `in five minutes` or `-15` for `fifteen minutes ago`). - :param float relative_second: (optional) A recognized mention of a relative - time, represented numerically as an offset in seconds from the current time (for - example, `10` for `in ten seconds` or `-30` for `thirty seconds ago`). - :param float specific_hour: (optional) A recognized specific hour mentioned as - part of a time value (for example, `10` for `10:15 AM`.). - :param float specific_minute: (optional) A recognized specific minute mentioned - as part of a time value (for example, `15` for `10:15 AM`.). - :param float specific_second: (optional) A recognized specific second mentioned - as part of a time value (for example, `30` for `10:15:30 AM`.). - :param str timezone: (optional) A recognized time zone mentioned as part of a - time value (for example, `EST`). + :param str skill_id: The skill ID of the skill. + :param str type: (optional) The type of the skill. + :param str snapshot: (optional) The name of the skill snapshot that is saved as + part of the release (for example, `draft` or `1`). """ def __init__( self, + skill_id: str, *, - calendar_type: Optional[str] = None, - datetime_link: Optional[str] = None, - festival: Optional[str] = None, - granularity: Optional[str] = None, - range_link: Optional[str] = None, - range_modifier: Optional[str] = None, - relative_day: Optional[float] = None, - relative_month: Optional[float] = None, - relative_week: Optional[float] = None, - relative_weekend: Optional[float] = None, - relative_year: Optional[float] = None, - specific_day: Optional[float] = None, - specific_day_of_week: Optional[str] = None, - specific_month: Optional[float] = None, - specific_quarter: Optional[float] = None, - specific_year: Optional[float] = None, - numeric_value: Optional[float] = None, - subtype: Optional[str] = None, - part_of_day: Optional[str] = None, - relative_hour: Optional[float] = None, - relative_minute: Optional[float] = None, - relative_second: Optional[float] = None, - specific_hour: Optional[float] = None, - specific_minute: Optional[float] = None, - specific_second: Optional[float] = None, - timezone: Optional[str] = None, + type: Optional[str] = None, + snapshot: Optional[str] = None, ) -> None: """ - Initialize a RuntimeEntityInterpretation object. + Initialize a ReleaseSkill object. - :param str calendar_type: (optional) The calendar used to represent a - recognized date (for example, `Gregorian`). - :param str datetime_link: (optional) A unique identifier used to associate - a recognized time and date. If the user input contains a date and time that - are mentioned together (for example, `Today at 5`, the same - **datetime_link** value is returned for both the `@sys-date` and - `@sys-time` entities). - :param str festival: (optional) A locale-specific holiday name (such as - `thanksgiving` or `christmas`). This property is included when a - `@sys-date` entity is recognized based on a holiday name in the user input. - :param str granularity: (optional) The precision or duration of a time - range specified by a recognized `@sys-time` or `@sys-date` entity. - :param str range_link: (optional) A unique identifier used to associate - multiple recognized `@sys-date`, `@sys-time`, or `@sys-number` entities - that are recognized as a range of values in the user's input (for example, - `from July 4 until July 14` or `from 20 to 25`). - :param str range_modifier: (optional) The word in the user input that - indicates that a `sys-date` or `sys-time` entity is part of an implied - range where only one date or time is specified (for example, `since` or - `until`). - :param float relative_day: (optional) A recognized mention of a relative - day, represented numerically as an offset from the current date (for - example, `-1` for `yesterday` or `10` for `in ten days`). - :param float relative_month: (optional) A recognized mention of a relative - month, represented numerically as an offset from the current month (for - example, `1` for `next month` or `-3` for `three months ago`). - :param float relative_week: (optional) A recognized mention of a relative - week, represented numerically as an offset from the current week (for - example, `2` for `in two weeks` or `-1` for `last week). - :param float relative_weekend: (optional) A recognized mention of a - relative date range for a weekend, represented numerically as an offset - from the current weekend (for example, `0` for `this weekend` or `-1` for - `last weekend`). - :param float relative_year: (optional) A recognized mention of a relative - year, represented numerically as an offset from the current year (for - example, `1` for `next year` or `-5` for `five years ago`). - :param float specific_day: (optional) A recognized mention of a specific - date, represented numerically as the date within the month (for example, - `30` for `June 30`.). - :param str specific_day_of_week: (optional) A recognized mention of a - specific day of the week as a lowercase string (for example, `monday`). - :param float specific_month: (optional) A recognized mention of a specific - month, represented numerically (for example, `7` for `July`). - :param float specific_quarter: (optional) A recognized mention of a - specific quarter, represented numerically (for example, `3` for `the third - quarter`). - :param float specific_year: (optional) A recognized mention of a specific - year (for example, `2016`). - :param float numeric_value: (optional) A recognized numeric value, - represented as an integer or double. - :param str subtype: (optional) The type of numeric value recognized in the - user input (`integer` or `rational`). - :param str part_of_day: (optional) A recognized term for a time that was - mentioned as a part of the day in the user's input (for example, `morning` - or `afternoon`). - :param float relative_hour: (optional) A recognized mention of a relative - hour, represented numerically as an offset from the current hour (for - example, `3` for `in three hours` or `-1` for `an hour ago`). - :param float relative_minute: (optional) A recognized mention of a relative - time, represented numerically as an offset in minutes from the current time - (for example, `5` for `in five minutes` or `-15` for `fifteen minutes - ago`). - :param float relative_second: (optional) A recognized mention of a relative - time, represented numerically as an offset in seconds from the current time - (for example, `10` for `in ten seconds` or `-30` for `thirty seconds ago`). - :param float specific_hour: (optional) A recognized specific hour mentioned - as part of a time value (for example, `10` for `10:15 AM`.). - :param float specific_minute: (optional) A recognized specific minute - mentioned as part of a time value (for example, `15` for `10:15 AM`.). - :param float specific_second: (optional) A recognized specific second - mentioned as part of a time value (for example, `30` for `10:15:30 AM`.). - :param str timezone: (optional) A recognized time zone mentioned as part of - a time value (for example, `EST`). + :param str skill_id: The skill ID of the skill. + :param str type: (optional) The type of the skill. + :param str snapshot: (optional) The name of the skill snapshot that is + saved as part of the release (for example, `draft` or `1`). """ - self.calendar_type = calendar_type - self.datetime_link = datetime_link - self.festival = festival - self.granularity = granularity - self.range_link = range_link - self.range_modifier = range_modifier - self.relative_day = relative_day - self.relative_month = relative_month - self.relative_week = relative_week - self.relative_weekend = relative_weekend - self.relative_year = relative_year - self.specific_day = specific_day - self.specific_day_of_week = specific_day_of_week - self.specific_month = specific_month - self.specific_quarter = specific_quarter - self.specific_year = specific_year - self.numeric_value = numeric_value - self.subtype = subtype - self.part_of_day = part_of_day - self.relative_hour = relative_hour - self.relative_minute = relative_minute - self.relative_second = relative_second - self.specific_hour = specific_hour - self.specific_minute = specific_minute - self.specific_second = specific_second - self.timezone = timezone + self.skill_id = skill_id + self.type = type + self.snapshot = snapshot @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntityInterpretation': - """Initialize a RuntimeEntityInterpretation object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseSkill': + """Initialize a ReleaseSkill object from a json dictionary.""" args = {} - if (calendar_type := _dict.get('calendar_type')) is not None: - args['calendar_type'] = calendar_type - if (datetime_link := _dict.get('datetime_link')) is not None: - args['datetime_link'] = datetime_link - if (festival := _dict.get('festival')) is not None: - args['festival'] = festival - if (granularity := _dict.get('granularity')) is not None: - args['granularity'] = granularity - if (range_link := _dict.get('range_link')) is not None: - args['range_link'] = range_link - if (range_modifier := _dict.get('range_modifier')) is not None: - args['range_modifier'] = range_modifier - if (relative_day := _dict.get('relative_day')) is not None: - args['relative_day'] = relative_day - if (relative_month := _dict.get('relative_month')) is not None: - args['relative_month'] = relative_month - if (relative_week := _dict.get('relative_week')) is not None: - args['relative_week'] = relative_week - if (relative_weekend := _dict.get('relative_weekend')) is not None: - args['relative_weekend'] = relative_weekend - if (relative_year := _dict.get('relative_year')) is not None: - args['relative_year'] = relative_year - if (specific_day := _dict.get('specific_day')) is not None: - args['specific_day'] = specific_day - if (specific_day_of_week := - _dict.get('specific_day_of_week')) is not None: - args['specific_day_of_week'] = specific_day_of_week - if (specific_month := _dict.get('specific_month')) is not None: - args['specific_month'] = specific_month - if (specific_quarter := _dict.get('specific_quarter')) is not None: - args['specific_quarter'] = specific_quarter - if (specific_year := _dict.get('specific_year')) is not None: - args['specific_year'] = specific_year - if (numeric_value := _dict.get('numeric_value')) is not None: - args['numeric_value'] = numeric_value - if (subtype := _dict.get('subtype')) is not None: - args['subtype'] = subtype - if (part_of_day := _dict.get('part_of_day')) is not None: - args['part_of_day'] = part_of_day - if (relative_hour := _dict.get('relative_hour')) is not None: - args['relative_hour'] = relative_hour - if (relative_minute := _dict.get('relative_minute')) is not None: - args['relative_minute'] = relative_minute - if (relative_second := _dict.get('relative_second')) is not None: - args['relative_second'] = relative_second - if (specific_hour := _dict.get('specific_hour')) is not None: - args['specific_hour'] = specific_hour - if (specific_minute := _dict.get('specific_minute')) is not None: - args['specific_minute'] = specific_minute - if (specific_second := _dict.get('specific_second')) is not None: - args['specific_second'] = specific_second - if (timezone := _dict.get('timezone')) is not None: - args['timezone'] = timezone + if (skill_id := _dict.get('skill_id')) is not None: + args['skill_id'] = skill_id + else: + raise ValueError( + 'Required property \'skill_id\' not present in ReleaseSkill JSON' + ) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (snapshot := _dict.get('snapshot')) is not None: + args['snapshot'] = snapshot return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RuntimeEntityInterpretation object from a json dictionary.""" + """Initialize a ReleaseSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'calendar_type') and self.calendar_type is not None: - _dict['calendar_type'] = self.calendar_type - if hasattr(self, 'datetime_link') and self.datetime_link is not None: - _dict['datetime_link'] = self.datetime_link - if hasattr(self, 'festival') and self.festival is not None: - _dict['festival'] = self.festival - if hasattr(self, 'granularity') and self.granularity is not None: - _dict['granularity'] = self.granularity - if hasattr(self, 'range_link') and self.range_link is not None: - _dict['range_link'] = self.range_link - if hasattr(self, 'range_modifier') and self.range_modifier is not None: - _dict['range_modifier'] = self.range_modifier - if hasattr(self, 'relative_day') and self.relative_day is not None: - _dict['relative_day'] = self.relative_day - if hasattr(self, 'relative_month') and self.relative_month is not None: - _dict['relative_month'] = self.relative_month - if hasattr(self, 'relative_week') and self.relative_week is not None: - _dict['relative_week'] = self.relative_week - if hasattr(self, - 'relative_weekend') and self.relative_weekend is not None: - _dict['relative_weekend'] = self.relative_weekend - if hasattr(self, 'relative_year') and self.relative_year is not None: - _dict['relative_year'] = self.relative_year - if hasattr(self, 'specific_day') and self.specific_day is not None: - _dict['specific_day'] = self.specific_day - if hasattr(self, 'specific_day_of_week' - ) and self.specific_day_of_week is not None: - _dict['specific_day_of_week'] = self.specific_day_of_week - if hasattr(self, 'specific_month') and self.specific_month is not None: - _dict['specific_month'] = self.specific_month - if hasattr(self, - 'specific_quarter') and self.specific_quarter is not None: - _dict['specific_quarter'] = self.specific_quarter - if hasattr(self, 'specific_year') and self.specific_year is not None: - _dict['specific_year'] = self.specific_year - if hasattr(self, 'numeric_value') and self.numeric_value is not None: - _dict['numeric_value'] = self.numeric_value - if hasattr(self, 'subtype') and self.subtype is not None: - _dict['subtype'] = self.subtype - if hasattr(self, 'part_of_day') and self.part_of_day is not None: - _dict['part_of_day'] = self.part_of_day - if hasattr(self, 'relative_hour') and self.relative_hour is not None: - _dict['relative_hour'] = self.relative_hour - if hasattr(self, - 'relative_minute') and self.relative_minute is not None: - _dict['relative_minute'] = self.relative_minute - if hasattr(self, - 'relative_second') and self.relative_second is not None: - _dict['relative_second'] = self.relative_second - if hasattr(self, 'specific_hour') and self.specific_hour is not None: - _dict['specific_hour'] = self.specific_hour + if hasattr(self, 'skill_id') and self.skill_id is not None: + _dict['skill_id'] = self.skill_id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'snapshot') and self.snapshot is not None: + _dict['snapshot'] = self.snapshot + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ReleaseSkill object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReleaseSkill') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReleaseSkill') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type of the skill. + """ + + DIALOG = 'dialog' + ACTION = 'action' + SEARCH = 'search' + + +class RequestAnalytics: + """ + An optional object containing analytics data. Currently, this data is used only for + events sent to the Segment extension. + + :param str browser: (optional) The browser that was used to send the message + that triggered the event. + :param str device: (optional) The type of device that was used to send the + message that triggered the event. + :param str page_url: (optional) The URL of the web page that was used to send + the message that triggered the event. + """ + + def __init__( + self, + *, + browser: Optional[str] = None, + device: Optional[str] = None, + page_url: Optional[str] = None, + ) -> None: + """ + Initialize a RequestAnalytics object. + + :param str browser: (optional) The browser that was used to send the + message that triggered the event. + :param str device: (optional) The type of device that was used to send the + message that triggered the event. + :param str page_url: (optional) The URL of the web page that was used to + send the message that triggered the event. + """ + self.browser = browser + self.device = device + self.page_url = page_url + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RequestAnalytics': + """Initialize a RequestAnalytics object from a json dictionary.""" + args = {} + if (browser := _dict.get('browser')) is not None: + args['browser'] = browser + if (device := _dict.get('device')) is not None: + args['device'] = device + if (page_url := _dict.get('pageUrl')) is not None: + args['page_url'] = page_url + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RequestAnalytics object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'browser') and self.browser is not None: + _dict['browser'] = self.browser + if hasattr(self, 'device') and self.device is not None: + _dict['device'] = self.device + if hasattr(self, 'page_url') and self.page_url is not None: + _dict['pageUrl'] = self.page_url + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RequestAnalytics object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RequestAnalytics') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RequestAnalytics') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResponseGenericChannel: + """ + ResponseGenericChannel. + + :param str channel: (optional) A channel for which the response is intended. + """ + + def __init__( + self, + *, + channel: Optional[str] = None, + ) -> None: + """ + Initialize a ResponseGenericChannel object. + + :param str channel: (optional) A channel for which the response is + intended. + """ + self.channel = channel + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResponseGenericChannel': + """Initialize a ResponseGenericChannel object from a json dictionary.""" + args = {} + if (channel := _dict.get('channel')) is not None: + args['channel'] = channel + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResponseGenericChannel object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'channel') and self.channel is not None: + _dict['channel'] = self.channel + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResponseGenericChannel object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResponseGenericChannel') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResponseGenericChannel') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResponseGenericCitation: + """ + ResponseGenericCitation. + + :param str title: The title of the citation text. + :param str text: The text of the citation. + :param str body: The body content of the citation. + :param int search_result_index: (optional) The index of the search_result where + the citation is generated. + :param List[ResponseGenericCitationRangesItem] ranges: The offsets of the start + and end of the citation in the generated response. For example, `ranges:[ { + start:0, end:5 }, ...]`. + """ + + def __init__( + self, + title: str, + text: str, + body: str, + ranges: List['ResponseGenericCitationRangesItem'], + *, + search_result_index: Optional[int] = None, + ) -> None: + """ + Initialize a ResponseGenericCitation object. + + :param str title: The title of the citation text. + :param str text: The text of the citation. + :param str body: The body content of the citation. + :param List[ResponseGenericCitationRangesItem] ranges: The offsets of the + start and end of the citation in the generated response. For example, + `ranges:[ { start:0, end:5 }, ...]`. + :param int search_result_index: (optional) The index of the search_result + where the citation is generated. + """ + self.title = title + self.text = text + self.body = body + self.search_result_index = search_result_index + self.ranges = ranges + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResponseGenericCitation': + """Initialize a ResponseGenericCitation object from a json dictionary.""" + args = {} + if (title := _dict.get('title')) is not None: + args['title'] = title + else: + raise ValueError( + 'Required property \'title\' not present in ResponseGenericCitation JSON' + ) + if (text := _dict.get('text')) is not None: + args['text'] = text + else: + raise ValueError( + 'Required property \'text\' not present in ResponseGenericCitation JSON' + ) + if (body := _dict.get('body')) is not None: + args['body'] = body + else: + raise ValueError( + 'Required property \'body\' not present in ResponseGenericCitation JSON' + ) + if (search_result_index := + _dict.get('search_result_index')) is not None: + args['search_result_index'] = search_result_index + if (ranges := _dict.get('ranges')) is not None: + args['ranges'] = [ + ResponseGenericCitationRangesItem.from_dict(v) for v in ranges + ] + else: + raise ValueError( + 'Required property \'ranges\' not present in ResponseGenericCitation JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResponseGenericCitation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr( + self, + 'search_result_index') and self.search_result_index is not None: + _dict['search_result_index'] = self.search_result_index + if hasattr(self, 'ranges') and self.ranges is not None: + ranges_list = [] + for v in self.ranges: + if isinstance(v, dict): + ranges_list.append(v) + else: + ranges_list.append(v.to_dict()) + _dict['ranges'] = ranges_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResponseGenericCitation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResponseGenericCitation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResponseGenericCitation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResponseGenericCitationRangesItem: + """ + ResponseGenericCitationRangesItem. + + :param int start: (optional) The offset of the start of the citation in the + generated response. + :param int end: (optional) The offset of the end of the citation in the + generated response. + """ + + def __init__( + self, + *, + start: Optional[int] = None, + end: Optional[int] = None, + ) -> None: + """ + Initialize a ResponseGenericCitationRangesItem object. + + :param int start: (optional) The offset of the start of the citation in the + generated response. + :param int end: (optional) The offset of the end of the citation in the + generated response. + """ + self.start = start + self.end = end + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResponseGenericCitationRangesItem': + """Initialize a ResponseGenericCitationRangesItem object from a json dictionary.""" + args = {} + if (start := _dict.get('start')) is not None: + args['start'] = start + if (end := _dict.get('end')) is not None: + args['end'] = end + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResponseGenericCitationRangesItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'start') and self.start is not None: + _dict['start'] = self.start + if hasattr(self, 'end') and self.end is not None: + _dict['end'] = self.end + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResponseGenericCitationRangesItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResponseGenericCitationRangesItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResponseGenericCitationRangesItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResponseGenericConfidenceScores: + """ + The confidence scores for determining whether to show the generated response or an “I + don't know” response. + + :param float threshold: (optional) The confidence score threshold. If either the + pre_gen or post_gen score is below this threshold, it shows an “I don't know” + response to replace the generated text. You can configure the threshold in + either the user interface or through the Update skill API. For more information, + see the [watsonx Assistant documentation]( + https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#behavioral-tuning-conversational-search). + :param float pre_gen: (optional) The confidence score based on user query and + search results. + :param float post_gen: (optional) The confidence score based on user query, + search results, and the generated response. + :param float extractiveness: (optional) It indicates how extractive the + generated response is from the search results. + """ + + def __init__( + self, + *, + threshold: Optional[float] = None, + pre_gen: Optional[float] = None, + post_gen: Optional[float] = None, + extractiveness: Optional[float] = None, + ) -> None: + """ + Initialize a ResponseGenericConfidenceScores object. + + :param float threshold: (optional) The confidence score threshold. If + either the pre_gen or post_gen score is below this threshold, it shows an + “I don't know” response to replace the generated text. You can configure + the threshold in either the user interface or through the Update skill API. + For more information, see the [watsonx Assistant documentation]( + https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#behavioral-tuning-conversational-search). + :param float pre_gen: (optional) The confidence score based on user query + and search results. + :param float post_gen: (optional) The confidence score based on user query, + search results, and the generated response. + :param float extractiveness: (optional) It indicates how extractive the + generated response is from the search results. + """ + self.threshold = threshold + self.pre_gen = pre_gen + self.post_gen = post_gen + self.extractiveness = extractiveness + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResponseGenericConfidenceScores': + """Initialize a ResponseGenericConfidenceScores object from a json dictionary.""" + args = {} + if (threshold := _dict.get('threshold')) is not None: + args['threshold'] = threshold + if (pre_gen := _dict.get('pre_gen')) is not None: + args['pre_gen'] = pre_gen + if (post_gen := _dict.get('post_gen')) is not None: + args['post_gen'] = post_gen + if (extractiveness := _dict.get('extractiveness')) is not None: + args['extractiveness'] = extractiveness + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResponseGenericConfidenceScores object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'threshold') and self.threshold is not None: + _dict['threshold'] = self.threshold + if hasattr(self, 'pre_gen') and self.pre_gen is not None: + _dict['pre_gen'] = self.pre_gen + if hasattr(self, 'post_gen') and self.post_gen is not None: + _dict['post_gen'] = self.post_gen + if hasattr(self, 'extractiveness') and self.extractiveness is not None: + _dict['extractiveness'] = self.extractiveness + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResponseGenericConfidenceScores object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResponseGenericConfidenceScores') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResponseGenericConfidenceScores') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RuntimeEntity: + """ + The entity value that was recognized in the user input. + + :param str entity: An entity detected in the input. + :param List[int] location: (optional) An array of zero-based character offsets + that indicate where the detected entity values begin and end in the input text. + :param str value: The term in the input text that was recognized as an entity + value. + :param float confidence: (optional) A decimal percentage that represents + confidence in the recognized entity. + :param List[CaptureGroup] groups: (optional) The recognized capture groups for + the entity, as defined by the entity pattern. + :param RuntimeEntityInterpretation interpretation: (optional) An object + containing detailed information about the entity recognized in the user input. + This property is included only if the new system entities are enabled for the + skill. + For more information about how the new system entities are interpreted, see the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities). + :param List[RuntimeEntityAlternative] alternatives: (optional) An array of + possible alternative values that the user might have intended instead of the + value returned in the **value** property. This property is returned only for + `@sys-time` and `@sys-date` entities when the user's input is ambiguous. + This property is included only if the new system entities are enabled for the + skill. + :param RuntimeEntityRole role: (optional) An object describing the role played + by a system entity that is specifies the beginning or end of a range recognized + in the user input. This property is included only if the new system entities are + enabled for the skill. + :param str skill: (optional) The skill that recognized the entity value. + Currently, the only possible values are `main skill` for the dialog skill (if + enabled) and `actions skill` for the action skill. + This property is present only if the assistant has both a dialog skill and an + action skill. + """ + + def __init__( + self, + entity: str, + value: str, + *, + location: Optional[List[int]] = None, + confidence: Optional[float] = None, + groups: Optional[List['CaptureGroup']] = None, + interpretation: Optional['RuntimeEntityInterpretation'] = None, + alternatives: Optional[List['RuntimeEntityAlternative']] = None, + role: Optional['RuntimeEntityRole'] = None, + skill: Optional[str] = None, + ) -> None: + """ + Initialize a RuntimeEntity object. + + :param str entity: An entity detected in the input. + :param str value: The term in the input text that was recognized as an + entity value. + :param List[int] location: (optional) An array of zero-based character + offsets that indicate where the detected entity values begin and end in the + input text. + :param float confidence: (optional) A decimal percentage that represents + confidence in the recognized entity. + :param List[CaptureGroup] groups: (optional) The recognized capture groups + for the entity, as defined by the entity pattern. + :param RuntimeEntityInterpretation interpretation: (optional) An object + containing detailed information about the entity recognized in the user + input. This property is included only if the new system entities are + enabled for the skill. + For more information about how the new system entities are interpreted, see + the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities). + :param List[RuntimeEntityAlternative] alternatives: (optional) An array of + possible alternative values that the user might have intended instead of + the value returned in the **value** property. This property is returned + only for `@sys-time` and `@sys-date` entities when the user's input is + ambiguous. + This property is included only if the new system entities are enabled for + the skill. + :param RuntimeEntityRole role: (optional) An object describing the role + played by a system entity that is specifies the beginning or end of a range + recognized in the user input. This property is included only if the new + system entities are enabled for the skill. + :param str skill: (optional) The skill that recognized the entity value. + Currently, the only possible values are `main skill` for the dialog skill + (if enabled) and `actions skill` for the action skill. + This property is present only if the assistant has both a dialog skill and + an action skill. + """ + self.entity = entity + self.location = location + self.value = value + self.confidence = confidence + self.groups = groups + self.interpretation = interpretation + self.alternatives = alternatives + self.role = role + self.skill = skill + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeEntity': + """Initialize a RuntimeEntity object from a json dictionary.""" + args = {} + if (entity := _dict.get('entity')) is not None: + args['entity'] = entity + else: + raise ValueError( + 'Required property \'entity\' not present in RuntimeEntity JSON' + ) + if (location := _dict.get('location')) is not None: + args['location'] = location + if (value := _dict.get('value')) is not None: + args['value'] = value + else: + raise ValueError( + 'Required property \'value\' not present in RuntimeEntity JSON') + if (confidence := _dict.get('confidence')) is not None: + args['confidence'] = confidence + if (groups := _dict.get('groups')) is not None: + args['groups'] = [CaptureGroup.from_dict(v) for v in groups] + if (interpretation := _dict.get('interpretation')) is not None: + args['interpretation'] = RuntimeEntityInterpretation.from_dict( + interpretation) + if (alternatives := _dict.get('alternatives')) is not None: + args['alternatives'] = [ + RuntimeEntityAlternative.from_dict(v) for v in alternatives + ] + if (role := _dict.get('role')) is not None: + args['role'] = RuntimeEntityRole.from_dict(role) + if (skill := _dict.get('skill')) is not None: + args['skill'] = skill + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeEntity object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'entity') and self.entity is not None: + _dict['entity'] = self.entity + if hasattr(self, 'location') and self.location is not None: + _dict['location'] = self.location + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + if hasattr(self, 'confidence') and self.confidence is not None: + _dict['confidence'] = self.confidence + if hasattr(self, 'groups') and self.groups is not None: + groups_list = [] + for v in self.groups: + if isinstance(v, dict): + groups_list.append(v) + else: + groups_list.append(v.to_dict()) + _dict['groups'] = groups_list + if hasattr(self, 'interpretation') and self.interpretation is not None: + if isinstance(self.interpretation, dict): + _dict['interpretation'] = self.interpretation + else: + _dict['interpretation'] = self.interpretation.to_dict() + if hasattr(self, 'alternatives') and self.alternatives is not None: + alternatives_list = [] + for v in self.alternatives: + if isinstance(v, dict): + alternatives_list.append(v) + else: + alternatives_list.append(v.to_dict()) + _dict['alternatives'] = alternatives_list + if hasattr(self, 'role') and self.role is not None: + if isinstance(self.role, dict): + _dict['role'] = self.role + else: + _dict['role'] = self.role.to_dict() + if hasattr(self, 'skill') and self.skill is not None: + _dict['skill'] = self.skill + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeEntity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RuntimeEntity') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RuntimeEntity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RuntimeEntityAlternative: + """ + An alternative value for the recognized entity. + + :param str value: (optional) The entity value that was recognized in the user + input. + :param float confidence: (optional) A decimal percentage that represents + confidence in the recognized entity. + """ + + def __init__( + self, + *, + value: Optional[str] = None, + confidence: Optional[float] = None, + ) -> None: + """ + Initialize a RuntimeEntityAlternative object. + + :param str value: (optional) The entity value that was recognized in the + user input. + :param float confidence: (optional) A decimal percentage that represents + confidence in the recognized entity. + """ + self.value = value + self.confidence = confidence + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeEntityAlternative': + """Initialize a RuntimeEntityAlternative object from a json dictionary.""" + args = {} + if (value := _dict.get('value')) is not None: + args['value'] = value + if (confidence := _dict.get('confidence')) is not None: + args['confidence'] = confidence + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeEntityAlternative object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + if hasattr(self, 'confidence') and self.confidence is not None: + _dict['confidence'] = self.confidence + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeEntityAlternative object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RuntimeEntityAlternative') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RuntimeEntityAlternative') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RuntimeEntityInterpretation: + """ + RuntimeEntityInterpretation. + + :param str calendar_type: (optional) The calendar used to represent a recognized + date (for example, `Gregorian`). + :param str datetime_link: (optional) A unique identifier used to associate a + recognized time and date. If the user input contains a date and time that are + mentioned together (for example, `Today at 5`, the same **datetime_link** value + is returned for both the `@sys-date` and `@sys-time` entities). + :param str festival: (optional) A locale-specific holiday name (such as + `thanksgiving` or `christmas`). This property is included when a `@sys-date` + entity is recognized based on a holiday name in the user input. + :param str granularity: (optional) The precision or duration of a time range + specified by a recognized `@sys-time` or `@sys-date` entity. + :param str range_link: (optional) A unique identifier used to associate multiple + recognized `@sys-date`, `@sys-time`, or `@sys-number` entities that are + recognized as a range of values in the user's input (for example, `from July 4 + until July 14` or `from 20 to 25`). + :param str range_modifier: (optional) The word in the user input that indicates + that a `sys-date` or `sys-time` entity is part of an implied range where only + one date or time is specified (for example, `since` or `until`). + :param float relative_day: (optional) A recognized mention of a relative day, + represented numerically as an offset from the current date (for example, `-1` + for `yesterday` or `10` for `in ten days`). + :param float relative_month: (optional) A recognized mention of a relative + month, represented numerically as an offset from the current month (for example, + `1` for `next month` or `-3` for `three months ago`). + :param float relative_week: (optional) A recognized mention of a relative week, + represented numerically as an offset from the current week (for example, `2` for + `in two weeks` or `-1` for `last week). + :param float relative_weekend: (optional) A recognized mention of a relative + date range for a weekend, represented numerically as an offset from the current + weekend (for example, `0` for `this weekend` or `-1` for `last weekend`). + :param float relative_year: (optional) A recognized mention of a relative year, + represented numerically as an offset from the current year (for example, `1` for + `next year` or `-5` for `five years ago`). + :param float specific_day: (optional) A recognized mention of a specific date, + represented numerically as the date within the month (for example, `30` for + `June 30`.). + :param str specific_day_of_week: (optional) A recognized mention of a specific + day of the week as a lowercase string (for example, `monday`). + :param float specific_month: (optional) A recognized mention of a specific + month, represented numerically (for example, `7` for `July`). + :param float specific_quarter: (optional) A recognized mention of a specific + quarter, represented numerically (for example, `3` for `the third quarter`). + :param float specific_year: (optional) A recognized mention of a specific year + (for example, `2016`). + :param float numeric_value: (optional) A recognized numeric value, represented + as an integer or double. + :param str subtype: (optional) The type of numeric value recognized in the user + input (`integer` or `rational`). + :param str part_of_day: (optional) A recognized term for a time that was + mentioned as a part of the day in the user's input (for example, `morning` or + `afternoon`). + :param float relative_hour: (optional) A recognized mention of a relative hour, + represented numerically as an offset from the current hour (for example, `3` for + `in three hours` or `-1` for `an hour ago`). + :param float relative_minute: (optional) A recognized mention of a relative + time, represented numerically as an offset in minutes from the current time (for + example, `5` for `in five minutes` or `-15` for `fifteen minutes ago`). + :param float relative_second: (optional) A recognized mention of a relative + time, represented numerically as an offset in seconds from the current time (for + example, `10` for `in ten seconds` or `-30` for `thirty seconds ago`). + :param float specific_hour: (optional) A recognized specific hour mentioned as + part of a time value (for example, `10` for `10:15 AM`.). + :param float specific_minute: (optional) A recognized specific minute mentioned + as part of a time value (for example, `15` for `10:15 AM`.). + :param float specific_second: (optional) A recognized specific second mentioned + as part of a time value (for example, `30` for `10:15:30 AM`.). + :param str timezone: (optional) A recognized time zone mentioned as part of a + time value (for example, `EST`). + """ + + def __init__( + self, + *, + calendar_type: Optional[str] = None, + datetime_link: Optional[str] = None, + festival: Optional[str] = None, + granularity: Optional[str] = None, + range_link: Optional[str] = None, + range_modifier: Optional[str] = None, + relative_day: Optional[float] = None, + relative_month: Optional[float] = None, + relative_week: Optional[float] = None, + relative_weekend: Optional[float] = None, + relative_year: Optional[float] = None, + specific_day: Optional[float] = None, + specific_day_of_week: Optional[str] = None, + specific_month: Optional[float] = None, + specific_quarter: Optional[float] = None, + specific_year: Optional[float] = None, + numeric_value: Optional[float] = None, + subtype: Optional[str] = None, + part_of_day: Optional[str] = None, + relative_hour: Optional[float] = None, + relative_minute: Optional[float] = None, + relative_second: Optional[float] = None, + specific_hour: Optional[float] = None, + specific_minute: Optional[float] = None, + specific_second: Optional[float] = None, + timezone: Optional[str] = None, + ) -> None: + """ + Initialize a RuntimeEntityInterpretation object. + + :param str calendar_type: (optional) The calendar used to represent a + recognized date (for example, `Gregorian`). + :param str datetime_link: (optional) A unique identifier used to associate + a recognized time and date. If the user input contains a date and time that + are mentioned together (for example, `Today at 5`, the same + **datetime_link** value is returned for both the `@sys-date` and + `@sys-time` entities). + :param str festival: (optional) A locale-specific holiday name (such as + `thanksgiving` or `christmas`). This property is included when a + `@sys-date` entity is recognized based on a holiday name in the user input. + :param str granularity: (optional) The precision or duration of a time + range specified by a recognized `@sys-time` or `@sys-date` entity. + :param str range_link: (optional) A unique identifier used to associate + multiple recognized `@sys-date`, `@sys-time`, or `@sys-number` entities + that are recognized as a range of values in the user's input (for example, + `from July 4 until July 14` or `from 20 to 25`). + :param str range_modifier: (optional) The word in the user input that + indicates that a `sys-date` or `sys-time` entity is part of an implied + range where only one date or time is specified (for example, `since` or + `until`). + :param float relative_day: (optional) A recognized mention of a relative + day, represented numerically as an offset from the current date (for + example, `-1` for `yesterday` or `10` for `in ten days`). + :param float relative_month: (optional) A recognized mention of a relative + month, represented numerically as an offset from the current month (for + example, `1` for `next month` or `-3` for `three months ago`). + :param float relative_week: (optional) A recognized mention of a relative + week, represented numerically as an offset from the current week (for + example, `2` for `in two weeks` or `-1` for `last week). + :param float relative_weekend: (optional) A recognized mention of a + relative date range for a weekend, represented numerically as an offset + from the current weekend (for example, `0` for `this weekend` or `-1` for + `last weekend`). + :param float relative_year: (optional) A recognized mention of a relative + year, represented numerically as an offset from the current year (for + example, `1` for `next year` or `-5` for `five years ago`). + :param float specific_day: (optional) A recognized mention of a specific + date, represented numerically as the date within the month (for example, + `30` for `June 30`.). + :param str specific_day_of_week: (optional) A recognized mention of a + specific day of the week as a lowercase string (for example, `monday`). + :param float specific_month: (optional) A recognized mention of a specific + month, represented numerically (for example, `7` for `July`). + :param float specific_quarter: (optional) A recognized mention of a + specific quarter, represented numerically (for example, `3` for `the third + quarter`). + :param float specific_year: (optional) A recognized mention of a specific + year (for example, `2016`). + :param float numeric_value: (optional) A recognized numeric value, + represented as an integer or double. + :param str subtype: (optional) The type of numeric value recognized in the + user input (`integer` or `rational`). + :param str part_of_day: (optional) A recognized term for a time that was + mentioned as a part of the day in the user's input (for example, `morning` + or `afternoon`). + :param float relative_hour: (optional) A recognized mention of a relative + hour, represented numerically as an offset from the current hour (for + example, `3` for `in three hours` or `-1` for `an hour ago`). + :param float relative_minute: (optional) A recognized mention of a relative + time, represented numerically as an offset in minutes from the current time + (for example, `5` for `in five minutes` or `-15` for `fifteen minutes + ago`). + :param float relative_second: (optional) A recognized mention of a relative + time, represented numerically as an offset in seconds from the current time + (for example, `10` for `in ten seconds` or `-30` for `thirty seconds ago`). + :param float specific_hour: (optional) A recognized specific hour mentioned + as part of a time value (for example, `10` for `10:15 AM`.). + :param float specific_minute: (optional) A recognized specific minute + mentioned as part of a time value (for example, `15` for `10:15 AM`.). + :param float specific_second: (optional) A recognized specific second + mentioned as part of a time value (for example, `30` for `10:15:30 AM`.). + :param str timezone: (optional) A recognized time zone mentioned as part of + a time value (for example, `EST`). + """ + self.calendar_type = calendar_type + self.datetime_link = datetime_link + self.festival = festival + self.granularity = granularity + self.range_link = range_link + self.range_modifier = range_modifier + self.relative_day = relative_day + self.relative_month = relative_month + self.relative_week = relative_week + self.relative_weekend = relative_weekend + self.relative_year = relative_year + self.specific_day = specific_day + self.specific_day_of_week = specific_day_of_week + self.specific_month = specific_month + self.specific_quarter = specific_quarter + self.specific_year = specific_year + self.numeric_value = numeric_value + self.subtype = subtype + self.part_of_day = part_of_day + self.relative_hour = relative_hour + self.relative_minute = relative_minute + self.relative_second = relative_second + self.specific_hour = specific_hour + self.specific_minute = specific_minute + self.specific_second = specific_second + self.timezone = timezone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeEntityInterpretation': + """Initialize a RuntimeEntityInterpretation object from a json dictionary.""" + args = {} + if (calendar_type := _dict.get('calendar_type')) is not None: + args['calendar_type'] = calendar_type + if (datetime_link := _dict.get('datetime_link')) is not None: + args['datetime_link'] = datetime_link + if (festival := _dict.get('festival')) is not None: + args['festival'] = festival + if (granularity := _dict.get('granularity')) is not None: + args['granularity'] = granularity + if (range_link := _dict.get('range_link')) is not None: + args['range_link'] = range_link + if (range_modifier := _dict.get('range_modifier')) is not None: + args['range_modifier'] = range_modifier + if (relative_day := _dict.get('relative_day')) is not None: + args['relative_day'] = relative_day + if (relative_month := _dict.get('relative_month')) is not None: + args['relative_month'] = relative_month + if (relative_week := _dict.get('relative_week')) is not None: + args['relative_week'] = relative_week + if (relative_weekend := _dict.get('relative_weekend')) is not None: + args['relative_weekend'] = relative_weekend + if (relative_year := _dict.get('relative_year')) is not None: + args['relative_year'] = relative_year + if (specific_day := _dict.get('specific_day')) is not None: + args['specific_day'] = specific_day + if (specific_day_of_week := + _dict.get('specific_day_of_week')) is not None: + args['specific_day_of_week'] = specific_day_of_week + if (specific_month := _dict.get('specific_month')) is not None: + args['specific_month'] = specific_month + if (specific_quarter := _dict.get('specific_quarter')) is not None: + args['specific_quarter'] = specific_quarter + if (specific_year := _dict.get('specific_year')) is not None: + args['specific_year'] = specific_year + if (numeric_value := _dict.get('numeric_value')) is not None: + args['numeric_value'] = numeric_value + if (subtype := _dict.get('subtype')) is not None: + args['subtype'] = subtype + if (part_of_day := _dict.get('part_of_day')) is not None: + args['part_of_day'] = part_of_day + if (relative_hour := _dict.get('relative_hour')) is not None: + args['relative_hour'] = relative_hour + if (relative_minute := _dict.get('relative_minute')) is not None: + args['relative_minute'] = relative_minute + if (relative_second := _dict.get('relative_second')) is not None: + args['relative_second'] = relative_second + if (specific_hour := _dict.get('specific_hour')) is not None: + args['specific_hour'] = specific_hour + if (specific_minute := _dict.get('specific_minute')) is not None: + args['specific_minute'] = specific_minute + if (specific_second := _dict.get('specific_second')) is not None: + args['specific_second'] = specific_second + if (timezone := _dict.get('timezone')) is not None: + args['timezone'] = timezone + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeEntityInterpretation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'calendar_type') and self.calendar_type is not None: + _dict['calendar_type'] = self.calendar_type + if hasattr(self, 'datetime_link') and self.datetime_link is not None: + _dict['datetime_link'] = self.datetime_link + if hasattr(self, 'festival') and self.festival is not None: + _dict['festival'] = self.festival + if hasattr(self, 'granularity') and self.granularity is not None: + _dict['granularity'] = self.granularity + if hasattr(self, 'range_link') and self.range_link is not None: + _dict['range_link'] = self.range_link + if hasattr(self, 'range_modifier') and self.range_modifier is not None: + _dict['range_modifier'] = self.range_modifier + if hasattr(self, 'relative_day') and self.relative_day is not None: + _dict['relative_day'] = self.relative_day + if hasattr(self, 'relative_month') and self.relative_month is not None: + _dict['relative_month'] = self.relative_month + if hasattr(self, 'relative_week') and self.relative_week is not None: + _dict['relative_week'] = self.relative_week + if hasattr(self, + 'relative_weekend') and self.relative_weekend is not None: + _dict['relative_weekend'] = self.relative_weekend + if hasattr(self, 'relative_year') and self.relative_year is not None: + _dict['relative_year'] = self.relative_year + if hasattr(self, 'specific_day') and self.specific_day is not None: + _dict['specific_day'] = self.specific_day + if hasattr(self, 'specific_day_of_week' + ) and self.specific_day_of_week is not None: + _dict['specific_day_of_week'] = self.specific_day_of_week + if hasattr(self, 'specific_month') and self.specific_month is not None: + _dict['specific_month'] = self.specific_month + if hasattr(self, + 'specific_quarter') and self.specific_quarter is not None: + _dict['specific_quarter'] = self.specific_quarter + if hasattr(self, 'specific_year') and self.specific_year is not None: + _dict['specific_year'] = self.specific_year + if hasattr(self, 'numeric_value') and self.numeric_value is not None: + _dict['numeric_value'] = self.numeric_value + if hasattr(self, 'subtype') and self.subtype is not None: + _dict['subtype'] = self.subtype + if hasattr(self, 'part_of_day') and self.part_of_day is not None: + _dict['part_of_day'] = self.part_of_day + if hasattr(self, 'relative_hour') and self.relative_hour is not None: + _dict['relative_hour'] = self.relative_hour + if hasattr(self, + 'relative_minute') and self.relative_minute is not None: + _dict['relative_minute'] = self.relative_minute + if hasattr(self, + 'relative_second') and self.relative_second is not None: + _dict['relative_second'] = self.relative_second + if hasattr(self, 'specific_hour') and self.specific_hour is not None: + _dict['specific_hour'] = self.specific_hour + if hasattr(self, + 'specific_minute') and self.specific_minute is not None: + _dict['specific_minute'] = self.specific_minute + if hasattr(self, + 'specific_second') and self.specific_second is not None: + _dict['specific_second'] = self.specific_second + if hasattr(self, 'timezone') and self.timezone is not None: + _dict['timezone'] = self.timezone + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeEntityInterpretation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RuntimeEntityInterpretation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RuntimeEntityInterpretation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class GranularityEnum(str, Enum): + """ + The precision or duration of a time range specified by a recognized `@sys-time` or + `@sys-date` entity. + """ + + DAY = 'day' + FORTNIGHT = 'fortnight' + HOUR = 'hour' + INSTANT = 'instant' + MINUTE = 'minute' + MONTH = 'month' + QUARTER = 'quarter' + SECOND = 'second' + WEEK = 'week' + WEEKEND = 'weekend' + YEAR = 'year' + + +class RuntimeEntityRole: + """ + An object describing the role played by a system entity that is specifies the + beginning or end of a range recognized in the user input. This property is included + only if the new system entities are enabled for the skill. + + :param str type: (optional) The relationship of the entity to the range. + """ + + def __init__( + self, + *, + type: Optional[str] = None, + ) -> None: + """ + Initialize a RuntimeEntityRole object. + + :param str type: (optional) The relationship of the entity to the range. + """ + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeEntityRole': + """Initialize a RuntimeEntityRole object from a json dictionary.""" + args = {} + if (type := _dict.get('type')) is not None: + args['type'] = type + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeEntityRole object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeEntityRole object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RuntimeEntityRole') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RuntimeEntityRole') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The relationship of the entity to the range. + """ + + DATE_FROM = 'date_from' + DATE_TO = 'date_to' + NUMBER_FROM = 'number_from' + NUMBER_TO = 'number_to' + TIME_FROM = 'time_from' + TIME_TO = 'time_to' + + +class RuntimeIntent: + """ + An intent identified in the user input. + + :param str intent: The name of the recognized intent. + :param float confidence: (optional) A decimal percentage that represents + confidence in the intent. If you are specifying an intent as part of a request, + but you do not have a calculated confidence value, specify `1`. + :param str skill: (optional) The skill that identified the intent. Currently, + the only possible values are `main skill` for the dialog skill (if enabled) and + `actions skill` for the action skill. + This property is present only if the assistant has both a dialog skill and an + action skill. + """ + + def __init__( + self, + intent: str, + *, + confidence: Optional[float] = None, + skill: Optional[str] = None, + ) -> None: + """ + Initialize a RuntimeIntent object. + + :param str intent: The name of the recognized intent. + :param float confidence: (optional) A decimal percentage that represents + confidence in the intent. If you are specifying an intent as part of a + request, but you do not have a calculated confidence value, specify `1`. + :param str skill: (optional) The skill that identified the intent. + Currently, the only possible values are `main skill` for the dialog skill + (if enabled) and `actions skill` for the action skill. + This property is present only if the assistant has both a dialog skill and + an action skill. + """ + self.intent = intent + self.confidence = confidence + self.skill = skill + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeIntent': + """Initialize a RuntimeIntent object from a json dictionary.""" + args = {} + if (intent := _dict.get('intent')) is not None: + args['intent'] = intent + else: + raise ValueError( + 'Required property \'intent\' not present in RuntimeIntent JSON' + ) + if (confidence := _dict.get('confidence')) is not None: + args['confidence'] = confidence + if (skill := _dict.get('skill')) is not None: + args['skill'] = skill + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeIntent object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'intent') and self.intent is not None: + _dict['intent'] = self.intent + if hasattr(self, 'confidence') and self.confidence is not None: + _dict['confidence'] = self.confidence + if hasattr(self, 'skill') and self.skill is not None: + _dict['skill'] = self.skill + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeIntent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RuntimeIntent') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RuntimeIntent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RuntimeResponseGeneric: + """ + RuntimeResponseGeneric. + + """ + + def __init__(self,) -> None: + """ + Initialize a RuntimeResponseGeneric object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch', + 'RuntimeResponseGenericRuntimeResponseTypeText', + 'RuntimeResponseGenericRuntimeResponseTypePause', + 'RuntimeResponseGenericRuntimeResponseTypeImage', + 'RuntimeResponseGenericRuntimeResponseTypeOption', + 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent', + 'RuntimeResponseGenericRuntimeResponseTypeSuggestion', + 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer', + 'RuntimeResponseGenericRuntimeResponseTypeSearch', + 'RuntimeResponseGenericRuntimeResponseTypeUserDefined', + 'RuntimeResponseGenericRuntimeResponseTypeVideo', + 'RuntimeResponseGenericRuntimeResponseTypeAudio', + 'RuntimeResponseGenericRuntimeResponseTypeIframe', + 'RuntimeResponseGenericRuntimeResponseTypeDate' + ])) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RuntimeResponseGeneric': + """Initialize a RuntimeResponseGeneric object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'RuntimeResponseGeneric'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join([ + 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch', + 'RuntimeResponseGenericRuntimeResponseTypeText', + 'RuntimeResponseGenericRuntimeResponseTypePause', + 'RuntimeResponseGenericRuntimeResponseTypeImage', + 'RuntimeResponseGenericRuntimeResponseTypeOption', + 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent', + 'RuntimeResponseGenericRuntimeResponseTypeSuggestion', + 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer', + 'RuntimeResponseGenericRuntimeResponseTypeSearch', + 'RuntimeResponseGenericRuntimeResponseTypeUserDefined', + 'RuntimeResponseGenericRuntimeResponseTypeVideo', + 'RuntimeResponseGenericRuntimeResponseTypeAudio', + 'RuntimeResponseGenericRuntimeResponseTypeIframe', + 'RuntimeResponseGenericRuntimeResponseTypeDate' + ])) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a RuntimeResponseGeneric object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping[ + 'conversation_search'] = 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch' + mapping['audio'] = 'RuntimeResponseGenericRuntimeResponseTypeAudio' + mapping[ + 'channel_transfer'] = 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer' + mapping[ + 'connect_to_agent'] = 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent' + mapping['date'] = 'RuntimeResponseGenericRuntimeResponseTypeDate' + mapping['iframe'] = 'RuntimeResponseGenericRuntimeResponseTypeIframe' + mapping['image'] = 'RuntimeResponseGenericRuntimeResponseTypeImage' + mapping['option'] = 'RuntimeResponseGenericRuntimeResponseTypeOption' + mapping[ + 'suggestion'] = 'RuntimeResponseGenericRuntimeResponseTypeSuggestion' + mapping['pause'] = 'RuntimeResponseGenericRuntimeResponseTypePause' + mapping['search'] = 'RuntimeResponseGenericRuntimeResponseTypeSearch' + mapping['text'] = 'RuntimeResponseGenericRuntimeResponseTypeText' + mapping[ + 'user_defined'] = 'RuntimeResponseGenericRuntimeResponseTypeUserDefined' + mapping['video'] = 'RuntimeResponseGenericRuntimeResponseTypeVideo' + disc_value = _dict.get('response_type') + if disc_value is None: + raise ValueError( + 'Discriminator property \'response_type\' not found in RuntimeResponseGeneric JSON' + ) + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + +class SearchResult: + """ + SearchResult. + + :param str id: The unique identifier of the document in the Discovery service + collection. + This property is included in responses from search skills, which are available + only to Plus or Enterprise plan users. + :param SearchResultMetadata result_metadata: An object containing search result + metadata from the Discovery service. + :param str body: (optional) A description of the search result. This is taken + from an abstract, summary, or highlight field in the Discovery service response, + as specified in the search skill configuration. + :param str title: (optional) The title of the search result. This is taken from + a title or name field in the Discovery service response, as specified in the + search skill configuration. + :param str url: (optional) The URL of the original data object in its native + data source. + :param SearchResultHighlight highlight: (optional) An object containing segments + of text from search results with query-matching text highlighted using HTML + `` tags. + :param List[SearchResultAnswer] answers: (optional) An array specifying segments + of text within the result that were identified as direct answers to the search + query. Currently, only the single answer with the highest confidence (if any) is + returned. + **Notes:** + - Answer finding is available only if the search skill is connected to a + Discovery v2 service instance. + - Answer finding is not supported on IBM Cloud Pak for Data. + """ + + def __init__( + self, + id: str, + result_metadata: 'SearchResultMetadata', + *, + body: Optional[str] = None, + title: Optional[str] = None, + url: Optional[str] = None, + highlight: Optional['SearchResultHighlight'] = None, + answers: Optional[List['SearchResultAnswer']] = None, + ) -> None: + """ + Initialize a SearchResult object. + + :param str id: The unique identifier of the document in the Discovery + service collection. + This property is included in responses from search skills, which are + available only to Plus or Enterprise plan users. + :param SearchResultMetadata result_metadata: An object containing search + result metadata from the Discovery service. + :param str body: (optional) A description of the search result. This is + taken from an abstract, summary, or highlight field in the Discovery + service response, as specified in the search skill configuration. + :param str title: (optional) The title of the search result. This is taken + from a title or name field in the Discovery service response, as specified + in the search skill configuration. + :param str url: (optional) The URL of the original data object in its + native data source. + :param SearchResultHighlight highlight: (optional) An object containing + segments of text from search results with query-matching text highlighted + using HTML `` tags. + :param List[SearchResultAnswer] answers: (optional) An array specifying + segments of text within the result that were identified as direct answers + to the search query. Currently, only the single answer with the highest + confidence (if any) is returned. + **Notes:** + - Answer finding is available only if the search skill is connected to a + Discovery v2 service instance. + - Answer finding is not supported on IBM Cloud Pak for Data. + """ + self.id = id + self.result_metadata = result_metadata + self.body = body + self.title = title + self.url = url + self.highlight = highlight + self.answers = answers + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResult': + """Initialize a SearchResult object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError( + 'Required property \'id\' not present in SearchResult JSON') + if (result_metadata := _dict.get('result_metadata')) is not None: + args['result_metadata'] = SearchResultMetadata.from_dict( + result_metadata) + else: + raise ValueError( + 'Required property \'result_metadata\' not present in SearchResult JSON' + ) + if (body := _dict.get('body')) is not None: + args['body'] = body + if (title := _dict.get('title')) is not None: + args['title'] = title + if (url := _dict.get('url')) is not None: + args['url'] = url + if (highlight := _dict.get('highlight')) is not None: + args['highlight'] = SearchResultHighlight.from_dict(highlight) + if (answers := _dict.get('answers')) is not None: + args['answers'] = [SearchResultAnswer.from_dict(v) for v in answers] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResult object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, + 'result_metadata') and self.result_metadata is not None: + if isinstance(self.result_metadata, dict): + _dict['result_metadata'] = self.result_metadata + else: + _dict['result_metadata'] = self.result_metadata.to_dict() + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'highlight') and self.highlight is not None: + if isinstance(self.highlight, dict): + _dict['highlight'] = self.highlight + else: + _dict['highlight'] = self.highlight.to_dict() + if hasattr(self, 'answers') and self.answers is not None: + answers_list = [] + for v in self.answers: + if isinstance(v, dict): + answers_list.append(v) + else: + answers_list.append(v.to_dict()) + _dict['answers'] = answers_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchResult object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResult') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResult') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchResultAnswer: + """ + An object specifing a segment of text that was identified as a direct answer to the + search query. + + :param str text: The text of the answer. + :param float confidence: The confidence score for the answer, as returned by the + Discovery service. + """ + + def __init__( + self, + text: str, + confidence: float, + ) -> None: + """ + Initialize a SearchResultAnswer object. + + :param str text: The text of the answer. + :param float confidence: The confidence score for the answer, as returned + by the Discovery service. + """ + self.text = text + self.confidence = confidence + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResultAnswer': + """Initialize a SearchResultAnswer object from a json dictionary.""" + args = {} + if (text := _dict.get('text')) is not None: + args['text'] = text + else: + raise ValueError( + 'Required property \'text\' not present in SearchResultAnswer JSON' + ) + if (confidence := _dict.get('confidence')) is not None: + args['confidence'] = confidence + else: + raise ValueError( + 'Required property \'confidence\' not present in SearchResultAnswer JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResultAnswer object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'confidence') and self.confidence is not None: + _dict['confidence'] = self.confidence + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchResultAnswer object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResultAnswer') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResultAnswer') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchResultHighlight: + """ + An object containing segments of text from search results with query-matching text + highlighted using HTML `` tags. + + :param List[str] body: (optional) An array of strings containing segments taken + from body text in the search results, with query-matching substrings + highlighted. + :param List[str] title: (optional) An array of strings containing segments taken + from title text in the search results, with query-matching substrings + highlighted. + :param List[str] url: (optional) An array of strings containing segments taken + from URLs in the search results, with query-matching substrings highlighted. + + This type supports additional properties of type List[str]. An array of strings + containing segments taken from a field in the search results that is not mapped to the + `body`, `title`, or `url` property, with query-matching substrings highlighted. The + property name is the name of the field in the Discovery collection. + """ + + # The set of defined properties for the class + _properties = frozenset(['body', 'title', 'url']) + + def __init__( + self, + *, + body: Optional[List[str]] = None, + title: Optional[List[str]] = None, + url: Optional[List[str]] = None, + **kwargs: Optional[List[str]], + ) -> None: + """ + Initialize a SearchResultHighlight object. + + :param List[str] body: (optional) An array of strings containing segments + taken from body text in the search results, with query-matching substrings + highlighted. + :param List[str] title: (optional) An array of strings containing segments + taken from title text in the search results, with query-matching substrings + highlighted. + :param List[str] url: (optional) An array of strings containing segments + taken from URLs in the search results, with query-matching substrings + highlighted. + :param List[str] **kwargs: (optional) An array of strings containing + segments taken from a field in the search results that is not mapped to the + `body`, `title`, or `url` property, with query-matching substrings + highlighted. The property name is the name of the field in the Discovery + collection. + """ + self.body = body + self.title = title + self.url = url + for k, v in kwargs.items(): + if k not in SearchResultHighlight._properties: + if not isinstance(v, List): + raise ValueError( + 'Value for additional property {} must be of type List[Foo]' + .format(k)) + _v = [] + for elem in v: + if not isinstance(elem, str): + raise ValueError( + 'Value for additional property {} must be of type List[str]' + .format(k)) + _v.append(elem) + setattr(self, k, _v) + else: + raise ValueError( + 'Property {} cannot be specified as an additional property'. + format(k)) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResultHighlight': + """Initialize a SearchResultHighlight object from a json dictionary.""" + args = {} + if (body := _dict.get('body')) is not None: + args['body'] = body + if (title := _dict.get('title')) is not None: + args['title'] = title + if (url := _dict.get('url')) is not None: + args['url'] = url + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, List): + raise ValueError( + 'Value for additional property {} must be of type List[str]' + .format(k)) + _v = [] + for elem in v: + if not isinstance(elem, str): + raise ValueError( + 'Value for additional property {} must be of type List[str]' + .format(k)) + _v.append(elem) + args[k] = _v + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResultHighlight object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + for k in [ + _k for _k in vars(self).keys() + if _k not in SearchResultHighlight._properties + ]: + _dict[k] = getattr(self, k) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def get_properties(self) -> Dict: + """Return the additional properties from this instance of SearchResultHighlight in the form of a dict.""" + _dict = {} + for k in [ + _k for _k in vars(self).keys() + if _k not in SearchResultHighlight._properties + ]: + _dict[k] = getattr(self, k) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of additional properties in this instance of SearchResultHighlight""" + for k in [ + _k for _k in vars(self).keys() + if _k not in SearchResultHighlight._properties + ]: + delattr(self, k) + for k, v in _dict.items(): + if k not in SearchResultHighlight._properties: + if not isinstance(v, List): + raise ValueError( + 'Value for additional property {} must be of type List[str]' + .format(k)) + _v = [] + for elem in v: + if not isinstance(elem, str): + raise ValueError( + 'Value for additional property {} must be of type List[str]' + .format(k)) + _v.append(elem) + setattr(self, k, _v) + else: + raise ValueError( + 'Property {} cannot be specified as an additional property'. + format(k)) + + def __str__(self) -> str: + """Return a `str` version of this SearchResultHighlight object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResultHighlight') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResultHighlight') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchResultMetadata: + """ + An object containing search result metadata from the Discovery service. + + :param float confidence: (optional) The confidence score for the given result, + as returned by the Discovery service. + :param float score: (optional) An unbounded measure of the relevance of a + particular result, dependent on the query and matching document. A higher score + indicates a greater match to the query parameters. + """ + + def __init__( + self, + *, + confidence: Optional[float] = None, + score: Optional[float] = None, + ) -> None: + """ + Initialize a SearchResultMetadata object. + + :param float confidence: (optional) The confidence score for the given + result, as returned by the Discovery service. + :param float score: (optional) An unbounded measure of the relevance of a + particular result, dependent on the query and matching document. A higher + score indicates a greater match to the query parameters. + """ + self.confidence = confidence + self.score = score + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResultMetadata': + """Initialize a SearchResultMetadata object from a json dictionary.""" + args = {} + if (confidence := _dict.get('confidence')) is not None: + args['confidence'] = confidence + if (score := _dict.get('score')) is not None: + args['score'] = score + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResultMetadata object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'confidence') and self.confidence is not None: + _dict['confidence'] = self.confidence + if hasattr(self, 'score') and self.score is not None: + _dict['score'] = self.score + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchResultMetadata object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResultMetadata') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResultMetadata') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchResults: + """ + SearchResults. + + :param SearchResultsResultMetadata result_metadata: The metadata of the search + result. + :param str id: The ID of the search result. It may not be unique. + :param str title: The title of the search result. + :param str body: The body content of the search result. + """ + + def __init__( + self, + result_metadata: 'SearchResultsResultMetadata', + id: str, + title: str, + body: str, + ) -> None: + """ + Initialize a SearchResults object. + + :param SearchResultsResultMetadata result_metadata: The metadata of the + search result. + :param str id: The ID of the search result. It may not be unique. + :param str title: The title of the search result. + :param str body: The body content of the search result. + """ + self.result_metadata = result_metadata + self.id = id + self.title = title + self.body = body + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResults': + """Initialize a SearchResults object from a json dictionary.""" + args = {} + if (result_metadata := _dict.get('result_metadata')) is not None: + args['result_metadata'] = SearchResultsResultMetadata.from_dict( + result_metadata) + else: + raise ValueError( + 'Required property \'result_metadata\' not present in SearchResults JSON' + ) + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError( + 'Required property \'id\' not present in SearchResults JSON') + if (title := _dict.get('title')) is not None: + args['title'] = title + else: + raise ValueError( + 'Required property \'title\' not present in SearchResults JSON') + if (body := _dict.get('body')) is not None: + args['body'] = body + else: + raise ValueError( + 'Required property \'body\' not present in SearchResults JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResults object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, + 'result_metadata') and self.result_metadata is not None: + if isinstance(self.result_metadata, dict): + _dict['result_metadata'] = self.result_metadata + else: + _dict['result_metadata'] = self.result_metadata.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchResults object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResults') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResults') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchResultsResultMetadata: + """ + The metadata of the search result. + + :param str document_retrieval_source: (optional) The source of the search + result. + :param int score: (optional) The relevance score of the search result to the + user query. + """ + + def __init__( + self, + *, + document_retrieval_source: Optional[str] = None, + score: Optional[int] = None, + ) -> None: + """ + Initialize a SearchResultsResultMetadata object. + + :param str document_retrieval_source: (optional) The source of the search + result. + :param int score: (optional) The relevance score of the search result to + the user query. + """ + self.document_retrieval_source = document_retrieval_source + self.score = score + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchResultsResultMetadata': + """Initialize a SearchResultsResultMetadata object from a json dictionary.""" + args = {} + if (document_retrieval_source := + _dict.get('document_retrieval_source')) is not None: + args['document_retrieval_source'] = document_retrieval_source + if (score := _dict.get('score')) is not None: + args['score'] = score + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchResultsResultMetadata object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'document_retrieval_source' + ) and self.document_retrieval_source is not None: + _dict['document_retrieval_source'] = self.document_retrieval_source + if hasattr(self, 'score') and self.score is not None: + _dict['score'] = self.score + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchResultsResultMetadata object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchResultsResultMetadata') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchResultsResultMetadata') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettings: + """ + An object describing the search skill configuration. + **Note:** Search settings are not supported in **Import skills** requests, and are not + included in **Export skills** responses. + + :param SearchSettingsDiscovery discovery: (optional) Configuration settings for + the Watson Discovery service instance used by the search integration. + :param SearchSettingsMessages messages: The messages included with responses + from the search integration. + :param SearchSettingsSchemaMapping schema_mapping: The mapping between fields in + the Watson Discovery collection and properties in the search response. + :param SearchSettingsElasticSearch elastic_search: (optional) Configuration + settings for the Elasticsearch service used by the search integration. You can + provide either basic auth or apiKey auth. + :param SearchSettingsConversationalSearch conversational_search: Configuration + settings for conversational search. + :param SearchSettingsServerSideSearch server_side_search: (optional) + Configuration settings for the server-side search service used by the search + integration. You can provide either basic auth, apiKey auth or none. + :param SearchSettingsClientSideSearch client_side_search: (optional) + Configuration settings for the client-side search service or server-side search + service used by the search integration. + """ + + def __init__( + self, + messages: 'SearchSettingsMessages', + schema_mapping: 'SearchSettingsSchemaMapping', + conversational_search: 'SearchSettingsConversationalSearch', + *, + discovery: Optional['SearchSettingsDiscovery'] = None, + elastic_search: Optional['SearchSettingsElasticSearch'] = None, + server_side_search: Optional['SearchSettingsServerSideSearch'] = None, + client_side_search: Optional['SearchSettingsClientSideSearch'] = None, + ) -> None: + """ + Initialize a SearchSettings object. + + :param SearchSettingsMessages messages: The messages included with + responses from the search integration. + :param SearchSettingsSchemaMapping schema_mapping: The mapping between + fields in the Watson Discovery collection and properties in the search + response. + :param SearchSettingsConversationalSearch conversational_search: + Configuration settings for conversational search. + :param SearchSettingsDiscovery discovery: (optional) Configuration settings + for the Watson Discovery service instance used by the search integration. + :param SearchSettingsElasticSearch elastic_search: (optional) Configuration + settings for the Elasticsearch service used by the search integration. You + can provide either basic auth or apiKey auth. + :param SearchSettingsServerSideSearch server_side_search: (optional) + Configuration settings for the server-side search service used by the + search integration. You can provide either basic auth, apiKey auth or none. + :param SearchSettingsClientSideSearch client_side_search: (optional) + Configuration settings for the client-side search service or server-side + search service used by the search integration. + """ + self.discovery = discovery + self.messages = messages + self.schema_mapping = schema_mapping + self.elastic_search = elastic_search + self.conversational_search = conversational_search + self.server_side_search = server_side_search + self.client_side_search = client_side_search + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettings': + """Initialize a SearchSettings object from a json dictionary.""" + args = {} + if (discovery := _dict.get('discovery')) is not None: + args['discovery'] = SearchSettingsDiscovery.from_dict(discovery) + if (messages := _dict.get('messages')) is not None: + args['messages'] = SearchSettingsMessages.from_dict(messages) + else: + raise ValueError( + 'Required property \'messages\' not present in SearchSettings JSON' + ) + if (schema_mapping := _dict.get('schema_mapping')) is not None: + args['schema_mapping'] = SearchSettingsSchemaMapping.from_dict( + schema_mapping) + else: + raise ValueError( + 'Required property \'schema_mapping\' not present in SearchSettings JSON' + ) + if (elastic_search := _dict.get('elastic_search')) is not None: + args['elastic_search'] = SearchSettingsElasticSearch.from_dict( + elastic_search) + if (conversational_search := + _dict.get('conversational_search')) is not None: + args[ + 'conversational_search'] = SearchSettingsConversationalSearch.from_dict( + conversational_search) + else: + raise ValueError( + 'Required property \'conversational_search\' not present in SearchSettings JSON' + ) + if (server_side_search := _dict.get('server_side_search')) is not None: + args[ + 'server_side_search'] = SearchSettingsServerSideSearch.from_dict( + server_side_search) + if (client_side_search := _dict.get('client_side_search')) is not None: + args[ + 'client_side_search'] = SearchSettingsClientSideSearch.from_dict( + client_side_search) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettings object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'discovery') and self.discovery is not None: + if isinstance(self.discovery, dict): + _dict['discovery'] = self.discovery + else: + _dict['discovery'] = self.discovery.to_dict() + if hasattr(self, 'messages') and self.messages is not None: + if isinstance(self.messages, dict): + _dict['messages'] = self.messages + else: + _dict['messages'] = self.messages.to_dict() + if hasattr(self, 'schema_mapping') and self.schema_mapping is not None: + if isinstance(self.schema_mapping, dict): + _dict['schema_mapping'] = self.schema_mapping + else: + _dict['schema_mapping'] = self.schema_mapping.to_dict() + if hasattr(self, 'elastic_search') and self.elastic_search is not None: + if isinstance(self.elastic_search, dict): + _dict['elastic_search'] = self.elastic_search + else: + _dict['elastic_search'] = self.elastic_search.to_dict() + if hasattr(self, 'conversational_search' + ) and self.conversational_search is not None: + if isinstance(self.conversational_search, dict): + _dict['conversational_search'] = self.conversational_search + else: + _dict[ + 'conversational_search'] = self.conversational_search.to_dict( + ) + if hasattr( + self, + 'server_side_search') and self.server_side_search is not None: + if isinstance(self.server_side_search, dict): + _dict['server_side_search'] = self.server_side_search + else: + _dict['server_side_search'] = self.server_side_search.to_dict() + if hasattr( + self, + 'client_side_search') and self.client_side_search is not None: + if isinstance(self.client_side_search, dict): + _dict['client_side_search'] = self.client_side_search + else: + _dict['client_side_search'] = self.client_side_search.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettings object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettings') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettings') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsClientSideSearch: + """ + Configuration settings for the client-side search service or server-side search + service used by the search integration. + + :param str filter: (optional) The filter string that is applied to the search + results. + :param dict metadata: (optional) The metadata object. + """ + + def __init__( + self, + *, + filter: Optional[str] = None, + metadata: Optional[dict] = None, + ) -> None: + """ + Initialize a SearchSettingsClientSideSearch object. + + :param str filter: (optional) The filter string that is applied to the + search results. + :param dict metadata: (optional) The metadata object. + """ + self.filter = filter + self.metadata = metadata + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsClientSideSearch': + """Initialize a SearchSettingsClientSideSearch object from a json dictionary.""" + args = {} + if (filter := _dict.get('filter')) is not None: + args['filter'] = filter + if (metadata := _dict.get('metadata')) is not None: + args['metadata'] = metadata + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsClientSideSearch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'filter') and self.filter is not None: + _dict['filter'] = self.filter + if hasattr(self, 'metadata') and self.metadata is not None: + _dict['metadata'] = self.metadata + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsClientSideSearch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsClientSideSearch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsClientSideSearch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsConversationalSearch: + """ + Configuration settings for conversational search. + + :param bool enabled: Whether to enable conversational search. + :param SearchSettingsConversationalSearchResponseLength response_length: + (optional) + :param SearchSettingsConversationalSearchSearchConfidence search_confidence: + (optional) + """ + + def __init__( + self, + enabled: bool, + *, + response_length: Optional[ + 'SearchSettingsConversationalSearchResponseLength'] = None, + search_confidence: Optional[ + 'SearchSettingsConversationalSearchSearchConfidence'] = None, + ) -> None: + """ + Initialize a SearchSettingsConversationalSearch object. + + :param bool enabled: Whether to enable conversational search. + :param SearchSettingsConversationalSearchResponseLength response_length: + (optional) + :param SearchSettingsConversationalSearchSearchConfidence + search_confidence: (optional) + """ + self.enabled = enabled + self.response_length = response_length + self.search_confidence = search_confidence + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsConversationalSearch': + """Initialize a SearchSettingsConversationalSearch object from a json dictionary.""" + args = {} + if (enabled := _dict.get('enabled')) is not None: + args['enabled'] = enabled + else: + raise ValueError( + 'Required property \'enabled\' not present in SearchSettingsConversationalSearch JSON' + ) + if (response_length := _dict.get('response_length')) is not None: + args[ + 'response_length'] = SearchSettingsConversationalSearchResponseLength.from_dict( + response_length) + if (search_confidence := _dict.get('search_confidence')) is not None: + args[ + 'search_confidence'] = SearchSettingsConversationalSearchSearchConfidence.from_dict( + search_confidence) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsConversationalSearch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, + 'response_length') and self.response_length is not None: + if isinstance(self.response_length, dict): + _dict['response_length'] = self.response_length + else: + _dict['response_length'] = self.response_length.to_dict() + if hasattr(self, + 'search_confidence') and self.search_confidence is not None: + if isinstance(self.search_confidence, dict): + _dict['search_confidence'] = self.search_confidence + else: + _dict['search_confidence'] = self.search_confidence.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsConversationalSearch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsConversationalSearch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsConversationalSearch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsConversationalSearchResponseLength: + """ + SearchSettingsConversationalSearchResponseLength. + + :param str option: (optional) The response length option. It controls the length + of the generated response. + """ + + def __init__( + self, + *, + option: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSettingsConversationalSearchResponseLength object. + + :param str option: (optional) The response length option. It controls the + length of the generated response. + """ + self.option = option + + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'SearchSettingsConversationalSearchResponseLength': + """Initialize a SearchSettingsConversationalSearchResponseLength object from a json dictionary.""" + args = {} + if (option := _dict.get('option')) is not None: + args['option'] = option + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsConversationalSearchResponseLength object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'option') and self.option is not None: + _dict['option'] = self.option + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsConversationalSearchResponseLength object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'SearchSettingsConversationalSearchResponseLength') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, + other: 'SearchSettingsConversationalSearchResponseLength') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class OptionEnum(str, Enum): + """ + The response length option. It controls the length of the generated response. + """ + + CONCISE = 'concise' + MODERATE = 'moderate' + VERBOSE = 'verbose' + + +class SearchSettingsConversationalSearchSearchConfidence: + """ + SearchSettingsConversationalSearchSearchConfidence. + + :param str threshold: (optional) The search confidence threshold. + It controls the tendency for conversational search to produce “I don't know” + answers. + """ + + def __init__( + self, + *, + threshold: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSettingsConversationalSearchSearchConfidence object. + + :param str threshold: (optional) The search confidence threshold. + It controls the tendency for conversational search to produce “I don't + know” answers. + """ + self.threshold = threshold + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'SearchSettingsConversationalSearchSearchConfidence': + """Initialize a SearchSettingsConversationalSearchSearchConfidence object from a json dictionary.""" + args = {} + if (threshold := _dict.get('threshold')) is not None: + args['threshold'] = threshold + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsConversationalSearchSearchConfidence object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'threshold') and self.threshold is not None: + _dict['threshold'] = self.threshold + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsConversationalSearchSearchConfidence object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: 'SearchSettingsConversationalSearchSearchConfidence' + ) -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, other: 'SearchSettingsConversationalSearchSearchConfidence' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ThresholdEnum(str, Enum): + """ + The search confidence threshold. + It controls the tendency for conversational search to produce “I don't know” + answers. + """ + + RARELY = 'rarely' + LESS_OFTEN = 'less_often' + MORE_OFTEN = 'more_often' + MOST_OFTEN = 'most_often' + + +class SearchSettingsDiscovery: + """ + Configuration settings for the Watson Discovery service instance used by the search + integration. + + :param str instance_id: The ID for the Watson Discovery service instance. + :param str project_id: The ID for the Watson Discovery project. + :param str url: The URL for the Watson Discovery service instance. + :param int max_primary_results: (optional) The maximum number of primary results + to include in the response. + :param int max_total_results: (optional) The maximum total number of primary and + additional results to include in the response. + :param float confidence_threshold: (optional) The minimum confidence threshold + for included results. Any results with a confidence below this threshold will be + discarded. + :param bool highlight: (optional) Whether to include the most relevant passages + of text in the **highlight** property of each result. + :param bool find_answers: (optional) Whether to use the answer finding feature + to emphasize answers within highlighted passages. This property is ignored if + **highlight**=`false`. + **Notes:** + - Answer finding is available only if the search skill is connected to a + Discovery v2 service instance. + - Answer finding is not supported on IBM Cloud Pak for Data. + :param SearchSettingsDiscoveryAuthentication authentication: Authentication + information for the Watson Discovery service. For more information, see the + [Watson Discovery + documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + **Note:** You must specify either **basic** or **bearer**, but not both. + """ + + def __init__( + self, + instance_id: str, + project_id: str, + url: str, + authentication: 'SearchSettingsDiscoveryAuthentication', + *, + max_primary_results: Optional[int] = None, + max_total_results: Optional[int] = None, + confidence_threshold: Optional[float] = None, + highlight: Optional[bool] = None, + find_answers: Optional[bool] = None, + ) -> None: + """ + Initialize a SearchSettingsDiscovery object. + + :param str instance_id: The ID for the Watson Discovery service instance. + :param str project_id: The ID for the Watson Discovery project. + :param str url: The URL for the Watson Discovery service instance. + :param SearchSettingsDiscoveryAuthentication authentication: Authentication + information for the Watson Discovery service. For more information, see the + [Watson Discovery + documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + **Note:** You must specify either **basic** or **bearer**, but not both. + :param int max_primary_results: (optional) The maximum number of primary + results to include in the response. + :param int max_total_results: (optional) The maximum total number of + primary and additional results to include in the response. + :param float confidence_threshold: (optional) The minimum confidence + threshold for included results. Any results with a confidence below this + threshold will be discarded. + :param bool highlight: (optional) Whether to include the most relevant + passages of text in the **highlight** property of each result. + :param bool find_answers: (optional) Whether to use the answer finding + feature to emphasize answers within highlighted passages. This property is + ignored if **highlight**=`false`. + **Notes:** + - Answer finding is available only if the search skill is connected to a + Discovery v2 service instance. + - Answer finding is not supported on IBM Cloud Pak for Data. + """ + self.instance_id = instance_id + self.project_id = project_id + self.url = url + self.max_primary_results = max_primary_results + self.max_total_results = max_total_results + self.confidence_threshold = confidence_threshold + self.highlight = highlight + self.find_answers = find_answers + self.authentication = authentication + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscovery': + """Initialize a SearchSettingsDiscovery object from a json dictionary.""" + args = {} + if (instance_id := _dict.get('instance_id')) is not None: + args['instance_id'] = instance_id + else: + raise ValueError( + 'Required property \'instance_id\' not present in SearchSettingsDiscovery JSON' + ) + if (project_id := _dict.get('project_id')) is not None: + args['project_id'] = project_id + else: + raise ValueError( + 'Required property \'project_id\' not present in SearchSettingsDiscovery JSON' + ) + if (url := _dict.get('url')) is not None: + args['url'] = url + else: + raise ValueError( + 'Required property \'url\' not present in SearchSettingsDiscovery JSON' + ) + if (max_primary_results := + _dict.get('max_primary_results')) is not None: + args['max_primary_results'] = max_primary_results + if (max_total_results := _dict.get('max_total_results')) is not None: + args['max_total_results'] = max_total_results + if (confidence_threshold := + _dict.get('confidence_threshold')) is not None: + args['confidence_threshold'] = confidence_threshold + if (highlight := _dict.get('highlight')) is not None: + args['highlight'] = highlight + if (find_answers := _dict.get('find_answers')) is not None: + args['find_answers'] = find_answers + if (authentication := _dict.get('authentication')) is not None: + args[ + 'authentication'] = SearchSettingsDiscoveryAuthentication.from_dict( + authentication) + else: + raise ValueError( + 'Required property \'authentication\' not present in SearchSettingsDiscovery JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsDiscovery object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'instance_id') and self.instance_id is not None: + _dict['instance_id'] = self.instance_id + if hasattr(self, 'project_id') and self.project_id is not None: + _dict['project_id'] = self.project_id + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr( + self, + 'max_primary_results') and self.max_primary_results is not None: + _dict['max_primary_results'] = self.max_primary_results + if hasattr(self, + 'max_total_results') and self.max_total_results is not None: + _dict['max_total_results'] = self.max_total_results + if hasattr(self, 'confidence_threshold' + ) and self.confidence_threshold is not None: + _dict['confidence_threshold'] = self.confidence_threshold + if hasattr(self, 'highlight') and self.highlight is not None: + _dict['highlight'] = self.highlight + if hasattr(self, 'find_answers') and self.find_answers is not None: + _dict['find_answers'] = self.find_answers + if hasattr(self, 'authentication') and self.authentication is not None: + if isinstance(self.authentication, dict): + _dict['authentication'] = self.authentication + else: + _dict['authentication'] = self.authentication.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsDiscovery object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsDiscovery') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsDiscovery') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsDiscoveryAuthentication: + """ + Authentication information for the Watson Discovery service. For more information, see + the [Watson Discovery + documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + **Note:** You must specify either **basic** or **bearer**, but not both. + + :param str basic: (optional) The HTTP basic authentication credentials for + Watson Discovery. Specify your Watson Discovery API key in the format + `apikey:{apikey}`. + :param str bearer: (optional) The authentication bearer token for Watson + Discovery. + """ + + def __init__( + self, + *, + basic: Optional[str] = None, + bearer: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSettingsDiscoveryAuthentication object. + + :param str basic: (optional) The HTTP basic authentication credentials for + Watson Discovery. Specify your Watson Discovery API key in the format + `apikey:{apikey}`. + :param str bearer: (optional) The authentication bearer token for Watson + Discovery. + """ + self.basic = basic + self.bearer = bearer + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscoveryAuthentication': + """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" + args = {} + if (basic := _dict.get('basic')) is not None: + args['basic'] = basic + if (bearer := _dict.get('bearer')) is not None: + args['bearer'] = bearer + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'basic') and self.basic is not None: + _dict['basic'] = self.basic + if hasattr(self, 'bearer') and self.bearer is not None: + _dict['bearer'] = self.bearer + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsDiscoveryAuthentication object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsDiscoveryAuthentication') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsDiscoveryAuthentication') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsElasticSearch: + """ + Configuration settings for the Elasticsearch service used by the search integration. + You can provide either basic auth or apiKey auth. + + :param str url: The URL for the Elasticsearch service. + :param str port: The port number for the Elasticsearch service URL. + **Note:** It can be omitted if a port number is appended to the URL. + :param str username: (optional) The username of the basic authentication method. + :param str password: (optional) The password of the basic authentication method. + The credentials are not returned due to security reasons. + :param str index: The Elasticsearch index to use for the search integration. + :param List[object] filter: (optional) An array of filters that can be applied + to the search results via the `$FILTER` variable in the `query_body`.For more + information, see [Elasticsearch filter + documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html). + :param dict query_body: (optional) The Elasticsearch query object. For more + information, see [Elasticsearch search API + documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html). + :param str managed_index: (optional) The Elasticsearch index for uploading + documents. It is created automatically when the upload document option is + selected from the user interface. + :param str apikey: (optional) The API key of the apiKey authentication method. + Use either basic auth or apiKey auth. The credentials are not returned due to + security reasons. + """ + + def __init__( + self, + url: str, + port: str, + index: str, + *, + username: Optional[str] = None, + password: Optional[str] = None, + filter: Optional[List[object]] = None, + query_body: Optional[dict] = None, + managed_index: Optional[str] = None, + apikey: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSettingsElasticSearch object. + + :param str url: The URL for the Elasticsearch service. + :param str port: The port number for the Elasticsearch service URL. + **Note:** It can be omitted if a port number is appended to the URL. + :param str index: The Elasticsearch index to use for the search + integration. + :param str username: (optional) The username of the basic authentication + method. + :param str password: (optional) The password of the basic authentication + method. The credentials are not returned due to security reasons. + :param List[object] filter: (optional) An array of filters that can be + applied to the search results via the `$FILTER` variable in the + `query_body`.For more information, see [Elasticsearch filter + documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html). + :param dict query_body: (optional) The Elasticsearch query object. For more + information, see [Elasticsearch search API + documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html). + :param str managed_index: (optional) The Elasticsearch index for uploading + documents. It is created automatically when the upload document option is + selected from the user interface. + :param str apikey: (optional) The API key of the apiKey authentication + method. Use either basic auth or apiKey auth. The credentials are not + returned due to security reasons. + """ + self.url = url + self.port = port + self.username = username + self.password = password + self.index = index + self.filter = filter + self.query_body = query_body + self.managed_index = managed_index + self.apikey = apikey + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsElasticSearch': + """Initialize a SearchSettingsElasticSearch object from a json dictionary.""" + args = {} + if (url := _dict.get('url')) is not None: + args['url'] = url + else: + raise ValueError( + 'Required property \'url\' not present in SearchSettingsElasticSearch JSON' + ) + if (port := _dict.get('port')) is not None: + args['port'] = port + else: + raise ValueError( + 'Required property \'port\' not present in SearchSettingsElasticSearch JSON' + ) + if (username := _dict.get('username')) is not None: + args['username'] = username + if (password := _dict.get('password')) is not None: + args['password'] = password + if (index := _dict.get('index')) is not None: + args['index'] = index + else: + raise ValueError( + 'Required property \'index\' not present in SearchSettingsElasticSearch JSON' + ) + if (filter := _dict.get('filter')) is not None: + args['filter'] = filter + if (query_body := _dict.get('query_body')) is not None: + args['query_body'] = query_body + if (managed_index := _dict.get('managed_index')) is not None: + args['managed_index'] = managed_index + if (apikey := _dict.get('apikey')) is not None: + args['apikey'] = apikey + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsElasticSearch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'username') and self.username is not None: + _dict['username'] = self.username + if hasattr(self, 'password') and self.password is not None: + _dict['password'] = self.password + if hasattr(self, 'index') and self.index is not None: + _dict['index'] = self.index + if hasattr(self, 'filter') and self.filter is not None: + _dict['filter'] = self.filter + if hasattr(self, 'query_body') and self.query_body is not None: + _dict['query_body'] = self.query_body + if hasattr(self, 'managed_index') and self.managed_index is not None: + _dict['managed_index'] = self.managed_index + if hasattr(self, 'apikey') and self.apikey is not None: + _dict['apikey'] = self.apikey + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsElasticSearch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsElasticSearch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsElasticSearch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsMessages: + """ + The messages included with responses from the search integration. + + :param str success: The message to include in the response to a successful + query. + :param str error: The message to include in the response when the query + encounters an error. + :param str no_result: The message to include in the response when there is no + result from the query. + """ + + def __init__( + self, + success: str, + error: str, + no_result: str, + ) -> None: + """ + Initialize a SearchSettingsMessages object. + + :param str success: The message to include in the response to a successful + query. + :param str error: The message to include in the response when the query + encounters an error. + :param str no_result: The message to include in the response when there is + no result from the query. + """ + self.success = success + self.error = error + self.no_result = no_result + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsMessages': + """Initialize a SearchSettingsMessages object from a json dictionary.""" + args = {} + if (success := _dict.get('success')) is not None: + args['success'] = success + else: + raise ValueError( + 'Required property \'success\' not present in SearchSettingsMessages JSON' + ) + if (error := _dict.get('error')) is not None: + args['error'] = error + else: + raise ValueError( + 'Required property \'error\' not present in SearchSettingsMessages JSON' + ) + if (no_result := _dict.get('no_result')) is not None: + args['no_result'] = no_result + else: + raise ValueError( + 'Required property \'no_result\' not present in SearchSettingsMessages JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsMessages object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'success') and self.success is not None: + _dict['success'] = self.success + if hasattr(self, 'error') and self.error is not None: + _dict['error'] = self.error + if hasattr(self, 'no_result') and self.no_result is not None: + _dict['no_result'] = self.no_result + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsMessages object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsMessages') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsMessages') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsSchemaMapping: + """ + The mapping between fields in the Watson Discovery collection and properties in the + search response. + + :param str url: The field in the collection to map to the **url** property of + the response. + :param str body: The field in the collection to map to the **body** property in + the response. + :param str title: The field in the collection to map to the **title** property + for the schema. + """ + + def __init__( + self, + url: str, + body: str, + title: str, + ) -> None: + """ + Initialize a SearchSettingsSchemaMapping object. + + :param str url: The field in the collection to map to the **url** property + of the response. + :param str body: The field in the collection to map to the **body** + property in the response. + :param str title: The field in the collection to map to the **title** + property for the schema. + """ + self.url = url + self.body = body + self.title = title + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsSchemaMapping': + """Initialize a SearchSettingsSchemaMapping object from a json dictionary.""" + args = {} + if (url := _dict.get('url')) is not None: + args['url'] = url + else: + raise ValueError( + 'Required property \'url\' not present in SearchSettingsSchemaMapping JSON' + ) + if (body := _dict.get('body')) is not None: + args['body'] = body + else: + raise ValueError( + 'Required property \'body\' not present in SearchSettingsSchemaMapping JSON' + ) + if (title := _dict.get('title')) is not None: + args['title'] = title + else: + raise ValueError( + 'Required property \'title\' not present in SearchSettingsSchemaMapping JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsSchemaMapping object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsSchemaMapping object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsSchemaMapping') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsSchemaMapping') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SearchSettingsServerSideSearch: + """ + Configuration settings for the server-side search service used by the search + integration. You can provide either basic auth, apiKey auth or none. + + :param str url: The URL of the server-side search service. + :param str port: (optional) The port number of the server-side search service. + :param str username: (optional) The username of the basic authentication method. + :param str password: (optional) The password of the basic authentication method. + The credentials are not returned due to security reasons. + :param str filter: (optional) The filter string that is applied to the search + results. + :param dict metadata: (optional) The metadata object. + :param str apikey: (optional) The API key of the apiKey authentication method. + The credentails are not returned due to security reasons. + :param bool no_auth: (optional) To clear previous auth, specify `no_auth = + true`. + :param str auth_type: (optional) The authorization type that is used. + """ + + def __init__( + self, + url: str, + *, + port: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + filter: Optional[str] = None, + metadata: Optional[dict] = None, + apikey: Optional[str] = None, + no_auth: Optional[bool] = None, + auth_type: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSettingsServerSideSearch object. + + :param str url: The URL of the server-side search service. + :param str port: (optional) The port number of the server-side search + service. + :param str username: (optional) The username of the basic authentication + method. + :param str password: (optional) The password of the basic authentication + method. The credentials are not returned due to security reasons. + :param str filter: (optional) The filter string that is applied to the + search results. + :param dict metadata: (optional) The metadata object. + :param str apikey: (optional) The API key of the apiKey authentication + method. The credentails are not returned due to security reasons. + :param bool no_auth: (optional) To clear previous auth, specify `no_auth = + true`. + :param str auth_type: (optional) The authorization type that is used. + """ + self.url = url + self.port = port + self.username = username + self.password = password + self.filter = filter + self.metadata = metadata + self.apikey = apikey + self.no_auth = no_auth + self.auth_type = auth_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsServerSideSearch': + """Initialize a SearchSettingsServerSideSearch object from a json dictionary.""" + args = {} + if (url := _dict.get('url')) is not None: + args['url'] = url + else: + raise ValueError( + 'Required property \'url\' not present in SearchSettingsServerSideSearch JSON' + ) + if (port := _dict.get('port')) is not None: + args['port'] = port + if (username := _dict.get('username')) is not None: + args['username'] = username + if (password := _dict.get('password')) is not None: + args['password'] = password + if (filter := _dict.get('filter')) is not None: + args['filter'] = filter + if (metadata := _dict.get('metadata')) is not None: + args['metadata'] = metadata + if (apikey := _dict.get('apikey')) is not None: + args['apikey'] = apikey + if (no_auth := _dict.get('no_auth')) is not None: + args['no_auth'] = no_auth + if (auth_type := _dict.get('auth_type')) is not None: + args['auth_type'] = auth_type + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSettingsServerSideSearch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'username') and self.username is not None: + _dict['username'] = self.username + if hasattr(self, 'password') and self.password is not None: + _dict['password'] = self.password + if hasattr(self, 'filter') and self.filter is not None: + _dict['filter'] = self.filter + if hasattr(self, 'metadata') and self.metadata is not None: + _dict['metadata'] = self.metadata + if hasattr(self, 'apikey') and self.apikey is not None: + _dict['apikey'] = self.apikey + if hasattr(self, 'no_auth') and self.no_auth is not None: + _dict['no_auth'] = self.no_auth + if hasattr(self, 'auth_type') and self.auth_type is not None: + _dict['auth_type'] = self.auth_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSettingsServerSideSearch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSettingsServerSideSearch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSettingsServerSideSearch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class AuthTypeEnum(str, Enum): + """ + The authorization type that is used. + """ + + BASIC = 'basic' + APIKEY = 'apikey' + NONE = 'none' + + +class SearchSkillWarning: + """ + A warning describing an error in the search skill configuration. + + :param str code: (optional) The error code. + :param str path: (optional) The location of the error in the search skill + configuration object. + :param str message: (optional) The error message. + """ + + def __init__( + self, + *, + code: Optional[str] = None, + path: Optional[str] = None, + message: Optional[str] = None, + ) -> None: + """ + Initialize a SearchSkillWarning object. + + :param str code: (optional) The error code. + :param str path: (optional) The location of the error in the search skill + configuration object. + :param str message: (optional) The error message. + """ + self.code = code + self.path = path + self.message = message + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSkillWarning': + """Initialize a SearchSkillWarning object from a json dictionary.""" + args = {} + if (code := _dict.get('code')) is not None: + args['code'] = code + if (path := _dict.get('path')) is not None: + args['path'] = path + if (message := _dict.get('message')) is not None: + args['message'] = message + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchSkillWarning object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'path') and self.path is not None: + _dict['path'] = self.path + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchSkillWarning object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchSkillWarning') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchSkillWarning') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SessionResponse: + """ + SessionResponse. + + :param str session_id: The session ID. + """ + + def __init__( + self, + session_id: str, + ) -> None: + """ + Initialize a SessionResponse object. + + :param str session_id: The session ID. + """ + self.session_id = session_id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SessionResponse': + """Initialize a SessionResponse object from a json dictionary.""" + args = {} + if (session_id := _dict.get('session_id')) is not None: + args['session_id'] = session_id + else: + raise ValueError( + 'Required property \'session_id\' not present in SessionResponse JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SessionResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'session_id') and self.session_id is not None: + _dict['session_id'] = self.session_id + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SessionResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SessionResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SessionResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class Skill: + """ + Skill. + + :param str name: (optional) The name of the skill. This string cannot contain + carriage return, newline, or tab characters. + :param str description: (optional) The description of the skill. This string + cannot contain carriage return, newline, or tab characters. + :param dict workspace: (optional) An object containing the conversational + content of an action or dialog skill. + :param str skill_id: (optional) The skill ID of the skill. + :param str status: (optional) The current status of the skill: + - **Available**: The skill is available and ready to process messages. + - **Failed**: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - **Non Existent**: The skill does not exist. + - **Processing**: An asynchronous operation has not yet completed. + - **Training**: The skill is training based on new data. + :param List[StatusError] status_errors: (optional) An array of messages about + errors that caused an asynchronous operation to fail. Included only if + **status**=`Failed`. + :param str status_description: (optional) The description of the failed + asynchronous operation. Included only if **status**=`Failed`. + :param dict dialog_settings: (optional) For internal use only. + :param str assistant_id: (optional) The unique identifier of the assistant the + skill is associated with. + :param str workspace_id: (optional) The unique identifier of the workspace that + contains the skill content. Included only for action and dialog skills. + :param str environment_id: (optional) The unique identifier of the environment + where the skill is defined. For action and dialog skills, this is always the + draft environment. + :param bool valid: (optional) Whether the skill is structurally valid. + :param str next_snapshot_version: (optional) The name that will be given to the + next snapshot that is created for the skill. A snapshot of each versionable + skill is saved for each new release of an assistant. + :param SearchSettings search_settings: (optional) An object describing the + search skill configuration. + **Note:** Search settings are not supported in **Import skills** requests, and + are not included in **Export skills** responses. + :param List[SearchSkillWarning] warnings: (optional) An array of warnings + describing errors with the search skill configuration. Included only for search + skills. + :param str language: The language of the skill. + :param str type: The type of skill. + """ + + def __init__( + self, + language: str, + type: str, + *, + name: Optional[str] = None, + description: Optional[str] = None, + workspace: Optional[dict] = None, + skill_id: Optional[str] = None, + status: Optional[str] = None, + status_errors: Optional[List['StatusError']] = None, + status_description: Optional[str] = None, + dialog_settings: Optional[dict] = None, + assistant_id: Optional[str] = None, + workspace_id: Optional[str] = None, + environment_id: Optional[str] = None, + valid: Optional[bool] = None, + next_snapshot_version: Optional[str] = None, + search_settings: Optional['SearchSettings'] = None, + warnings: Optional[List['SearchSkillWarning']] = None, + ) -> None: + """ + Initialize a Skill object. + + :param str language: The language of the skill. + :param str type: The type of skill. + :param str name: (optional) The name of the skill. This string cannot + contain carriage return, newline, or tab characters. + :param str description: (optional) The description of the skill. This + string cannot contain carriage return, newline, or tab characters. + :param dict workspace: (optional) An object containing the conversational + content of an action or dialog skill. + :param dict dialog_settings: (optional) For internal use only. + :param SearchSettings search_settings: (optional) An object describing the + search skill configuration. + **Note:** Search settings are not supported in **Import skills** requests, + and are not included in **Export skills** responses. + """ + self.name = name + self.description = description + self.workspace = workspace + self.skill_id = skill_id + self.status = status + self.status_errors = status_errors + self.status_description = status_description + self.dialog_settings = dialog_settings + self.assistant_id = assistant_id + self.workspace_id = workspace_id + self.environment_id = environment_id + self.valid = valid + self.next_snapshot_version = next_snapshot_version + self.search_settings = search_settings + self.warnings = warnings + self.language = language + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'Skill': + """Initialize a Skill object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + if (description := _dict.get('description')) is not None: + args['description'] = description + if (workspace := _dict.get('workspace')) is not None: + args['workspace'] = workspace + if (skill_id := _dict.get('skill_id')) is not None: + args['skill_id'] = skill_id + if (status := _dict.get('status')) is not None: + args['status'] = status + if (status_errors := _dict.get('status_errors')) is not None: + args['status_errors'] = [ + StatusError.from_dict(v) for v in status_errors + ] + if (status_description := _dict.get('status_description')) is not None: + args['status_description'] = status_description + if (dialog_settings := _dict.get('dialog_settings')) is not None: + args['dialog_settings'] = dialog_settings + if (assistant_id := _dict.get('assistant_id')) is not None: + args['assistant_id'] = assistant_id + if (workspace_id := _dict.get('workspace_id')) is not None: + args['workspace_id'] = workspace_id + if (environment_id := _dict.get('environment_id')) is not None: + args['environment_id'] = environment_id + if (valid := _dict.get('valid')) is not None: + args['valid'] = valid + if (next_snapshot_version := + _dict.get('next_snapshot_version')) is not None: + args['next_snapshot_version'] = next_snapshot_version + if (search_settings := _dict.get('search_settings')) is not None: + args['search_settings'] = SearchSettings.from_dict(search_settings) + if (warnings := _dict.get('warnings')) is not None: + args['warnings'] = [ + SearchSkillWarning.from_dict(v) for v in warnings + ] + if (language := _dict.get('language')) is not None: + args['language'] = language + else: + raise ValueError( + 'Required property \'language\' not present in Skill JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError( + 'Required property \'type\' not present in Skill JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a Skill object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'workspace') and self.workspace is not None: + _dict['workspace'] = self.workspace + if hasattr(self, 'skill_id') and getattr(self, 'skill_id') is not None: + _dict['skill_id'] = getattr(self, 'skill_id') + if hasattr(self, 'status') and getattr(self, 'status') is not None: + _dict['status'] = getattr(self, 'status') + if hasattr(self, 'status_errors') and getattr( + self, 'status_errors') is not None: + status_errors_list = [] + for v in getattr(self, 'status_errors'): + if isinstance(v, dict): + status_errors_list.append(v) + else: + status_errors_list.append(v.to_dict()) + _dict['status_errors'] = status_errors_list + if hasattr(self, 'status_description') and getattr( + self, 'status_description') is not None: + _dict['status_description'] = getattr(self, 'status_description') + if hasattr(self, + 'dialog_settings') and self.dialog_settings is not None: + _dict['dialog_settings'] = self.dialog_settings + if hasattr(self, 'assistant_id') and getattr( + self, 'assistant_id') is not None: + _dict['assistant_id'] = getattr(self, 'assistant_id') + if hasattr(self, 'workspace_id') and getattr( + self, 'workspace_id') is not None: + _dict['workspace_id'] = getattr(self, 'workspace_id') + if hasattr(self, 'environment_id') and getattr( + self, 'environment_id') is not None: + _dict['environment_id'] = getattr(self, 'environment_id') + if hasattr(self, 'valid') and getattr(self, 'valid') is not None: + _dict['valid'] = getattr(self, 'valid') + if hasattr(self, 'next_snapshot_version') and getattr( + self, 'next_snapshot_version') is not None: + _dict['next_snapshot_version'] = getattr(self, + 'next_snapshot_version') + if hasattr(self, + 'search_settings') and self.search_settings is not None: + if isinstance(self.search_settings, dict): + _dict['search_settings'] = self.search_settings + else: + _dict['search_settings'] = self.search_settings.to_dict() + if hasattr(self, 'warnings') and getattr(self, 'warnings') is not None: + warnings_list = [] + for v in getattr(self, 'warnings'): + if isinstance(v, dict): + warnings_list.append(v) + else: + warnings_list.append(v.to_dict()) + _dict['warnings'] = warnings_list + if hasattr(self, 'language') and self.language is not None: + _dict['language'] = self.language + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this Skill object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'Skill') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'Skill') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class StatusEnum(str, Enum): + """ + The current status of the skill: + - **Available**: The skill is available and ready to process messages. + - **Failed**: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - **Non Existent**: The skill does not exist. + - **Processing**: An asynchronous operation has not yet completed. + - **Training**: The skill is training based on new data. + """ + + AVAILABLE = 'Available' + FAILED = 'Failed' + NON_EXISTENT = 'Non Existent' + PROCESSING = 'Processing' + TRAINING = 'Training' + UNAVAILABLE = 'Unavailable' + + class TypeEnum(str, Enum): + """ + The type of skill. + """ + + ACTION = 'action' + DIALOG = 'dialog' + SEARCH = 'search' + + +class SkillImport: + """ + SkillImport. + + :param str name: (optional) The name of the skill. This string cannot contain + carriage return, newline, or tab characters. + :param str description: (optional) The description of the skill. This string + cannot contain carriage return, newline, or tab characters. + :param dict workspace: (optional) An object containing the conversational + content of an action or dialog skill. + :param str skill_id: (optional) The skill ID of the skill. + :param str status: (optional) The current status of the skill: + - **Available**: The skill is available and ready to process messages. + - **Failed**: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - **Non Existent**: The skill does not exist. + - **Processing**: An asynchronous operation has not yet completed. + - **Training**: The skill is training based on new data. + :param List[StatusError] status_errors: (optional) An array of messages about + errors that caused an asynchronous operation to fail. Included only if + **status**=`Failed`. + :param str status_description: (optional) The description of the failed + asynchronous operation. Included only if **status**=`Failed`. + :param dict dialog_settings: (optional) For internal use only. + :param str assistant_id: (optional) The unique identifier of the assistant the + skill is associated with. + :param str workspace_id: (optional) The unique identifier of the workspace that + contains the skill content. Included only for action and dialog skills. + :param str environment_id: (optional) The unique identifier of the environment + where the skill is defined. For action and dialog skills, this is always the + draft environment. + :param bool valid: (optional) Whether the skill is structurally valid. + :param str next_snapshot_version: (optional) The name that will be given to the + next snapshot that is created for the skill. A snapshot of each versionable + skill is saved for each new release of an assistant. + :param SearchSettings search_settings: (optional) An object describing the + search skill configuration. + **Note:** Search settings are not supported in **Import skills** requests, and + are not included in **Export skills** responses. + :param List[SearchSkillWarning] warnings: (optional) An array of warnings + describing errors with the search skill configuration. Included only for search + skills. + :param str language: The language of the skill. + :param str type: The type of skill. + """ + + def __init__( + self, + language: str, + type: str, + *, + name: Optional[str] = None, + description: Optional[str] = None, + workspace: Optional[dict] = None, + skill_id: Optional[str] = None, + status: Optional[str] = None, + status_errors: Optional[List['StatusError']] = None, + status_description: Optional[str] = None, + dialog_settings: Optional[dict] = None, + assistant_id: Optional[str] = None, + workspace_id: Optional[str] = None, + environment_id: Optional[str] = None, + valid: Optional[bool] = None, + next_snapshot_version: Optional[str] = None, + search_settings: Optional['SearchSettings'] = None, + warnings: Optional[List['SearchSkillWarning']] = None, + ) -> None: + """ + Initialize a SkillImport object. + + :param str language: The language of the skill. + :param str type: The type of skill. + :param str name: (optional) The name of the skill. This string cannot + contain carriage return, newline, or tab characters. + :param str description: (optional) The description of the skill. This + string cannot contain carriage return, newline, or tab characters. + :param dict workspace: (optional) An object containing the conversational + content of an action or dialog skill. + :param dict dialog_settings: (optional) For internal use only. + :param SearchSettings search_settings: (optional) An object describing the + search skill configuration. + **Note:** Search settings are not supported in **Import skills** requests, + and are not included in **Export skills** responses. + """ + self.name = name + self.description = description + self.workspace = workspace + self.skill_id = skill_id + self.status = status + self.status_errors = status_errors + self.status_description = status_description + self.dialog_settings = dialog_settings + self.assistant_id = assistant_id + self.workspace_id = workspace_id + self.environment_id = environment_id + self.valid = valid + self.next_snapshot_version = next_snapshot_version + self.search_settings = search_settings + self.warnings = warnings + self.language = language + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SkillImport': + """Initialize a SkillImport object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + if (description := _dict.get('description')) is not None: + args['description'] = description + if (workspace := _dict.get('workspace')) is not None: + args['workspace'] = workspace + if (skill_id := _dict.get('skill_id')) is not None: + args['skill_id'] = skill_id + if (status := _dict.get('status')) is not None: + args['status'] = status + if (status_errors := _dict.get('status_errors')) is not None: + args['status_errors'] = [ + StatusError.from_dict(v) for v in status_errors + ] + if (status_description := _dict.get('status_description')) is not None: + args['status_description'] = status_description + if (dialog_settings := _dict.get('dialog_settings')) is not None: + args['dialog_settings'] = dialog_settings + if (assistant_id := _dict.get('assistant_id')) is not None: + args['assistant_id'] = assistant_id + if (workspace_id := _dict.get('workspace_id')) is not None: + args['workspace_id'] = workspace_id + if (environment_id := _dict.get('environment_id')) is not None: + args['environment_id'] = environment_id + if (valid := _dict.get('valid')) is not None: + args['valid'] = valid + if (next_snapshot_version := + _dict.get('next_snapshot_version')) is not None: + args['next_snapshot_version'] = next_snapshot_version + if (search_settings := _dict.get('search_settings')) is not None: + args['search_settings'] = SearchSettings.from_dict(search_settings) + if (warnings := _dict.get('warnings')) is not None: + args['warnings'] = [ + SearchSkillWarning.from_dict(v) for v in warnings + ] + if (language := _dict.get('language')) is not None: + args['language'] = language + else: + raise ValueError( + 'Required property \'language\' not present in SkillImport JSON' + ) + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError( + 'Required property \'type\' not present in SkillImport JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SkillImport object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'workspace') and self.workspace is not None: + _dict['workspace'] = self.workspace + if hasattr(self, 'skill_id') and getattr(self, 'skill_id') is not None: + _dict['skill_id'] = getattr(self, 'skill_id') + if hasattr(self, 'status') and getattr(self, 'status') is not None: + _dict['status'] = getattr(self, 'status') + if hasattr(self, 'status_errors') and getattr( + self, 'status_errors') is not None: + status_errors_list = [] + for v in getattr(self, 'status_errors'): + if isinstance(v, dict): + status_errors_list.append(v) + else: + status_errors_list.append(v.to_dict()) + _dict['status_errors'] = status_errors_list + if hasattr(self, 'status_description') and getattr( + self, 'status_description') is not None: + _dict['status_description'] = getattr(self, 'status_description') if hasattr(self, - 'specific_minute') and self.specific_minute is not None: - _dict['specific_minute'] = self.specific_minute + 'dialog_settings') and self.dialog_settings is not None: + _dict['dialog_settings'] = self.dialog_settings + if hasattr(self, 'assistant_id') and getattr( + self, 'assistant_id') is not None: + _dict['assistant_id'] = getattr(self, 'assistant_id') + if hasattr(self, 'workspace_id') and getattr( + self, 'workspace_id') is not None: + _dict['workspace_id'] = getattr(self, 'workspace_id') + if hasattr(self, 'environment_id') and getattr( + self, 'environment_id') is not None: + _dict['environment_id'] = getattr(self, 'environment_id') + if hasattr(self, 'valid') and getattr(self, 'valid') is not None: + _dict['valid'] = getattr(self, 'valid') + if hasattr(self, 'next_snapshot_version') and getattr( + self, 'next_snapshot_version') is not None: + _dict['next_snapshot_version'] = getattr(self, + 'next_snapshot_version') if hasattr(self, - 'specific_second') and self.specific_second is not None: - _dict['specific_second'] = self.specific_second - if hasattr(self, 'timezone') and self.timezone is not None: - _dict['timezone'] = self.timezone + 'search_settings') and self.search_settings is not None: + if isinstance(self.search_settings, dict): + _dict['search_settings'] = self.search_settings + else: + _dict['search_settings'] = self.search_settings.to_dict() + if hasattr(self, 'warnings') and getattr(self, 'warnings') is not None: + warnings_list = [] + for v in getattr(self, 'warnings'): + if isinstance(v, dict): + warnings_list.append(v) + else: + warnings_list.append(v.to_dict()) + _dict['warnings'] = warnings_list + if hasattr(self, 'language') and self.language is not None: + _dict['language'] = self.language + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -10847,77 +14906,122 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RuntimeEntityInterpretation object.""" + """Return a `str` version of this SkillImport object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityInterpretation') -> bool: + def __eq__(self, other: 'SkillImport') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RuntimeEntityInterpretation') -> bool: + def __ne__(self, other: 'SkillImport') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class GranularityEnum(str, Enum): + class StatusEnum(str, Enum): """ - The precision or duration of a time range specified by a recognized `@sys-time` or - `@sys-date` entity. + The current status of the skill: + - **Available**: The skill is available and ready to process messages. + - **Failed**: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - **Non Existent**: The skill does not exist. + - **Processing**: An asynchronous operation has not yet completed. + - **Training**: The skill is training based on new data. """ - DAY = 'day' - FORTNIGHT = 'fortnight' - HOUR = 'hour' - INSTANT = 'instant' - MINUTE = 'minute' - MONTH = 'month' - QUARTER = 'quarter' - SECOND = 'second' - WEEK = 'week' - WEEKEND = 'weekend' - YEAR = 'year' + AVAILABLE = 'Available' + FAILED = 'Failed' + NON_EXISTENT = 'Non Existent' + PROCESSING = 'Processing' + TRAINING = 'Training' + UNAVAILABLE = 'Unavailable' + + class TypeEnum(str, Enum): + """ + The type of skill. + """ + + ACTION = 'action' + DIALOG = 'dialog' -class RuntimeEntityRole: +class SkillsAsyncRequestStatus: """ - An object describing the role played by a system entity that is specifies the - beginning or end of a range recognized in the user input. This property is included - only if the new system entities are enabled for the skill. + SkillsAsyncRequestStatus. - :param str type: (optional) The relationship of the entity to the range. + :param str assistant_id: (optional) The assistant ID of the assistant. + :param str status: (optional) The current status of the asynchronous operation: + - `Available`: An asynchronous export is available. + - `Completed`: An asynchronous import operation has completed successfully. + - `Failed`: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - `Processing`: An asynchronous operation has not yet completed. + :param str status_description: (optional) The description of the failed + asynchronous operation. Included only if **status**=`Failed`. + :param List[StatusError] status_errors: (optional) An array of messages about + errors that caused an asynchronous operation to fail. Included only if + **status**=`Failed`. """ def __init__( self, *, - type: Optional[str] = None, + assistant_id: Optional[str] = None, + status: Optional[str] = None, + status_description: Optional[str] = None, + status_errors: Optional[List['StatusError']] = None, ) -> None: """ - Initialize a RuntimeEntityRole object. + Initialize a SkillsAsyncRequestStatus object. - :param str type: (optional) The relationship of the entity to the range. """ - self.type = type + self.assistant_id = assistant_id + self.status = status + self.status_description = status_description + self.status_errors = status_errors @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntityRole': - """Initialize a RuntimeEntityRole object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SkillsAsyncRequestStatus': + """Initialize a SkillsAsyncRequestStatus object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type + if (assistant_id := _dict.get('assistant_id')) is not None: + args['assistant_id'] = assistant_id + if (status := _dict.get('status')) is not None: + args['status'] = status + if (status_description := _dict.get('status_description')) is not None: + args['status_description'] = status_description + if (status_errors := _dict.get('status_errors')) is not None: + args['status_errors'] = [ + StatusError.from_dict(v) for v in status_errors + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RuntimeEntityRole object from a json dictionary.""" + """Initialize a SkillsAsyncRequestStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'assistant_id') and getattr( + self, 'assistant_id') is not None: + _dict['assistant_id'] = getattr(self, 'assistant_id') + if hasattr(self, 'status') and getattr(self, 'status') is not None: + _dict['status'] = getattr(self, 'status') + if hasattr(self, 'status_description') and getattr( + self, 'status_description') is not None: + _dict['status_description'] = getattr(self, 'status_description') + if hasattr(self, 'status_errors') and getattr( + self, 'status_errors') is not None: + status_errors_list = [] + for v in getattr(self, 'status_errors'): + if isinstance(v, dict): + status_errors_list.append(v) + else: + status_errors_list.append(v.to_dict()) + _dict['status_errors'] = status_errors_list return _dict def _to_dict(self): @@ -10925,101 +15029,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RuntimeEntityRole object.""" + """Return a `str` version of this SkillsAsyncRequestStatus object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityRole') -> bool: + def __eq__(self, other: 'SkillsAsyncRequestStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RuntimeEntityRole') -> bool: + def __ne__(self, other: 'SkillsAsyncRequestStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The relationship of the entity to the range. + The current status of the asynchronous operation: + - `Available`: An asynchronous export is available. + - `Completed`: An asynchronous import operation has completed successfully. + - `Failed`: An asynchronous operation has failed. See the **status_errors** + property for more information about the cause of the failure. + - `Processing`: An asynchronous operation has not yet completed. """ - DATE_FROM = 'date_from' - DATE_TO = 'date_to' - NUMBER_FROM = 'number_from' - NUMBER_TO = 'number_to' - TIME_FROM = 'time_from' - TIME_TO = 'time_to' + AVAILABLE = 'Available' + COMPLETED = 'Completed' + FAILED = 'Failed' + PROCESSING = 'Processing' -class RuntimeIntent: +class SkillsExport: """ - An intent identified in the user input. + SkillsExport. - :param str intent: The name of the recognized intent. - :param float confidence: (optional) A decimal percentage that represents - confidence in the intent. If you are specifying an intent as part of a request, - but you do not have a calculated confidence value, specify `1`. - :param str skill: (optional) The skill that identified the intent. Currently, - the only possible values are `main skill` for the dialog skill (if enabled) and - `actions skill` for the action skill. - This property is present only if the assistant has both a dialog skill and an - action skill. + :param List[Skill] assistant_skills: An array of objects describing the skills + for the assistant. Included in responses only if **status**=`Available`. + :param AssistantState assistant_state: Status information about the skills for + the assistant. Included in responses only if **status**=`Available`. """ def __init__( self, - intent: str, - *, - confidence: Optional[float] = None, - skill: Optional[str] = None, + assistant_skills: List['Skill'], + assistant_state: 'AssistantState', ) -> None: """ - Initialize a RuntimeIntent object. + Initialize a SkillsExport object. - :param str intent: The name of the recognized intent. - :param float confidence: (optional) A decimal percentage that represents - confidence in the intent. If you are specifying an intent as part of a - request, but you do not have a calculated confidence value, specify `1`. - :param str skill: (optional) The skill that identified the intent. - Currently, the only possible values are `main skill` for the dialog skill - (if enabled) and `actions skill` for the action skill. - This property is present only if the assistant has both a dialog skill and - an action skill. + :param List[Skill] assistant_skills: An array of objects describing the + skills for the assistant. Included in responses only if + **status**=`Available`. + :param AssistantState assistant_state: Status information about the skills + for the assistant. Included in responses only if **status**=`Available`. """ - self.intent = intent - self.confidence = confidence - self.skill = skill + self.assistant_skills = assistant_skills + self.assistant_state = assistant_state @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeIntent': - """Initialize a RuntimeIntent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SkillsExport': + """Initialize a SkillsExport object from a json dictionary.""" args = {} - if (intent := _dict.get('intent')) is not None: - args['intent'] = intent + if (assistant_skills := _dict.get('assistant_skills')) is not None: + args['assistant_skills'] = [ + Skill.from_dict(v) for v in assistant_skills + ] else: raise ValueError( - 'Required property \'intent\' not present in RuntimeIntent JSON' + 'Required property \'assistant_skills\' not present in SkillsExport JSON' + ) + if (assistant_state := _dict.get('assistant_state')) is not None: + args['assistant_state'] = AssistantState.from_dict(assistant_state) + else: + raise ValueError( + 'Required property \'assistant_state\' not present in SkillsExport JSON' ) - if (confidence := _dict.get('confidence')) is not None: - args['confidence'] = confidence - if (skill := _dict.get('skill')) is not None: - args['skill'] = skill return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RuntimeIntent object from a json dictionary.""" + """Initialize a SkillsExport object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'intent') and self.intent is not None: - _dict['intent'] = self.intent - if hasattr(self, 'confidence') and self.confidence is not None: - _dict['confidence'] = self.confidence - if hasattr(self, 'skill') and self.skill is not None: - _dict['skill'] = self.skill + if hasattr(self, + 'assistant_skills') and self.assistant_skills is not None: + assistant_skills_list = [] + for v in self.assistant_skills: + if isinstance(v, dict): + assistant_skills_list.append(v) + else: + assistant_skills_list.append(v.to_dict()) + _dict['assistant_skills'] = assistant_skills_list + if hasattr(self, + 'assistant_state') and self.assistant_state is not None: + if isinstance(self.assistant_state, dict): + _dict['assistant_state'] = self.assistant_state + else: + _dict['assistant_state'] = self.assistant_state.to_dict() return _dict def _to_dict(self): @@ -11027,255 +15135,141 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RuntimeIntent object.""" + """Return a `str` version of this SkillsExport object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeIntent') -> bool: + def __eq__(self, other: 'SkillsExport') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RuntimeIntent') -> bool: + def __ne__(self, other: 'SkillsExport') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeResponseGeneric: - """ - RuntimeResponseGeneric. - - """ - - def __init__(self,) -> None: - """ - Initialize a RuntimeResponseGeneric object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'RuntimeResponseGenericRuntimeResponseTypeText', - 'RuntimeResponseGenericRuntimeResponseTypePause', - 'RuntimeResponseGenericRuntimeResponseTypeImage', - 'RuntimeResponseGenericRuntimeResponseTypeOption', - 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent', - 'RuntimeResponseGenericRuntimeResponseTypeSuggestion', - 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer', - 'RuntimeResponseGenericRuntimeResponseTypeSearch', - 'RuntimeResponseGenericRuntimeResponseTypeUserDefined', - 'RuntimeResponseGenericRuntimeResponseTypeVideo', - 'RuntimeResponseGenericRuntimeResponseTypeAudio', - 'RuntimeResponseGenericRuntimeResponseTypeIframe', - 'RuntimeResponseGenericRuntimeResponseTypeDate' - ])) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeResponseGeneric': - """Initialize a RuntimeResponseGeneric object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'RuntimeResponseGeneric'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join([ - 'RuntimeResponseGenericRuntimeResponseTypeText', - 'RuntimeResponseGenericRuntimeResponseTypePause', - 'RuntimeResponseGenericRuntimeResponseTypeImage', - 'RuntimeResponseGenericRuntimeResponseTypeOption', - 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent', - 'RuntimeResponseGenericRuntimeResponseTypeSuggestion', - 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer', - 'RuntimeResponseGenericRuntimeResponseTypeSearch', - 'RuntimeResponseGenericRuntimeResponseTypeUserDefined', - 'RuntimeResponseGenericRuntimeResponseTypeVideo', - 'RuntimeResponseGenericRuntimeResponseTypeAudio', - 'RuntimeResponseGenericRuntimeResponseTypeIframe', - 'RuntimeResponseGenericRuntimeResponseTypeDate' - ])) - raise Exception(msg) - - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a RuntimeResponseGeneric object from a json dictionary.""" - return cls.from_dict(_dict) - - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['audio'] = 'RuntimeResponseGenericRuntimeResponseTypeAudio' - mapping[ - 'channel_transfer'] = 'RuntimeResponseGenericRuntimeResponseTypeChannelTransfer' - mapping[ - 'connect_to_agent'] = 'RuntimeResponseGenericRuntimeResponseTypeConnectToAgent' - mapping['date'] = 'RuntimeResponseGenericRuntimeResponseTypeDate' - mapping['iframe'] = 'RuntimeResponseGenericRuntimeResponseTypeIframe' - mapping['image'] = 'RuntimeResponseGenericRuntimeResponseTypeImage' - mapping['option'] = 'RuntimeResponseGenericRuntimeResponseTypeOption' - mapping[ - 'suggestion'] = 'RuntimeResponseGenericRuntimeResponseTypeSuggestion' - mapping['pause'] = 'RuntimeResponseGenericRuntimeResponseTypePause' - mapping['search'] = 'RuntimeResponseGenericRuntimeResponseTypeSearch' - mapping['text'] = 'RuntimeResponseGenericRuntimeResponseTypeText' - mapping[ - 'user_defined'] = 'RuntimeResponseGenericRuntimeResponseTypeUserDefined' - mapping['video'] = 'RuntimeResponseGenericRuntimeResponseTypeVideo' - disc_value = _dict.get('response_type') - if disc_value is None: - raise ValueError( - 'Discriminator property \'response_type\' not found in RuntimeResponseGeneric JSON' - ) - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - -class SearchResult: +class StatefulMessageResponse: """ - SearchResult. + A response from the watsonx Assistant service. - :param str id: The unique identifier of the document in the Discovery service - collection. - This property is included in responses from search skills, which are available - only to Plus or Enterprise plan users. - :param SearchResultMetadata result_metadata: An object containing search result - metadata from the Discovery service. - :param str body: (optional) A description of the search result. This is taken - from an abstract, summary, or highlight field in the Discovery service response, - as specified in the search skill configuration. - :param str title: (optional) The title of the search result. This is taken from - a title or name field in the Discovery service response, as specified in the - search skill configuration. - :param str url: (optional) The URL of the original data object in its native - data source. - :param SearchResultHighlight highlight: (optional) An object containing segments - of text from search results with query-matching text highlighted using HTML - `` tags. - :param List[SearchResultAnswer] answers: (optional) An array specifying segments - of text within the result that were identified as direct answers to the search - query. Currently, only the single answer with the highest confidence (if any) is - returned. - **Notes:** - - Answer finding is available only if the search skill is connected to a - Discovery v2 service instance. - - Answer finding is not supported on IBM Cloud Pak for Data. + :param MessageOutput output: Assistant output to be rendered or processed by the + client. + :param MessageContext context: (optional) Context data for the conversation. You + can use this property to access context variables. The context is stored by the + assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: A string value that identifies the user who is interacting + with the assistant. The client must provide a unique identifier for each + individual end user who accesses the application. For user-based plans, this + user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. + :param MessageOutput masked_output: (optional) Assistant output to be rendered + or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes the + input text. All private data is masked or removed. """ def __init__( self, - id: str, - result_metadata: 'SearchResultMetadata', + output: 'MessageOutput', + user_id: str, *, - body: Optional[str] = None, - title: Optional[str] = None, - url: Optional[str] = None, - highlight: Optional['SearchResultHighlight'] = None, - answers: Optional[List['SearchResultAnswer']] = None, + context: Optional['MessageContext'] = None, + masked_output: Optional['MessageOutput'] = None, + masked_input: Optional['MessageInput'] = None, ) -> None: """ - Initialize a SearchResult object. + Initialize a StatefulMessageResponse object. - :param str id: The unique identifier of the document in the Discovery - service collection. - This property is included in responses from search skills, which are - available only to Plus or Enterprise plan users. - :param SearchResultMetadata result_metadata: An object containing search - result metadata from the Discovery service. - :param str body: (optional) A description of the search result. This is - taken from an abstract, summary, or highlight field in the Discovery - service response, as specified in the search skill configuration. - :param str title: (optional) The title of the search result. This is taken - from a title or name field in the Discovery service response, as specified - in the search skill configuration. - :param str url: (optional) The URL of the original data object in its - native data source. - :param SearchResultHighlight highlight: (optional) An object containing - segments of text from search results with query-matching text highlighted - using HTML `` tags. - :param List[SearchResultAnswer] answers: (optional) An array specifying - segments of text within the result that were identified as direct answers - to the search query. Currently, only the single answer with the highest - confidence (if any) is returned. - **Notes:** - - Answer finding is available only if the search skill is connected to a - Discovery v2 service instance. - - Answer finding is not supported on IBM Cloud Pak for Data. + :param MessageOutput output: Assistant output to be rendered or processed + by the client. + :param str user_id: A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier + for each individual end user who accesses the application. For user-based + plans, this user ID is used to identify unique users for billing purposes. + This string cannot contain carriage return, newline, or tab characters. If + no value is specified in the input, **user_id** is automatically set to the + value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. + :param MessageContext context: (optional) Context data for the + conversation. You can use this property to access context variables. The + context is stored by the assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param MessageOutput masked_output: (optional) Assistant output to be + rendered or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes + the input text. All private data is masked or removed. """ - self.id = id - self.result_metadata = result_metadata - self.body = body - self.title = title - self.url = url - self.highlight = highlight - self.answers = answers + self.output = output + self.context = context + self.user_id = user_id + self.masked_output = masked_output + self.masked_input = masked_input @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchResult': - """Initialize a SearchResult object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatefulMessageResponse': + """Initialize a StatefulMessageResponse object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id + if (output := _dict.get('output')) is not None: + args['output'] = MessageOutput.from_dict(output) else: raise ValueError( - 'Required property \'id\' not present in SearchResult JSON') - if (result_metadata := _dict.get('result_metadata')) is not None: - args['result_metadata'] = SearchResultMetadata.from_dict( - result_metadata) + 'Required property \'output\' not present in StatefulMessageResponse JSON' + ) + if (context := _dict.get('context')) is not None: + args['context'] = MessageContext.from_dict(context) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id else: raise ValueError( - 'Required property \'result_metadata\' not present in SearchResult JSON' + 'Required property \'user_id\' not present in StatefulMessageResponse JSON' ) - if (body := _dict.get('body')) is not None: - args['body'] = body - if (title := _dict.get('title')) is not None: - args['title'] = title - if (url := _dict.get('url')) is not None: - args['url'] = url - if (highlight := _dict.get('highlight')) is not None: - args['highlight'] = SearchResultHighlight.from_dict(highlight) - if (answers := _dict.get('answers')) is not None: - args['answers'] = [SearchResultAnswer.from_dict(v) for v in answers] + if (masked_output := _dict.get('masked_output')) is not None: + args['masked_output'] = MessageOutput.from_dict(masked_output) + if (masked_input := _dict.get('masked_input')) is not None: + args['masked_input'] = MessageInput.from_dict(masked_input) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchResult object from a json dictionary.""" + """Initialize a StatefulMessageResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, - 'result_metadata') and self.result_metadata is not None: - if isinstance(self.result_metadata, dict): - _dict['result_metadata'] = self.result_metadata + if hasattr(self, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output else: - _dict['result_metadata'] = self.result_metadata.to_dict() - if hasattr(self, 'body') and self.body is not None: - _dict['body'] = self.body - if hasattr(self, 'title') and self.title is not None: - _dict['title'] = self.title - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'highlight') and self.highlight is not None: - if isinstance(self.highlight, dict): - _dict['highlight'] = self.highlight + _dict['output'] = self.output.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context else: - _dict['highlight'] = self.highlight.to_dict() - if hasattr(self, 'answers') and self.answers is not None: - answers_list = [] - for v in self.answers: - if isinstance(v, dict): - answers_list.append(v) - else: - answers_list.append(v.to_dict()) - _dict['answers'] = answers_list + _dict['context'] = self.context.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id + if hasattr(self, 'masked_output') and self.masked_output is not None: + if isinstance(self.masked_output, dict): + _dict['masked_output'] = self.masked_output + else: + _dict['masked_output'] = self.masked_output.to_dict() + if hasattr(self, 'masked_input') and self.masked_input is not None: + if isinstance(self.masked_input, dict): + _dict['masked_input'] = self.masked_input + else: + _dict['masked_input'] = self.masked_input.to_dict() return _dict def _to_dict(self): @@ -11283,75 +15277,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchResult object.""" + """Return a `str` version of this StatefulMessageResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResult') -> bool: + def __eq__(self, other: 'StatefulMessageResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchResult') -> bool: + def __ne__(self, other: 'StatefulMessageResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultAnswer: +class StatelessFinalResponse: """ - An object specifing a segment of text that was identified as a direct answer to the - search query. + Message final response content. - :param str text: The text of the answer. - :param float confidence: The confidence score for the answer, as returned by the - Discovery service. + :param StatelessFinalResponseOutput output: (optional) Assistant output to be + rendered or processed by the client. + :param StatelessMessageContext context: (optional) Context data for the + conversation. You can use this property to access context variables. The context + is stored by the assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: (optional) A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier for + each individual end user who accesses the application. For user-based plans, + this user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. """ def __init__( self, - text: str, - confidence: float, + *, + output: Optional['StatelessFinalResponseOutput'] = None, + context: Optional['StatelessMessageContext'] = None, + user_id: Optional[str] = None, ) -> None: """ - Initialize a SearchResultAnswer object. + Initialize a StatelessFinalResponse object. - :param str text: The text of the answer. - :param float confidence: The confidence score for the answer, as returned - by the Discovery service. + :param StatelessFinalResponseOutput output: (optional) Assistant output to + be rendered or processed by the client. + :param StatelessMessageContext context: (optional) Context data for the + conversation. You can use this property to access context variables. The + context is stored by the assistant on a per-session basis. + **Note:** The context is included in message responses only if + **return_context**=`true` in the message request. Full context is always + included in logs. + :param str user_id: (optional) A string value that identifies the user who + is interacting with the assistant. The client must provide a unique + identifier for each individual end user who accesses the application. For + user-based plans, this user ID is used to identify unique users for billing + purposes. This string cannot contain carriage return, newline, or tab + characters. If no value is specified in the input, **user_id** is + automatically set to the value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. """ - self.text = text - self.confidence = confidence + self.output = output + self.context = context + self.user_id = user_id @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchResultAnswer': - """Initialize a SearchResultAnswer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessFinalResponse': + """Initialize a StatelessFinalResponse object from a json dictionary.""" args = {} - if (text := _dict.get('text')) is not None: - args['text'] = text - else: - raise ValueError( - 'Required property \'text\' not present in SearchResultAnswer JSON' - ) - if (confidence := _dict.get('confidence')) is not None: - args['confidence'] = confidence - else: - raise ValueError( - 'Required property \'confidence\' not present in SearchResultAnswer JSON' - ) + if (output := _dict.get('output')) is not None: + args['output'] = StatelessFinalResponseOutput.from_dict(output) + if (context := _dict.get('context')) is not None: + args['context'] = StatelessMessageContext.from_dict(context) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchResultAnswer object from a json dictionary.""" + """Initialize a StatelessFinalResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'text') and self.text is not None: - _dict['text'] = self.text - if hasattr(self, 'confidence') and self.confidence is not None: - _dict['confidence'] = self.confidence + if hasattr(self, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output + else: + _dict['output'] = self.output.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id return _dict def _to_dict(self): @@ -11359,244 +15385,282 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchResultAnswer object.""" + """Return a `str` version of this StatelessFinalResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultAnswer') -> bool: + def __eq__(self, other: 'StatelessFinalResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchResultAnswer') -> bool: + def __ne__(self, other: 'StatelessFinalResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultHighlight: +class StatelessFinalResponseOutput: """ - An object containing segments of text from search results with query-matching text - highlighted using HTML `` tags. - - :param List[str] body: (optional) An array of strings containing segments taken - from body text in the search results, with query-matching substrings - highlighted. - :param List[str] title: (optional) An array of strings containing segments taken - from title text in the search results, with query-matching substrings - highlighted. - :param List[str] url: (optional) An array of strings containing segments taken - from URLs in the search results, with query-matching substrings highlighted. + Assistant output to be rendered or processed by the client. - This type supports additional properties of type List[str]. An array of strings - containing segments taken from a field in the search results that is not mapped to the - `body`, `title`, or `url` property, with query-matching substrings highlighted. The - property name is the name of the field in the Discovery collection. + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for any + channel. It is the responsibility of the client application to implement the + supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents recognized in + the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities identified + in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects describing + any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom properties + included in the response. This object includes any arbitrary properties defined + in the dialog JSON editor as part of the dialog node output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. + :param StatelessMessageContext streaming_metadata: """ - # The set of defined properties for the class - _properties = frozenset(['body', 'title', 'url']) - def __init__( self, + streaming_metadata: 'StatelessMessageContext', *, - body: Optional[List[str]] = None, - title: Optional[List[str]] = None, - url: Optional[List[str]] = None, - **kwargs: Optional[List[str]], - ) -> None: - """ - Initialize a SearchResultHighlight object. - - :param List[str] body: (optional) An array of strings containing segments - taken from body text in the search results, with query-matching substrings - highlighted. - :param List[str] title: (optional) An array of strings containing segments - taken from title text in the search results, with query-matching substrings - highlighted. - :param List[str] url: (optional) An array of strings containing segments - taken from URLs in the search results, with query-matching substrings - highlighted. - :param List[str] **kwargs: (optional) An array of strings containing - segments taken from a field in the search results that is not mapped to the - `body`, `title`, or `url` property, with query-matching substrings - highlighted. The property name is the name of the field in the Discovery - collection. + generic: Optional[List['RuntimeResponseGeneric']] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + actions: Optional[List['DialogNodeAction']] = None, + debug: Optional['MessageOutputDebug'] = None, + user_defined: Optional[dict] = None, + spelling: Optional['MessageOutputSpelling'] = None, + llm_metadata: Optional[List['MessageOutputLLMMetadata']] = None, + ) -> None: """ - self.body = body - self.title = title - self.url = url - for k, v in kwargs.items(): - if k not in SearchResultHighlight._properties: - if not isinstance(v, List): - raise ValueError( - 'Value for additional property {} must be of type List[Foo]' - .format(k)) - _v = [] - for elem in v: - if not isinstance(elem, str): - raise ValueError( - 'Value for additional property {} must be of type List[str]' - .format(k)) - _v.append(elem) - setattr(self, k, _v) - else: - raise ValueError( - 'Property {} cannot be specified as an additional property'. - format(k)) + Initialize a StatelessFinalResponseOutput object. + + :param StatelessMessageContext streaming_metadata: + :param List[RuntimeResponseGeneric] generic: (optional) Output intended for + any channel. It is the responsibility of the client application to + implement the supported response types. + :param List[RuntimeIntent] intents: (optional) An array of intents + recognized in the user input, sorted in descending order of confidence. + :param List[RuntimeEntity] entities: (optional) An array of entities + identified in the user input. + :param List[DialogNodeAction] actions: (optional) An array of objects + describing any actions requested by the dialog node. + :param MessageOutputDebug debug: (optional) Additional detailed information + about a message response and how it was generated. + :param dict user_defined: (optional) An object containing any custom + properties included in the response. This object includes any arbitrary + properties defined in the dialog JSON editor as part of the dialog node + output. + :param MessageOutputSpelling spelling: (optional) Properties describing any + spelling corrections in the user input that was received. + :param List[MessageOutputLLMMetadata] llm_metadata: (optional) An array of + objects that provide information about calls to large language models that + occured as part of handling this message. + """ + self.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions + self.debug = debug + self.user_defined = user_defined + self.spelling = spelling + self.llm_metadata = llm_metadata + self.streaming_metadata = streaming_metadata @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchResultHighlight': - """Initialize a SearchResultHighlight object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessFinalResponseOutput': + """Initialize a StatelessFinalResponseOutput object from a json dictionary.""" args = {} - if (body := _dict.get('body')) is not None: - args['body'] = body - if (title := _dict.get('title')) is not None: - args['title'] = title - if (url := _dict.get('url')) is not None: - args['url'] = url - for k, v in _dict.items(): - if k not in cls._properties: - if not isinstance(v, List): - raise ValueError( - 'Value for additional property {} must be of type List[str]' - .format(k)) - _v = [] - for elem in v: - if not isinstance(elem, str): - raise ValueError( - 'Value for additional property {} must be of type List[str]' - .format(k)) - _v.append(elem) - args[k] = _v + if (generic := _dict.get('generic')) is not None: + args['generic'] = [ + RuntimeResponseGeneric.from_dict(v) for v in generic + ] + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (actions := _dict.get('actions')) is not None: + args['actions'] = [DialogNodeAction.from_dict(v) for v in actions] + if (debug := _dict.get('debug')) is not None: + args['debug'] = MessageOutputDebug.from_dict(debug) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageOutputSpelling.from_dict(spelling) + if (llm_metadata := _dict.get('llm_metadata')) is not None: + args['llm_metadata'] = [ + MessageOutputLLMMetadata.from_dict(v) for v in llm_metadata + ] + if (streaming_metadata := _dict.get('streaming_metadata')) is not None: + args['streaming_metadata'] = StatelessMessageContext.from_dict( + streaming_metadata) + else: + raise ValueError( + 'Required property \'streaming_metadata\' not present in StatelessFinalResponseOutput JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchResultHighlight object from a json dictionary.""" + """Initialize a StatelessFinalResponseOutput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'body') and self.body is not None: - _dict['body'] = self.body - if hasattr(self, 'title') and self.title is not None: - _dict['title'] = self.title - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - for k in [ - _k for _k in vars(self).keys() - if _k not in SearchResultHighlight._properties - ]: - _dict[k] = getattr(self, k) + if hasattr(self, 'generic') and self.generic is not None: + generic_list = [] + for v in self.generic: + if isinstance(v, dict): + generic_list.append(v) + else: + generic_list.append(v.to_dict()) + _dict['generic'] = generic_list + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'actions') and self.actions is not None: + actions_list = [] + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) + else: + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'debug') and self.debug is not None: + if isinstance(self.debug, dict): + _dict['debug'] = self.debug + else: + _dict['debug'] = self.debug.to_dict() + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling + else: + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'llm_metadata') and self.llm_metadata is not None: + llm_metadata_list = [] + for v in self.llm_metadata: + if isinstance(v, dict): + llm_metadata_list.append(v) + else: + llm_metadata_list.append(v.to_dict()) + _dict['llm_metadata'] = llm_metadata_list + if hasattr( + self, + 'streaming_metadata') and self.streaming_metadata is not None: + if isinstance(self.streaming_metadata, dict): + _dict['streaming_metadata'] = self.streaming_metadata + else: + _dict['streaming_metadata'] = self.streaming_metadata.to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() - def get_properties(self) -> Dict: - """Return the additional properties from this instance of SearchResultHighlight in the form of a dict.""" - _dict = {} - for k in [ - _k for _k in vars(self).keys() - if _k not in SearchResultHighlight._properties - ]: - _dict[k] = getattr(self, k) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of additional properties in this instance of SearchResultHighlight""" - for k in [ - _k for _k in vars(self).keys() - if _k not in SearchResultHighlight._properties - ]: - delattr(self, k) - for k, v in _dict.items(): - if k not in SearchResultHighlight._properties: - if not isinstance(v, List): - raise ValueError( - 'Value for additional property {} must be of type List[str]' - .format(k)) - _v = [] - for elem in v: - if not isinstance(elem, str): - raise ValueError( - 'Value for additional property {} must be of type List[str]' - .format(k)) - _v.append(elem) - setattr(self, k, _v) - else: - raise ValueError( - 'Property {} cannot be specified as an additional property'. - format(k)) - def __str__(self) -> str: - """Return a `str` version of this SearchResultHighlight object.""" + """Return a `str` version of this StatelessFinalResponseOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultHighlight') -> bool: + def __eq__(self, other: 'StatelessFinalResponseOutput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchResultHighlight') -> bool: + def __ne__(self, other: 'StatelessFinalResponseOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultMetadata: +class StatelessMessageContext: """ - An object containing search result metadata from the Discovery service. + StatelessMessageContext. - :param float confidence: (optional) The confidence score for the given result, - as returned by the Discovery service. - :param float score: (optional) An unbounded measure of the relevance of a - particular result, dependent on the query and matching document. A higher score - indicates a greater match to the query parameters. + :param StatelessMessageContextGlobal global_: (optional) Session context data + that is shared by all skills used by the assistant. + :param StatelessMessageContextSkills skills: (optional) Context data specific to + particular skills used by the assistant. + :param dict integrations: (optional) An object containing context data that is + specific to particular integrations. For more information, see the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). """ def __init__( self, *, - confidence: Optional[float] = None, - score: Optional[float] = None, + global_: Optional['StatelessMessageContextGlobal'] = None, + skills: Optional['StatelessMessageContextSkills'] = None, + integrations: Optional[dict] = None, ) -> None: """ - Initialize a SearchResultMetadata object. + Initialize a StatelessMessageContext object. - :param float confidence: (optional) The confidence score for the given - result, as returned by the Discovery service. - :param float score: (optional) An unbounded measure of the relevance of a - particular result, dependent on the query and matching document. A higher - score indicates a greater match to the query parameters. + :param StatelessMessageContextGlobal global_: (optional) Session context + data that is shared by all skills used by the assistant. + :param StatelessMessageContextSkills skills: (optional) Context data + specific to particular skills used by the assistant. + :param dict integrations: (optional) An object containing context data that + is specific to particular integrations. For more information, see the + [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). """ - self.confidence = confidence - self.score = score + self.global_ = global_ + self.skills = skills + self.integrations = integrations @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchResultMetadata': - """Initialize a SearchResultMetadata object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContext': + """Initialize a StatelessMessageContext object from a json dictionary.""" args = {} - if (confidence := _dict.get('confidence')) is not None: - args['confidence'] = confidence - if (score := _dict.get('score')) is not None: - args['score'] = score + if (global_ := _dict.get('global')) is not None: + args['global_'] = StatelessMessageContextGlobal.from_dict(global_) + if (skills := _dict.get('skills')) is not None: + args['skills'] = StatelessMessageContextSkills.from_dict(skills) + if (integrations := _dict.get('integrations')) is not None: + args['integrations'] = integrations return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchResultMetadata object from a json dictionary.""" + """Initialize a StatelessMessageContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'confidence') and self.confidence is not None: - _dict['confidence'] = self.confidence - if hasattr(self, 'score') and self.score is not None: - _dict['score'] = self.score + if hasattr(self, 'global_') and self.global_ is not None: + if isinstance(self.global_, dict): + _dict['global'] = self.global_ + else: + _dict['global'] = self.global_.to_dict() + if hasattr(self, 'skills') and self.skills is not None: + if isinstance(self.skills, dict): + _dict['skills'] = self.skills + else: + _dict['skills'] = self.skills.to_dict() + if hasattr(self, 'integrations') and self.integrations is not None: + _dict['integrations'] = self.integrations return _dict def _to_dict(self): @@ -11604,178 +15668,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchResultMetadata object.""" + """Return a `str` version of this StatelessMessageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultMetadata') -> bool: + def __eq__(self, other: 'StatelessMessageContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchResultMetadata') -> bool: + def __ne__(self, other: 'StatelessMessageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettings: +class StatelessMessageContextGlobal: """ - An object describing the search skill configuration. - **Note:** Search settings are not supported in **Import skills** requests, and are not - included in **Export skills** responses. + Session context data that is shared by all skills used by the assistant. - :param SearchSettingsDiscovery discovery: Configuration settings for the Watson - Discovery service instance used by the search integration. - :param SearchSettingsMessages messages: The messages included with responses - from the search integration. - :param SearchSettingsSchemaMapping schema_mapping: The mapping between fields in - the Watson Discovery collection and properties in the search response. - :param SearchSettingsElasticSearch elastic_search: (optional) Configuration - settings for the Elasticsearch service used by the search integration. You can - provide either basic auth or apiKey auth. - :param SearchSettingsConversationalSearch conversational_search: (optional) - Configuration settings for conversational search. - :param SearchSettingsServerSideSearch server_side_search: (optional) - Configuration settings for the server-side search service used by the search - integration. You can provide either basic auth, apiKey auth or none. - :param SearchSettingsClientSideSearch client_side_search: (optional) - Configuration settings for the client-side search service or server-side search - service used by the search integration. + :param MessageContextGlobalSystem system: (optional) Built-in system properties + that apply to all skills used by the assistant. + :param str session_id: (optional) The unique identifier of the session. """ def __init__( self, - discovery: 'SearchSettingsDiscovery', - messages: 'SearchSettingsMessages', - schema_mapping: 'SearchSettingsSchemaMapping', *, - elastic_search: Optional['SearchSettingsElasticSearch'] = None, - conversational_search: Optional[ - 'SearchSettingsConversationalSearch'] = None, - server_side_search: Optional['SearchSettingsServerSideSearch'] = None, - client_side_search: Optional['SearchSettingsClientSideSearch'] = None, + system: Optional['MessageContextGlobalSystem'] = None, + session_id: Optional[str] = None, ) -> None: """ - Initialize a SearchSettings object. + Initialize a StatelessMessageContextGlobal object. - :param SearchSettingsDiscovery discovery: Configuration settings for the - Watson Discovery service instance used by the search integration. - :param SearchSettingsMessages messages: The messages included with - responses from the search integration. - :param SearchSettingsSchemaMapping schema_mapping: The mapping between - fields in the Watson Discovery collection and properties in the search - response. - :param SearchSettingsElasticSearch elastic_search: (optional) Configuration - settings for the Elasticsearch service used by the search integration. You - can provide either basic auth or apiKey auth. - :param SearchSettingsConversationalSearch conversational_search: (optional) - Configuration settings for conversational search. - :param SearchSettingsServerSideSearch server_side_search: (optional) - Configuration settings for the server-side search service used by the - search integration. You can provide either basic auth, apiKey auth or none. - :param SearchSettingsClientSideSearch client_side_search: (optional) - Configuration settings for the client-side search service or server-side - search service used by the search integration. + :param MessageContextGlobalSystem system: (optional) Built-in system + properties that apply to all skills used by the assistant. + :param str session_id: (optional) The unique identifier of the session. """ - self.discovery = discovery - self.messages = messages - self.schema_mapping = schema_mapping - self.elastic_search = elastic_search - self.conversational_search = conversational_search - self.server_side_search = server_side_search - self.client_side_search = client_side_search + self.system = system + self.session_id = session_id @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettings': - """Initialize a SearchSettings object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextGlobal': + """Initialize a StatelessMessageContextGlobal object from a json dictionary.""" args = {} - if (discovery := _dict.get('discovery')) is not None: - args['discovery'] = SearchSettingsDiscovery.from_dict(discovery) - else: - raise ValueError( - 'Required property \'discovery\' not present in SearchSettings JSON' - ) - if (messages := _dict.get('messages')) is not None: - args['messages'] = SearchSettingsMessages.from_dict(messages) - else: - raise ValueError( - 'Required property \'messages\' not present in SearchSettings JSON' - ) - if (schema_mapping := _dict.get('schema_mapping')) is not None: - args['schema_mapping'] = SearchSettingsSchemaMapping.from_dict( - schema_mapping) - else: - raise ValueError( - 'Required property \'schema_mapping\' not present in SearchSettings JSON' - ) - if (elastic_search := _dict.get('elastic_search')) is not None: - args['elastic_search'] = SearchSettingsElasticSearch.from_dict( - elastic_search) - if (conversational_search := - _dict.get('conversational_search')) is not None: - args[ - 'conversational_search'] = SearchSettingsConversationalSearch.from_dict( - conversational_search) - if (server_side_search := _dict.get('server_side_search')) is not None: - args[ - 'server_side_search'] = SearchSettingsServerSideSearch.from_dict( - server_side_search) - if (client_side_search := _dict.get('client_side_search')) is not None: - args[ - 'client_side_search'] = SearchSettingsClientSideSearch.from_dict( - client_side_search) + if (system := _dict.get('system')) is not None: + args['system'] = MessageContextGlobalSystem.from_dict(system) + if (session_id := _dict.get('session_id')) is not None: + args['session_id'] = session_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettings object from a json dictionary.""" + """Initialize a StatelessMessageContextGlobal object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'discovery') and self.discovery is not None: - if isinstance(self.discovery, dict): - _dict['discovery'] = self.discovery - else: - _dict['discovery'] = self.discovery.to_dict() - if hasattr(self, 'messages') and self.messages is not None: - if isinstance(self.messages, dict): - _dict['messages'] = self.messages - else: - _dict['messages'] = self.messages.to_dict() - if hasattr(self, 'schema_mapping') and self.schema_mapping is not None: - if isinstance(self.schema_mapping, dict): - _dict['schema_mapping'] = self.schema_mapping - else: - _dict['schema_mapping'] = self.schema_mapping.to_dict() - if hasattr(self, 'elastic_search') and self.elastic_search is not None: - if isinstance(self.elastic_search, dict): - _dict['elastic_search'] = self.elastic_search - else: - _dict['elastic_search'] = self.elastic_search.to_dict() - if hasattr(self, 'conversational_search' - ) and self.conversational_search is not None: - if isinstance(self.conversational_search, dict): - _dict['conversational_search'] = self.conversational_search - else: - _dict[ - 'conversational_search'] = self.conversational_search.to_dict( - ) - if hasattr( - self, - 'server_side_search') and self.server_side_search is not None: - if isinstance(self.server_side_search, dict): - _dict['server_side_search'] = self.server_side_search - else: - _dict['server_side_search'] = self.server_side_search.to_dict() - if hasattr( - self, - 'client_side_search') and self.client_side_search is not None: - if isinstance(self.client_side_search, dict): - _dict['client_side_search'] = self.client_side_search + if hasattr(self, 'system') and self.system is not None: + if isinstance(self.system, dict): + _dict['system'] = self.system else: - _dict['client_side_search'] = self.client_side_search.to_dict() + _dict['system'] = self.system.to_dict() + if hasattr(self, 'session_id') and self.session_id is not None: + _dict['session_id'] = self.session_id return _dict def _to_dict(self): @@ -11783,68 +15739,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettings object.""" + """Return a `str` version of this StatelessMessageContextGlobal object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettings') -> bool: + def __eq__(self, other: 'StatelessMessageContextGlobal') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettings') -> bool: + def __ne__(self, other: 'StatelessMessageContextGlobal') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsClientSideSearch: +class StatelessMessageContextSkills: """ - Configuration settings for the client-side search service or server-side search - service used by the search integration. + Context data specific to particular skills used by the assistant. - :param str filter: (optional) The filter string that is applied to the search - results. - :param dict metadata: (optional) The metadata object. + :param MessageContextDialogSkill main_skill: (optional) Context variables that + are used by the dialog skill. + :param StatelessMessageContextSkillsActionsSkill actions_skill: (optional) + Context variables that are used by the action skill. """ def __init__( self, *, - filter: Optional[str] = None, - metadata: Optional[dict] = None, + main_skill: Optional['MessageContextDialogSkill'] = None, + actions_skill: Optional[ + 'StatelessMessageContextSkillsActionsSkill'] = None, ) -> None: """ - Initialize a SearchSettingsClientSideSearch object. + Initialize a StatelessMessageContextSkills object. - :param str filter: (optional) The filter string that is applied to the - search results. - :param dict metadata: (optional) The metadata object. + :param MessageContextDialogSkill main_skill: (optional) Context variables + that are used by the dialog skill. + :param StatelessMessageContextSkillsActionsSkill actions_skill: (optional) + Context variables that are used by the action skill. """ - self.filter = filter - self.metadata = metadata + self.main_skill = main_skill + self.actions_skill = actions_skill @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsClientSideSearch': - """Initialize a SearchSettingsClientSideSearch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextSkills': + """Initialize a StatelessMessageContextSkills object from a json dictionary.""" args = {} - if (filter := _dict.get('filter')) is not None: - args['filter'] = filter - if (metadata := _dict.get('metadata')) is not None: - args['metadata'] = metadata + if (main_skill := _dict.get('main skill')) is not None: + args['main_skill'] = MessageContextDialogSkill.from_dict(main_skill) + if (actions_skill := _dict.get('actions skill')) is not None: + args[ + 'actions_skill'] = StatelessMessageContextSkillsActionsSkill.from_dict( + actions_skill) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsClientSideSearch object from a json dictionary.""" + """Initialize a StatelessMessageContextSkills object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'filter') and self.filter is not None: - _dict['filter'] = self.filter - if hasattr(self, 'metadata') and self.metadata is not None: - _dict['metadata'] = self.metadata + if hasattr(self, 'main_skill') and self.main_skill is not None: + if isinstance(self.main_skill, dict): + _dict['main skill'] = self.main_skill + else: + _dict['main skill'] = self.main_skill.to_dict() + if hasattr(self, 'actions_skill') and self.actions_skill is not None: + if isinstance(self.actions_skill, dict): + _dict['actions skill'] = self.actions_skill + else: + _dict['actions skill'] = self.actions_skill.to_dict() return _dict def _to_dict(self): @@ -11852,95 +15818,134 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsClientSideSearch object.""" + """Return a `str` version of this StatelessMessageContextSkills object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsClientSideSearch') -> bool: + def __eq__(self, other: 'StatelessMessageContextSkills') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsClientSideSearch') -> bool: + def __ne__(self, other: 'StatelessMessageContextSkills') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsConversationalSearch: +class StatelessMessageContextSkillsActionsSkill: """ - Configuration settings for conversational search. + Context variables that are used by the action skill. - :param bool enabled: Whether to enable conversational search. - :param SearchSettingsConversationalSearchResponseLength response_length: - (optional) - :param SearchSettingsConversationalSearchSearchConfidence search_confidence: - (optional) + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data used by + the skill. + :param dict action_variables: (optional) An object containing action variables. + Action variables can be accessed only by steps in the same action, and do not + persist after the action ends. + :param dict skill_variables: (optional) An object containing skill variables. + (In the watsonx Assistant user interface, skill variables are called _session + variables_.) Skill variables can be accessed by any action and persist for the + duration of the session. + :param dict private_action_variables: (optional) An object containing private + action variables. Action variables can be accessed only by steps in the same + action, and do not persist after the action ends. Private variables are + encrypted. + :param dict private_skill_variables: (optional) An object containing private + skill variables. (In the watsonx Assistant user interface, skill variables are + called _session variables_.) Skill variables can be accessed by any action and + persist for the duration of the session. Private variables are encrypted. """ def __init__( self, - enabled: bool, *, - response_length: Optional[ - 'SearchSettingsConversationalSearchResponseLength'] = None, - search_confidence: Optional[ - 'SearchSettingsConversationalSearchSearchConfidence'] = None, + user_defined: Optional[dict] = None, + system: Optional['MessageContextSkillSystem'] = None, + action_variables: Optional[dict] = None, + skill_variables: Optional[dict] = None, + private_action_variables: Optional[dict] = None, + private_skill_variables: Optional[dict] = None, ) -> None: """ - Initialize a SearchSettingsConversationalSearch object. + Initialize a StatelessMessageContextSkillsActionsSkill object. - :param bool enabled: Whether to enable conversational search. - :param SearchSettingsConversationalSearchResponseLength response_length: - (optional) - :param SearchSettingsConversationalSearchSearchConfidence - search_confidence: (optional) + :param dict user_defined: (optional) An object containing any arbitrary + variables that can be read and written by a particular skill. + :param MessageContextSkillSystem system: (optional) System context data + used by the skill. + :param dict action_variables: (optional) An object containing action + variables. Action variables can be accessed only by steps in the same + action, and do not persist after the action ends. + :param dict skill_variables: (optional) An object containing skill + variables. (In the watsonx Assistant user interface, skill variables are + called _session variables_.) Skill variables can be accessed by any action + and persist for the duration of the session. + :param dict private_action_variables: (optional) An object containing + private action variables. Action variables can be accessed only by steps in + the same action, and do not persist after the action ends. Private + variables are encrypted. + :param dict private_skill_variables: (optional) An object containing + private skill variables. (In the watsonx Assistant user interface, skill + variables are called _session variables_.) Skill variables can be accessed + by any action and persist for the duration of the session. Private + variables are encrypted. """ - self.enabled = enabled - self.response_length = response_length - self.search_confidence = search_confidence + self.user_defined = user_defined + self.system = system + self.action_variables = action_variables + self.skill_variables = skill_variables + self.private_action_variables = private_action_variables + self.private_skill_variables = private_skill_variables @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsConversationalSearch': - """Initialize a SearchSettingsConversationalSearch object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'StatelessMessageContextSkillsActionsSkill': + """Initialize a StatelessMessageContextSkillsActionsSkill object from a json dictionary.""" args = {} - if (enabled := _dict.get('enabled')) is not None: - args['enabled'] = enabled - else: - raise ValueError( - 'Required property \'enabled\' not present in SearchSettingsConversationalSearch JSON' - ) - if (response_length := _dict.get('response_length')) is not None: - args[ - 'response_length'] = SearchSettingsConversationalSearchResponseLength.from_dict( - response_length) - if (search_confidence := _dict.get('search_confidence')) is not None: - args[ - 'search_confidence'] = SearchSettingsConversationalSearchSearchConfidence.from_dict( - search_confidence) + if (user_defined := _dict.get('user_defined')) is not None: + args['user_defined'] = user_defined + if (system := _dict.get('system')) is not None: + args['system'] = MessageContextSkillSystem.from_dict(system) + if (action_variables := _dict.get('action_variables')) is not None: + args['action_variables'] = action_variables + if (skill_variables := _dict.get('skill_variables')) is not None: + args['skill_variables'] = skill_variables + if (private_action_variables := + _dict.get('private_action_variables')) is not None: + args['private_action_variables'] = private_action_variables + if (private_skill_variables := + _dict.get('private_skill_variables')) is not None: + args['private_skill_variables'] = private_skill_variables return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsConversationalSearch object from a json dictionary.""" + """Initialize a StatelessMessageContextSkillsActionsSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, - 'response_length') and self.response_length is not None: - if isinstance(self.response_length, dict): - _dict['response_length'] = self.response_length + if hasattr(self, 'user_defined') and self.user_defined is not None: + _dict['user_defined'] = self.user_defined + if hasattr(self, 'system') and self.system is not None: + if isinstance(self.system, dict): + _dict['system'] = self.system else: - _dict['response_length'] = self.response_length.to_dict() + _dict['system'] = self.system.to_dict() if hasattr(self, - 'search_confidence') and self.search_confidence is not None: - if isinstance(self.search_confidence, dict): - _dict['search_confidence'] = self.search_confidence - else: - _dict['search_confidence'] = self.search_confidence.to_dict() + 'action_variables') and self.action_variables is not None: + _dict['action_variables'] = self.action_variables + if hasattr(self, + 'skill_variables') and self.skill_variables is not None: + _dict['skill_variables'] = self.skill_variables + if hasattr(self, 'private_action_variables' + ) and self.private_action_variables is not None: + _dict['private_action_variables'] = self.private_action_variables + if hasattr(self, 'private_skill_variables' + ) and self.private_skill_variables is not None: + _dict['private_skill_variables'] = self.private_skill_variables return _dict def _to_dict(self): @@ -11948,61 +15953,177 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsConversationalSearch object.""" + """Return a `str` version of this StatelessMessageContextSkillsActionsSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsConversationalSearch') -> bool: + def __eq__(self, + other: 'StatelessMessageContextSkillsActionsSkill') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsConversationalSearch') -> bool: + def __ne__(self, + other: 'StatelessMessageContextSkillsActionsSkill') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsConversationalSearchResponseLength: +class StatelessMessageInput: """ - SearchSettingsConversationalSearchResponseLength. + An input object that includes the input text. - :param str option: (optional) The response length option. It controls the length - of the generated response. + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating + the user input. Include intents from the previous response to continue using + those intents rather than trying to recognize intents in the new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating + the message. Include entities from the previous response to continue using those + entities rather than detecting entities in the new input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the Segment + extension. + :param StatelessMessageInputOptions options: (optional) Optional properties that + control how the assistant responds. """ def __init__( self, *, - option: Optional[str] = None, + message_type: Optional[str] = None, + text: Optional[str] = None, + intents: Optional[List['RuntimeIntent']] = None, + entities: Optional[List['RuntimeEntity']] = None, + suggestion_id: Optional[str] = None, + attachments: Optional[List['MessageInputAttachment']] = None, + analytics: Optional['RequestAnalytics'] = None, + options: Optional['StatelessMessageInputOptions'] = None, ) -> None: """ - Initialize a SearchSettingsConversationalSearchResponseLength object. + Initialize a StatelessMessageInput object. - :param str option: (optional) The response length option. It controls the - length of the generated response. + :param str message_type: (optional) The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill + is bypassed.) + **Note:** A `search` message results in an error if no search skill is + configured for the assistant. + :param str text: (optional) The text of the user input. This string cannot + contain carriage return, newline, or tab characters. + :param List[RuntimeIntent] intents: (optional) Intents to use when + evaluating the user input. Include intents from the previous response to + continue using those intents rather than trying to recognize intents in the + new input. + :param List[RuntimeEntity] entities: (optional) Entities to use when + evaluating the message. Include entities from the previous response to + continue using those entities rather than detecting entities in the new + input. + :param str suggestion_id: (optional) For internal use only. + :param List[MessageInputAttachment] attachments: (optional) An array of + multimedia attachments to be sent with the message. Attachments are not + processed by the assistant itself, but can be sent to external services by + webhooks. + **Note:** Attachments are not supported on IBM Cloud Pak for Data. + :param RequestAnalytics analytics: (optional) An optional object containing + analytics data. Currently, this data is used only for events sent to the + Segment extension. + :param StatelessMessageInputOptions options: (optional) Optional properties + that control how the assistant responds. """ - self.option = option + self.message_type = message_type + self.text = text + self.intents = intents + self.entities = entities + self.suggestion_id = suggestion_id + self.attachments = attachments + self.analytics = analytics + self.options = options @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SearchSettingsConversationalSearchResponseLength': - """Initialize a SearchSettingsConversationalSearchResponseLength object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageInput': + """Initialize a StatelessMessageInput object from a json dictionary.""" args = {} - if (option := _dict.get('option')) is not None: - args['option'] = option + if (message_type := _dict.get('message_type')) is not None: + args['message_type'] = message_type + if (text := _dict.get('text')) is not None: + args['text'] = text + if (intents := _dict.get('intents')) is not None: + args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] + if (entities := _dict.get('entities')) is not None: + args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] + if (suggestion_id := _dict.get('suggestion_id')) is not None: + args['suggestion_id'] = suggestion_id + if (attachments := _dict.get('attachments')) is not None: + args['attachments'] = [ + MessageInputAttachment.from_dict(v) for v in attachments + ] + if (analytics := _dict.get('analytics')) is not None: + args['analytics'] = RequestAnalytics.from_dict(analytics) + if (options := _dict.get('options')) is not None: + args['options'] = StatelessMessageInputOptions.from_dict(options) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsConversationalSearchResponseLength object from a json dictionary.""" + """Initialize a StatelessMessageInput object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'option') and self.option is not None: - _dict['option'] = self.option + if hasattr(self, 'message_type') and self.message_type is not None: + _dict['message_type'] = self.message_type + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'intents') and self.intents is not None: + intents_list = [] + for v in self.intents: + if isinstance(v, dict): + intents_list.append(v) + else: + intents_list.append(v.to_dict()) + _dict['intents'] = intents_list + if hasattr(self, 'entities') and self.entities is not None: + entities_list = [] + for v in self.entities: + if isinstance(v, dict): + entities_list.append(v) + else: + entities_list.append(v.to_dict()) + _dict['entities'] = entities_list + if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: + _dict['suggestion_id'] = self.suggestion_id + if hasattr(self, 'attachments') and self.attachments is not None: + attachments_list = [] + for v in self.attachments: + if isinstance(v, dict): + attachments_list.append(v) + else: + attachments_list.append(v.to_dict()) + _dict['attachments'] = attachments_list + if hasattr(self, 'analytics') and self.analytics is not None: + if isinstance(self.analytics, dict): + _dict['analytics'] = self.analytics + else: + _dict['analytics'] = self.analytics.to_dict() + if hasattr(self, 'options') and self.options is not None: + if isinstance(self.options, dict): + _dict['options'] = self.options + else: + _dict['options'] = self.options.to_dict() return _dict def _to_dict(self): @@ -12010,76 +16131,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsConversationalSearchResponseLength object.""" + """Return a `str` version of this StatelessMessageInput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'SearchSettingsConversationalSearchResponseLength') -> bool: + def __eq__(self, other: 'StatelessMessageInput') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, - other: 'SearchSettingsConversationalSearchResponseLength') -> bool: + def __ne__(self, other: 'StatelessMessageInput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class OptionEnum(str, Enum): + class MessageTypeEnum(str, Enum): """ - The response length option. It controls the length of the generated response. + The type of the message: + - `text`: The user input is processed normally by the assistant. + - `search`: Only search results are returned. (Any dialog or action skill is + bypassed.) + **Note:** A `search` message results in an error if no search skill is configured + for the assistant. """ - CONCISE = 'concise' - MODERATE = 'moderate' - VERBOSE = 'verbose' + TEXT = 'text' + SEARCH = 'search' -class SearchSettingsConversationalSearchSearchConfidence: +class StatelessMessageInputOptions: """ - SearchSettingsConversationalSearchSearchConfidence. + Optional properties that control how the assistant responds. - :param str threshold: (optional) The search confidence threshold. - It controls the tendency for conversational search to produce “I don't know” - answers. + :param bool restart: (optional) Whether to restart dialog processing at the root + of the dialog, regardless of any previously visited nodes. **Note:** This does + not affect `turn_count` or any other context variables. + :param bool alternate_intents: (optional) Whether to return more than one + intent. Set to `true` to return all matching intents. + :param bool async_callout: (optional) Whether custom extension callouts are + executed asynchronously. Asynchronous execution means the response to the + extension callout will be processed on the subsequent message call, the initial + message response signals to the client that the operation may be long running. + With synchronous execution the custom extension is executed and returns the + response in a single message turn. **Note:** **async_callout** defaults to true + for API versions earlier than 2023-06-15. + :param MessageInputOptionsSpelling spelling: (optional) Spelling correction + options for the message. Any options specified on an individual message override + the settings configured for the skill. + :param bool debug: (optional) Whether to return additional diagnostic + information. Set to `true` to return additional information in the + `output.debug` property. """ def __init__( self, *, - threshold: Optional[str] = None, + restart: Optional[bool] = None, + alternate_intents: Optional[bool] = None, + async_callout: Optional[bool] = None, + spelling: Optional['MessageInputOptionsSpelling'] = None, + debug: Optional[bool] = None, ) -> None: """ - Initialize a SearchSettingsConversationalSearchSearchConfidence object. + Initialize a StatelessMessageInputOptions object. - :param str threshold: (optional) The search confidence threshold. - It controls the tendency for conversational search to produce “I don't - know” answers. + :param bool restart: (optional) Whether to restart dialog processing at the + root of the dialog, regardless of any previously visited nodes. **Note:** + This does not affect `turn_count` or any other context variables. + :param bool alternate_intents: (optional) Whether to return more than one + intent. Set to `true` to return all matching intents. + :param bool async_callout: (optional) Whether custom extension callouts are + executed asynchronously. Asynchronous execution means the response to the + extension callout will be processed on the subsequent message call, the + initial message response signals to the client that the operation may be + long running. With synchronous execution the custom extension is executed + and returns the response in a single message turn. **Note:** + **async_callout** defaults to true for API versions earlier than + 2023-06-15. + :param MessageInputOptionsSpelling spelling: (optional) Spelling correction + options for the message. Any options specified on an individual message + override the settings configured for the skill. + :param bool debug: (optional) Whether to return additional diagnostic + information. Set to `true` to return additional information in the + `output.debug` property. """ - self.threshold = threshold + self.restart = restart + self.alternate_intents = alternate_intents + self.async_callout = async_callout + self.spelling = spelling + self.debug = debug @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'SearchSettingsConversationalSearchSearchConfidence': - """Initialize a SearchSettingsConversationalSearchSearchConfidence object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageInputOptions': + """Initialize a StatelessMessageInputOptions object from a json dictionary.""" args = {} - if (threshold := _dict.get('threshold')) is not None: - args['threshold'] = threshold + if (restart := _dict.get('restart')) is not None: + args['restart'] = restart + if (alternate_intents := _dict.get('alternate_intents')) is not None: + args['alternate_intents'] = alternate_intents + if (async_callout := _dict.get('async_callout')) is not None: + args['async_callout'] = async_callout + if (spelling := _dict.get('spelling')) is not None: + args['spelling'] = MessageInputOptionsSpelling.from_dict(spelling) + if (debug := _dict.get('debug')) is not None: + args['debug'] = debug return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsConversationalSearchSearchConfidence object from a json dictionary.""" + """Initialize a StatelessMessageInputOptions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'threshold') and self.threshold is not None: - _dict['threshold'] = self.threshold + if hasattr(self, 'restart') and self.restart is not None: + _dict['restart'] = self.restart + if hasattr(self, + 'alternate_intents') and self.alternate_intents is not None: + _dict['alternate_intents'] = self.alternate_intents + if hasattr(self, 'async_callout') and self.async_callout is not None: + _dict['async_callout'] = self.async_callout + if hasattr(self, 'spelling') and self.spelling is not None: + if isinstance(self.spelling, dict): + _dict['spelling'] = self.spelling + else: + _dict['spelling'] = self.spelling.to_dict() + if hasattr(self, 'debug') and self.debug is not None: + _dict['debug'] = self.debug return _dict def _to_dict(self): @@ -12087,195 +16265,137 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsConversationalSearchSearchConfidence object.""" + """Return a `str` version of this StatelessMessageInputOptions object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'SearchSettingsConversationalSearchSearchConfidence' - ) -> bool: + def __eq__(self, other: 'StatelessMessageInputOptions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, other: 'SearchSettingsConversationalSearchSearchConfidence' - ) -> bool: + def __ne__(self, other: 'StatelessMessageInputOptions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ThresholdEnum(str, Enum): - """ - The search confidence threshold. - It controls the tendency for conversational search to produce “I don't know” - answers. - """ - - RARELY = 'rarely' - LESS_OFTEN = 'less_often' - MORE_OFTEN = 'more_often' - MOST_OFTEN = 'most_often' - -class SearchSettingsDiscovery: +class StatelessMessageResponse: """ - Configuration settings for the Watson Discovery service instance used by the search - integration. + A stateless response from the watsonx Assistant service. - :param str instance_id: The ID for the Watson Discovery service instance. - :param str project_id: The ID for the Watson Discovery project. - :param str url: The URL for the Watson Discovery service instance. - :param int max_primary_results: (optional) The maximum number of primary results - to include in the response. - :param int max_total_results: (optional) The maximum total number of primary and - additional results to include in the response. - :param float confidence_threshold: (optional) The minimum confidence threshold - for included results. Any results with a confidence below this threshold will be - discarded. - :param bool highlight: (optional) Whether to include the most relevant passages - of text in the **highlight** property of each result. - :param bool find_answers: (optional) Whether to use the answer finding feature - to emphasize answers within highlighted passages. This property is ignored if - **highlight**=`false`. - **Notes:** - - Answer finding is available only if the search skill is connected to a - Discovery v2 service instance. - - Answer finding is not supported on IBM Cloud Pak for Data. - :param SearchSettingsDiscoveryAuthentication authentication: Authentication - information for the Watson Discovery service. For more information, see the - [Watson Discovery - documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). - **Note:** You must specify either **basic** or **bearer**, but not both. + :param MessageOutput output: Assistant output to be rendered or processed by the + client. + :param StatelessMessageContext context: Context data for the conversation. You + can use this property to access context variables. The context is not stored by + the assistant; to maintain session state, include the context from the response + in the next message. + :param MessageOutput masked_output: (optional) Assistant output to be rendered + or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes the + input text. All private data is masked or removed. + :param str user_id: (optional) A string value that identifies the user who is + interacting with the assistant. The client must provide a unique identifier for + each individual end user who accesses the application. For user-based plans, + this user ID is used to identify unique users for billing purposes. This string + cannot contain carriage return, newline, or tab characters. If no value is + specified in the input, **user_id** is automatically set to the value of + **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the global + system context. """ - - def __init__( - self, - instance_id: str, - project_id: str, - url: str, - authentication: 'SearchSettingsDiscoveryAuthentication', - *, - max_primary_results: Optional[int] = None, - max_total_results: Optional[int] = None, - confidence_threshold: Optional[float] = None, - highlight: Optional[bool] = None, - find_answers: Optional[bool] = None, - ) -> None: - """ - Initialize a SearchSettingsDiscovery object. - - :param str instance_id: The ID for the Watson Discovery service instance. - :param str project_id: The ID for the Watson Discovery project. - :param str url: The URL for the Watson Discovery service instance. - :param SearchSettingsDiscoveryAuthentication authentication: Authentication - information for the Watson Discovery service. For more information, see the - [Watson Discovery - documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). - **Note:** You must specify either **basic** or **bearer**, but not both. - :param int max_primary_results: (optional) The maximum number of primary - results to include in the response. - :param int max_total_results: (optional) The maximum total number of - primary and additional results to include in the response. - :param float confidence_threshold: (optional) The minimum confidence - threshold for included results. Any results with a confidence below this - threshold will be discarded. - :param bool highlight: (optional) Whether to include the most relevant - passages of text in the **highlight** property of each result. - :param bool find_answers: (optional) Whether to use the answer finding - feature to emphasize answers within highlighted passages. This property is - ignored if **highlight**=`false`. - **Notes:** - - Answer finding is available only if the search skill is connected to a - Discovery v2 service instance. - - Answer finding is not supported on IBM Cloud Pak for Data. + + def __init__( + self, + output: 'MessageOutput', + context: 'StatelessMessageContext', + *, + masked_output: Optional['MessageOutput'] = None, + masked_input: Optional['MessageInput'] = None, + user_id: Optional[str] = None, + ) -> None: """ - self.instance_id = instance_id - self.project_id = project_id - self.url = url - self.max_primary_results = max_primary_results - self.max_total_results = max_total_results - self.confidence_threshold = confidence_threshold - self.highlight = highlight - self.find_answers = find_answers - self.authentication = authentication + Initialize a StatelessMessageResponse object. + + :param MessageOutput output: Assistant output to be rendered or processed + by the client. + :param StatelessMessageContext context: Context data for the conversation. + You can use this property to access context variables. The context is not + stored by the assistant; to maintain session state, include the context + from the response in the next message. + :param MessageOutput masked_output: (optional) Assistant output to be + rendered or processed by the client. All private data is masked or removed. + :param MessageInput masked_input: (optional) An input object that includes + the input text. All private data is masked or removed. + :param str user_id: (optional) A string value that identifies the user who + is interacting with the assistant. The client must provide a unique + identifier for each individual end user who accesses the application. For + user-based plans, this user ID is used to identify unique users for billing + purposes. This string cannot contain carriage return, newline, or tab + characters. If no value is specified in the input, **user_id** is + automatically set to the value of **context.global.session_id**. + **Note:** This property is the same as the **user_id** property in the + global system context. + """ + self.output = output + self.context = context + self.masked_output = masked_output + self.masked_input = masked_input + self.user_id = user_id @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscovery': - """Initialize a SearchSettingsDiscovery object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageResponse': + """Initialize a StatelessMessageResponse object from a json dictionary.""" args = {} - if (instance_id := _dict.get('instance_id')) is not None: - args['instance_id'] = instance_id - else: - raise ValueError( - 'Required property \'instance_id\' not present in SearchSettingsDiscovery JSON' - ) - if (project_id := _dict.get('project_id')) is not None: - args['project_id'] = project_id - else: - raise ValueError( - 'Required property \'project_id\' not present in SearchSettingsDiscovery JSON' - ) - if (url := _dict.get('url')) is not None: - args['url'] = url + if (output := _dict.get('output')) is not None: + args['output'] = MessageOutput.from_dict(output) else: raise ValueError( - 'Required property \'url\' not present in SearchSettingsDiscovery JSON' + 'Required property \'output\' not present in StatelessMessageResponse JSON' ) - if (max_primary_results := - _dict.get('max_primary_results')) is not None: - args['max_primary_results'] = max_primary_results - if (max_total_results := _dict.get('max_total_results')) is not None: - args['max_total_results'] = max_total_results - if (confidence_threshold := - _dict.get('confidence_threshold')) is not None: - args['confidence_threshold'] = confidence_threshold - if (highlight := _dict.get('highlight')) is not None: - args['highlight'] = highlight - if (find_answers := _dict.get('find_answers')) is not None: - args['find_answers'] = find_answers - if (authentication := _dict.get('authentication')) is not None: - args[ - 'authentication'] = SearchSettingsDiscoveryAuthentication.from_dict( - authentication) + if (context := _dict.get('context')) is not None: + args['context'] = StatelessMessageContext.from_dict(context) else: raise ValueError( - 'Required property \'authentication\' not present in SearchSettingsDiscovery JSON' + 'Required property \'context\' not present in StatelessMessageResponse JSON' ) + if (masked_output := _dict.get('masked_output')) is not None: + args['masked_output'] = MessageOutput.from_dict(masked_output) + if (masked_input := _dict.get('masked_input')) is not None: + args['masked_input'] = MessageInput.from_dict(masked_input) + if (user_id := _dict.get('user_id')) is not None: + args['user_id'] = user_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsDiscovery object from a json dictionary.""" + """Initialize a StatelessMessageResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'instance_id') and self.instance_id is not None: - _dict['instance_id'] = self.instance_id - if hasattr(self, 'project_id') and self.project_id is not None: - _dict['project_id'] = self.project_id - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr( - self, - 'max_primary_results') and self.max_primary_results is not None: - _dict['max_primary_results'] = self.max_primary_results - if hasattr(self, - 'max_total_results') and self.max_total_results is not None: - _dict['max_total_results'] = self.max_total_results - if hasattr(self, 'confidence_threshold' - ) and self.confidence_threshold is not None: - _dict['confidence_threshold'] = self.confidence_threshold - if hasattr(self, 'highlight') and self.highlight is not None: - _dict['highlight'] = self.highlight - if hasattr(self, 'find_answers') and self.find_answers is not None: - _dict['find_answers'] = self.find_answers - if hasattr(self, 'authentication') and self.authentication is not None: - if isinstance(self.authentication, dict): - _dict['authentication'] = self.authentication + if hasattr(self, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output else: - _dict['authentication'] = self.authentication.to_dict() + _dict['output'] = self.output.to_dict() + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'masked_output') and self.masked_output is not None: + if isinstance(self.masked_output, dict): + _dict['masked_output'] = self.masked_output + else: + _dict['masked_output'] = self.masked_output.to_dict() + if hasattr(self, 'masked_input') and self.masked_input is not None: + if isinstance(self.masked_input, dict): + _dict['masked_input'] = self.masked_input + else: + _dict['masked_input'] = self.masked_input.to_dict() + if hasattr(self, 'user_id') and self.user_id is not None: + _dict['user_id'] = self.user_id return _dict def _to_dict(self): @@ -12283,74 +16403,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsDiscovery object.""" + """Return a `str` version of this StatelessMessageResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsDiscovery') -> bool: + def __eq__(self, other: 'StatelessMessageResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsDiscovery') -> bool: + def __ne__(self, other: 'StatelessMessageResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsDiscoveryAuthentication: +class StatelessMessageStreamResponse: """ - Authentication information for the Watson Discovery service. For more information, see - the [Watson Discovery - documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). - **Note:** You must specify either **basic** or **bearer**, but not both. + A stateless streamed response form the watsonx Assistant service. - :param str basic: (optional) The HTTP basic authentication credentials for - Watson Discovery. Specify your Watson Discovery API key in the format - `apikey:{apikey}`. - :param str bearer: (optional) The authentication bearer token for Watson - Discovery. + """ + + def __init__(self,) -> None: + """ + Initialize a StatelessMessageStreamResponse object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'StatelessMessageStreamResponseMessageStreamPartialItem', + 'StatelessMessageStreamResponseMessageStreamCompleteItem', + 'StatelessMessageStreamResponseStatelessMessageStreamFinalResponse' + ])) + raise Exception(msg) + + +class StatusError: + """ + An object describing an error that occurred during processing of an asynchronous + operation. + + :param str message: (optional) The text of the error message. """ def __init__( self, *, - basic: Optional[str] = None, - bearer: Optional[str] = None, + message: Optional[str] = None, ) -> None: """ - Initialize a SearchSettingsDiscoveryAuthentication object. + Initialize a StatusError object. - :param str basic: (optional) The HTTP basic authentication credentials for - Watson Discovery. Specify your Watson Discovery API key in the format - `apikey:{apikey}`. - :param str bearer: (optional) The authentication bearer token for Watson - Discovery. + :param str message: (optional) The text of the error message. """ - self.basic = basic - self.bearer = bearer + self.message = message @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscoveryAuthentication': - """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatusError': + """Initialize a StatusError object from a json dictionary.""" args = {} - if (basic := _dict.get('basic')) is not None: - args['basic'] = basic - if (bearer := _dict.get('bearer')) is not None: - args['bearer'] = bearer + if (message := _dict.get('message')) is not None: + args['message'] = message return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" + """Initialize a StatusError object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'basic') and self.basic is not None: - _dict['basic'] = self.basic - if hasattr(self, 'bearer') and self.bearer is not None: - _dict['bearer'] = self.bearer + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message return _dict def _to_dict(self): @@ -12358,158 +16482,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsDiscoveryAuthentication object.""" + """Return a `str` version of this StatusError object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsDiscoveryAuthentication') -> bool: + def __eq__(self, other: 'StatusError') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsDiscoveryAuthentication') -> bool: + def __ne__(self, other: 'StatusError') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsElasticSearch: +class TurnEventActionSource: """ - Configuration settings for the Elasticsearch service used by the search integration. - You can provide either basic auth or apiKey auth. + TurnEventActionSource. - :param str url: The URL for the Elasticsearch service. - :param str port: The port number for the Elasticsearch service URL. - **Note:** It can be omitted if a port number is appended to the URL. - :param str username: (optional) The username of the basic authentication method. - :param str password: (optional) The password of the basic authentication method. - The credentials are not returned due to security reasons. - :param str index: The Elasticsearch index to use for the search integration. - :param List[object] filter: (optional) An array of filters that can be applied - to the search results via the `$FILTER` variable in the `query_body`.For more - information, see [Elasticsearch filter - documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html). - :param dict query_body: (optional) The Elasticsearch query object. For more - information, see [Elasticsearch search API - documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html). - :param str managed_index: (optional) The Elasticsearch index for uploading - documents. It is created automatically when the upload document option is - selected from the user interface. - :param str apikey: (optional) The API key of the apiKey authentication method. - Use either basic auth or apiKey auth. The credentials are not returned due to - security reasons. + :param str type: (optional) The type of turn event. + :param str action: (optional) An action that was visited during processing of + the message. + :param str action_title: (optional) The title of the action. + :param str condition: (optional) The condition that triggered the dialog node. """ def __init__( self, - url: str, - port: str, - index: str, *, - username: Optional[str] = None, - password: Optional[str] = None, - filter: Optional[List[object]] = None, - query_body: Optional[dict] = None, - managed_index: Optional[str] = None, - apikey: Optional[str] = None, + type: Optional[str] = None, + action: Optional[str] = None, + action_title: Optional[str] = None, + condition: Optional[str] = None, ) -> None: """ - Initialize a SearchSettingsElasticSearch object. + Initialize a TurnEventActionSource object. - :param str url: The URL for the Elasticsearch service. - :param str port: The port number for the Elasticsearch service URL. - **Note:** It can be omitted if a port number is appended to the URL. - :param str index: The Elasticsearch index to use for the search - integration. - :param str username: (optional) The username of the basic authentication - method. - :param str password: (optional) The password of the basic authentication - method. The credentials are not returned due to security reasons. - :param List[object] filter: (optional) An array of filters that can be - applied to the search results via the `$FILTER` variable in the - `query_body`.For more information, see [Elasticsearch filter - documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html). - :param dict query_body: (optional) The Elasticsearch query object. For more - information, see [Elasticsearch search API - documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html). - :param str managed_index: (optional) The Elasticsearch index for uploading - documents. It is created automatically when the upload document option is - selected from the user interface. - :param str apikey: (optional) The API key of the apiKey authentication - method. Use either basic auth or apiKey auth. The credentials are not - returned due to security reasons. + :param str type: (optional) The type of turn event. + :param str action: (optional) An action that was visited during processing + of the message. + :param str action_title: (optional) The title of the action. + :param str condition: (optional) The condition that triggered the dialog + node. """ - self.url = url - self.port = port - self.username = username - self.password = password - self.index = index - self.filter = filter - self.query_body = query_body - self.managed_index = managed_index - self.apikey = apikey + self.type = type + self.action = action + self.action_title = action_title + self.condition = condition @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsElasticSearch': - """Initialize a SearchSettingsElasticSearch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventActionSource': + """Initialize a TurnEventActionSource object from a json dictionary.""" args = {} - if (url := _dict.get('url')) is not None: - args['url'] = url - else: - raise ValueError( - 'Required property \'url\' not present in SearchSettingsElasticSearch JSON' - ) - if (port := _dict.get('port')) is not None: - args['port'] = port - else: - raise ValueError( - 'Required property \'port\' not present in SearchSettingsElasticSearch JSON' - ) - if (username := _dict.get('username')) is not None: - args['username'] = username - if (password := _dict.get('password')) is not None: - args['password'] = password - if (index := _dict.get('index')) is not None: - args['index'] = index - else: - raise ValueError( - 'Required property \'index\' not present in SearchSettingsElasticSearch JSON' - ) - if (filter := _dict.get('filter')) is not None: - args['filter'] = filter - if (query_body := _dict.get('query_body')) is not None: - args['query_body'] = query_body - if (managed_index := _dict.get('managed_index')) is not None: - args['managed_index'] = managed_index - if (apikey := _dict.get('apikey')) is not None: - args['apikey'] = apikey + if (type := _dict.get('type')) is not None: + args['type'] = type + if (action := _dict.get('action')) is not None: + args['action'] = action + if (action_title := _dict.get('action_title')) is not None: + args['action_title'] = action_title + if (condition := _dict.get('condition')) is not None: + args['condition'] = condition return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsElasticSearch object from a json dictionary.""" + """Initialize a TurnEventActionSource object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'username') and self.username is not None: - _dict['username'] = self.username - if hasattr(self, 'password') and self.password is not None: - _dict['password'] = self.password - if hasattr(self, 'index') and self.index is not None: - _dict['index'] = self.index - if hasattr(self, 'filter') and self.filter is not None: - _dict['filter'] = self.filter - if hasattr(self, 'query_body') and self.query_body is not None: - _dict['query_body'] = self.query_body - if hasattr(self, 'managed_index') and self.managed_index is not None: - _dict['managed_index'] = self.managed_index - if hasattr(self, 'apikey') and self.apikey is not None: - _dict['apikey'] = self.apikey + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'action_title') and self.action_title is not None: + _dict['action_title'] = self.action_title + if hasattr(self, 'condition') and self.condition is not None: + _dict['condition'] = self.condition return _dict def _to_dict(self): @@ -12517,90 +16567,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsElasticSearch object.""" + """Return a `str` version of this TurnEventActionSource object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsElasticSearch') -> bool: + def __eq__(self, other: 'TurnEventActionSource') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsElasticSearch') -> bool: + def __ne__(self, other: 'TurnEventActionSource') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of turn event. + """ + + ACTION = 'action' -class SearchSettingsMessages: + +class TurnEventCalloutCallout: """ - The messages included with responses from the search integration. + TurnEventCalloutCallout. - :param str success: The message to include in the response to a successful - query. - :param str error: The message to include in the response when the query - encounters an error. - :param str no_result: The message to include in the response when there is no - result from the query. + :param str type: (optional) The type of callout. Currently, the only supported + value is `integration_interaction` (for calls to extensions). + :param dict internal: (optional) For internal use only. + :param str result_variable: (optional) The name of the variable where the + callout result is stored. + :param TurnEventCalloutCalloutRequest request: (optional) The request object + executed to the external server specified by the extension. + :param TurnEventCalloutCalloutResponse response: (optional) The response object + received by the external server made by the extension. """ def __init__( self, - success: str, - error: str, - no_result: str, + *, + type: Optional[str] = None, + internal: Optional[dict] = None, + result_variable: Optional[str] = None, + request: Optional['TurnEventCalloutCalloutRequest'] = None, + response: Optional['TurnEventCalloutCalloutResponse'] = None, ) -> None: """ - Initialize a SearchSettingsMessages object. + Initialize a TurnEventCalloutCallout object. - :param str success: The message to include in the response to a successful - query. - :param str error: The message to include in the response when the query - encounters an error. - :param str no_result: The message to include in the response when there is - no result from the query. + :param str type: (optional) The type of callout. Currently, the only + supported value is `integration_interaction` (for calls to extensions). + :param dict internal: (optional) For internal use only. + :param str result_variable: (optional) The name of the variable where the + callout result is stored. + :param TurnEventCalloutCalloutRequest request: (optional) The request + object executed to the external server specified by the extension. + :param TurnEventCalloutCalloutResponse response: (optional) The response + object received by the external server made by the extension. """ - self.success = success - self.error = error - self.no_result = no_result + self.type = type + self.internal = internal + self.result_variable = result_variable + self.request = request + self.response = response @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsMessages': - """Initialize a SearchSettingsMessages object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCallout': + """Initialize a TurnEventCalloutCallout object from a json dictionary.""" args = {} - if (success := _dict.get('success')) is not None: - args['success'] = success - else: - raise ValueError( - 'Required property \'success\' not present in SearchSettingsMessages JSON' - ) - if (error := _dict.get('error')) is not None: - args['error'] = error - else: - raise ValueError( - 'Required property \'error\' not present in SearchSettingsMessages JSON' - ) - if (no_result := _dict.get('no_result')) is not None: - args['no_result'] = no_result - else: - raise ValueError( - 'Required property \'no_result\' not present in SearchSettingsMessages JSON' - ) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (internal := _dict.get('internal')) is not None: + args['internal'] = internal + if (result_variable := _dict.get('result_variable')) is not None: + args['result_variable'] = result_variable + if (request := _dict.get('request')) is not None: + args['request'] = TurnEventCalloutCalloutRequest.from_dict(request) + if (response := _dict.get('response')) is not None: + args['response'] = TurnEventCalloutCalloutResponse.from_dict( + response) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsMessages object from a json dictionary.""" + """Initialize a TurnEventCalloutCallout object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'success') and self.success is not None: - _dict['success'] = self.success - if hasattr(self, 'error') and self.error is not None: - _dict['error'] = self.error - if hasattr(self, 'no_result') and self.no_result is not None: - _dict['no_result'] = self.no_result + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'internal') and self.internal is not None: + _dict['internal'] = self.internal + if hasattr(self, + 'result_variable') and self.result_variable is not None: + _dict['result_variable'] = self.result_variable + if hasattr(self, 'request') and self.request is not None: + if isinstance(self.request, dict): + _dict['request'] = self.request + else: + _dict['request'] = self.request.to_dict() + if hasattr(self, 'response') and self.response is not None: + if isinstance(self.response, dict): + _dict['response'] = self.response + else: + _dict['response'] = self.response.to_dict() return _dict def _to_dict(self): @@ -12608,91 +16680,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsMessages object.""" + """Return a `str` version of this TurnEventCalloutCallout object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsMessages') -> bool: + def __eq__(self, other: 'TurnEventCalloutCallout') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsMessages') -> bool: + def __ne__(self, other: 'TurnEventCalloutCallout') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of callout. Currently, the only supported value is + `integration_interaction` (for calls to extensions). + """ + + INTEGRATION_INTERACTION = 'integration_interaction' -class SearchSettingsSchemaMapping: - """ - The mapping between fields in the Watson Discovery collection and properties in the - search response. - :param str url: The field in the collection to map to the **url** property of - the response. - :param str body: The field in the collection to map to the **body** property in - the response. - :param str title: The field in the collection to map to the **title** property - for the schema. +class TurnEventCalloutCalloutRequest: + """ + TurnEventCalloutCalloutRequest. + + :param str method: (optional) The REST method of the request. + :param str url: (optional) The host URL of the request call. + :param str path: (optional) The URL path of the request call. + :param str query_parameters: (optional) Any query parameters appended to the URL + of the request call. + :param dict headers_: (optional) Any headers included in the request call. + :param dict body: (optional) Contains the response of the external server or an + object. In cases like timeouts or connections errors, it will contain details of + why the callout to the external server failed. """ def __init__( self, - url: str, - body: str, - title: str, + *, + method: Optional[str] = None, + url: Optional[str] = None, + path: Optional[str] = None, + query_parameters: Optional[str] = None, + headers_: Optional[dict] = None, + body: Optional[dict] = None, ) -> None: """ - Initialize a SearchSettingsSchemaMapping object. + Initialize a TurnEventCalloutCalloutRequest object. - :param str url: The field in the collection to map to the **url** property - of the response. - :param str body: The field in the collection to map to the **body** - property in the response. - :param str title: The field in the collection to map to the **title** - property for the schema. + :param str method: (optional) The REST method of the request. + :param str url: (optional) The host URL of the request call. + :param str path: (optional) The URL path of the request call. + :param str query_parameters: (optional) Any query parameters appended to + the URL of the request call. + :param dict headers_: (optional) Any headers included in the request call. + :param dict body: (optional) Contains the response of the external server + or an object. In cases like timeouts or connections errors, it will contain + details of why the callout to the external server failed. """ + self.method = method self.url = url + self.path = path + self.query_parameters = query_parameters + self.headers_ = headers_ self.body = body - self.title = title @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsSchemaMapping': - """Initialize a SearchSettingsSchemaMapping object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCalloutRequest': + """Initialize a TurnEventCalloutCalloutRequest object from a json dictionary.""" args = {} + if (method := _dict.get('method')) is not None: + args['method'] = method if (url := _dict.get('url')) is not None: args['url'] = url - else: - raise ValueError( - 'Required property \'url\' not present in SearchSettingsSchemaMapping JSON' - ) + if (path := _dict.get('path')) is not None: + args['path'] = path + if (query_parameters := _dict.get('query_parameters')) is not None: + args['query_parameters'] = query_parameters + if (headers_ := _dict.get('headers')) is not None: + args['headers_'] = headers_ if (body := _dict.get('body')) is not None: args['body'] = body - else: - raise ValueError( - 'Required property \'body\' not present in SearchSettingsSchemaMapping JSON' - ) - if (title := _dict.get('title')) is not None: - args['title'] = title - else: - raise ValueError( - 'Required property \'title\' not present in SearchSettingsSchemaMapping JSON' - ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsSchemaMapping object from a json dictionary.""" + """Initialize a TurnEventCalloutCalloutRequest object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'method') and self.method is not None: + _dict['method'] = self.method if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url + if hasattr(self, 'path') and self.path is not None: + _dict['path'] = self.path + if hasattr(self, + 'query_parameters') and self.query_parameters is not None: + _dict['query_parameters'] = self.query_parameters + if hasattr(self, 'headers_') and self.headers_ is not None: + _dict['headers'] = self.headers_ if hasattr(self, 'body') and self.body is not None: _dict['body'] = self.body - if hasattr(self, 'title') and self.title is not None: - _dict['title'] = self.title return _dict def _to_dict(self): @@ -12700,136 +16793,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsSchemaMapping object.""" + """Return a `str` version of this TurnEventCalloutCalloutRequest object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsSchemaMapping') -> bool: + def __eq__(self, other: 'TurnEventCalloutCalloutRequest') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsSchemaMapping') -> bool: + def __ne__(self, other: 'TurnEventCalloutCalloutRequest') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class MethodEnum(str, Enum): + """ + The REST method of the request. + """ + + GET = 'get' + POST = 'post' + PUT = 'put' + DELETE = 'delete' + PATCH = 'patch' + -class SearchSettingsServerSideSearch: +class TurnEventCalloutCalloutResponse: """ - Configuration settings for the server-side search service used by the search - integration. You can provide either basic auth, apiKey auth or none. + TurnEventCalloutCalloutResponse. - :param str url: The URL of the server-side search service. - :param str port: (optional) The port number of the server-side search service. - :param str username: (optional) The username of the basic authentication method. - :param str password: (optional) The password of the basic authentication method. - The credentials are not returned due to security reasons. - :param str filter: (optional) The filter string that is applied to the search - results. - :param dict metadata: (optional) The metadata object. - :param str apikey: (optional) The API key of the apiKey authentication method. - The credentails are not returned due to security reasons. - :param bool no_auth: (optional) To clear previous auth, specify `no_auth = - true`. - :param str auth_type: (optional) The authorization type that is used. + :param str body: (optional) The final response string. This response is a + composition of every partial chunk received from the stream. + :param int status_code: (optional) The final status code of the response. + :param dict last_event: (optional) The response from the last chunk received + from the response stream. """ def __init__( self, - url: str, *, - port: Optional[str] = None, - username: Optional[str] = None, - password: Optional[str] = None, - filter: Optional[str] = None, - metadata: Optional[dict] = None, - apikey: Optional[str] = None, - no_auth: Optional[bool] = None, - auth_type: Optional[str] = None, + body: Optional[str] = None, + status_code: Optional[int] = None, + last_event: Optional[dict] = None, ) -> None: """ - Initialize a SearchSettingsServerSideSearch object. + Initialize a TurnEventCalloutCalloutResponse object. - :param str url: The URL of the server-side search service. - :param str port: (optional) The port number of the server-side search - service. - :param str username: (optional) The username of the basic authentication - method. - :param str password: (optional) The password of the basic authentication - method. The credentials are not returned due to security reasons. - :param str filter: (optional) The filter string that is applied to the - search results. - :param dict metadata: (optional) The metadata object. - :param str apikey: (optional) The API key of the apiKey authentication - method. The credentails are not returned due to security reasons. - :param bool no_auth: (optional) To clear previous auth, specify `no_auth = - true`. - :param str auth_type: (optional) The authorization type that is used. + :param str body: (optional) The final response string. This response is a + composition of every partial chunk received from the stream. + :param int status_code: (optional) The final status code of the response. + :param dict last_event: (optional) The response from the last chunk + received from the response stream. """ - self.url = url - self.port = port - self.username = username - self.password = password - self.filter = filter - self.metadata = metadata - self.apikey = apikey - self.no_auth = no_auth - self.auth_type = auth_type + self.body = body + self.status_code = status_code + self.last_event = last_event @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsServerSideSearch': - """Initialize a SearchSettingsServerSideSearch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCalloutResponse': + """Initialize a TurnEventCalloutCalloutResponse object from a json dictionary.""" args = {} - if (url := _dict.get('url')) is not None: - args['url'] = url - else: - raise ValueError( - 'Required property \'url\' not present in SearchSettingsServerSideSearch JSON' - ) - if (port := _dict.get('port')) is not None: - args['port'] = port - if (username := _dict.get('username')) is not None: - args['username'] = username - if (password := _dict.get('password')) is not None: - args['password'] = password - if (filter := _dict.get('filter')) is not None: - args['filter'] = filter - if (metadata := _dict.get('metadata')) is not None: - args['metadata'] = metadata - if (apikey := _dict.get('apikey')) is not None: - args['apikey'] = apikey - if (no_auth := _dict.get('no_auth')) is not None: - args['no_auth'] = no_auth - if (auth_type := _dict.get('auth_type')) is not None: - args['auth_type'] = auth_type + if (body := _dict.get('body')) is not None: + args['body'] = body + if (status_code := _dict.get('status_code')) is not None: + args['status_code'] = status_code + if (last_event := _dict.get('last_event')) is not None: + args['last_event'] = last_event return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsServerSideSearch object from a json dictionary.""" + """Initialize a TurnEventCalloutCalloutResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'username') and self.username is not None: - _dict['username'] = self.username - if hasattr(self, 'password') and self.password is not None: - _dict['password'] = self.password - if hasattr(self, 'filter') and self.filter is not None: - _dict['filter'] = self.filter - if hasattr(self, 'metadata') and self.metadata is not None: - _dict['metadata'] = self.metadata - if hasattr(self, 'apikey') and self.apikey is not None: - _dict['apikey'] = self.apikey - if hasattr(self, 'no_auth') and self.no_auth is not None: - _dict['no_auth'] = self.no_auth - if hasattr(self, 'auth_type') and self.auth_type is not None: - _dict['auth_type'] = self.auth_type + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr(self, 'status_code') and self.status_code is not None: + _dict['status_code'] = self.status_code + if hasattr(self, 'last_event') and self.last_event is not None: + _dict['last_event'] = self.last_event return _dict def _to_dict(self): @@ -12837,82 +16882,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSettingsServerSideSearch object.""" + """Return a `str` version of this TurnEventCalloutCalloutResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsServerSideSearch') -> bool: + def __eq__(self, other: 'TurnEventCalloutCalloutResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSettingsServerSideSearch') -> bool: + def __ne__(self, other: 'TurnEventCalloutCalloutResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthTypeEnum(str, Enum): - """ - The authorization type that is used. - """ - - BASIC = 'basic' - APIKEY = 'apikey' - NONE = 'none' - -class SearchSkillWarning: +class TurnEventCalloutError: """ - A warning describing an error in the search skill configuration. + TurnEventCalloutError. - :param str code: (optional) The error code. - :param str path: (optional) The location of the error in the search skill - configuration object. - :param str message: (optional) The error message. + :param str message: (optional) Any error message returned by a failed call to an + external service. """ def __init__( self, *, - code: Optional[str] = None, - path: Optional[str] = None, message: Optional[str] = None, ) -> None: """ - Initialize a SearchSkillWarning object. + Initialize a TurnEventCalloutError object. - :param str code: (optional) The error code. - :param str path: (optional) The location of the error in the search skill - configuration object. - :param str message: (optional) The error message. + :param str message: (optional) Any error message returned by a failed call + to an external service. """ - self.code = code - self.path = path self.message = message @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSkillWarning': - """Initialize a SearchSkillWarning object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutError': + """Initialize a TurnEventCalloutError object from a json dictionary.""" args = {} - if (code := _dict.get('code')) is not None: - args['code'] = code - if (path := _dict.get('path')) is not None: - args['path'] = path if (message := _dict.get('message')) is not None: args['message'] = message return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSkillWarning object from a json dictionary.""" + """Initialize a TurnEventCalloutError object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'path') and self.path is not None: - _dict['path'] = self.path if hasattr(self, 'message') and self.message is not None: _dict['message'] = self.message return _dict @@ -12922,60 +16942,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SearchSkillWarning object.""" + """Return a `str` version of this TurnEventCalloutError object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSkillWarning') -> bool: + def __eq__(self, other: 'TurnEventCalloutError') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SearchSkillWarning') -> bool: + def __ne__(self, other: 'TurnEventCalloutError') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SessionResponse: +class TurnEventGenerativeAICalledCallout: """ - SessionResponse. + TurnEventGenerativeAICalledCallout. - :param str session_id: The session ID. + :param bool search_called: (optional) Whether the document search engine was + called. + :param bool llm_called: (optional) Whether watsonx.ai was called during answer + generation. + :param TurnEventGenerativeAICalledCalloutSearch search: (optional) + :param TurnEventGenerativeAICalledCalloutLlm llm: (optional) + :param str idk_reason_code: (optional) Indicates why a conversational search + response resolved to an idk response. This field will only be available when the + conversational search response is an idk response. """ def __init__( self, - session_id: str, + *, + search_called: Optional[bool] = None, + llm_called: Optional[bool] = None, + search: Optional['TurnEventGenerativeAICalledCalloutSearch'] = None, + llm: Optional['TurnEventGenerativeAICalledCalloutLlm'] = None, + idk_reason_code: Optional[str] = None, ) -> None: """ - Initialize a SessionResponse object. + Initialize a TurnEventGenerativeAICalledCallout object. - :param str session_id: The session ID. + :param bool search_called: (optional) Whether the document search engine + was called. + :param bool llm_called: (optional) Whether watsonx.ai was called during + answer generation. + :param TurnEventGenerativeAICalledCalloutSearch search: (optional) + :param TurnEventGenerativeAICalledCalloutLlm llm: (optional) + :param str idk_reason_code: (optional) Indicates why a conversational + search response resolved to an idk response. This field will only be + available when the conversational search response is an idk response. """ - self.session_id = session_id + self.search_called = search_called + self.llm_called = llm_called + self.search = search + self.llm = llm + self.idk_reason_code = idk_reason_code @classmethod - def from_dict(cls, _dict: Dict) -> 'SessionResponse': - """Initialize a SessionResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventGenerativeAICalledCallout': + """Initialize a TurnEventGenerativeAICalledCallout object from a json dictionary.""" args = {} - if (session_id := _dict.get('session_id')) is not None: - args['session_id'] = session_id - else: - raise ValueError( - 'Required property \'session_id\' not present in SessionResponse JSON' - ) + if (search_called := _dict.get('search_called')) is not None: + args['search_called'] = search_called + if (llm_called := _dict.get('llm_called')) is not None: + args['llm_called'] = llm_called + if (search := _dict.get('search')) is not None: + args['search'] = TurnEventGenerativeAICalledCalloutSearch.from_dict( + search) + if (llm := _dict.get('llm')) is not None: + args['llm'] = TurnEventGenerativeAICalledCalloutLlm.from_dict(llm) + if (idk_reason_code := _dict.get('idk_reason_code')) is not None: + args['idk_reason_code'] = idk_reason_code return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SessionResponse object from a json dictionary.""" + """Initialize a TurnEventGenerativeAICalledCallout object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'session_id') and self.session_id is not None: - _dict['session_id'] = self.session_id + if hasattr(self, 'search_called') and self.search_called is not None: + _dict['search_called'] = self.search_called + if hasattr(self, 'llm_called') and self.llm_called is not None: + _dict['llm_called'] = self.llm_called + if hasattr(self, 'search') and self.search is not None: + if isinstance(self.search, dict): + _dict['search'] = self.search + else: + _dict['search'] = self.search.to_dict() + if hasattr(self, 'llm') and self.llm is not None: + if isinstance(self.llm, dict): + _dict['llm'] = self.llm + else: + _dict['llm'] = self.llm.to_dict() + if hasattr(self, + 'idk_reason_code') and self.idk_reason_code is not None: + _dict['idk_reason_code'] = self.idk_reason_code return _dict def _to_dict(self): @@ -12983,239 +17048,146 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SessionResponse object.""" + """Return a `str` version of this TurnEventGenerativeAICalledCallout object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SessionResponse') -> bool: + def __eq__(self, other: 'TurnEventGenerativeAICalledCallout') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SessionResponse') -> bool: + def __ne__(self, other: 'TurnEventGenerativeAICalledCallout') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Skill: +class TurnEventGenerativeAICalledCalloutLlm: """ - Skill. + TurnEventGenerativeAICalledCalloutLlm. - :param str name: (optional) The name of the skill. This string cannot contain - carriage return, newline, or tab characters. - :param str description: (optional) The description of the skill. This string - cannot contain carriage return, newline, or tab characters. - :param dict workspace: (optional) An object containing the conversational - content of an action or dialog skill. - :param str skill_id: (optional) The skill ID of the skill. - :param str status: (optional) The current status of the skill: - - **Available**: The skill is available and ready to process messages. - - **Failed**: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - **Non Existent**: The skill does not exist. - - **Processing**: An asynchronous operation has not yet completed. - - **Training**: The skill is training based on new data. - :param List[StatusError] status_errors: (optional) An array of messages about - errors that caused an asynchronous operation to fail. Included only if - **status**=`Failed`. - :param str status_description: (optional) The description of the failed - asynchronous operation. Included only if **status**=`Failed`. - :param dict dialog_settings: (optional) For internal use only. - :param str assistant_id: (optional) The unique identifier of the assistant the - skill is associated with. - :param str workspace_id: (optional) The unique identifier of the workspace that - contains the skill content. Included only for action and dialog skills. - :param str environment_id: (optional) The unique identifier of the environment - where the skill is defined. For action and dialog skills, this is always the - draft environment. - :param bool valid: (optional) Whether the skill is structurally valid. - :param str next_snapshot_version: (optional) The name that will be given to the - next snapshot that is created for the skill. A snapshot of each versionable - skill is saved for each new release of an assistant. - :param SearchSettings search_settings: (optional) An object describing the - search skill configuration. - **Note:** Search settings are not supported in **Import skills** requests, and - are not included in **Export skills** responses. - :param List[SearchSkillWarning] warnings: (optional) An array of warnings - describing errors with the search skill configuration. Included only for search - skills. - :param str language: The language of the skill. - :param str type: The type of skill. + :param str type: (optional) The name of the LLM engine called by the system. + :param str model_id: (optional) The LLM model used to generate the response. + :param str model_class_id: (optional) The watsonx.ai class ID that was used + during the answer generation request to the LLM. This is only included when a + request to the LLM has been made by the system. + :param int generated_token_count: (optional) The number of tokens that were + generated in the response by the LLM. This is only included when a request to + the LLM was successful and a response was generated. + :param int input_token_count: (optional) The number of tokens that were sent to + the LLM during answer generation. This is only included when a request to the + LLM has been made by the system. + :param bool success: (optional) Whether the answer generation request to the LLM + was successful. + :param TurnEventGenerativeAICalledCalloutLlmResponse response: (optional) + :param List[SearchResults] request: (optional) n array of objects containing the + search results. """ - - def __init__( - self, - language: str, - type: str, - *, - name: Optional[str] = None, - description: Optional[str] = None, - workspace: Optional[dict] = None, - skill_id: Optional[str] = None, - status: Optional[str] = None, - status_errors: Optional[List['StatusError']] = None, - status_description: Optional[str] = None, - dialog_settings: Optional[dict] = None, - assistant_id: Optional[str] = None, - workspace_id: Optional[str] = None, - environment_id: Optional[str] = None, - valid: Optional[bool] = None, - next_snapshot_version: Optional[str] = None, - search_settings: Optional['SearchSettings'] = None, - warnings: Optional[List['SearchSkillWarning']] = None, - ) -> None: - """ - Initialize a Skill object. - - :param str language: The language of the skill. - :param str type: The type of skill. - :param str name: (optional) The name of the skill. This string cannot - contain carriage return, newline, or tab characters. - :param str description: (optional) The description of the skill. This - string cannot contain carriage return, newline, or tab characters. - :param dict workspace: (optional) An object containing the conversational - content of an action or dialog skill. - :param dict dialog_settings: (optional) For internal use only. - :param SearchSettings search_settings: (optional) An object describing the - search skill configuration. - **Note:** Search settings are not supported in **Import skills** requests, - and are not included in **Export skills** responses. - """ - self.name = name - self.description = description - self.workspace = workspace - self.skill_id = skill_id - self.status = status - self.status_errors = status_errors - self.status_description = status_description - self.dialog_settings = dialog_settings - self.assistant_id = assistant_id - self.workspace_id = workspace_id - self.environment_id = environment_id - self.valid = valid - self.next_snapshot_version = next_snapshot_version - self.search_settings = search_settings - self.warnings = warnings - self.language = language - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'Skill': - """Initialize a Skill object from a json dictionary.""" - args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name - if (description := _dict.get('description')) is not None: - args['description'] = description - if (workspace := _dict.get('workspace')) is not None: - args['workspace'] = workspace - if (skill_id := _dict.get('skill_id')) is not None: - args['skill_id'] = skill_id - if (status := _dict.get('status')) is not None: - args['status'] = status - if (status_errors := _dict.get('status_errors')) is not None: - args['status_errors'] = [ - StatusError.from_dict(v) for v in status_errors - ] - if (status_description := _dict.get('status_description')) is not None: - args['status_description'] = status_description - if (dialog_settings := _dict.get('dialog_settings')) is not None: - args['dialog_settings'] = dialog_settings - if (assistant_id := _dict.get('assistant_id')) is not None: - args['assistant_id'] = assistant_id - if (workspace_id := _dict.get('workspace_id')) is not None: - args['workspace_id'] = workspace_id - if (environment_id := _dict.get('environment_id')) is not None: - args['environment_id'] = environment_id - if (valid := _dict.get('valid')) is not None: - args['valid'] = valid - if (next_snapshot_version := - _dict.get('next_snapshot_version')) is not None: - args['next_snapshot_version'] = next_snapshot_version - if (search_settings := _dict.get('search_settings')) is not None: - args['search_settings'] = SearchSettings.from_dict(search_settings) - if (warnings := _dict.get('warnings')) is not None: - args['warnings'] = [ - SearchSkillWarning.from_dict(v) for v in warnings - ] - if (language := _dict.get('language')) is not None: - args['language'] = language - else: - raise ValueError( - 'Required property \'language\' not present in Skill JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in Skill JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a Skill object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'workspace') and self.workspace is not None: - _dict['workspace'] = self.workspace - if hasattr(self, 'skill_id') and getattr(self, 'skill_id') is not None: - _dict['skill_id'] = getattr(self, 'skill_id') - if hasattr(self, 'status') and getattr(self, 'status') is not None: - _dict['status'] = getattr(self, 'status') - if hasattr(self, 'status_errors') and getattr( - self, 'status_errors') is not None: - status_errors_list = [] - for v in getattr(self, 'status_errors'): - if isinstance(v, dict): - status_errors_list.append(v) - else: - status_errors_list.append(v.to_dict()) - _dict['status_errors'] = status_errors_list - if hasattr(self, 'status_description') and getattr( - self, 'status_description') is not None: - _dict['status_description'] = getattr(self, 'status_description') - if hasattr(self, - 'dialog_settings') and self.dialog_settings is not None: - _dict['dialog_settings'] = self.dialog_settings - if hasattr(self, 'assistant_id') and getattr( - self, 'assistant_id') is not None: - _dict['assistant_id'] = getattr(self, 'assistant_id') - if hasattr(self, 'workspace_id') and getattr( - self, 'workspace_id') is not None: - _dict['workspace_id'] = getattr(self, 'workspace_id') - if hasattr(self, 'environment_id') and getattr( - self, 'environment_id') is not None: - _dict['environment_id'] = getattr(self, 'environment_id') - if hasattr(self, 'valid') and getattr(self, 'valid') is not None: - _dict['valid'] = getattr(self, 'valid') - if hasattr(self, 'next_snapshot_version') and getattr( - self, 'next_snapshot_version') is not None: - _dict['next_snapshot_version'] = getattr(self, - 'next_snapshot_version') + + def __init__( + self, + *, + type: Optional[str] = None, + model_id: Optional[str] = None, + model_class_id: Optional[str] = None, + generated_token_count: Optional[int] = None, + input_token_count: Optional[int] = None, + success: Optional[bool] = None, + response: Optional[ + 'TurnEventGenerativeAICalledCalloutLlmResponse'] = None, + request: Optional[List['SearchResults']] = None, + ) -> None: + """ + Initialize a TurnEventGenerativeAICalledCalloutLlm object. + + :param str type: (optional) The name of the LLM engine called by the + system. + :param str model_id: (optional) The LLM model used to generate the + response. + :param str model_class_id: (optional) The watsonx.ai class ID that was used + during the answer generation request to the LLM. This is only included when + a request to the LLM has been made by the system. + :param int generated_token_count: (optional) The number of tokens that were + generated in the response by the LLM. This is only included when a request + to the LLM was successful and a response was generated. + :param int input_token_count: (optional) The number of tokens that were + sent to the LLM during answer generation. This is only included when a + request to the LLM has been made by the system. + :param bool success: (optional) Whether the answer generation request to + the LLM was successful. + :param TurnEventGenerativeAICalledCalloutLlmResponse response: (optional) + :param List[SearchResults] request: (optional) n array of objects + containing the search results. + """ + self.type = type + self.model_id = model_id + self.model_class_id = model_class_id + self.generated_token_count = generated_token_count + self.input_token_count = input_token_count + self.success = success + self.response = response + self.request = request + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TurnEventGenerativeAICalledCalloutLlm': + """Initialize a TurnEventGenerativeAICalledCalloutLlm object from a json dictionary.""" + args = {} + if (type := _dict.get('type')) is not None: + args['type'] = type + if (model_id := _dict.get('model_id')) is not None: + args['model_id'] = model_id + if (model_class_id := _dict.get('model_class_id')) is not None: + args['model_class_id'] = model_class_id + if (generated_token_count := + _dict.get('generated_token_count')) is not None: + args['generated_token_count'] = generated_token_count + if (input_token_count := _dict.get('input_token_count')) is not None: + args['input_token_count'] = input_token_count + if (success := _dict.get('success')) is not None: + args['success'] = success + if (response := _dict.get('response')) is not None: + args[ + 'response'] = TurnEventGenerativeAICalledCalloutLlmResponse.from_dict( + response) + if (request := _dict.get('request')) is not None: + args['request'] = [SearchResults.from_dict(v) for v in request] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TurnEventGenerativeAICalledCalloutLlm object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'model_id') and self.model_id is not None: + _dict['model_id'] = self.model_id + if hasattr(self, 'model_class_id') and self.model_class_id is not None: + _dict['model_class_id'] = self.model_class_id + if hasattr(self, 'generated_token_count' + ) and self.generated_token_count is not None: + _dict['generated_token_count'] = self.generated_token_count if hasattr(self, - 'search_settings') and self.search_settings is not None: - if isinstance(self.search_settings, dict): - _dict['search_settings'] = self.search_settings + 'input_token_count') and self.input_token_count is not None: + _dict['input_token_count'] = self.input_token_count + if hasattr(self, 'success') and self.success is not None: + _dict['success'] = self.success + if hasattr(self, 'response') and self.response is not None: + if isinstance(self.response, dict): + _dict['response'] = self.response else: - _dict['search_settings'] = self.search_settings.to_dict() - if hasattr(self, 'warnings') and getattr(self, 'warnings') is not None: - warnings_list = [] - for v in getattr(self, 'warnings'): + _dict['response'] = self.response.to_dict() + if hasattr(self, 'request') and self.request is not None: + request_list = [] + for v in self.request: if isinstance(v, dict): - warnings_list.append(v) + request_list.append(v) else: - warnings_list.append(v.to_dict()) - _dict['warnings'] = warnings_list - if hasattr(self, 'language') and self.language is not None: - _dict['language'] = self.language - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + request_list.append(v.to_dict()) + _dict['request'] = request_list return _dict def _to_dict(self): @@ -13223,267 +17195,193 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Skill object.""" + """Return a `str` version of this TurnEventGenerativeAICalledCalloutLlm object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Skill') -> bool: + def __eq__(self, other: 'TurnEventGenerativeAICalledCalloutLlm') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Skill') -> bool: + def __ne__(self, other: 'TurnEventGenerativeAICalledCalloutLlm') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The current status of the skill: - - **Available**: The skill is available and ready to process messages. - - **Failed**: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - **Non Existent**: The skill does not exist. - - **Processing**: An asynchronous operation has not yet completed. - - **Training**: The skill is training based on new data. - """ - AVAILABLE = 'Available' - FAILED = 'Failed' - NON_EXISTENT = 'Non Existent' - PROCESSING = 'Processing' - TRAINING = 'Training' - UNAVAILABLE = 'Unavailable' +class TurnEventGenerativeAICalledCalloutLlmResponse: + """ + - class TypeEnum(str, Enum): + :param str text: (optional) The LLM response that is returned. + :param str response_type: (optional) The type of response that is returned. + :param bool is_idk_response: (optional) Whether the response is an idk response. + """ + + def __init__( + self, + *, + text: Optional[str] = None, + response_type: Optional[str] = None, + is_idk_response: Optional[bool] = None, + ) -> None: """ - The type of skill. + Initialize a TurnEventGenerativeAICalledCalloutLlmResponse object. + + :param str text: (optional) The LLM response that is returned. + :param str response_type: (optional) The type of response that is returned. + :param bool is_idk_response: (optional) Whether the response is an idk + response. """ + self.text = text + self.response_type = response_type + self.is_idk_response = is_idk_response - ACTION = 'action' - DIALOG = 'dialog' - SEARCH = 'search' + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'TurnEventGenerativeAICalledCalloutLlmResponse': + """Initialize a TurnEventGenerativeAICalledCalloutLlmResponse object from a json dictionary.""" + args = {} + if (text := _dict.get('text')) is not None: + args['text'] = text + if (response_type := _dict.get('response_type')) is not None: + args['response_type'] = response_type + if (is_idk_response := _dict.get('is_idk_response')) is not None: + args['is_idk_response'] = is_idk_response + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a TurnEventGenerativeAICalledCalloutLlmResponse object from a json dictionary.""" + return cls.from_dict(_dict) -class SkillImport: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, 'response_type') and self.response_type is not None: + _dict['response_type'] = self.response_type + if hasattr(self, + 'is_idk_response') and self.is_idk_response is not None: + _dict['is_idk_response'] = self.is_idk_response + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this TurnEventGenerativeAICalledCalloutLlmResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'TurnEventGenerativeAICalledCalloutLlmResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, + other: 'TurnEventGenerativeAICalledCalloutLlmResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class TurnEventGenerativeAICalledCalloutRequest: """ - SkillImport. + TurnEventGenerativeAICalledCalloutRequest. - :param str name: (optional) The name of the skill. This string cannot contain - carriage return, newline, or tab characters. - :param str description: (optional) The description of the skill. This string - cannot contain carriage return, newline, or tab characters. - :param dict workspace: (optional) An object containing the conversational - content of an action or dialog skill. - :param str skill_id: (optional) The skill ID of the skill. - :param str status: (optional) The current status of the skill: - - **Available**: The skill is available and ready to process messages. - - **Failed**: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - **Non Existent**: The skill does not exist. - - **Processing**: An asynchronous operation has not yet completed. - - **Training**: The skill is training based on new data. - :param List[StatusError] status_errors: (optional) An array of messages about - errors that caused an asynchronous operation to fail. Included only if - **status**=`Failed`. - :param str status_description: (optional) The description of the failed - asynchronous operation. Included only if **status**=`Failed`. - :param dict dialog_settings: (optional) For internal use only. - :param str assistant_id: (optional) The unique identifier of the assistant the - skill is associated with. - :param str workspace_id: (optional) The unique identifier of the workspace that - contains the skill content. Included only for action and dialog skills. - :param str environment_id: (optional) The unique identifier of the environment - where the skill is defined. For action and dialog skills, this is always the - draft environment. - :param bool valid: (optional) Whether the skill is structurally valid. - :param str next_snapshot_version: (optional) The name that will be given to the - next snapshot that is created for the skill. A snapshot of each versionable - skill is saved for each new release of an assistant. - :param SearchSettings search_settings: (optional) An object describing the - search skill configuration. - **Note:** Search settings are not supported in **Import skills** requests, and - are not included in **Export skills** responses. - :param List[SearchSkillWarning] warnings: (optional) An array of warnings - describing errors with the search skill configuration. Included only for search - skills. - :param str language: The language of the skill. - :param str type: The type of skill. + :param str method: (optional) The REST method of the request. + :param str url: (optional) The host URL of the request call. + :param str port: (optional) The host port of the request call. + :param str path: (optional) The URL path of the request call. + :param str query_parameters: (optional) Any query parameters appended to the URL + of the request call. + :param dict headers_: (optional) Any headers included in the request call. + :param dict body: (optional) Contains the response of the external server or an + object. In cases like timeouts or connections errors, it will contain details of + why the callout to the external server failed. """ def __init__( self, - language: str, - type: str, *, - name: Optional[str] = None, - description: Optional[str] = None, - workspace: Optional[dict] = None, - skill_id: Optional[str] = None, - status: Optional[str] = None, - status_errors: Optional[List['StatusError']] = None, - status_description: Optional[str] = None, - dialog_settings: Optional[dict] = None, - assistant_id: Optional[str] = None, - workspace_id: Optional[str] = None, - environment_id: Optional[str] = None, - valid: Optional[bool] = None, - next_snapshot_version: Optional[str] = None, - search_settings: Optional['SearchSettings'] = None, - warnings: Optional[List['SearchSkillWarning']] = None, + method: Optional[str] = None, + url: Optional[str] = None, + port: Optional[str] = None, + path: Optional[str] = None, + query_parameters: Optional[str] = None, + headers_: Optional[dict] = None, + body: Optional[dict] = None, ) -> None: """ - Initialize a SkillImport object. + Initialize a TurnEventGenerativeAICalledCalloutRequest object. - :param str language: The language of the skill. - :param str type: The type of skill. - :param str name: (optional) The name of the skill. This string cannot - contain carriage return, newline, or tab characters. - :param str description: (optional) The description of the skill. This - string cannot contain carriage return, newline, or tab characters. - :param dict workspace: (optional) An object containing the conversational - content of an action or dialog skill. - :param dict dialog_settings: (optional) For internal use only. - :param SearchSettings search_settings: (optional) An object describing the - search skill configuration. - **Note:** Search settings are not supported in **Import skills** requests, - and are not included in **Export skills** responses. + :param str method: (optional) The REST method of the request. + :param str url: (optional) The host URL of the request call. + :param str port: (optional) The host port of the request call. + :param str path: (optional) The URL path of the request call. + :param str query_parameters: (optional) Any query parameters appended to + the URL of the request call. + :param dict headers_: (optional) Any headers included in the request call. + :param dict body: (optional) Contains the response of the external server + or an object. In cases like timeouts or connections errors, it will contain + details of why the callout to the external server failed. """ - self.name = name - self.description = description - self.workspace = workspace - self.skill_id = skill_id - self.status = status - self.status_errors = status_errors - self.status_description = status_description - self.dialog_settings = dialog_settings - self.assistant_id = assistant_id - self.workspace_id = workspace_id - self.environment_id = environment_id - self.valid = valid - self.next_snapshot_version = next_snapshot_version - self.search_settings = search_settings - self.warnings = warnings - self.language = language - self.type = type + self.method = method + self.url = url + self.port = port + self.path = path + self.query_parameters = query_parameters + self.headers_ = headers_ + self.body = body @classmethod - def from_dict(cls, _dict: Dict) -> 'SkillImport': - """Initialize a SkillImport object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'TurnEventGenerativeAICalledCalloutRequest': + """Initialize a TurnEventGenerativeAICalledCalloutRequest object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name - if (description := _dict.get('description')) is not None: - args['description'] = description - if (workspace := _dict.get('workspace')) is not None: - args['workspace'] = workspace - if (skill_id := _dict.get('skill_id')) is not None: - args['skill_id'] = skill_id - if (status := _dict.get('status')) is not None: - args['status'] = status - if (status_errors := _dict.get('status_errors')) is not None: - args['status_errors'] = [ - StatusError.from_dict(v) for v in status_errors - ] - if (status_description := _dict.get('status_description')) is not None: - args['status_description'] = status_description - if (dialog_settings := _dict.get('dialog_settings')) is not None: - args['dialog_settings'] = dialog_settings - if (assistant_id := _dict.get('assistant_id')) is not None: - args['assistant_id'] = assistant_id - if (workspace_id := _dict.get('workspace_id')) is not None: - args['workspace_id'] = workspace_id - if (environment_id := _dict.get('environment_id')) is not None: - args['environment_id'] = environment_id - if (valid := _dict.get('valid')) is not None: - args['valid'] = valid - if (next_snapshot_version := - _dict.get('next_snapshot_version')) is not None: - args['next_snapshot_version'] = next_snapshot_version - if (search_settings := _dict.get('search_settings')) is not None: - args['search_settings'] = SearchSettings.from_dict(search_settings) - if (warnings := _dict.get('warnings')) is not None: - args['warnings'] = [ - SearchSkillWarning.from_dict(v) for v in warnings - ] - if (language := _dict.get('language')) is not None: - args['language'] = language - else: - raise ValueError( - 'Required property \'language\' not present in SkillImport JSON' - ) - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in SkillImport JSON') + if (method := _dict.get('method')) is not None: + args['method'] = method + if (url := _dict.get('url')) is not None: + args['url'] = url + if (port := _dict.get('port')) is not None: + args['port'] = port + if (path := _dict.get('path')) is not None: + args['path'] = path + if (query_parameters := _dict.get('query_parameters')) is not None: + args['query_parameters'] = query_parameters + if (headers_ := _dict.get('headers')) is not None: + args['headers_'] = headers_ + if (body := _dict.get('body')) is not None: + args['body'] = body return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SkillImport object from a json dictionary.""" + """Initialize a TurnEventGenerativeAICalledCalloutRequest object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'workspace') and self.workspace is not None: - _dict['workspace'] = self.workspace - if hasattr(self, 'skill_id') and getattr(self, 'skill_id') is not None: - _dict['skill_id'] = getattr(self, 'skill_id') - if hasattr(self, 'status') and getattr(self, 'status') is not None: - _dict['status'] = getattr(self, 'status') - if hasattr(self, 'status_errors') and getattr( - self, 'status_errors') is not None: - status_errors_list = [] - for v in getattr(self, 'status_errors'): - if isinstance(v, dict): - status_errors_list.append(v) - else: - status_errors_list.append(v.to_dict()) - _dict['status_errors'] = status_errors_list - if hasattr(self, 'status_description') and getattr( - self, 'status_description') is not None: - _dict['status_description'] = getattr(self, 'status_description') - if hasattr(self, - 'dialog_settings') and self.dialog_settings is not None: - _dict['dialog_settings'] = self.dialog_settings - if hasattr(self, 'assistant_id') and getattr( - self, 'assistant_id') is not None: - _dict['assistant_id'] = getattr(self, 'assistant_id') - if hasattr(self, 'workspace_id') and getattr( - self, 'workspace_id') is not None: - _dict['workspace_id'] = getattr(self, 'workspace_id') - if hasattr(self, 'environment_id') and getattr( - self, 'environment_id') is not None: - _dict['environment_id'] = getattr(self, 'environment_id') - if hasattr(self, 'valid') and getattr(self, 'valid') is not None: - _dict['valid'] = getattr(self, 'valid') - if hasattr(self, 'next_snapshot_version') and getattr( - self, 'next_snapshot_version') is not None: - _dict['next_snapshot_version'] = getattr(self, - 'next_snapshot_version') + if hasattr(self, 'method') and self.method is not None: + _dict['method'] = self.method + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'path') and self.path is not None: + _dict['path'] = self.path if hasattr(self, - 'search_settings') and self.search_settings is not None: - if isinstance(self.search_settings, dict): - _dict['search_settings'] = self.search_settings - else: - _dict['search_settings'] = self.search_settings.to_dict() - if hasattr(self, 'warnings') and getattr(self, 'warnings') is not None: - warnings_list = [] - for v in getattr(self, 'warnings'): - if isinstance(v, dict): - warnings_list.append(v) - else: - warnings_list.append(v.to_dict()) - _dict['warnings'] = warnings_list - if hasattr(self, 'language') and self.language is not None: - _dict['language'] = self.language - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + 'query_parameters') and self.query_parameters is not None: + _dict['query_parameters'] = self.query_parameters + if hasattr(self, 'headers_') and self.headers_ is not None: + _dict['headers'] = self.headers_ + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body return _dict def _to_dict(self): @@ -13491,122 +17389,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SkillImport object.""" + """Return a `str` version of this TurnEventGenerativeAICalledCalloutRequest object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillImport') -> bool: + def __eq__(self, + other: 'TurnEventGenerativeAICalledCalloutRequest') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SkillImport') -> bool: + def __ne__(self, + other: 'TurnEventGenerativeAICalledCalloutRequest') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The current status of the skill: - - **Available**: The skill is available and ready to process messages. - - **Failed**: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - **Non Existent**: The skill does not exist. - - **Processing**: An asynchronous operation has not yet completed. - - **Training**: The skill is training based on new data. - """ - - AVAILABLE = 'Available' - FAILED = 'Failed' - NON_EXISTENT = 'Non Existent' - PROCESSING = 'Processing' - TRAINING = 'Training' - UNAVAILABLE = 'Unavailable' - - class TypeEnum(str, Enum): + class MethodEnum(str, Enum): """ - The type of skill. + The REST method of the request. """ - ACTION = 'action' - DIALOG = 'dialog' + GET = 'GET' + POST = 'POST' + PUT = 'PUT' + DELETE = 'DELETE' + PATCH = 'PATCH' -class SkillsAsyncRequestStatus: +class TurnEventGenerativeAICalledCalloutResponse: """ - SkillsAsyncRequestStatus. + TurnEventGenerativeAICalledCalloutResponse. - :param str assistant_id: (optional) The assistant ID of the assistant. - :param str status: (optional) The current status of the asynchronous operation: - - `Available`: An asynchronous export is available. - - `Completed`: An asynchronous import operation has completed successfully. - - `Failed`: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - `Processing`: An asynchronous operation has not yet completed. - :param str status_description: (optional) The description of the failed - asynchronous operation. Included only if **status**=`Failed`. - :param List[StatusError] status_errors: (optional) An array of messages about - errors that caused an asynchronous operation to fail. Included only if - **status**=`Failed`. + :param str body: (optional) The final response string. This response is a + composition of every partial chunk received from the stream. + :param int status_code: (optional) The final status code of the response. """ def __init__( self, *, - assistant_id: Optional[str] = None, - status: Optional[str] = None, - status_description: Optional[str] = None, - status_errors: Optional[List['StatusError']] = None, + body: Optional[str] = None, + status_code: Optional[int] = None, ) -> None: """ - Initialize a SkillsAsyncRequestStatus object. + Initialize a TurnEventGenerativeAICalledCalloutResponse object. + :param str body: (optional) The final response string. This response is a + composition of every partial chunk received from the stream. + :param int status_code: (optional) The final status code of the response. """ - self.assistant_id = assistant_id - self.status = status - self.status_description = status_description - self.status_errors = status_errors + self.body = body + self.status_code = status_code @classmethod - def from_dict(cls, _dict: Dict) -> 'SkillsAsyncRequestStatus': - """Initialize a SkillsAsyncRequestStatus object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'TurnEventGenerativeAICalledCalloutResponse': + """Initialize a TurnEventGenerativeAICalledCalloutResponse object from a json dictionary.""" args = {} - if (assistant_id := _dict.get('assistant_id')) is not None: - args['assistant_id'] = assistant_id - if (status := _dict.get('status')) is not None: - args['status'] = status - if (status_description := _dict.get('status_description')) is not None: - args['status_description'] = status_description - if (status_errors := _dict.get('status_errors')) is not None: - args['status_errors'] = [ - StatusError.from_dict(v) for v in status_errors - ] + if (body := _dict.get('body')) is not None: + args['body'] = body + if (status_code := _dict.get('status_code')) is not None: + args['status_code'] = status_code return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SkillsAsyncRequestStatus object from a json dictionary.""" + """Initialize a TurnEventGenerativeAICalledCalloutResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'assistant_id') and getattr( - self, 'assistant_id') is not None: - _dict['assistant_id'] = getattr(self, 'assistant_id') - if hasattr(self, 'status') and getattr(self, 'status') is not None: - _dict['status'] = getattr(self, 'status') - if hasattr(self, 'status_description') and getattr( - self, 'status_description') is not None: - _dict['status_description'] = getattr(self, 'status_description') - if hasattr(self, 'status_errors') and getattr( - self, 'status_errors') is not None: - status_errors_list = [] - for v in getattr(self, 'status_errors'): - if isinstance(v, dict): - status_errors_list.append(v) - else: - status_errors_list.append(v.to_dict()) - _dict['status_errors'] = status_errors_list + if hasattr(self, 'body') and self.body is not None: + _dict['body'] = self.body + if hasattr(self, 'status_code') and self.status_code is not None: + _dict['status_code'] = self.status_code return _dict def _to_dict(self): @@ -13614,105 +17471,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SkillsAsyncRequestStatus object.""" + """Return a `str` version of this TurnEventGenerativeAICalledCalloutResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillsAsyncRequestStatus') -> bool: + def __eq__(self, + other: 'TurnEventGenerativeAICalledCalloutResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SkillsAsyncRequestStatus') -> bool: + def __ne__(self, + other: 'TurnEventGenerativeAICalledCalloutResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The current status of the asynchronous operation: - - `Available`: An asynchronous export is available. - - `Completed`: An asynchronous import operation has completed successfully. - - `Failed`: An asynchronous operation has failed. See the **status_errors** - property for more information about the cause of the failure. - - `Processing`: An asynchronous operation has not yet completed. - """ - - AVAILABLE = 'Available' - COMPLETED = 'Completed' - FAILED = 'Failed' - PROCESSING = 'Processing' - -class SkillsExport: +class TurnEventGenerativeAICalledCalloutSearch: """ - SkillsExport. + TurnEventGenerativeAICalledCalloutSearch. - :param List[Skill] assistant_skills: An array of objects describing the skills - for the assistant. Included in responses only if **status**=`Available`. - :param AssistantState assistant_state: Status information about the skills for - the assistant. Included in responses only if **status**=`Available`. + :param str engine: (optional) The search engine that was used to scan the + documents. + :param str index: (optional) The name of the Elasticsearch index being used. + This field is only available if the engine being used is Elasticsearch. + :param str query: (optional) The query that will be used by the system to + initiate search on the document search engine. + :param TurnEventGenerativeAICalledCalloutRequest request: (optional) + :param TurnEventGenerativeAICalledCalloutResponse response: (optional) """ def __init__( self, - assistant_skills: List['Skill'], - assistant_state: 'AssistantState', + *, + engine: Optional[str] = None, + index: Optional[str] = None, + query: Optional[str] = None, + request: Optional['TurnEventGenerativeAICalledCalloutRequest'] = None, + response: Optional['TurnEventGenerativeAICalledCalloutResponse'] = None, ) -> None: """ - Initialize a SkillsExport object. + Initialize a TurnEventGenerativeAICalledCalloutSearch object. - :param List[Skill] assistant_skills: An array of objects describing the - skills for the assistant. Included in responses only if - **status**=`Available`. - :param AssistantState assistant_state: Status information about the skills - for the assistant. Included in responses only if **status**=`Available`. + :param str engine: (optional) The search engine that was used to scan the + documents. + :param str index: (optional) The name of the Elasticsearch index being + used. This field is only available if the engine being used is + Elasticsearch. + :param str query: (optional) The query that will be used by the system to + initiate search on the document search engine. + :param TurnEventGenerativeAICalledCalloutRequest request: (optional) + :param TurnEventGenerativeAICalledCalloutResponse response: (optional) """ - self.assistant_skills = assistant_skills - self.assistant_state = assistant_state + self.engine = engine + self.index = index + self.query = query + self.request = request + self.response = response @classmethod - def from_dict(cls, _dict: Dict) -> 'SkillsExport': - """Initialize a SkillsExport object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'TurnEventGenerativeAICalledCalloutSearch': + """Initialize a TurnEventGenerativeAICalledCalloutSearch object from a json dictionary.""" args = {} - if (assistant_skills := _dict.get('assistant_skills')) is not None: - args['assistant_skills'] = [ - Skill.from_dict(v) for v in assistant_skills - ] - else: - raise ValueError( - 'Required property \'assistant_skills\' not present in SkillsExport JSON' - ) - if (assistant_state := _dict.get('assistant_state')) is not None: - args['assistant_state'] = AssistantState.from_dict(assistant_state) - else: - raise ValueError( - 'Required property \'assistant_state\' not present in SkillsExport JSON' - ) + if (engine := _dict.get('engine')) is not None: + args['engine'] = engine + if (index := _dict.get('index')) is not None: + args['index'] = index + if (query := _dict.get('query')) is not None: + args['query'] = query + if (request := _dict.get('request')) is not None: + args[ + 'request'] = TurnEventGenerativeAICalledCalloutRequest.from_dict( + request) + if (response := _dict.get('response')) is not None: + args[ + 'response'] = TurnEventGenerativeAICalledCalloutResponse.from_dict( + response) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SkillsExport object from a json dictionary.""" + """Initialize a TurnEventGenerativeAICalledCalloutSearch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, - 'assistant_skills') and self.assistant_skills is not None: - assistant_skills_list = [] - for v in self.assistant_skills: - if isinstance(v, dict): - assistant_skills_list.append(v) - else: - assistant_skills_list.append(v.to_dict()) - _dict['assistant_skills'] = assistant_skills_list - if hasattr(self, - 'assistant_state') and self.assistant_state is not None: - if isinstance(self.assistant_state, dict): - _dict['assistant_state'] = self.assistant_state + if hasattr(self, 'engine') and self.engine is not None: + _dict['engine'] = self.engine + if hasattr(self, 'index') and self.index is not None: + _dict['index'] = self.index + if hasattr(self, 'query') and self.query is not None: + _dict['query'] = self.query + if hasattr(self, 'request') and self.request is not None: + if isinstance(self.request, dict): + _dict['request'] = self.request else: - _dict['assistant_state'] = self.assistant_state.to_dict() + _dict['request'] = self.request.to_dict() + if hasattr(self, 'response') and self.response is not None: + if isinstance(self.response, dict): + _dict['response'] = self.response + else: + _dict['response'] = self.response.to_dict() return _dict def _to_dict(self): @@ -13720,141 +17581,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SkillsExport object.""" + """Return a `str` version of this TurnEventGenerativeAICalledCalloutSearch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillsExport') -> bool: + def __eq__(self, other: 'TurnEventGenerativeAICalledCalloutSearch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SkillsExport') -> bool: + def __ne__(self, other: 'TurnEventGenerativeAICalledCalloutSearch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatefulMessageResponse: +class TurnEventGenerativeAICalledMetrics: """ - A response from the watsonx Assistant service. + TurnEventGenerativeAICalledMetrics. - :param MessageOutput output: Assistant output to be rendered or processed by the - client. - :param MessageContext context: (optional) Context data for the conversation. You - can use this property to access context variables. The context is stored by the - assistant on a per-session basis. - **Note:** The context is included in message responses only if - **return_context**=`true` in the message request. Full context is always - included in logs. - :param str user_id: A string value that identifies the user who is interacting - with the assistant. The client must provide a unique identifier for each - individual end user who accesses the application. For user-based plans, this - user ID is used to identify unique users for billing purposes. This string - cannot contain carriage return, newline, or tab characters. If no value is - specified in the input, **user_id** is automatically set to the value of - **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the global - system context. - :param MessageOutput masked_output: (optional) Assistant output to be rendered - or processed by the client. All private data is masked or removed. - :param MessageInput masked_input: (optional) An input object that includes the - input text. All private data is masked or removed. + :param float search_time_ms: (optional) The amount of time (in milliseconds) it + took for the system to complete the search using the document search engine. + :param float answer_generation_time_ms: (optional) The amount of time (in + milliseconds) it took for the system to complete answer generation process by + reaching out to watsonx.ai. + :param float total_time_ms: (optional) The amount of time (in milliseconds) it + took for the system to fully process the conversational search. """ def __init__( self, - output: 'MessageOutput', - user_id: str, *, - context: Optional['MessageContext'] = None, - masked_output: Optional['MessageOutput'] = None, - masked_input: Optional['MessageInput'] = None, + search_time_ms: Optional[float] = None, + answer_generation_time_ms: Optional[float] = None, + total_time_ms: Optional[float] = None, ) -> None: """ - Initialize a StatefulMessageResponse object. + Initialize a TurnEventGenerativeAICalledMetrics object. - :param MessageOutput output: Assistant output to be rendered or processed - by the client. - :param str user_id: A string value that identifies the user who is - interacting with the assistant. The client must provide a unique identifier - for each individual end user who accesses the application. For user-based - plans, this user ID is used to identify unique users for billing purposes. - This string cannot contain carriage return, newline, or tab characters. If - no value is specified in the input, **user_id** is automatically set to the - value of **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the - global system context. - :param MessageContext context: (optional) Context data for the - conversation. You can use this property to access context variables. The - context is stored by the assistant on a per-session basis. - **Note:** The context is included in message responses only if - **return_context**=`true` in the message request. Full context is always - included in logs. - :param MessageOutput masked_output: (optional) Assistant output to be - rendered or processed by the client. All private data is masked or removed. - :param MessageInput masked_input: (optional) An input object that includes - the input text. All private data is masked or removed. + :param float search_time_ms: (optional) The amount of time (in + milliseconds) it took for the system to complete the search using the + document search engine. + :param float answer_generation_time_ms: (optional) The amount of time (in + milliseconds) it took for the system to complete answer generation process + by reaching out to watsonx.ai. + :param float total_time_ms: (optional) The amount of time (in milliseconds) + it took for the system to fully process the conversational search. """ - self.output = output - self.context = context - self.user_id = user_id - self.masked_output = masked_output - self.masked_input = masked_input + self.search_time_ms = search_time_ms + self.answer_generation_time_ms = answer_generation_time_ms + self.total_time_ms = total_time_ms @classmethod - def from_dict(cls, _dict: Dict) -> 'StatefulMessageResponse': - """Initialize a StatefulMessageResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventGenerativeAICalledMetrics': + """Initialize a TurnEventGenerativeAICalledMetrics object from a json dictionary.""" args = {} - if (output := _dict.get('output')) is not None: - args['output'] = MessageOutput.from_dict(output) - else: - raise ValueError( - 'Required property \'output\' not present in StatefulMessageResponse JSON' - ) - if (context := _dict.get('context')) is not None: - args['context'] = MessageContext.from_dict(context) - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id - else: - raise ValueError( - 'Required property \'user_id\' not present in StatefulMessageResponse JSON' - ) - if (masked_output := _dict.get('masked_output')) is not None: - args['masked_output'] = MessageOutput.from_dict(masked_output) - if (masked_input := _dict.get('masked_input')) is not None: - args['masked_input'] = MessageInput.from_dict(masked_input) + if (search_time_ms := _dict.get('search_time_ms')) is not None: + args['search_time_ms'] = search_time_ms + if (answer_generation_time_ms := + _dict.get('answer_generation_time_ms')) is not None: + args['answer_generation_time_ms'] = answer_generation_time_ms + if (total_time_ms := _dict.get('total_time_ms')) is not None: + args['total_time_ms'] = total_time_ms return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatefulMessageResponse object from a json dictionary.""" + """Initialize a TurnEventGenerativeAICalledMetrics object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'output') and self.output is not None: - if isinstance(self.output, dict): - _dict['output'] = self.output - else: - _dict['output'] = self.output.to_dict() - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'user_id') and self.user_id is not None: - _dict['user_id'] = self.user_id - if hasattr(self, 'masked_output') and self.masked_output is not None: - if isinstance(self.masked_output, dict): - _dict['masked_output'] = self.masked_output - else: - _dict['masked_output'] = self.masked_output.to_dict() - if hasattr(self, 'masked_input') and self.masked_input is not None: - if isinstance(self.masked_input, dict): - _dict['masked_input'] = self.masked_input - else: - _dict['masked_input'] = self.masked_input.to_dict() + if hasattr(self, 'search_time_ms') and self.search_time_ms is not None: + _dict['search_time_ms'] = self.search_time_ms + if hasattr(self, 'answer_generation_time_ms' + ) and self.answer_generation_time_ms is not None: + _dict['answer_generation_time_ms'] = self.answer_generation_time_ms + if hasattr(self, 'total_time_ms') and self.total_time_ms is not None: + _dict['total_time_ms'] = self.total_time_ms return _dict def _to_dict(self): @@ -13862,87 +17666,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatefulMessageResponse object.""" + """Return a `str` version of this TurnEventGenerativeAICalledMetrics object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatefulMessageResponse') -> bool: + def __eq__(self, other: 'TurnEventGenerativeAICalledMetrics') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatefulMessageResponse') -> bool: + def __ne__(self, other: 'TurnEventGenerativeAICalledMetrics') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatelessMessageContext: +class TurnEventNodeSource: """ - StatelessMessageContext. + TurnEventNodeSource. - :param StatelessMessageContextGlobal global_: (optional) Session context data - that is shared by all skills used by the assistant. - :param StatelessMessageContextSkills skills: (optional) Context data specific to - particular skills used by the assistant. - :param dict integrations: (optional) An object containing context data that is - specific to particular integrations. For more information, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). + :param str type: (optional) The type of turn event. + :param str dialog_node: (optional) A dialog node that was visited during + processing of the input message. + :param str title: (optional) The title of the dialog node. + :param str condition: (optional) The condition that triggered the dialog node. """ def __init__( self, *, - global_: Optional['StatelessMessageContextGlobal'] = None, - skills: Optional['StatelessMessageContextSkills'] = None, - integrations: Optional[dict] = None, + type: Optional[str] = None, + dialog_node: Optional[str] = None, + title: Optional[str] = None, + condition: Optional[str] = None, ) -> None: """ - Initialize a StatelessMessageContext object. + Initialize a TurnEventNodeSource object. - :param StatelessMessageContextGlobal global_: (optional) Session context - data that is shared by all skills used by the assistant. - :param StatelessMessageContextSkills skills: (optional) Context data - specific to particular skills used by the assistant. - :param dict integrations: (optional) An object containing context data that - is specific to particular integrations. For more information, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrations). + :param str type: (optional) The type of turn event. + :param str dialog_node: (optional) A dialog node that was visited during + processing of the input message. + :param str title: (optional) The title of the dialog node. + :param str condition: (optional) The condition that triggered the dialog + node. """ - self.global_ = global_ - self.skills = skills - self.integrations = integrations + self.type = type + self.dialog_node = dialog_node + self.title = title + self.condition = condition @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageContext': - """Initialize a StatelessMessageContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventNodeSource': + """Initialize a TurnEventNodeSource object from a json dictionary.""" args = {} - if (global_ := _dict.get('global')) is not None: - args['global_'] = StatelessMessageContextGlobal.from_dict(global_) - if (skills := _dict.get('skills')) is not None: - args['skills'] = StatelessMessageContextSkills.from_dict(skills) - if (integrations := _dict.get('integrations')) is not None: - args['integrations'] = integrations + if (type := _dict.get('type')) is not None: + args['type'] = type + if (dialog_node := _dict.get('dialog_node')) is not None: + args['dialog_node'] = dialog_node + if (title := _dict.get('title')) is not None: + args['title'] = title + if (condition := _dict.get('condition')) is not None: + args['condition'] = condition return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageContext object from a json dictionary.""" + """Initialize a TurnEventNodeSource object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'global_') and self.global_ is not None: - if isinstance(self.global_, dict): - _dict['global'] = self.global_ - else: - _dict['global'] = self.global_.to_dict() - if hasattr(self, 'skills') and self.skills is not None: - if isinstance(self.skills, dict): - _dict['skills'] = self.skills - else: - _dict['skills'] = self.skills.to_dict() - if hasattr(self, 'integrations') and self.integrations is not None: - _dict['integrations'] = self.integrations + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'dialog_node') and self.dialog_node is not None: + _dict['dialog_node'] = self.dialog_node + if hasattr(self, 'title') and self.title is not None: + _dict['title'] = self.title + if hasattr(self, 'condition') and self.condition is not None: + _dict['condition'] = self.condition return _dict def _to_dict(self): @@ -13950,70 +17751,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageContext object.""" + """Return a `str` version of this TurnEventNodeSource object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageContext') -> bool: + def __eq__(self, other: 'TurnEventNodeSource') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageContext') -> bool: + def __ne__(self, other: 'TurnEventNodeSource') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of turn event. + """ + + DIALOG_NODE = 'dialog_node' + -class StatelessMessageContextGlobal: +class TurnEventSearchError: """ - Session context data that is shared by all skills used by the assistant. + TurnEventSearchError. - :param MessageContextGlobalSystem system: (optional) Built-in system properties - that apply to all skills used by the assistant. - :param str session_id: (optional) The unique identifier of the session. + :param str message: (optional) Any error message returned by a failed call to a + search skill. """ def __init__( self, *, - system: Optional['MessageContextGlobalSystem'] = None, - session_id: Optional[str] = None, + message: Optional[str] = None, ) -> None: """ - Initialize a StatelessMessageContextGlobal object. + Initialize a TurnEventSearchError object. - :param MessageContextGlobalSystem system: (optional) Built-in system - properties that apply to all skills used by the assistant. - :param str session_id: (optional) The unique identifier of the session. + :param str message: (optional) Any error message returned by a failed call + to a search skill. """ - self.system = system - self.session_id = session_id + self.message = message @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextGlobal': - """Initialize a StatelessMessageContextGlobal object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventSearchError': + """Initialize a TurnEventSearchError object from a json dictionary.""" args = {} - if (system := _dict.get('system')) is not None: - args['system'] = MessageContextGlobalSystem.from_dict(system) - if (session_id := _dict.get('session_id')) is not None: - args['session_id'] = session_id + if (message := _dict.get('message')) is not None: + args['message'] = message return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageContextGlobal object from a json dictionary.""" + """Initialize a TurnEventSearchError object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'system') and self.system is not None: - if isinstance(self.system, dict): - _dict['system'] = self.system - else: - _dict['system'] = self.system.to_dict() - if hasattr(self, 'session_id') and self.session_id is not None: - _dict['session_id'] = self.session_id + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message return _dict def _to_dict(self): @@ -14021,78 +17818,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageContextGlobal object.""" + """Return a `str` version of this TurnEventSearchError object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageContextGlobal') -> bool: + def __eq__(self, other: 'TurnEventSearchError') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageContextGlobal') -> bool: + def __ne__(self, other: 'TurnEventSearchError') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatelessMessageContextSkills: +class TurnEventStepSource: """ - Context data specific to particular skills used by the assistant. + TurnEventStepSource. - :param MessageContextDialogSkill main_skill: (optional) Context variables that - are used by the dialog skill. - :param StatelessMessageContextSkillsActionsSkill actions_skill: (optional) - Context variables that are used by the action skill. + :param str type: (optional) The type of turn event. + :param str action: (optional) An action that was visited during processing of + the message. + :param str action_title: (optional) The title of the action. + :param str step: (optional) A step that was visited during processing of the + message. + :param bool is_ai_guided: (optional) Whether the action that the turn event was + generated from is an AI-guided action. + :param bool is_skill_based: (optional) Whether the action that the turn event + was generated from is a skill-guided action. """ def __init__( self, *, - main_skill: Optional['MessageContextDialogSkill'] = None, - actions_skill: Optional[ - 'StatelessMessageContextSkillsActionsSkill'] = None, + type: Optional[str] = None, + action: Optional[str] = None, + action_title: Optional[str] = None, + step: Optional[str] = None, + is_ai_guided: Optional[bool] = None, + is_skill_based: Optional[bool] = None, ) -> None: """ - Initialize a StatelessMessageContextSkills object. + Initialize a TurnEventStepSource object. - :param MessageContextDialogSkill main_skill: (optional) Context variables - that are used by the dialog skill. - :param StatelessMessageContextSkillsActionsSkill actions_skill: (optional) - Context variables that are used by the action skill. + :param str type: (optional) The type of turn event. + :param str action: (optional) An action that was visited during processing + of the message. + :param str action_title: (optional) The title of the action. + :param str step: (optional) A step that was visited during processing of + the message. + :param bool is_ai_guided: (optional) Whether the action that the turn event + was generated from is an AI-guided action. + :param bool is_skill_based: (optional) Whether the action that the turn + event was generated from is a skill-guided action. """ - self.main_skill = main_skill - self.actions_skill = actions_skill + self.type = type + self.action = action + self.action_title = action_title + self.step = step + self.is_ai_guided = is_ai_guided + self.is_skill_based = is_skill_based @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextSkills': - """Initialize a StatelessMessageContextSkills object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TurnEventStepSource': + """Initialize a TurnEventStepSource object from a json dictionary.""" args = {} - if (main_skill := _dict.get('main skill')) is not None: - args['main_skill'] = MessageContextDialogSkill.from_dict(main_skill) - if (actions_skill := _dict.get('actions skill')) is not None: - args[ - 'actions_skill'] = StatelessMessageContextSkillsActionsSkill.from_dict( - actions_skill) + if (type := _dict.get('type')) is not None: + args['type'] = type + if (action := _dict.get('action')) is not None: + args['action'] = action + if (action_title := _dict.get('action_title')) is not None: + args['action_title'] = action_title + if (step := _dict.get('step')) is not None: + args['step'] = step + if (is_ai_guided := _dict.get('is_ai_guided')) is not None: + args['is_ai_guided'] = is_ai_guided + if (is_skill_based := _dict.get('is_skill_based')) is not None: + args['is_skill_based'] = is_skill_based return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageContextSkills object from a json dictionary.""" + """Initialize a TurnEventStepSource object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'main_skill') and self.main_skill is not None: - if isinstance(self.main_skill, dict): - _dict['main skill'] = self.main_skill - else: - _dict['main skill'] = self.main_skill.to_dict() - if hasattr(self, 'actions_skill') and self.actions_skill is not None: - if isinstance(self.actions_skill, dict): - _dict['actions skill'] = self.actions_skill - else: - _dict['actions skill'] = self.actions_skill.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'action_title') and self.action_title is not None: + _dict['action_title'] = self.action_title + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'is_ai_guided') and self.is_ai_guided is not None: + _dict['is_ai_guided'] = self.is_ai_guided + if hasattr(self, 'is_skill_based') and self.is_skill_based is not None: + _dict['is_skill_based'] = self.is_skill_based return _dict def _to_dict(self): @@ -14100,134 +17924,72 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageContextSkills object.""" + """Return a `str` version of this TurnEventStepSource object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageContextSkills') -> bool: + def __eq__(self, other: 'TurnEventStepSource') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageContextSkills') -> bool: + def __ne__(self, other: 'TurnEventStepSource') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type of turn event. + """ + + STEP = 'step' -class StatelessMessageContextSkillsActionsSkill: + +class UpdateEnvironmentOrchestration: """ - Context variables that are used by the action skill. + The search skill orchestration settings for the environment. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data used by - the skill. - :param dict action_variables: (optional) An object containing action variables. - Action variables can be accessed only by steps in the same action, and do not - persist after the action ends. - :param dict skill_variables: (optional) An object containing skill variables. - (In the watsonx Assistant user interface, skill variables are called _session - variables_.) Skill variables can be accessed by any action and persist for the - duration of the session. - :param dict private_action_variables: (optional) An object containing private - action variables. Action variables can be accessed only by steps in the same - action, and do not persist after the action ends. Private variables are - encrypted. - :param dict private_skill_variables: (optional) An object containing private - skill variables. (In the watsonx Assistant user interface, skill variables are - called _session variables_.) Skill variables can be accessed by any action and - persist for the duration of the session. Private variables are encrypted. + :param bool search_skill_fallback: (optional) Whether to fall back to a search + skill when responding to messages that do not match any intent or action defined + in dialog or action skills. (If no search skill is configured for the + environment, this property is ignored.). """ def __init__( self, *, - user_defined: Optional[dict] = None, - system: Optional['MessageContextSkillSystem'] = None, - action_variables: Optional[dict] = None, - skill_variables: Optional[dict] = None, - private_action_variables: Optional[dict] = None, - private_skill_variables: Optional[dict] = None, + search_skill_fallback: Optional[bool] = None, ) -> None: """ - Initialize a StatelessMessageContextSkillsActionsSkill object. + Initialize a UpdateEnvironmentOrchestration object. - :param dict user_defined: (optional) An object containing any arbitrary - variables that can be read and written by a particular skill. - :param MessageContextSkillSystem system: (optional) System context data - used by the skill. - :param dict action_variables: (optional) An object containing action - variables. Action variables can be accessed only by steps in the same - action, and do not persist after the action ends. - :param dict skill_variables: (optional) An object containing skill - variables. (In the watsonx Assistant user interface, skill variables are - called _session variables_.) Skill variables can be accessed by any action - and persist for the duration of the session. - :param dict private_action_variables: (optional) An object containing - private action variables. Action variables can be accessed only by steps in - the same action, and do not persist after the action ends. Private - variables are encrypted. - :param dict private_skill_variables: (optional) An object containing - private skill variables. (In the watsonx Assistant user interface, skill - variables are called _session variables_.) Skill variables can be accessed - by any action and persist for the duration of the session. Private - variables are encrypted. + :param bool search_skill_fallback: (optional) Whether to fall back to a + search skill when responding to messages that do not match any intent or + action defined in dialog or action skills. (If no search skill is + configured for the environment, this property is ignored.). """ - self.user_defined = user_defined - self.system = system - self.action_variables = action_variables - self.skill_variables = skill_variables - self.private_action_variables = private_action_variables - self.private_skill_variables = private_skill_variables + self.search_skill_fallback = search_skill_fallback @classmethod - def from_dict(cls, - _dict: Dict) -> 'StatelessMessageContextSkillsActionsSkill': - """Initialize a StatelessMessageContextSkillsActionsSkill object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateEnvironmentOrchestration': + """Initialize a UpdateEnvironmentOrchestration object from a json dictionary.""" args = {} - if (user_defined := _dict.get('user_defined')) is not None: - args['user_defined'] = user_defined - if (system := _dict.get('system')) is not None: - args['system'] = MessageContextSkillSystem.from_dict(system) - if (action_variables := _dict.get('action_variables')) is not None: - args['action_variables'] = action_variables - if (skill_variables := _dict.get('skill_variables')) is not None: - args['skill_variables'] = skill_variables - if (private_action_variables := - _dict.get('private_action_variables')) is not None: - args['private_action_variables'] = private_action_variables - if (private_skill_variables := - _dict.get('private_skill_variables')) is not None: - args['private_skill_variables'] = private_skill_variables + if (search_skill_fallback := + _dict.get('search_skill_fallback')) is not None: + args['search_skill_fallback'] = search_skill_fallback return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a StatelessMessageContextSkillsActionsSkill object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'user_defined') and self.user_defined is not None: - _dict['user_defined'] = self.user_defined - if hasattr(self, 'system') and self.system is not None: - if isinstance(self.system, dict): - _dict['system'] = self.system - else: - _dict['system'] = self.system.to_dict() - if hasattr(self, - 'action_variables') and self.action_variables is not None: - _dict['action_variables'] = self.action_variables - if hasattr(self, - 'skill_variables') and self.skill_variables is not None: - _dict['skill_variables'] = self.skill_variables - if hasattr(self, 'private_action_variables' - ) and self.private_action_variables is not None: - _dict['private_action_variables'] = self.private_action_variables - if hasattr(self, 'private_skill_variables' - ) and self.private_skill_variables is not None: - _dict['private_skill_variables'] = self.private_skill_variables + @classmethod + def _from_dict(cls, _dict): + """Initialize a UpdateEnvironmentOrchestration object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'search_skill_fallback' + ) and self.search_skill_fallback is not None: + _dict['search_skill_fallback'] = self.search_skill_fallback return _dict def _to_dict(self): @@ -14235,177 +17997,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageContextSkillsActionsSkill object.""" + """Return a `str` version of this UpdateEnvironmentOrchestration object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'StatelessMessageContextSkillsActionsSkill') -> bool: + def __eq__(self, other: 'UpdateEnvironmentOrchestration') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, - other: 'StatelessMessageContextSkillsActionsSkill') -> bool: + def __ne__(self, other: 'UpdateEnvironmentOrchestration') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatelessMessageInput: +class UpdateEnvironmentReleaseReference: """ - An input object that includes the input text. + An object describing the release that is currently deployed in the environment. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when evaluating - the user input. Include intents from the previous response to continue using - those intents rather than trying to recognize intents in the new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when evaluating - the message. Include entities from the previous response to continue using those - entities rather than detecting entities in the new input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the Segment - extension. - :param StatelessMessageInputOptions options: (optional) Optional properties that - control how the assistant responds. + :param str release: (optional) The name of the deployed release. """ def __init__( self, *, - message_type: Optional[str] = None, - text: Optional[str] = None, - intents: Optional[List['RuntimeIntent']] = None, - entities: Optional[List['RuntimeEntity']] = None, - suggestion_id: Optional[str] = None, - attachments: Optional[List['MessageInputAttachment']] = None, - analytics: Optional['RequestAnalytics'] = None, - options: Optional['StatelessMessageInputOptions'] = None, + release: Optional[str] = None, ) -> None: """ - Initialize a StatelessMessageInput object. + Initialize a UpdateEnvironmentReleaseReference object. - :param str message_type: (optional) The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill - is bypassed.) - **Note:** A `search` message results in an error if no search skill is - configured for the assistant. - :param str text: (optional) The text of the user input. This string cannot - contain carriage return, newline, or tab characters. - :param List[RuntimeIntent] intents: (optional) Intents to use when - evaluating the user input. Include intents from the previous response to - continue using those intents rather than trying to recognize intents in the - new input. - :param List[RuntimeEntity] entities: (optional) Entities to use when - evaluating the message. Include entities from the previous response to - continue using those entities rather than detecting entities in the new - input. - :param str suggestion_id: (optional) For internal use only. - :param List[MessageInputAttachment] attachments: (optional) An array of - multimedia attachments to be sent with the message. Attachments are not - processed by the assistant itself, but can be sent to external services by - webhooks. - **Note:** Attachments are not supported on IBM Cloud Pak for Data. - :param RequestAnalytics analytics: (optional) An optional object containing - analytics data. Currently, this data is used only for events sent to the - Segment extension. - :param StatelessMessageInputOptions options: (optional) Optional properties - that control how the assistant responds. + :param str release: (optional) The name of the deployed release. """ - self.message_type = message_type - self.text = text - self.intents = intents - self.entities = entities - self.suggestion_id = suggestion_id - self.attachments = attachments - self.analytics = analytics - self.options = options + self.release = release @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageInput': - """Initialize a StatelessMessageInput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateEnvironmentReleaseReference': + """Initialize a UpdateEnvironmentReleaseReference object from a json dictionary.""" args = {} - if (message_type := _dict.get('message_type')) is not None: - args['message_type'] = message_type - if (text := _dict.get('text')) is not None: - args['text'] = text - if (intents := _dict.get('intents')) is not None: - args['intents'] = [RuntimeIntent.from_dict(v) for v in intents] - if (entities := _dict.get('entities')) is not None: - args['entities'] = [RuntimeEntity.from_dict(v) for v in entities] - if (suggestion_id := _dict.get('suggestion_id')) is not None: - args['suggestion_id'] = suggestion_id - if (attachments := _dict.get('attachments')) is not None: - args['attachments'] = [ - MessageInputAttachment.from_dict(v) for v in attachments - ] - if (analytics := _dict.get('analytics')) is not None: - args['analytics'] = RequestAnalytics.from_dict(analytics) - if (options := _dict.get('options')) is not None: - args['options'] = StatelessMessageInputOptions.from_dict(options) + if (release := _dict.get('release')) is not None: + args['release'] = release return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageInput object from a json dictionary.""" + """Initialize a UpdateEnvironmentReleaseReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message_type') and self.message_type is not None: - _dict['message_type'] = self.message_type - if hasattr(self, 'text') and self.text is not None: - _dict['text'] = self.text - if hasattr(self, 'intents') and self.intents is not None: - intents_list = [] - for v in self.intents: - if isinstance(v, dict): - intents_list.append(v) - else: - intents_list.append(v.to_dict()) - _dict['intents'] = intents_list - if hasattr(self, 'entities') and self.entities is not None: - entities_list = [] - for v in self.entities: - if isinstance(v, dict): - entities_list.append(v) - else: - entities_list.append(v.to_dict()) - _dict['entities'] = entities_list - if hasattr(self, 'suggestion_id') and self.suggestion_id is not None: - _dict['suggestion_id'] = self.suggestion_id - if hasattr(self, 'attachments') and self.attachments is not None: - attachments_list = [] - for v in self.attachments: - if isinstance(v, dict): - attachments_list.append(v) - else: - attachments_list.append(v.to_dict()) - _dict['attachments'] = attachments_list - if hasattr(self, 'analytics') and self.analytics is not None: - if isinstance(self.analytics, dict): - _dict['analytics'] = self.analytics - else: - _dict['analytics'] = self.analytics.to_dict() - if hasattr(self, 'options') and self.options is not None: - if isinstance(self.options, dict): - _dict['options'] = self.options - else: - _dict['options'] = self.options.to_dict() + if hasattr(self, 'release') and self.release is not None: + _dict['release'] = self.release return _dict def _to_dict(self): @@ -14413,133 +18055,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageInput object.""" + """Return a `str` version of this UpdateEnvironmentReleaseReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageInput') -> bool: + def __eq__(self, other: 'UpdateEnvironmentReleaseReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageInput') -> bool: + def __ne__(self, other: 'UpdateEnvironmentReleaseReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MessageTypeEnum(str, Enum): - """ - The type of the message: - - `text`: The user input is processed normally by the assistant. - - `search`: Only search results are returned. (Any dialog or action skill is - bypassed.) - **Note:** A `search` message results in an error if no search skill is configured - for the assistant. - """ - - TEXT = 'text' - SEARCH = 'search' - -class StatelessMessageInputOptions: +class CompleteItem(RuntimeResponseGeneric): """ - Optional properties that control how the assistant responds. + CompleteItem. - :param bool restart: (optional) Whether to restart dialog processing at the root - of the dialog, regardless of any previously visited nodes. **Note:** This does - not affect `turn_count` or any other context variables. - :param bool alternate_intents: (optional) Whether to return more than one - intent. Set to `true` to return all matching intents. - :param bool async_callout: (optional) Whether custom extension callouts are - executed asynchronously. Asynchronous execution means the response to the - extension callout will be processed on the subsequent message call, the initial - message response signals to the client that the operation may be long running. - With synchronous execution the custom extension is executed and returns the - response in a single message turn. **Note:** **async_callout** defaults to true - for API versions earlier than 2023-06-15. - :param MessageInputOptionsSpelling spelling: (optional) Spelling correction - options for the message. Any options specified on an individual message override - the settings configured for the skill. - :param bool debug: (optional) Whether to return additional diagnostic - information. Set to `true` to return additional information in the - `output.debug` property. + :param Metadata streaming_metadata: """ def __init__( self, - *, - restart: Optional[bool] = None, - alternate_intents: Optional[bool] = None, - async_callout: Optional[bool] = None, - spelling: Optional['MessageInputOptionsSpelling'] = None, - debug: Optional[bool] = None, + streaming_metadata: 'Metadata', ) -> None: """ - Initialize a StatelessMessageInputOptions object. - - :param bool restart: (optional) Whether to restart dialog processing at the - root of the dialog, regardless of any previously visited nodes. **Note:** - This does not affect `turn_count` or any other context variables. - :param bool alternate_intents: (optional) Whether to return more than one - intent. Set to `true` to return all matching intents. - :param bool async_callout: (optional) Whether custom extension callouts are - executed asynchronously. Asynchronous execution means the response to the - extension callout will be processed on the subsequent message call, the - initial message response signals to the client that the operation may be - long running. With synchronous execution the custom extension is executed - and returns the response in a single message turn. **Note:** - **async_callout** defaults to true for API versions earlier than - 2023-06-15. - :param MessageInputOptionsSpelling spelling: (optional) Spelling correction - options for the message. Any options specified on an individual message - override the settings configured for the skill. - :param bool debug: (optional) Whether to return additional diagnostic - information. Set to `true` to return additional information in the - `output.debug` property. - """ - self.restart = restart - self.alternate_intents = alternate_intents - self.async_callout = async_callout - self.spelling = spelling - self.debug = debug + Initialize a CompleteItem object. - @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageInputOptions': - """Initialize a StatelessMessageInputOptions object from a json dictionary.""" - args = {} - if (restart := _dict.get('restart')) is not None: - args['restart'] = restart - if (alternate_intents := _dict.get('alternate_intents')) is not None: - args['alternate_intents'] = alternate_intents - if (async_callout := _dict.get('async_callout')) is not None: - args['async_callout'] = async_callout - if (spelling := _dict.get('spelling')) is not None: - args['spelling'] = MessageInputOptionsSpelling.from_dict(spelling) - if (debug := _dict.get('debug')) is not None: - args['debug'] = debug + :param Metadata streaming_metadata: + """ + # pylint: disable=super-init-not-called + self.streaming_metadata = streaming_metadata + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CompleteItem': + """Initialize a CompleteItem object from a json dictionary.""" + args = {} + if (streaming_metadata := _dict.get('streaming_metadata')) is not None: + args['streaming_metadata'] = Metadata.from_dict(streaming_metadata) + else: + raise ValueError( + 'Required property \'streaming_metadata\' not present in CompleteItem JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageInputOptions object from a json dictionary.""" + """Initialize a CompleteItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'restart') and self.restart is not None: - _dict['restart'] = self.restart - if hasattr(self, - 'alternate_intents') and self.alternate_intents is not None: - _dict['alternate_intents'] = self.alternate_intents - if hasattr(self, 'async_callout') and self.async_callout is not None: - _dict['async_callout'] = self.async_callout - if hasattr(self, 'spelling') and self.spelling is not None: - if isinstance(self.spelling, dict): - _dict['spelling'] = self.spelling + if hasattr( + self, + 'streaming_metadata') and self.streaming_metadata is not None: + if isinstance(self.streaming_metadata, dict): + _dict['streaming_metadata'] = self.streaming_metadata else: - _dict['spelling'] = self.spelling.to_dict() - if hasattr(self, 'debug') and self.debug is not None: - _dict['debug'] = self.debug + _dict['streaming_metadata'] = self.streaming_metadata.to_dict() return _dict def _to_dict(self): @@ -14547,137 +18122,120 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageInputOptions object.""" + """Return a `str` version of this CompleteItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageInputOptions') -> bool: + def __eq__(self, other: 'CompleteItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageInputOptions') -> bool: + def __ne__(self, other: 'CompleteItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatelessMessageResponse: +class GenerativeAITaskContentGroundedAnswering(GenerativeAITask): """ - A stateless response from the watsonx Assistant service. + GenerativeAITaskContentGroundedAnswering. - :param MessageOutput output: Assistant output to be rendered or processed by the - client. - :param StatelessMessageContext context: Context data for the conversation. You - can use this property to access context variables. The context is not stored by - the assistant; to maintain session state, include the context from the response - in the next message. - :param MessageOutput masked_output: (optional) Assistant output to be rendered - or processed by the client. All private data is masked or removed. - :param MessageInput masked_input: (optional) An input object that includes the - input text. All private data is masked or removed. - :param str user_id: (optional) A string value that identifies the user who is - interacting with the assistant. The client must provide a unique identifier for - each individual end user who accesses the application. For user-based plans, - this user ID is used to identify unique users for billing purposes. This string - cannot contain carriage return, newline, or tab characters. If no value is - specified in the input, **user_id** is automatically set to the value of - **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the global - system context. + :param str task: (optional) The type of generative ai task. + :param bool is_idk_response: (optional) Whether response was an idk response. + :param bool is_hap_detected: (optional) Whether response was a hap response. + :param GenerativeAITaskConfidenceScores confidence_scores: (optional) The + confidence scores for determining whether to show the generated response or an + “I don't know” response. + :param str original_response: (optional) The original response returned by the + generative ai. + :param str inferred_query: (optional) Generated from the input text after + auto-correction. If this field is not present, the input text was used as the + query to the generative ai. """ def __init__( self, - output: 'MessageOutput', - context: 'StatelessMessageContext', *, - masked_output: Optional['MessageOutput'] = None, - masked_input: Optional['MessageInput'] = None, - user_id: Optional[str] = None, + task: Optional[str] = None, + is_idk_response: Optional[bool] = None, + is_hap_detected: Optional[bool] = None, + confidence_scores: Optional['GenerativeAITaskConfidenceScores'] = None, + original_response: Optional[str] = None, + inferred_query: Optional[str] = None, ) -> None: """ - Initialize a StatelessMessageResponse object. + Initialize a GenerativeAITaskContentGroundedAnswering object. - :param MessageOutput output: Assistant output to be rendered or processed - by the client. - :param StatelessMessageContext context: Context data for the conversation. - You can use this property to access context variables. The context is not - stored by the assistant; to maintain session state, include the context - from the response in the next message. - :param MessageOutput masked_output: (optional) Assistant output to be - rendered or processed by the client. All private data is masked or removed. - :param MessageInput masked_input: (optional) An input object that includes - the input text. All private data is masked or removed. - :param str user_id: (optional) A string value that identifies the user who - is interacting with the assistant. The client must provide a unique - identifier for each individual end user who accesses the application. For - user-based plans, this user ID is used to identify unique users for billing - purposes. This string cannot contain carriage return, newline, or tab - characters. If no value is specified in the input, **user_id** is - automatically set to the value of **context.global.session_id**. - **Note:** This property is the same as the **user_id** property in the - global system context. + :param str task: (optional) The type of generative ai task. + :param bool is_idk_response: (optional) Whether response was an idk + response. + :param bool is_hap_detected: (optional) Whether response was a hap + response. + :param GenerativeAITaskConfidenceScores confidence_scores: (optional) The + confidence scores for determining whether to show the generated response or + an “I don't know” response. + :param str original_response: (optional) The original response returned by + the generative ai. + :param str inferred_query: (optional) Generated from the input text after + auto-correction. If this field is not present, the input text was used as + the query to the generative ai. """ - self.output = output - self.context = context - self.masked_output = masked_output - self.masked_input = masked_input - self.user_id = user_id + # pylint: disable=super-init-not-called + self.task = task + self.is_idk_response = is_idk_response + self.is_hap_detected = is_hap_detected + self.confidence_scores = confidence_scores + self.original_response = original_response + self.inferred_query = inferred_query @classmethod - def from_dict(cls, _dict: Dict) -> 'StatelessMessageResponse': - """Initialize a StatelessMessageResponse object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'GenerativeAITaskContentGroundedAnswering': + """Initialize a GenerativeAITaskContentGroundedAnswering object from a json dictionary.""" args = {} - if (output := _dict.get('output')) is not None: - args['output'] = MessageOutput.from_dict(output) - else: - raise ValueError( - 'Required property \'output\' not present in StatelessMessageResponse JSON' - ) - if (context := _dict.get('context')) is not None: - args['context'] = StatelessMessageContext.from_dict(context) - else: - raise ValueError( - 'Required property \'context\' not present in StatelessMessageResponse JSON' - ) - if (masked_output := _dict.get('masked_output')) is not None: - args['masked_output'] = MessageOutput.from_dict(masked_output) - if (masked_input := _dict.get('masked_input')) is not None: - args['masked_input'] = MessageInput.from_dict(masked_input) - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id + if (task := _dict.get('task')) is not None: + args['task'] = task + if (is_idk_response := _dict.get('is_idk_response')) is not None: + args['is_idk_response'] = is_idk_response + if (is_hap_detected := _dict.get('is_hap_detected')) is not None: + args['is_hap_detected'] = is_hap_detected + if (confidence_scores := _dict.get('confidence_scores')) is not None: + args[ + 'confidence_scores'] = GenerativeAITaskConfidenceScores.from_dict( + confidence_scores) + if (original_response := _dict.get('original_response')) is not None: + args['original_response'] = original_response + if (inferred_query := _dict.get('inferred_query')) is not None: + args['inferred_query'] = inferred_query return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatelessMessageResponse object from a json dictionary.""" + """Initialize a GenerativeAITaskContentGroundedAnswering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'output') and self.output is not None: - if isinstance(self.output, dict): - _dict['output'] = self.output - else: - _dict['output'] = self.output.to_dict() - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'masked_output') and self.masked_output is not None: - if isinstance(self.masked_output, dict): - _dict['masked_output'] = self.masked_output - else: - _dict['masked_output'] = self.masked_output.to_dict() - if hasattr(self, 'masked_input') and self.masked_input is not None: - if isinstance(self.masked_input, dict): - _dict['masked_input'] = self.masked_input + if hasattr(self, 'task') and self.task is not None: + _dict['task'] = self.task + if hasattr(self, + 'is_idk_response') and self.is_idk_response is not None: + _dict['is_idk_response'] = self.is_idk_response + if hasattr(self, + 'is_hap_detected') and self.is_hap_detected is not None: + _dict['is_hap_detected'] = self.is_hap_detected + if hasattr(self, + 'confidence_scores') and self.confidence_scores is not None: + if isinstance(self.confidence_scores, dict): + _dict['confidence_scores'] = self.confidence_scores else: - _dict['masked_input'] = self.masked_input.to_dict() - if hasattr(self, 'user_id') and self.user_id is not None: - _dict['user_id'] = self.user_id + _dict['confidence_scores'] = self.confidence_scores.to_dict() + if hasattr(self, + 'original_response') and self.original_response is not None: + _dict['original_response'] = self.original_response + if hasattr(self, 'inferred_query') and self.inferred_query is not None: + _dict['inferred_query'] = self.inferred_query return _dict def _to_dict(self): @@ -14685,58 +18243,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatelessMessageResponse object.""" + """Return a `str` version of this GenerativeAITaskContentGroundedAnswering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatelessMessageResponse') -> bool: + def __eq__(self, other: 'GenerativeAITaskContentGroundedAnswering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatelessMessageResponse') -> bool: + def __ne__(self, other: 'GenerativeAITaskContentGroundedAnswering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class StatusError: +class GenerativeAITaskGeneralPurposeAnswering(GenerativeAITask): """ - An object describing an error that occurred during processing of an asynchronous - operation. + GenerativeAITaskGeneralPurposeAnswering. - :param str message: (optional) The text of the error message. + :param str task: (optional) The type of generative ai task. + :param bool is_idk_response: (optional) Whether response was an idk response. + :param bool is_hap_detected: (optional) Whether response was a hap response. """ def __init__( self, *, - message: Optional[str] = None, + task: Optional[str] = None, + is_idk_response: Optional[bool] = None, + is_hap_detected: Optional[bool] = None, ) -> None: """ - Initialize a StatusError object. + Initialize a GenerativeAITaskGeneralPurposeAnswering object. - :param str message: (optional) The text of the error message. + :param str task: (optional) The type of generative ai task. + :param bool is_idk_response: (optional) Whether response was an idk + response. + :param bool is_hap_detected: (optional) Whether response was a hap + response. """ - self.message = message + # pylint: disable=super-init-not-called + self.task = task + self.is_idk_response = is_idk_response + self.is_hap_detected = is_hap_detected @classmethod - def from_dict(cls, _dict: Dict) -> 'StatusError': - """Initialize a StatusError object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'GenerativeAITaskGeneralPurposeAnswering': + """Initialize a GenerativeAITaskGeneralPurposeAnswering object from a json dictionary.""" args = {} - if (message := _dict.get('message')) is not None: - args['message'] = message + if (task := _dict.get('task')) is not None: + args['task'] = task + if (is_idk_response := _dict.get('is_idk_response')) is not None: + args['is_idk_response'] = is_idk_response + if (is_hap_detected := _dict.get('is_hap_detected')) is not None: + args['is_hap_detected'] = is_hap_detected return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a StatusError object from a json dictionary.""" + """Initialize a GenerativeAITaskGeneralPurposeAnswering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message + if hasattr(self, 'task') and self.task is not None: + _dict['task'] = self.task + if hasattr(self, + 'is_idk_response') and self.is_idk_response is not None: + _dict['is_idk_response'] = self.is_idk_response + if hasattr(self, + 'is_hap_detected') and self.is_hap_detected is not None: + _dict['is_hap_detected'] = self.is_hap_detected return _dict def _to_dict(self): @@ -14744,71 +18323,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this StatusError object.""" + """Return a `str` version of this GenerativeAITaskGeneralPurposeAnswering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'StatusError') -> bool: + def __eq__(self, other: 'GenerativeAITaskGeneralPurposeAnswering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'StatusError') -> bool: + def __ne__(self, other: 'GenerativeAITaskGeneralPurposeAnswering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TurnEventActionSource: +class LogMessageSourceAction(LogMessageSource): """ - TurnEventActionSource. + An object that identifies the dialog element that generated the error message. - :param str type: (optional) The type of turn event. - :param str action: (optional) An action that was visited during processing of - the message. - :param str action_title: (optional) The title of the action. - :param str condition: (optional) The condition that triggered the dialog node. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the error + message. """ def __init__( self, - *, - type: Optional[str] = None, - action: Optional[str] = None, - action_title: Optional[str] = None, - condition: Optional[str] = None, + type: str, + action: str, ) -> None: """ - Initialize a TurnEventActionSource object. + Initialize a LogMessageSourceAction object. - :param str type: (optional) The type of turn event. - :param str action: (optional) An action that was visited during processing - of the message. - :param str action_title: (optional) The title of the action. - :param str condition: (optional) The condition that triggered the dialog - node. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the + error message. """ + # pylint: disable=super-init-not-called self.type = type self.action = action - self.action_title = action_title - self.condition = condition @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventActionSource': - """Initialize a TurnEventActionSource object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogMessageSourceAction': + """Initialize a LogMessageSourceAction object from a json dictionary.""" args = {} if (type := _dict.get('type')) is not None: args['type'] = type + else: + raise ValueError( + 'Required property \'type\' not present in LogMessageSourceAction JSON' + ) if (action := _dict.get('action')) is not None: args['action'] = action - if (action_title := _dict.get('action_title')) is not None: - args['action_title'] = action_title - if (condition := _dict.get('condition')) is not None: - args['condition'] = condition + else: + raise ValueError( + 'Required property \'action\' not present in LogMessageSourceAction JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventActionSource object from a json dictionary.""" + """Initialize a LogMessageSourceAction object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -14818,10 +18394,6 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action - if hasattr(self, 'action_title') and self.action_title is not None: - _dict['action_title'] = self.action_title - if hasattr(self, 'condition') and self.condition is not None: - _dict['condition'] = self.condition return _dict def _to_dict(self): @@ -14829,90 +18401,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventActionSource object.""" + """Return a `str` version of this LogMessageSourceAction object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventActionSource') -> bool: + def __eq__(self, other: 'LogMessageSourceAction') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventActionSource') -> bool: + def __ne__(self, other: 'LogMessageSourceAction') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - - class TypeEnum(str, Enum): - """ - The type of turn event. - """ - - ACTION = 'action' - - -class TurnEventCalloutCallout: - """ - TurnEventCalloutCallout. - - :param str type: (optional) The type of callout. Currently, the only supported - value is `integration_interaction` (for calls to extensions). - :param dict internal: (optional) For internal use only. - :param str result_variable: (optional) The name of the variable where the - callout result is stored. - :param TurnEventCalloutCalloutRequest request: (optional) The request object - executed to the external server specified by the extension. - :param TurnEventCalloutCalloutResponse response: (optional) The response object - received by the external server made by the extension. + + +class LogMessageSourceDialogNode(LogMessageSource): + """ + An object that identifies the dialog element that generated the error message. + + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str dialog_node: The unique identifier of the dialog node that generated + the error message. """ def __init__( self, - *, - type: Optional[str] = None, - internal: Optional[dict] = None, - result_variable: Optional[str] = None, - request: Optional['TurnEventCalloutCalloutRequest'] = None, - response: Optional['TurnEventCalloutCalloutResponse'] = None, + type: str, + dialog_node: str, ) -> None: """ - Initialize a TurnEventCalloutCallout object. + Initialize a LogMessageSourceDialogNode object. - :param str type: (optional) The type of callout. Currently, the only - supported value is `integration_interaction` (for calls to extensions). - :param dict internal: (optional) For internal use only. - :param str result_variable: (optional) The name of the variable where the - callout result is stored. - :param TurnEventCalloutCalloutRequest request: (optional) The request - object executed to the external server specified by the extension. - :param TurnEventCalloutCalloutResponse response: (optional) The response - object received by the external server made by the extension. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str dialog_node: The unique identifier of the dialog node that + generated the error message. """ + # pylint: disable=super-init-not-called self.type = type - self.internal = internal - self.result_variable = result_variable - self.request = request - self.response = response + self.dialog_node = dialog_node @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCallout': - """Initialize a TurnEventCalloutCallout object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogMessageSourceDialogNode': + """Initialize a LogMessageSourceDialogNode object from a json dictionary.""" args = {} if (type := _dict.get('type')) is not None: args['type'] = type - if (internal := _dict.get('internal')) is not None: - args['internal'] = internal - if (result_variable := _dict.get('result_variable')) is not None: - args['result_variable'] = result_variable - if (request := _dict.get('request')) is not None: - args['request'] = TurnEventCalloutCalloutRequest.from_dict(request) - if (response := _dict.get('response')) is not None: - args['response'] = TurnEventCalloutCalloutResponse.from_dict( - response) + else: + raise ValueError( + 'Required property \'type\' not present in LogMessageSourceDialogNode JSON' + ) + if (dialog_node := _dict.get('dialog_node')) is not None: + args['dialog_node'] = dialog_node + else: + raise ValueError( + 'Required property \'dialog_node\' not present in LogMessageSourceDialogNode JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventCalloutCallout object from a json dictionary.""" + """Initialize a LogMessageSourceDialogNode object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -14920,21 +18470,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'internal') and self.internal is not None: - _dict['internal'] = self.internal - if hasattr(self, - 'result_variable') and self.result_variable is not None: - _dict['result_variable'] = self.result_variable - if hasattr(self, 'request') and self.request is not None: - if isinstance(self.request, dict): - _dict['request'] = self.request - else: - _dict['request'] = self.request.to_dict() - if hasattr(self, 'response') and self.response is not None: - if isinstance(self.response, dict): - _dict['response'] = self.response - else: - _dict['response'] = self.response.to_dict() + if hasattr(self, 'dialog_node') and self.dialog_node is not None: + _dict['dialog_node'] = self.dialog_node return _dict def _to_dict(self): @@ -14942,112 +18479,102 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventCalloutCallout object.""" + """Return a `str` version of this LogMessageSourceDialogNode object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventCalloutCallout') -> bool: + def __eq__(self, other: 'LogMessageSourceDialogNode') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventCalloutCallout') -> bool: + def __ne__(self, other: 'LogMessageSourceDialogNode') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type of callout. Currently, the only supported value is - `integration_interaction` (for calls to extensions). - """ - - INTEGRATION_INTERACTION = 'integration_interaction' - -class TurnEventCalloutCalloutRequest: +class LogMessageSourceHandler(LogMessageSource): """ - TurnEventCalloutCalloutRequest. + An object that identifies the dialog element that generated the error message. - :param str method: (optional) The REST method of the request. - :param str url: (optional) The host URL of the request call. - :param str path: (optional) The URL path of the request call. - :param str query_parameters: (optional) Any query parameters appended to the URL - of the request call. - :param dict headers_: (optional) Any headers included in the request call. - :param dict body: (optional) Contains the response of the external server or an - object. In cases like timeouts or connections errors, it will contain details of - why the callout to the external server failed. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the error + message. + :param str step: (optional) The unique identifier of the step that generated the + error message. + :param str handler: The unique identifier of the handler that generated the + error message. """ def __init__( self, + type: str, + action: str, + handler: str, *, - method: Optional[str] = None, - url: Optional[str] = None, - path: Optional[str] = None, - query_parameters: Optional[str] = None, - headers_: Optional[dict] = None, - body: Optional[dict] = None, + step: Optional[str] = None, ) -> None: """ - Initialize a TurnEventCalloutCalloutRequest object. + Initialize a LogMessageSourceHandler object. - :param str method: (optional) The REST method of the request. - :param str url: (optional) The host URL of the request call. - :param str path: (optional) The URL path of the request call. - :param str query_parameters: (optional) Any query parameters appended to - the URL of the request call. - :param dict headers_: (optional) Any headers included in the request call. - :param dict body: (optional) Contains the response of the external server - or an object. In cases like timeouts or connections errors, it will contain - details of why the callout to the external server failed. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the + error message. + :param str handler: The unique identifier of the handler that generated the + error message. + :param str step: (optional) The unique identifier of the step that + generated the error message. """ - self.method = method - self.url = url - self.path = path - self.query_parameters = query_parameters - self.headers_ = headers_ - self.body = body + # pylint: disable=super-init-not-called + self.type = type + self.action = action + self.step = step + self.handler = handler @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCalloutRequest': - """Initialize a TurnEventCalloutCalloutRequest object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogMessageSourceHandler': + """Initialize a LogMessageSourceHandler object from a json dictionary.""" args = {} - if (method := _dict.get('method')) is not None: - args['method'] = method - if (url := _dict.get('url')) is not None: - args['url'] = url - if (path := _dict.get('path')) is not None: - args['path'] = path - if (query_parameters := _dict.get('query_parameters')) is not None: - args['query_parameters'] = query_parameters - if (headers_ := _dict.get('headers')) is not None: - args['headers_'] = headers_ - if (body := _dict.get('body')) is not None: - args['body'] = body + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError( + 'Required property \'type\' not present in LogMessageSourceHandler JSON' + ) + if (action := _dict.get('action')) is not None: + args['action'] = action + else: + raise ValueError( + 'Required property \'action\' not present in LogMessageSourceHandler JSON' + ) + if (step := _dict.get('step')) is not None: + args['step'] = step + if (handler := _dict.get('handler')) is not None: + args['handler'] = handler + else: + raise ValueError( + 'Required property \'handler\' not present in LogMessageSourceHandler JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventCalloutCalloutRequest object from a json dictionary.""" + """Initialize a LogMessageSourceHandler object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'method') and self.method is not None: - _dict['method'] = self.method - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'path') and self.path is not None: - _dict['path'] = self.path - if hasattr(self, - 'query_parameters') and self.query_parameters is not None: - _dict['query_parameters'] = self.query_parameters - if hasattr(self, 'headers_') and self.headers_ is not None: - _dict['headers'] = self.headers_ - if hasattr(self, 'body') and self.body is not None: - _dict['body'] = self.body + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'handler') and self.handler is not None: + _dict['handler'] = self.handler return _dict def _to_dict(self): @@ -15055,88 +18582,91 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventCalloutCalloutRequest object.""" + """Return a `str` version of this LogMessageSourceHandler object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventCalloutCalloutRequest') -> bool: + def __eq__(self, other: 'LogMessageSourceHandler') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventCalloutCalloutRequest') -> bool: + def __ne__(self, other: 'LogMessageSourceHandler') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MethodEnum(str, Enum): - """ - The REST method of the request. - """ - - GET = 'get' - POST = 'post' - PUT = 'put' - DELETE = 'delete' - PATCH = 'patch' - -class TurnEventCalloutCalloutResponse: +class LogMessageSourceStep(LogMessageSource): """ - TurnEventCalloutCalloutResponse. + An object that identifies the dialog element that generated the error message. - :param str body: (optional) The final response string. This response is a - composition of every partial chunk received from the stream. - :param int status_code: (optional) The final status code of the response. - :param dict last_event: (optional) The response from the last chunk received - from the response stream. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the error + message. + :param str step: The unique identifier of the step that generated the error + message. """ def __init__( self, - *, - body: Optional[str] = None, - status_code: Optional[int] = None, - last_event: Optional[dict] = None, + type: str, + action: str, + step: str, ) -> None: """ - Initialize a TurnEventCalloutCalloutResponse object. + Initialize a LogMessageSourceStep object. - :param str body: (optional) The final response string. This response is a - composition of every partial chunk received from the stream. - :param int status_code: (optional) The final status code of the response. - :param dict last_event: (optional) The response from the last chunk - received from the response stream. + :param str type: A string that indicates the type of dialog element that + generated the error message. + :param str action: The unique identifier of the action that generated the + error message. + :param str step: The unique identifier of the step that generated the error + message. """ - self.body = body - self.status_code = status_code - self.last_event = last_event + # pylint: disable=super-init-not-called + self.type = type + self.action = action + self.step = step @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutCalloutResponse': - """Initialize a TurnEventCalloutCalloutResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogMessageSourceStep': + """Initialize a LogMessageSourceStep object from a json dictionary.""" args = {} - if (body := _dict.get('body')) is not None: - args['body'] = body - if (status_code := _dict.get('status_code')) is not None: - args['status_code'] = status_code - if (last_event := _dict.get('last_event')) is not None: - args['last_event'] = last_event + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError( + 'Required property \'type\' not present in LogMessageSourceStep JSON' + ) + if (action := _dict.get('action')) is not None: + args['action'] = action + else: + raise ValueError( + 'Required property \'action\' not present in LogMessageSourceStep JSON' + ) + if (step := _dict.get('step')) is not None: + args['step'] = step + else: + raise ValueError( + 'Required property \'step\' not present in LogMessageSourceStep JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventCalloutCalloutResponse object from a json dictionary.""" + """Initialize a LogMessageSourceStep object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'body') and self.body is not None: - _dict['body'] = self.body - if hasattr(self, 'status_code') and self.status_code is not None: - _dict['status_code'] = self.status_code - if hasattr(self, 'last_event') and self.last_event is not None: - _dict['last_event'] = self.last_event + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step return _dict def _to_dict(self): @@ -15144,59 +18674,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventCalloutCalloutResponse object.""" + """Return a `str` version of this LogMessageSourceStep object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventCalloutCalloutResponse') -> bool: + def __eq__(self, other: 'LogMessageSourceStep') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventCalloutCalloutResponse') -> bool: + def __ne__(self, other: 'LogMessageSourceStep') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TurnEventCalloutError: +class MessageOutputDebugTurnEventTurnEventActionFinished( + MessageOutputDebugTurnEvent): """ - TurnEventCalloutError. + MessageOutputDebugTurnEventTurnEventActionFinished. - :param str message: (optional) Any error message returned by a failed call to an - external service. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str reason: (optional) The reason the action finished processing. + :param dict action_variables: (optional) The state of all action variables at + the time the action finished. """ def __init__( self, *, - message: Optional[str] = None, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + action_start_time: Optional[str] = None, + condition_type: Optional[str] = None, + reason: Optional[str] = None, + action_variables: Optional[dict] = None, ) -> None: """ - Initialize a TurnEventCalloutError object. + Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object. - :param str message: (optional) Any error message returned by a failed call - to an external service. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str reason: (optional) The reason the action finished processing. + :param dict action_variables: (optional) The state of all action variables + at the time the action finished. """ - self.message = message + # pylint: disable=super-init-not-called + self.event = event + self.source = source + self.action_start_time = action_start_time + self.condition_type = condition_type + self.reason = reason + self.action_variables = action_variables @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventCalloutError': - """Initialize a TurnEventCalloutError object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventActionFinished': + """Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object from a json dictionary.""" args = {} - if (message := _dict.get('message')) is not None: - args['message'] = message + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason + if (action_variables := _dict.get('action_variables')) is not None: + args['action_variables'] = action_variables return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventCalloutError object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type + if hasattr(self, 'reason') and self.reason is not None: + _dict['reason'] = self.reason + if hasattr(self, + 'action_variables') and self.action_variables is not None: + _dict['action_variables'] = self.action_variables return _dict def _to_dict(self): @@ -15204,84 +18787,115 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventCalloutError object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventActionFinished object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventCalloutError') -> bool: + def __eq__( + self, other: 'MessageOutputDebugTurnEventTurnEventActionFinished' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventCalloutError') -> bool: + def __ne__( + self, other: 'MessageOutputDebugTurnEventTurnEventActionFinished' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionTypeEnum(str, Enum): + """ + The type of condition (if any) that is defined for the action. + """ -class TurnEventNodeSource: + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' + + class ReasonEnum(str, Enum): + """ + The reason the action finished processing. + """ + + ALL_STEPS_DONE = 'all_steps_done' + NO_STEPS_VISITED = 'no_steps_visited' + ENDED_BY_STEP = 'ended_by_step' + CONNECT_TO_AGENT = 'connect_to_agent' + MAX_RETRIES_REACHED = 'max_retries_reached' + FALLBACK = 'fallback' + + +class MessageOutputDebugTurnEventTurnEventActionRoutingDenied( + MessageOutputDebugTurnEvent): """ - TurnEventNodeSource. + MessageOutputDebugTurnEventTurnEventActionRoutingDenied. - :param str type: (optional) The type of turn event. - :param str dialog_node: (optional) A dialog node that was visited during - processing of the input message. - :param str title: (optional) The title of the dialog node. - :param str condition: (optional) The condition that triggered the dialog node. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str reason: (optional) The reason the action was visited. """ def __init__( self, *, - type: Optional[str] = None, - dialog_node: Optional[str] = None, - title: Optional[str] = None, - condition: Optional[str] = None, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + condition_type: Optional[str] = None, + reason: Optional[str] = None, ) -> None: """ - Initialize a TurnEventNodeSource object. + Initialize a MessageOutputDebugTurnEventTurnEventActionRoutingDenied object. - :param str type: (optional) The type of turn event. - :param str dialog_node: (optional) A dialog node that was visited during - processing of the input message. - :param str title: (optional) The title of the dialog node. - :param str condition: (optional) The condition that triggered the dialog - node. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str reason: (optional) The reason the action was visited. """ - self.type = type - self.dialog_node = dialog_node - self.title = title - self.condition = condition + # pylint: disable=super-init-not-called + self.event = event + self.source = source + self.condition_type = condition_type + self.reason = reason @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventNodeSource': - """Initialize a TurnEventNodeSource object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied': + """Initialize a MessageOutputDebugTurnEventTurnEventActionRoutingDenied object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - if (dialog_node := _dict.get('dialog_node')) is not None: - args['dialog_node'] = dialog_node - if (title := _dict.get('title')) is not None: - args['title'] = title - if (condition := _dict.get('condition')) is not None: - args['condition'] = condition + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventNodeSource object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventActionRoutingDenied object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'dialog_node') and self.dialog_node is not None: - _dict['dialog_node'] = self.dialog_node - if hasattr(self, 'title') and self.title is not None: - _dict['title'] = self.title - if hasattr(self, 'condition') and self.condition is not None: - _dict['condition'] = self.condition + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type + if hasattr(self, 'reason') and self.reason is not None: + _dict['reason'] = self.reason return _dict def _to_dict(self): @@ -15289,66 +18903,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventNodeSource object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventActionRoutingDenied object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventNodeSource') -> bool: + def __eq__( + self, other: 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventNodeSource') -> bool: + def __ne__( + self, other: 'MessageOutputDebugTurnEventTurnEventActionRoutingDenied' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ConditionTypeEnum(str, Enum): """ - The type of turn event. + The type of condition (if any) that is defined for the action. """ - DIALOG_NODE = 'dialog_node' + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' + + class ReasonEnum(str, Enum): + """ + The reason the action was visited. + """ + ACTION_CONDITIONS_FAILED = 'action_conditions_failed' -class TurnEventSearchError: + +class MessageOutputDebugTurnEventTurnEventActionVisited( + MessageOutputDebugTurnEvent): """ - TurnEventSearchError. + MessageOutputDebugTurnEventTurnEventActionVisited. - :param str message: (optional) Any error message returned by a failed call to a - search skill. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str reason: (optional) The reason the action was visited. + :param str result_variable: (optional) The variable where the result of the call + to the action is stored. Included only if **reason**=`subaction_return`. """ def __init__( self, *, - message: Optional[str] = None, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + action_start_time: Optional[str] = None, + condition_type: Optional[str] = None, + reason: Optional[str] = None, + result_variable: Optional[str] = None, ) -> None: """ - Initialize a TurnEventSearchError object. + Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object. - :param str message: (optional) Any error message returned by a failed call - to a search skill. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str reason: (optional) The reason the action was visited. + :param str result_variable: (optional) The variable where the result of the + call to the action is stored. Included only if + **reason**=`subaction_return`. """ - self.message = message + # pylint: disable=super-init-not-called + self.event = event + self.source = source + self.action_start_time = action_start_time + self.condition_type = condition_type + self.reason = reason + self.result_variable = result_variable @classmethod - def from_dict(cls, _dict: Dict) -> 'TurnEventSearchError': - """Initialize a TurnEventSearchError object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventActionVisited': + """Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object from a json dictionary.""" args = {} - if (message := _dict.get('message')) is not None: - args['message'] = message + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason + if (result_variable := _dict.get('result_variable')) is not None: + args['result_variable'] = result_variable return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TurnEventSearchError object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type + if hasattr(self, 'reason') and self.reason is not None: + _dict['reason'] = self.reason + if hasattr(self, + 'result_variable') and self.result_variable is not None: + _dict['result_variable'] = self.result_variable return _dict def _to_dict(self): @@ -15356,65 +19037,120 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TurnEventSearchError object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventActionVisited object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TurnEventSearchError') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventActionVisited') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TurnEventSearchError') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventActionVisited') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionTypeEnum(str, Enum): + """ + The type of condition (if any) that is defined for the action. + """ + + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' -class UpdateEnvironmentOrchestration: + class ReasonEnum(str, Enum): + """ + The reason the action was visited. + """ + + INTENT = 'intent' + INVOKE_SUBACTION = 'invoke_subaction' + SUBACTION_RETURN = 'subaction_return' + INVOKE_EXTERNAL = 'invoke_external' + TOPIC_SWITCH = 'topic_switch' + TOPIC_RETURN = 'topic_return' + AGENT_REQUESTED = 'agent_requested' + STEP_VALIDATION_FAILED = 'step_validation_failed' + NO_ACTION_MATCHES = 'no_action_matches' + + +class MessageOutputDebugTurnEventTurnEventCallout(MessageOutputDebugTurnEvent): """ - The search skill orchestration settings for the environment. + MessageOutputDebugTurnEventTurnEventCallout. - :param bool search_skill_fallback: (optional) Whether to fall back to a search - skill when responding to messages that do not match any intent or action defined - in dialog or action skills. (If no search skill is configured for the - environment, this property is ignored.). + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param TurnEventCalloutCallout callout: (optional) + :param TurnEventCalloutError error: (optional) """ def __init__( self, *, - search_skill_fallback: Optional[bool] = None, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + callout: Optional['TurnEventCalloutCallout'] = None, + error: Optional['TurnEventCalloutError'] = None, ) -> None: """ - Initialize a UpdateEnvironmentOrchestration object. + Initialize a MessageOutputDebugTurnEventTurnEventCallout object. - :param bool search_skill_fallback: (optional) Whether to fall back to a - search skill when responding to messages that do not match any intent or - action defined in dialog or action skills. (If no search skill is - configured for the environment, this property is ignored.). + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param TurnEventCalloutCallout callout: (optional) + :param TurnEventCalloutError error: (optional) """ - self.search_skill_fallback = search_skill_fallback + # pylint: disable=super-init-not-called + self.event = event + self.source = source + self.callout = callout + self.error = error @classmethod - def from_dict(cls, _dict: Dict) -> 'UpdateEnvironmentOrchestration': - """Initialize a UpdateEnvironmentOrchestration object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventCallout': + """Initialize a MessageOutputDebugTurnEventTurnEventCallout object from a json dictionary.""" args = {} - if (search_skill_fallback := - _dict.get('search_skill_fallback')) is not None: - args['search_skill_fallback'] = search_skill_fallback + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (callout := _dict.get('callout')) is not None: + args['callout'] = TurnEventCalloutCallout.from_dict(callout) + if (error := _dict.get('error')) is not None: + args['error'] = TurnEventCalloutError.from_dict(error) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a UpdateEnvironmentOrchestration object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventCallout object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'search_skill_fallback' - ) and self.search_skill_fallback is not None: - _dict['search_skill_fallback'] = self.search_skill_fallback + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'callout') and self.callout is not None: + if isinstance(self.callout, dict): + _dict['callout'] = self.callout + else: + _dict['callout'] = self.callout.to_dict() + if hasattr(self, 'error') and self.error is not None: + if isinstance(self.error, dict): + _dict['error'] = self.error + else: + _dict['error'] = self.error.to_dict() return _dict def _to_dict(self): @@ -15422,57 +19158,91 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this UpdateEnvironmentOrchestration object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventCallout object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'UpdateEnvironmentOrchestration') -> bool: + def __eq__(self, + other: 'MessageOutputDebugTurnEventTurnEventCallout') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'UpdateEnvironmentOrchestration') -> bool: + def __ne__(self, + other: 'MessageOutputDebugTurnEventTurnEventCallout') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class UpdateEnvironmentReleaseReference: +class MessageOutputDebugTurnEventTurnEventClientActions( + MessageOutputDebugTurnEvent): """ - An object describing the release that is currently deployed in the environment. + MessageOutputDebugTurnEventTurnEventClientActions. - :param str release: (optional) The name of the deployed release. + :param str event: (optional) The type of turn event. + :param TurnEventStepSource source: (optional) + :param List[ClientAction] client_actions: (optional) An array of client actions. """ def __init__( self, *, - release: Optional[str] = None, + event: Optional[str] = None, + source: Optional['TurnEventStepSource'] = None, + client_actions: Optional[List['ClientAction']] = None, ) -> None: """ - Initialize a UpdateEnvironmentReleaseReference object. + Initialize a MessageOutputDebugTurnEventTurnEventClientActions object. - :param str release: (optional) The name of the deployed release. + :param str event: (optional) The type of turn event. + :param TurnEventStepSource source: (optional) + :param List[ClientAction] client_actions: (optional) An array of client + actions. """ - self.release = release + # pylint: disable=super-init-not-called + self.event = event + self.source = source + self.client_actions = client_actions @classmethod - def from_dict(cls, _dict: Dict) -> 'UpdateEnvironmentReleaseReference': - """Initialize a UpdateEnvironmentReleaseReference object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventClientActions': + """Initialize a MessageOutputDebugTurnEventTurnEventClientActions object from a json dictionary.""" args = {} - if (release := _dict.get('release')) is not None: - args['release'] = release + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventStepSource.from_dict(source) + if (client_actions := _dict.get('client_actions')) is not None: + args['client_actions'] = [ + ClientAction.from_dict(v) for v in client_actions + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a UpdateEnvironmentReleaseReference object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventClientActions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'release') and self.release is not None: - _dict['release'] = self.release + _dict = {} + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'client_actions') and self.client_actions is not None: + client_actions_list = [] + for v in self.client_actions: + if isinstance(v, dict): + client_actions_list.append(v) + else: + client_actions_list.append(v.to_dict()) + _dict['client_actions'] = client_actions_list return _dict def _to_dict(self): @@ -15480,66 +19250,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this UpdateEnvironmentReleaseReference object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventClientActions object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'UpdateEnvironmentReleaseReference') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventClientActions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'UpdateEnvironmentReleaseReference') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventClientActions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CompleteItem(RuntimeResponseGeneric): +class MessageOutputDebugTurnEventTurnEventConversationalSearchEnd( + MessageOutputDebugTurnEvent): """ - CompleteItem. + MessageOutputDebugTurnEventTurnEventConversationalSearchEnd. - :param Metadata streaming_metadata: + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. """ def __init__( self, - streaming_metadata: 'Metadata', + *, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + condition_type: Optional[str] = None, ) -> None: """ - Initialize a CompleteItem object. + Initialize a MessageOutputDebugTurnEventTurnEventConversationalSearchEnd object. - :param Metadata streaming_metadata: + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. """ # pylint: disable=super-init-not-called - self.streaming_metadata = streaming_metadata + self.event = event + self.source = source + self.condition_type = condition_type @classmethod - def from_dict(cls, _dict: Dict) -> 'CompleteItem': - """Initialize a CompleteItem object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd': + """Initialize a MessageOutputDebugTurnEventTurnEventConversationalSearchEnd object from a json dictionary.""" args = {} - if (streaming_metadata := _dict.get('streaming_metadata')) is not None: - args['streaming_metadata'] = Metadata.from_dict(streaming_metadata) - else: - raise ValueError( - 'Required property \'streaming_metadata\' not present in CompleteItem JSON' - ) + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CompleteItem object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventConversationalSearchEnd object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr( - self, - 'streaming_metadata') and self.streaming_metadata is not None: - if isinstance(self.streaming_metadata, dict): - _dict['streaming_metadata'] = self.streaming_metadata + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source else: - _dict['streaming_metadata'] = self.streaming_metadata.to_dict() + _dict['source'] = self.source.to_dict() + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type return _dict def _to_dict(self): @@ -15547,77 +19337,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CompleteItem object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventConversationalSearchEnd object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CompleteItem') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CompleteItem') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventConversationalSearchEnd' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionTypeEnum(str, Enum): + """ + The type of condition (if any) that is defined for the action. + """ -class LogMessageSourceAction(LogMessageSource): + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' + + +class MessageOutputDebugTurnEventTurnEventGenerativeAICalled( + MessageOutputDebugTurnEvent): """ - An object that identifies the dialog element that generated the error message. + MessageOutputDebugTurnEventTurnEventGenerativeAICalled. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the error - message. + :param str event: (optional) The type of turn event. + :param dict source: (optional) For internal use only. + :param str generative_ai_start_time: (optional) The time when generative ai + started processing the message. + :param GenerativeAITask generative_ai: (optional) + :param TurnEventGenerativeAICalledCallout callout: (optional) + :param TurnEventGenerativeAICalledMetrics metrics: (optional) """ def __init__( self, - type: str, - action: str, + *, + event: Optional[str] = None, + source: Optional[dict] = None, + generative_ai_start_time: Optional[str] = None, + generative_ai: Optional['GenerativeAITask'] = None, + callout: Optional['TurnEventGenerativeAICalledCallout'] = None, + metrics: Optional['TurnEventGenerativeAICalledMetrics'] = None, ) -> None: """ - Initialize a LogMessageSourceAction object. + Initialize a MessageOutputDebugTurnEventTurnEventGenerativeAICalled object. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the - error message. + :param str event: (optional) The type of turn event. + :param dict source: (optional) For internal use only. + :param str generative_ai_start_time: (optional) The time when generative ai + started processing the message. + :param GenerativeAITask generative_ai: (optional) + :param TurnEventGenerativeAICalledCallout callout: (optional) + :param TurnEventGenerativeAICalledMetrics metrics: (optional) """ # pylint: disable=super-init-not-called - self.type = type - self.action = action + self.event = event + self.source = source + self.generative_ai_start_time = generative_ai_start_time + self.generative_ai = generative_ai + self.callout = callout + self.metrics = metrics @classmethod - def from_dict(cls, _dict: Dict) -> 'LogMessageSourceAction': - """Initialize a LogMessageSourceAction object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled': + """Initialize a MessageOutputDebugTurnEventTurnEventGenerativeAICalled object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in LogMessageSourceAction JSON' - ) - if (action := _dict.get('action')) is not None: - args['action'] = action - else: - raise ValueError( - 'Required property \'action\' not present in LogMessageSourceAction JSON' - ) + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = source + if (generative_ai_start_time := + _dict.get('generative_ai_start_time')) is not None: + args['generative_ai_start_time'] = generative_ai_start_time + if (generative_ai := _dict.get('generative_ai')) is not None: + args['generative_ai'] = GenerativeAITask.from_dict(generative_ai) + if (callout := _dict.get('callout')) is not None: + args['callout'] = TurnEventGenerativeAICalledCallout.from_dict( + callout) + if (metrics := _dict.get('metrics')) is not None: + args['metrics'] = TurnEventGenerativeAICalledMetrics.from_dict( + metrics) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogMessageSourceAction object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventGenerativeAICalled object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'generative_ai_start_time' + ) and self.generative_ai_start_time is not None: + _dict['generative_ai_start_time'] = self.generative_ai_start_time + if hasattr(self, 'generative_ai') and self.generative_ai is not None: + if isinstance(self.generative_ai, dict): + _dict['generative_ai'] = self.generative_ai + else: + _dict['generative_ai'] = self.generative_ai.to_dict() + if hasattr(self, 'callout') and self.callout is not None: + if isinstance(self.callout, dict): + _dict['callout'] = self.callout + else: + _dict['callout'] = self.callout.to_dict() + if hasattr(self, 'metrics') and self.metrics is not None: + if isinstance(self.metrics, dict): + _dict['metrics'] = self.metrics + else: + _dict['metrics'] = self.metrics.to_dict() return _dict def _to_dict(self): @@ -15625,77 +19469,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogMessageSourceAction object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventGenerativeAICalled object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogMessageSourceAction') -> bool: + def __eq__( + self, other: 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogMessageSourceAction') -> bool: + def __ne__( + self, other: 'MessageOutputDebugTurnEventTurnEventGenerativeAICalled' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogMessageSourceDialogNode(LogMessageSource): +class MessageOutputDebugTurnEventTurnEventHandlerVisited( + MessageOutputDebugTurnEvent): """ - An object that identifies the dialog element that generated the error message. + MessageOutputDebugTurnEventTurnEventHandlerVisited. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str dialog_node: The unique identifier of the dialog node that generated - the error message. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. """ def __init__( self, - type: str, - dialog_node: str, + *, + event: Optional[str] = None, + source: Optional['TurnEventActionSource'] = None, + action_start_time: Optional[str] = None, ) -> None: """ - Initialize a LogMessageSourceDialogNode object. + Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str dialog_node: The unique identifier of the dialog node that - generated the error message. + :param str event: (optional) The type of turn event. + :param TurnEventActionSource source: (optional) + :param str action_start_time: (optional) The time when the action started + processing the message. """ # pylint: disable=super-init-not-called - self.type = type - self.dialog_node = dialog_node + self.event = event + self.source = source + self.action_start_time = action_start_time @classmethod - def from_dict(cls, _dict: Dict) -> 'LogMessageSourceDialogNode': - """Initialize a LogMessageSourceDialogNode object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventHandlerVisited': + """Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in LogMessageSourceDialogNode JSON' - ) - if (dialog_node := _dict.get('dialog_node')) is not None: - args['dialog_node'] = dialog_node - else: - raise ValueError( - 'Required property \'dialog_node\' not present in LogMessageSourceDialogNode JSON' - ) + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventActionSource.from_dict(source) + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogMessageSourceDialogNode object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'dialog_node') and self.dialog_node is not None: - _dict['dialog_node'] = self.dialog_node + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time return _dict def _to_dict(self): @@ -15703,102 +19557,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogMessageSourceDialogNode object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventHandlerVisited object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogMessageSourceDialogNode') -> bool: + def __eq__( + self, other: 'MessageOutputDebugTurnEventTurnEventHandlerVisited' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogMessageSourceDialogNode') -> bool: + def __ne__( + self, other: 'MessageOutputDebugTurnEventTurnEventHandlerVisited' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LogMessageSourceHandler(LogMessageSource): +class MessageOutputDebugTurnEventTurnEventManualRoute( + MessageOutputDebugTurnEvent): """ - An object that identifies the dialog element that generated the error message. + MessageOutputDebugTurnEventTurnEventManualRoute. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the error - message. - :param str step: (optional) The unique identifier of the step that generated the - error message. - :param str handler: The unique identifier of the handler that generated the - error message. + :param str event: (optional) The type of turn event. + :param TurnEventStepSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str route_name: (optional) The name of the route. """ def __init__( self, - type: str, - action: str, - handler: str, *, - step: Optional[str] = None, + event: Optional[str] = None, + source: Optional['TurnEventStepSource'] = None, + condition_type: Optional[str] = None, + action_start_time: Optional[str] = None, + route_name: Optional[str] = None, ) -> None: """ - Initialize a LogMessageSourceHandler object. + Initialize a MessageOutputDebugTurnEventTurnEventManualRoute object. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the - error message. - :param str handler: The unique identifier of the handler that generated the - error message. - :param str step: (optional) The unique identifier of the step that - generated the error message. + :param str event: (optional) The type of turn event. + :param TurnEventStepSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param str route_name: (optional) The name of the route. """ # pylint: disable=super-init-not-called - self.type = type - self.action = action - self.step = step - self.handler = handler + self.event = event + self.source = source + self.condition_type = condition_type + self.action_start_time = action_start_time + self.route_name = route_name @classmethod - def from_dict(cls, _dict: Dict) -> 'LogMessageSourceHandler': - """Initialize a LogMessageSourceHandler object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventManualRoute': + """Initialize a MessageOutputDebugTurnEventTurnEventManualRoute object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in LogMessageSourceHandler JSON' - ) - if (action := _dict.get('action')) is not None: - args['action'] = action - else: - raise ValueError( - 'Required property \'action\' not present in LogMessageSourceHandler JSON' - ) - if (step := _dict.get('step')) is not None: - args['step'] = step - if (handler := _dict.get('handler')) is not None: - args['handler'] = handler - else: - raise ValueError( - 'Required property \'handler\' not present in LogMessageSourceHandler JSON' - ) + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventStepSource.from_dict(source) + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time + if (route_name := _dict.get('route_name')) is not None: + args['route_name'] = route_name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogMessageSourceHandler object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventManualRoute object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'handler') and self.handler is not None: - _dict['handler'] = self.handler + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type + if hasattr(self, + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'route_name') and self.route_name is not None: + _dict['route_name'] = self.route_name return _dict def _to_dict(self): @@ -15806,91 +19663,93 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogMessageSourceHandler object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventManualRoute object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogMessageSourceHandler') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventManualRoute') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogMessageSourceHandler') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventManualRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionTypeEnum(str, Enum): + """ + The type of condition (if any) that is defined for the action. + """ -class LogMessageSourceStep(LogMessageSource): + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' + + +class MessageOutputDebugTurnEventTurnEventNodeVisited( + MessageOutputDebugTurnEvent): """ - An object that identifies the dialog element that generated the error message. + MessageOutputDebugTurnEventTurnEventNodeVisited. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the error - message. - :param str step: The unique identifier of the step that generated the error - message. + :param str event: (optional) The type of turn event. + :param TurnEventNodeSource source: (optional) + :param str reason: (optional) The reason the dialog node was visited. """ def __init__( self, - type: str, - action: str, - step: str, + *, + event: Optional[str] = None, + source: Optional['TurnEventNodeSource'] = None, + reason: Optional[str] = None, ) -> None: """ - Initialize a LogMessageSourceStep object. + Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object. - :param str type: A string that indicates the type of dialog element that - generated the error message. - :param str action: The unique identifier of the action that generated the - error message. - :param str step: The unique identifier of the step that generated the error - message. + :param str event: (optional) The type of turn event. + :param TurnEventNodeSource source: (optional) + :param str reason: (optional) The reason the dialog node was visited. """ # pylint: disable=super-init-not-called - self.type = type - self.action = action - self.step = step + self.event = event + self.source = source + self.reason = reason @classmethod - def from_dict(cls, _dict: Dict) -> 'LogMessageSourceStep': - """Initialize a LogMessageSourceStep object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventNodeVisited': + """Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError( - 'Required property \'type\' not present in LogMessageSourceStep JSON' - ) - if (action := _dict.get('action')) is not None: - args['action'] = action - else: - raise ValueError( - 'Required property \'action\' not present in LogMessageSourceStep JSON' - ) - if (step := _dict.get('step')) is not None: - args['step'] = step - else: - raise ValueError( - 'Required property \'step\' not present in LogMessageSourceStep JSON' - ) + if (event := _dict.get('event')) is not None: + args['event'] = event + if (source := _dict.get('source')) is not None: + args['source'] = TurnEventNodeSource.from_dict(source) + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LogMessageSourceStep object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'reason') and self.reason is not None: + _dict['reason'] = self.reason return _dict def _to_dict(self): @@ -15898,34 +19757,43 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LogMessageSourceStep object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventNodeVisited object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LogMessageSourceStep') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventNodeVisited') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LogMessageSourceStep') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventNodeVisited') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ReasonEnum(str, Enum): + """ + The reason the dialog node was visited. + """ -class MessageOutputDebugTurnEventTurnEventActionFinished( - MessageOutputDebugTurnEvent): + WELCOME = 'welcome' + BRANCH_START = 'branch_start' + TOPIC_SWITCH = 'topic_switch' + TOPIC_RETURN = 'topic_return' + TOPIC_SWITCH_WITHOUT_RETURN = 'topic_switch_without_return' + JUMP = 'jump' + + +class MessageOutputDebugTurnEventTurnEventSearch(MessageOutputDebugTurnEvent): """ - MessageOutputDebugTurnEventTurnEventActionFinished. + MessageOutputDebugTurnEventTurnEventSearch. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. - :param str condition_type: (optional) The type of condition (if any) that is - defined for the action. - :param str reason: (optional) The reason the action finished processing. - :param dict action_variables: (optional) The state of all action variables at - the time the action finished. + :param TurnEventSearchError error: (optional) """ def __init__( @@ -15933,55 +19801,36 @@ def __init__( *, event: Optional[str] = None, source: Optional['TurnEventActionSource'] = None, - action_start_time: Optional[str] = None, - condition_type: Optional[str] = None, - reason: Optional[str] = None, - action_variables: Optional[dict] = None, + error: Optional['TurnEventSearchError'] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object. + Initialize a MessageOutputDebugTurnEventTurnEventSearch object. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. - :param str condition_type: (optional) The type of condition (if any) that - is defined for the action. - :param str reason: (optional) The reason the action finished processing. - :param dict action_variables: (optional) The state of all action variables - at the time the action finished. + :param TurnEventSearchError error: (optional) """ # pylint: disable=super-init-not-called self.event = event self.source = source - self.action_start_time = action_start_time - self.condition_type = condition_type - self.reason = reason - self.action_variables = action_variables + self.error = error @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'MessageOutputDebugTurnEventTurnEventActionFinished': - """Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventSearch': + """Initialize a MessageOutputDebugTurnEventTurnEventSearch object from a json dictionary.""" args = {} if (event := _dict.get('event')) is not None: args['event'] = event if (source := _dict.get('source')) is not None: args['source'] = TurnEventActionSource.from_dict(source) - if (action_start_time := _dict.get('action_start_time')) is not None: - args['action_start_time'] = action_start_time - if (condition_type := _dict.get('condition_type')) is not None: - args['condition_type'] = condition_type - if (reason := _dict.get('reason')) is not None: - args['reason'] = reason - if (action_variables := _dict.get('action_variables')) is not None: - args['action_variables'] = action_variables + if (error := _dict.get('error')) is not None: + args['error'] = TurnEventSearchError.from_dict(error) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventActionFinished object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventSearch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -15994,16 +19843,11 @@ def to_dict(self) -> Dict: _dict['source'] = self.source else: _dict['source'] = self.source.to_dict() - if hasattr(self, - 'action_start_time') and self.action_start_time is not None: - _dict['action_start_time'] = self.action_start_time - if hasattr(self, 'condition_type') and self.condition_type is not None: - _dict['condition_type'] = self.condition_type - if hasattr(self, 'reason') and self.reason is not None: - _dict['reason'] = self.reason - if hasattr(self, - 'action_variables') and self.action_variables is not None: - _dict['action_variables'] = self.action_variables + if hasattr(self, 'error') and self.error is not None: + if isinstance(self.error, dict): + _dict['error'] = self.error + else: + _dict['error'] = self.error.to_dict() return _dict def _to_dict(self): @@ -16011,59 +19855,36 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventActionFinished object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventSearch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'MessageOutputDebugTurnEventTurnEventActionFinished' - ) -> bool: + def __eq__(self, + other: 'MessageOutputDebugTurnEventTurnEventSearch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, other: 'MessageOutputDebugTurnEventTurnEventActionFinished' - ) -> bool: + def __ne__(self, + other: 'MessageOutputDebugTurnEventTurnEventSearch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConditionTypeEnum(str, Enum): - """ - The type of condition (if any) that is defined for the action. - """ - - USER_DEFINED = 'user_defined' - WELCOME = 'welcome' - ANYTHING_ELSE = 'anything_else' - - class ReasonEnum(str, Enum): - """ - The reason the action finished processing. - """ - - ALL_STEPS_DONE = 'all_steps_done' - NO_STEPS_VISITED = 'no_steps_visited' - ENDED_BY_STEP = 'ended_by_step' - CONNECT_TO_AGENT = 'connect_to_agent' - MAX_RETRIES_REACHED = 'max_retries_reached' - FALLBACK = 'fallback' - -class MessageOutputDebugTurnEventTurnEventActionVisited( +class MessageOutputDebugTurnEventTurnEventStepAnswered( MessageOutputDebugTurnEvent): """ - MessageOutputDebugTurnEventTurnEventActionVisited. + MessageOutputDebugTurnEventTurnEventStepAnswered. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. :param str condition_type: (optional) The type of condition (if any) that is defined for the action. - :param str reason: (optional) The reason the action was visited. - :param str result_variable: (optional) The variable where the result of the call - to the action is stored. Included only if **reason**=`subaction_return`. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param bool prompted: (optional) Whether the step was answered in response to a + prompt from the assistant. If this property is `false`, the user provided the + answer without visiting the step. """ def __init__( @@ -16071,56 +19892,51 @@ def __init__( *, event: Optional[str] = None, source: Optional['TurnEventActionSource'] = None, - action_start_time: Optional[str] = None, condition_type: Optional[str] = None, - reason: Optional[str] = None, - result_variable: Optional[str] = None, + action_start_time: Optional[str] = None, + prompted: Optional[bool] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object. + Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. :param str condition_type: (optional) The type of condition (if any) that is defined for the action. - :param str reason: (optional) The reason the action was visited. - :param str result_variable: (optional) The variable where the result of the - call to the action is stored. Included only if - **reason**=`subaction_return`. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param bool prompted: (optional) Whether the step was answered in response + to a prompt from the assistant. If this property is `false`, the user + provided the answer without visiting the step. """ # pylint: disable=super-init-not-called self.event = event self.source = source - self.action_start_time = action_start_time self.condition_type = condition_type - self.reason = reason - self.result_variable = result_variable + self.action_start_time = action_start_time + self.prompted = prompted @classmethod def from_dict( cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventActionVisited': - """Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object from a json dictionary.""" + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventStepAnswered': + """Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object from a json dictionary.""" args = {} if (event := _dict.get('event')) is not None: args['event'] = event if (source := _dict.get('source')) is not None: args['source'] = TurnEventActionSource.from_dict(source) - if (action_start_time := _dict.get('action_start_time')) is not None: - args['action_start_time'] = action_start_time if (condition_type := _dict.get('condition_type')) is not None: args['condition_type'] = condition_type - if (reason := _dict.get('reason')) is not None: - args['reason'] = reason - if (result_variable := _dict.get('result_variable')) is not None: - args['result_variable'] = result_variable + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time + if (prompted := _dict.get('prompted')) is not None: + args['prompted'] = prompted return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventActionVisited object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -16133,16 +19949,13 @@ def to_dict(self) -> Dict: _dict['source'] = self.source else: _dict['source'] = self.source.to_dict() - if hasattr(self, - 'action_start_time') and self.action_start_time is not None: - _dict['action_start_time'] = self.action_start_time if hasattr(self, 'condition_type') and self.condition_type is not None: _dict['condition_type'] = self.condition_type - if hasattr(self, 'reason') and self.reason is not None: - _dict['reason'] = self.reason if hasattr(self, - 'result_variable') and self.result_variable is not None: - _dict['result_variable'] = self.result_variable + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'prompted') and self.prompted is not None: + _dict['prompted'] = self.prompted return _dict def _to_dict(self): @@ -16150,12 +19963,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventActionVisited object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventStepAnswered object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( self, - other: 'MessageOutputDebugTurnEventTurnEventActionVisited') -> bool: + other: 'MessageOutputDebugTurnEventTurnEventStepAnswered') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False @@ -16163,7 +19976,7 @@ def __eq__( def __ne__( self, - other: 'MessageOutputDebugTurnEventTurnEventActionVisited') -> bool: + other: 'MessageOutputDebugTurnEventTurnEventStepAnswered') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -16176,30 +19989,20 @@ class ConditionTypeEnum(str, Enum): WELCOME = 'welcome' ANYTHING_ELSE = 'anything_else' - class ReasonEnum(str, Enum): - """ - The reason the action was visited. - """ - - INTENT = 'intent' - INVOKE_SUBACTION = 'invoke_subaction' - SUBACTION_RETURN = 'subaction_return' - INVOKE_EXTERNAL = 'invoke_external' - TOPIC_SWITCH = 'topic_switch' - TOPIC_RETURN = 'topic_return' - AGENT_REQUESTED = 'agent_requested' - STEP_VALIDATION_FAILED = 'step_validation_failed' - NO_ACTION_MATCHES = 'no_action_matches' - -class MessageOutputDebugTurnEventTurnEventCallout(MessageOutputDebugTurnEvent): +class MessageOutputDebugTurnEventTurnEventStepVisited( + MessageOutputDebugTurnEvent): """ - MessageOutputDebugTurnEventTurnEventCallout. + MessageOutputDebugTurnEventTurnEventStepVisited. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param TurnEventCalloutCallout callout: (optional) - :param TurnEventCalloutError error: (optional) + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param bool has_question: (optional) Whether the step collects a customer + response. """ def __init__( @@ -16207,41 +20010,50 @@ def __init__( *, event: Optional[str] = None, source: Optional['TurnEventActionSource'] = None, - callout: Optional['TurnEventCalloutCallout'] = None, - error: Optional['TurnEventCalloutError'] = None, + condition_type: Optional[str] = None, + action_start_time: Optional[str] = None, + has_question: Optional[bool] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventCallout object. + Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object. :param str event: (optional) The type of turn event. :param TurnEventActionSource source: (optional) - :param TurnEventCalloutCallout callout: (optional) - :param TurnEventCalloutError error: (optional) + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str action_start_time: (optional) The time when the action started + processing the message. + :param bool has_question: (optional) Whether the step collects a customer + response. """ # pylint: disable=super-init-not-called self.event = event self.source = source - self.callout = callout - self.error = error + self.condition_type = condition_type + self.action_start_time = action_start_time + self.has_question = has_question @classmethod - def from_dict(cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventCallout': - """Initialize a MessageOutputDebugTurnEventTurnEventCallout object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventStepVisited': + """Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object from a json dictionary.""" args = {} if (event := _dict.get('event')) is not None: args['event'] = event if (source := _dict.get('source')) is not None: args['source'] = TurnEventActionSource.from_dict(source) - if (callout := _dict.get('callout')) is not None: - args['callout'] = TurnEventCalloutCallout.from_dict(callout) - if (error := _dict.get('error')) is not None: - args['error'] = TurnEventCalloutError.from_dict(error) + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type + if (action_start_time := _dict.get('action_start_time')) is not None: + args['action_start_time'] = action_start_time + if (has_question := _dict.get('has_question')) is not None: + args['has_question'] = has_question return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventCallout object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -16254,16 +20066,13 @@ def to_dict(self) -> Dict: _dict['source'] = self.source else: _dict['source'] = self.source.to_dict() - if hasattr(self, 'callout') and self.callout is not None: - if isinstance(self.callout, dict): - _dict['callout'] = self.callout - else: - _dict['callout'] = self.callout.to_dict() - if hasattr(self, 'error') and self.error is not None: - if isinstance(self.error, dict): - _dict['error'] = self.error - else: - _dict['error'] = self.error.to_dict() + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type + if hasattr(self, + 'action_start_time') and self.action_start_time is not None: + _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'has_question') and self.has_question is not None: + _dict['has_question'] = self.has_question return _dict def _to_dict(self): @@ -16271,85 +20080,92 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventCallout object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventStepVisited object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'MessageOutputDebugTurnEventTurnEventCallout') -> bool: + def __eq__( + self, + other: 'MessageOutputDebugTurnEventTurnEventStepVisited') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, - other: 'MessageOutputDebugTurnEventTurnEventCallout') -> bool: + def __ne__( + self, + other: 'MessageOutputDebugTurnEventTurnEventStepVisited') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionTypeEnum(str, Enum): + """ + The type of condition (if any) that is defined for the action. + """ + + USER_DEFINED = 'user_defined' + WELCOME = 'welcome' + ANYTHING_ELSE = 'anything_else' + -class MessageOutputDebugTurnEventTurnEventHandlerVisited( +class MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied( MessageOutputDebugTurnEvent): """ - MessageOutputDebugTurnEventTurnEventHandlerVisited. + MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied. :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. + :param List[RuntimeIntent] intents_denied: (optional) An array of denied + intents. """ def __init__( self, *, event: Optional[str] = None, - source: Optional['TurnEventActionSource'] = None, - action_start_time: Optional[str] = None, + intents_denied: Optional[List['RuntimeIntent']] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object. + Initialize a MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied object. :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str action_start_time: (optional) The time when the action started - processing the message. + :param List[RuntimeIntent] intents_denied: (optional) An array of denied + intents. """ # pylint: disable=super-init-not-called self.event = event - self.source = source - self.action_start_time = action_start_time + self.intents_denied = intents_denied @classmethod def from_dict( - cls, _dict: Dict - ) -> 'MessageOutputDebugTurnEventTurnEventHandlerVisited': - """Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object from a json dictionary.""" + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied': + """Initialize a MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied object from a json dictionary.""" args = {} if (event := _dict.get('event')) is not None: args['event'] = event - if (source := _dict.get('source')) is not None: - args['source'] = TurnEventActionSource.from_dict(source) - if (action_start_time := _dict.get('action_start_time')) is not None: - args['action_start_time'] = action_start_time + if (intents_denied := _dict.get('intents_denied')) is not None: + args['intents_denied'] = [ + RuntimeIntent.from_dict(v) for v in intents_denied + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventHandlerVisited object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'event') and self.event is not None: - _dict['event'] = self.event - if hasattr(self, 'source') and self.source is not None: - if isinstance(self.source, dict): - _dict['source'] = self.source - else: - _dict['source'] = self.source.to_dict() - if hasattr(self, - 'action_start_time') and self.action_start_time is not None: - _dict['action_start_time'] = self.action_start_time + if hasattr(self, 'event') and self.event is not None: + _dict['event'] = self.event + if hasattr(self, 'intents_denied') and self.intents_denied is not None: + intents_denied_list = [] + for v in self.intents_denied: + if isinstance(v, dict): + intents_denied_list.append(v) + else: + intents_denied_list.append(v.to_dict()) + _dict['intents_denied'] = intents_denied_list return _dict def _to_dict(self): @@ -16357,11 +20173,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventHandlerVisited object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: 'MessageOutputDebugTurnEventTurnEventHandlerVisited' + self, + other: 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -16369,58 +20186,67 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: 'MessageOutputDebugTurnEventTurnEventHandlerVisited' + self, + other: 'MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageOutputDebugTurnEventTurnEventNodeVisited( +class MessageOutputDebugTurnEventTurnEventTopicSwitchDenied( MessageOutputDebugTurnEvent): """ - MessageOutputDebugTurnEventTurnEventNodeVisited. + MessageOutputDebugTurnEventTurnEventTopicSwitchDenied. :param str event: (optional) The type of turn event. - :param TurnEventNodeSource source: (optional) - :param str reason: (optional) The reason the dialog node was visited. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that is + defined for the action. + :param str reason: (optional) The reason the action was visited. """ def __init__( self, *, event: Optional[str] = None, - source: Optional['TurnEventNodeSource'] = None, + source: Optional['TurnEventActionSource'] = None, + condition_type: Optional[str] = None, reason: Optional[str] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object. + Initialize a MessageOutputDebugTurnEventTurnEventTopicSwitchDenied object. :param str event: (optional) The type of turn event. - :param TurnEventNodeSource source: (optional) - :param str reason: (optional) The reason the dialog node was visited. + :param TurnEventActionSource source: (optional) + :param str condition_type: (optional) The type of condition (if any) that + is defined for the action. + :param str reason: (optional) The reason the action was visited. """ # pylint: disable=super-init-not-called self.event = event self.source = source + self.condition_type = condition_type self.reason = reason @classmethod def from_dict( - cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventNodeVisited': - """Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object from a json dictionary.""" + cls, _dict: Dict + ) -> 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied': + """Initialize a MessageOutputDebugTurnEventTurnEventTopicSwitchDenied object from a json dictionary.""" args = {} if (event := _dict.get('event')) is not None: args['event'] = event if (source := _dict.get('source')) is not None: - args['source'] = TurnEventNodeSource.from_dict(source) + args['source'] = TurnEventActionSource.from_dict(source) + if (condition_type := _dict.get('condition_type')) is not None: + args['condition_type'] = condition_type if (reason := _dict.get('reason')) is not None: args['reason'] = reason return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventNodeVisited object from a json dictionary.""" + """Initialize a MessageOutputDebugTurnEventTurnEventTopicSwitchDenied object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -16433,6 +20259,8 @@ def to_dict(self) -> Dict: _dict['source'] = self.source else: _dict['source'] = self.source.to_dict() + if hasattr(self, 'condition_type') and self.condition_type is not None: + _dict['condition_type'] = self.condition_type if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason return _dict @@ -16442,97 +20270,85 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventNodeVisited object.""" + """Return a `str` version of this MessageOutputDebugTurnEventTurnEventTopicSwitchDenied object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'MessageOutputDebugTurnEventTurnEventNodeVisited') -> bool: + self, other: 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'MessageOutputDebugTurnEventTurnEventNodeVisited') -> bool: + self, other: 'MessageOutputDebugTurnEventTurnEventTopicSwitchDenied' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ReasonEnum(str, Enum): + class ConditionTypeEnum(str, Enum): """ - The reason the dialog node was visited. + The type of condition (if any) that is defined for the action. """ + USER_DEFINED = 'user_defined' WELCOME = 'welcome' - BRANCH_START = 'branch_start' - TOPIC_SWITCH = 'topic_switch' - TOPIC_RETURN = 'topic_return' - TOPIC_SWITCH_WITHOUT_RETURN = 'topic_switch_without_return' - JUMP = 'jump' + ANYTHING_ELSE = 'anything_else' + + class ReasonEnum(str, Enum): + """ + The reason the action was visited. + """ + ACTION_CONDITIONS_FAILED = 'action_conditions_failed' -class MessageOutputDebugTurnEventTurnEventSearch(MessageOutputDebugTurnEvent): + +class MessageStreamResponseMessageStreamCompleteItem(MessageStreamResponse): """ - MessageOutputDebugTurnEventTurnEventSearch. + A completed response item. A complete item is a composition of every streamed partial + item with the same streaming_metadata.id, and each complete item contains its own + unique streaming_metadata.id. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param TurnEventSearchError error: (optional) + :param CompleteItem complete_item: (optional) """ def __init__( self, *, - event: Optional[str] = None, - source: Optional['TurnEventActionSource'] = None, - error: Optional['TurnEventSearchError'] = None, + complete_item: Optional['CompleteItem'] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventSearch object. + Initialize a MessageStreamResponseMessageStreamCompleteItem object. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param TurnEventSearchError error: (optional) + :param CompleteItem complete_item: (optional) """ # pylint: disable=super-init-not-called - self.event = event - self.source = source - self.error = error + self.complete_item = complete_item @classmethod - def from_dict(cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventSearch': - """Initialize a MessageOutputDebugTurnEventTurnEventSearch object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'MessageStreamResponseMessageStreamCompleteItem': + """Initialize a MessageStreamResponseMessageStreamCompleteItem object from a json dictionary.""" args = {} - if (event := _dict.get('event')) is not None: - args['event'] = event - if (source := _dict.get('source')) is not None: - args['source'] = TurnEventActionSource.from_dict(source) - if (error := _dict.get('error')) is not None: - args['error'] = TurnEventSearchError.from_dict(error) + if (complete_item := _dict.get('complete_item')) is not None: + args['complete_item'] = CompleteItem.from_dict(complete_item) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventSearch object from a json dictionary.""" + """Initialize a MessageStreamResponseMessageStreamCompleteItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'event') and self.event is not None: - _dict['event'] = self.event - if hasattr(self, 'source') and self.source is not None: - if isinstance(self.source, dict): - _dict['source'] = self.source - else: - _dict['source'] = self.source.to_dict() - if hasattr(self, 'error') and self.error is not None: - if isinstance(self.error, dict): - _dict['error'] = self.error + if hasattr(self, 'complete_item') and self.complete_item is not None: + if isinstance(self.complete_item, dict): + _dict['complete_item'] = self.complete_item else: - _dict['error'] = self.error.to_dict() + _dict['complete_item'] = self.complete_item.to_dict() return _dict def _to_dict(self): @@ -16540,107 +20356,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventSearch object.""" + """Return a `str` version of this MessageStreamResponseMessageStreamCompleteItem object.""" return json.dumps(self.to_dict(), indent=2) def __eq__(self, - other: 'MessageOutputDebugTurnEventTurnEventSearch') -> bool: + other: 'MessageStreamResponseMessageStreamCompleteItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, - other: 'MessageOutputDebugTurnEventTurnEventSearch') -> bool: + other: 'MessageStreamResponseMessageStreamCompleteItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageOutputDebugTurnEventTurnEventStepAnswered( - MessageOutputDebugTurnEvent): +class MessageStreamResponseMessageStreamPartialItem(MessageStreamResponse): """ - MessageOutputDebugTurnEventTurnEventStepAnswered. + A chunk of the streamed message response. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str condition_type: (optional) The type of condition (if any) that is - defined for the action. - :param str action_start_time: (optional) The time when the action started - processing the message. - :param bool prompted: (optional) Whether the step was answered in response to a - prompt from the assistant. If this property is `false`, the user provided the - answer without visiting the step. + :param PartialItem partial_item: (optional) Message response partial item + content. """ def __init__( self, *, - event: Optional[str] = None, - source: Optional['TurnEventActionSource'] = None, - condition_type: Optional[str] = None, - action_start_time: Optional[str] = None, - prompted: Optional[bool] = None, + partial_item: Optional['PartialItem'] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object. + Initialize a MessageStreamResponseMessageStreamPartialItem object. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str condition_type: (optional) The type of condition (if any) that - is defined for the action. - :param str action_start_time: (optional) The time when the action started - processing the message. - :param bool prompted: (optional) Whether the step was answered in response - to a prompt from the assistant. If this property is `false`, the user - provided the answer without visiting the step. + :param PartialItem partial_item: (optional) Message response partial item + content. """ # pylint: disable=super-init-not-called - self.event = event - self.source = source - self.condition_type = condition_type - self.action_start_time = action_start_time - self.prompted = prompted + self.partial_item = partial_item @classmethod def from_dict( cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventStepAnswered': - """Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object from a json dictionary.""" + _dict: Dict) -> 'MessageStreamResponseMessageStreamPartialItem': + """Initialize a MessageStreamResponseMessageStreamPartialItem object from a json dictionary.""" args = {} - if (event := _dict.get('event')) is not None: - args['event'] = event - if (source := _dict.get('source')) is not None: - args['source'] = TurnEventActionSource.from_dict(source) - if (condition_type := _dict.get('condition_type')) is not None: - args['condition_type'] = condition_type - if (action_start_time := _dict.get('action_start_time')) is not None: - args['action_start_time'] = action_start_time - if (prompted := _dict.get('prompted')) is not None: - args['prompted'] = prompted + if (partial_item := _dict.get('partial_item')) is not None: + args['partial_item'] = PartialItem.from_dict(partial_item) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventStepAnswered object from a json dictionary.""" + """Initialize a MessageStreamResponseMessageStreamPartialItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'event') and self.event is not None: - _dict['event'] = self.event - if hasattr(self, 'source') and self.source is not None: - if isinstance(self.source, dict): - _dict['source'] = self.source + if hasattr(self, 'partial_item') and self.partial_item is not None: + if isinstance(self.partial_item, dict): + _dict['partial_item'] = self.partial_item else: - _dict['source'] = self.source.to_dict() - if hasattr(self, 'condition_type') and self.condition_type is not None: - _dict['condition_type'] = self.condition_type - if hasattr(self, - 'action_start_time') and self.action_start_time is not None: - _dict['action_start_time'] = self.action_start_time - if hasattr(self, 'prompted') and self.prompted is not None: - _dict['prompted'] = self.prompted + _dict['partial_item'] = self.partial_item.to_dict() return _dict def _to_dict(self): @@ -16648,116 +20424,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventStepAnswered object.""" + """Return a `str` version of this MessageStreamResponseMessageStreamPartialItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'MessageOutputDebugTurnEventTurnEventStepAnswered') -> bool: + def __eq__(self, + other: 'MessageStreamResponseMessageStreamPartialItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, - other: 'MessageOutputDebugTurnEventTurnEventStepAnswered') -> bool: + def __ne__(self, + other: 'MessageStreamResponseMessageStreamPartialItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConditionTypeEnum(str, Enum): - """ - The type of condition (if any) that is defined for the action. - """ - - USER_DEFINED = 'user_defined' - WELCOME = 'welcome' - ANYTHING_ELSE = 'anything_else' - -class MessageOutputDebugTurnEventTurnEventStepVisited( - MessageOutputDebugTurnEvent): +class MessageStreamResponseStatefulMessageStreamFinalResponse( + MessageStreamResponse): """ - MessageOutputDebugTurnEventTurnEventStepVisited. + The final and stateful message response. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str condition_type: (optional) The type of condition (if any) that is - defined for the action. - :param str action_start_time: (optional) The time when the action started - processing the message. - :param bool has_question: (optional) Whether the step collects a customer - response. + :param FinalResponse final_response: (optional) Message final response content. """ def __init__( self, *, - event: Optional[str] = None, - source: Optional['TurnEventActionSource'] = None, - condition_type: Optional[str] = None, - action_start_time: Optional[str] = None, - has_question: Optional[bool] = None, + final_response: Optional['FinalResponse'] = None, ) -> None: """ - Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object. + Initialize a MessageStreamResponseStatefulMessageStreamFinalResponse object. - :param str event: (optional) The type of turn event. - :param TurnEventActionSource source: (optional) - :param str condition_type: (optional) The type of condition (if any) that - is defined for the action. - :param str action_start_time: (optional) The time when the action started - processing the message. - :param bool has_question: (optional) Whether the step collects a customer - response. + :param FinalResponse final_response: (optional) Message final response + content. """ # pylint: disable=super-init-not-called - self.event = event - self.source = source - self.condition_type = condition_type - self.action_start_time = action_start_time - self.has_question = has_question + self.final_response = final_response @classmethod def from_dict( - cls, - _dict: Dict) -> 'MessageOutputDebugTurnEventTurnEventStepVisited': - """Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object from a json dictionary.""" + cls, _dict: Dict + ) -> 'MessageStreamResponseStatefulMessageStreamFinalResponse': + """Initialize a MessageStreamResponseStatefulMessageStreamFinalResponse object from a json dictionary.""" args = {} - if (event := _dict.get('event')) is not None: - args['event'] = event - if (source := _dict.get('source')) is not None: - args['source'] = TurnEventActionSource.from_dict(source) - if (condition_type := _dict.get('condition_type')) is not None: - args['condition_type'] = condition_type - if (action_start_time := _dict.get('action_start_time')) is not None: - args['action_start_time'] = action_start_time - if (has_question := _dict.get('has_question')) is not None: - args['has_question'] = has_question + if (final_response := _dict.get('final_response')) is not None: + args['final_response'] = FinalResponse.from_dict(final_response) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageOutputDebugTurnEventTurnEventStepVisited object from a json dictionary.""" + """Initialize a MessageStreamResponseStatefulMessageStreamFinalResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'event') and self.event is not None: - _dict['event'] = self.event - if hasattr(self, 'source') and self.source is not None: - if isinstance(self.source, dict): - _dict['source'] = self.source + if hasattr(self, 'final_response') and self.final_response is not None: + if isinstance(self.final_response, dict): + _dict['final_response'] = self.final_response else: - _dict['source'] = self.source.to_dict() - if hasattr(self, 'condition_type') and self.condition_type is not None: - _dict['condition_type'] = self.condition_type - if hasattr(self, - 'action_start_time') and self.action_start_time is not None: - _dict['action_start_time'] = self.action_start_time - if hasattr(self, 'has_question') and self.has_question is not None: - _dict['has_question'] = self.has_question + _dict['final_response'] = self.final_response.to_dict() return _dict def _to_dict(self): @@ -16765,31 +20492,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageOutputDebugTurnEventTurnEventStepVisited object.""" + """Return a `str` version of this MessageStreamResponseStatefulMessageStreamFinalResponse object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'MessageOutputDebugTurnEventTurnEventStepVisited') -> bool: + self, other: 'MessageStreamResponseStatefulMessageStreamFinalResponse' + ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__( - self, - other: 'MessageOutputDebugTurnEventTurnEventStepVisited') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ConditionTypeEnum(str, Enum): - """ - The type of condition (if any) that is defined for the action. - """ - - USER_DEFINED = 'user_defined' - WELCOME = 'welcome' - ANYTHING_ELSE = 'anything_else' + def __ne__( + self, other: 'MessageStreamResponseStatefulMessageStreamFinalResponse' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode( @@ -18098,6 +21816,208 @@ def __ne__( return not self == other +class RuntimeResponseGenericRuntimeResponseTypeConversationalSearch( + RuntimeResponseGeneric): + """ + RuntimeResponseGenericRuntimeResponseTypeConversationalSearch. + + :param str response_type: The type of response returned by the dialog node. The + specified response type must be supported by the client application or channel. + :param str text: The text of the conversational search response. + :param str citations_title: The title of the citations. The default is “How do + we know?”. It can be updated in the conversational search user interface. + :param List[ResponseGenericCitation] citations: The citations for the generated + response. + :param ResponseGenericConfidenceScores confidence_scores: The confidence scores + for determining whether to show the generated response or an “I don't know” + response. + :param str response_length_option: The response length option. It is used to + control the length of the generated response. It is configured either in the + user interface or through the Update skill API. For more information, see + [watsonx Assistant documentation]( + https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#tuning-the-generated-response-length-in-conversational-search). + :param List[SearchResults] search_results: An array of objects containing the + search results. + :param str disclaimer: A disclaimer for the conversational search response. + """ + + def __init__( + self, + response_type: str, + text: str, + citations_title: str, + citations: List['ResponseGenericCitation'], + confidence_scores: 'ResponseGenericConfidenceScores', + response_length_option: str, + search_results: List['SearchResults'], + disclaimer: str, + ) -> None: + """ + Initialize a RuntimeResponseGenericRuntimeResponseTypeConversationalSearch object. + + :param str response_type: The type of response returned by the dialog node. + The specified response type must be supported by the client application or + channel. + :param str text: The text of the conversational search response. + :param str citations_title: The title of the citations. The default is “How + do we know?”. It can be updated in the conversational search user + interface. + :param List[ResponseGenericCitation] citations: The citations for the + generated response. + :param ResponseGenericConfidenceScores confidence_scores: The confidence + scores for determining whether to show the generated response or an “I + don't know” response. + :param str response_length_option: The response length option. It is used + to control the length of the generated response. It is configured either in + the user interface or through the Update skill API. For more information, + see [watsonx Assistant documentation]( + https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#tuning-the-generated-response-length-in-conversational-search). + :param List[SearchResults] search_results: An array of objects containing + the search results. + :param str disclaimer: A disclaimer for the conversational search response. + """ + # pylint: disable=super-init-not-called + self.response_type = response_type + self.text = text + self.citations_title = citations_title + self.citations = citations + self.confidence_scores = confidence_scores + self.response_length_option = response_length_option + self.search_results = search_results + self.disclaimer = disclaimer + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch': + """Initialize a RuntimeResponseGenericRuntimeResponseTypeConversationalSearch object from a json dictionary.""" + args = {} + if (response_type := _dict.get('response_type')) is not None: + args['response_type'] = response_type + else: + raise ValueError( + 'Required property \'response_type\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (text := _dict.get('text')) is not None: + args['text'] = text + else: + raise ValueError( + 'Required property \'text\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (citations_title := _dict.get('citations_title')) is not None: + args['citations_title'] = citations_title + else: + raise ValueError( + 'Required property \'citations_title\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (citations := _dict.get('citations')) is not None: + args['citations'] = [ + ResponseGenericCitation.from_dict(v) for v in citations + ] + else: + raise ValueError( + 'Required property \'citations\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (confidence_scores := _dict.get('confidence_scores')) is not None: + args[ + 'confidence_scores'] = ResponseGenericConfidenceScores.from_dict( + confidence_scores) + else: + raise ValueError( + 'Required property \'confidence_scores\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (response_length_option := + _dict.get('response_length_option')) is not None: + args['response_length_option'] = response_length_option + else: + raise ValueError( + 'Required property \'response_length_option\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (search_results := _dict.get('search_results')) is not None: + args['search_results'] = [ + SearchResults.from_dict(v) for v in search_results + ] + else: + raise ValueError( + 'Required property \'search_results\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + if (disclaimer := _dict.get('disclaimer')) is not None: + args['disclaimer'] = disclaimer + else: + raise ValueError( + 'Required property \'disclaimer\' not present in RuntimeResponseGenericRuntimeResponseTypeConversationalSearch JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RuntimeResponseGenericRuntimeResponseTypeConversationalSearch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'response_type') and self.response_type is not None: + _dict['response_type'] = self.response_type + if hasattr(self, 'text') and self.text is not None: + _dict['text'] = self.text + if hasattr(self, + 'citations_title') and self.citations_title is not None: + _dict['citations_title'] = self.citations_title + if hasattr(self, 'citations') and self.citations is not None: + citations_list = [] + for v in self.citations: + if isinstance(v, dict): + citations_list.append(v) + else: + citations_list.append(v.to_dict()) + _dict['citations'] = citations_list + if hasattr(self, + 'confidence_scores') and self.confidence_scores is not None: + if isinstance(self.confidence_scores, dict): + _dict['confidence_scores'] = self.confidence_scores + else: + _dict['confidence_scores'] = self.confidence_scores.to_dict() + if hasattr(self, 'response_length_option' + ) and self.response_length_option is not None: + _dict['response_length_option'] = self.response_length_option + if hasattr(self, 'search_results') and self.search_results is not None: + search_results_list = [] + for v in self.search_results: + if isinstance(v, dict): + search_results_list.append(v) + else: + search_results_list.append(v.to_dict()) + _dict['search_results'] = search_results_list + if hasattr(self, 'disclaimer') and self.disclaimer is not None: + _dict['disclaimer'] = self.disclaimer + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RuntimeResponseGenericRuntimeResponseTypeConversationalSearch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch' + ) -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, + other: 'RuntimeResponseGenericRuntimeResponseTypeConversationalSearch' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class RuntimeResponseGenericRuntimeResponseTypeDate(RuntimeResponseGeneric): """ RuntimeResponseGenericRuntimeResponseTypeDate. @@ -19345,3 +23265,219 @@ def __ne__(self, other: 'RuntimeResponseGenericRuntimeResponseTypeVideo') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + + +class StatelessMessageStreamResponseMessageStreamCompleteItem( + StatelessMessageStreamResponse): + """ + A completed response item. A complete item is a composition of every streamed partial + item with the same streaming_metadata.id, and each complete item contains its own + unique streaming_metadata.id. + + :param CompleteItem complete_item: (optional) + """ + + def __init__( + self, + *, + complete_item: Optional['CompleteItem'] = None, + ) -> None: + """ + Initialize a StatelessMessageStreamResponseMessageStreamCompleteItem object. + + :param CompleteItem complete_item: (optional) + """ + # pylint: disable=super-init-not-called + self.complete_item = complete_item + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'StatelessMessageStreamResponseMessageStreamCompleteItem': + """Initialize a StatelessMessageStreamResponseMessageStreamCompleteItem object from a json dictionary.""" + args = {} + if (complete_item := _dict.get('complete_item')) is not None: + args['complete_item'] = CompleteItem.from_dict(complete_item) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a StatelessMessageStreamResponseMessageStreamCompleteItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'complete_item') and self.complete_item is not None: + if isinstance(self.complete_item, dict): + _dict['complete_item'] = self.complete_item + else: + _dict['complete_item'] = self.complete_item.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this StatelessMessageStreamResponseMessageStreamCompleteItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: 'StatelessMessageStreamResponseMessageStreamCompleteItem' + ) -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, other: 'StatelessMessageStreamResponseMessageStreamCompleteItem' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class StatelessMessageStreamResponseMessageStreamPartialItem( + StatelessMessageStreamResponse): + """ + A chunk of the streamed message response. + + :param PartialItem partial_item: (optional) Message response partial item + content. + """ + + def __init__( + self, + *, + partial_item: Optional['PartialItem'] = None, + ) -> None: + """ + Initialize a StatelessMessageStreamResponseMessageStreamPartialItem object. + + :param PartialItem partial_item: (optional) Message response partial item + content. + """ + # pylint: disable=super-init-not-called + self.partial_item = partial_item + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'StatelessMessageStreamResponseMessageStreamPartialItem': + """Initialize a StatelessMessageStreamResponseMessageStreamPartialItem object from a json dictionary.""" + args = {} + if (partial_item := _dict.get('partial_item')) is not None: + args['partial_item'] = PartialItem.from_dict(partial_item) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a StatelessMessageStreamResponseMessageStreamPartialItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'partial_item') and self.partial_item is not None: + if isinstance(self.partial_item, dict): + _dict['partial_item'] = self.partial_item + else: + _dict['partial_item'] = self.partial_item.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this StatelessMessageStreamResponseMessageStreamPartialItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: 'StatelessMessageStreamResponseMessageStreamPartialItem' + ) -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, other: 'StatelessMessageStreamResponseMessageStreamPartialItem' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class StatelessMessageStreamResponseStatelessMessageStreamFinalResponse( + StatelessMessageStreamResponse): + """ + The final and stateless message response. + + :param StatelessFinalResponse final_response: (optional) Message final response + content. + """ + + def __init__( + self, + *, + final_response: Optional['StatelessFinalResponse'] = None, + ) -> None: + """ + Initialize a StatelessMessageStreamResponseStatelessMessageStreamFinalResponse object. + + :param StatelessFinalResponse final_response: (optional) Message final + response content. + """ + # pylint: disable=super-init-not-called + self.final_response = final_response + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'StatelessMessageStreamResponseStatelessMessageStreamFinalResponse': + """Initialize a StatelessMessageStreamResponseStatelessMessageStreamFinalResponse object from a json dictionary.""" + args = {} + if (final_response := _dict.get('final_response')) is not None: + args['final_response'] = StatelessFinalResponse.from_dict( + final_response) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a StatelessMessageStreamResponseStatelessMessageStreamFinalResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'final_response') and self.final_response is not None: + if isinstance(self.final_response, dict): + _dict['final_response'] = self.final_response + else: + _dict['final_response'] = self.final_response.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this StatelessMessageStreamResponseStatelessMessageStreamFinalResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'StatelessMessageStreamResponseStatelessMessageStreamFinalResponse' + ) -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__( + self, + other: 'StatelessMessageStreamResponseStatelessMessageStreamFinalResponse' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other diff --git a/ibm_watson/discovery_v2.py b/ibm_watson/discovery_v2.py index f9a99490..64200742 100644 --- a/ibm_watson/discovery_v2.py +++ b/ibm_watson/discovery_v2.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2019, 2024. +# (C) Copyright IBM Corp. 2019, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 +# IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 """ IBM Watson® Discovery is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better @@ -1206,6 +1206,23 @@ def delete_document( remove subdocuments that are generated by an uploaded file, delete the original document instead. You can get the document ID of the original document from the `parent_document_id` of the subdocument result. + If the document with the given document ID exists, Watson Discovery first marks or + tags the document as deleted when it sends the 200 response code. At a later time + (within a couple of minutes unless the document has many child documents), it + removes the document from the collection. + There is no bulk document delete API. Documents must be deleted one at a time + using this API. However, you can delete a collection, and all the documents from + the collection are removed along with the collection. + The document will be deleted from the given collection only, not from the + corresponding data source. Wherever relevant, an incremental crawl will not bring + back the document into Watson Discovery from the data source. Only a full crawl + will retrieve the deleted document back from the data source provided it is still + present in the same data source. + Finally, if multiple collections share the same dataset, deleting a document from + a collection will remove it from that collection only (in other remaining + collections the document will still exist). The document will be removed from the + dataset, if this document is deleted from all the collections that share the same + dataset. :param str project_id: The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate and Deploy* page diff --git a/ibm_watson/speech_to_text_v1.py b/ibm_watson/speech_to_text_v1.py index 459564a8..1f413afb 100644 --- a/ibm_watson/speech_to_text_v1.py +++ b/ibm_watson/speech_to_text_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2015, 2024. +# (C) Copyright IBM Corp. 2015, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 +# IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 """ The IBM Watson™ Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can @@ -4309,6 +4309,7 @@ class ModelId(str, Enum): AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel' AR_MS_TELEPHONY = 'ar-MS_Telephony' CS_CZ_TELEPHONY = 'cs-CZ_Telephony' + DE_DE = 'de-DE' DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel' DE_DE_MULTIMEDIA = 'de-DE_Multimedia' DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel' @@ -4438,6 +4439,7 @@ class Model(str, Enum): AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel' AR_MS_TELEPHONY = 'ar-MS_Telephony' CS_CZ_TELEPHONY = 'cs-CZ_Telephony' + DE_DE = 'de-DE' DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel' DE_DE_MULTIMEDIA = 'de-DE_Multimedia' DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel' @@ -4567,6 +4569,7 @@ class Model(str, Enum): AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel' AR_MS_TELEPHONY = 'ar-MS_Telephony' CS_CZ_TELEPHONY = 'cs-CZ_Telephony' + DE_DE = 'de-DE' DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel' DE_DE_MULTIMEDIA = 'de-DE_Multimedia' DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel' diff --git a/ibm_watson/text_to_speech_v1.py b/ibm_watson/text_to_speech_v1.py index 145fdcae..5cdac13f 100644 --- a/ibm_watson/text_to_speech_v1.py +++ b/ibm_watson/text_to_speech_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2015, 2024. +# (C) Copyright IBM Corp. 2015, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 +# IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 """ The IBM Watson™ Text to Speech service provides APIs that use IBM's speech-synthesis capabilities to synthesize text into natural-sounding speech in a variety of languages, @@ -232,31 +232,32 @@ def synthesize( * `audio/alaw` - You must specify the `rate` of the audio. * `audio/basic` - The service returns audio with a sampling rate of 8000 Hz. * `audio/flac` - You can optionally specify the `rate` of the audio. The default - sampling rate is 22,050 Hz. + sampling rate is 24,000 Hz for Natural voices and 22,050 Hz for all other voices. * `audio/l16` - You must specify the `rate` of the audio. You can optionally specify the `endianness` of the audio. The default endianness is `little-endian`. * `audio/mp3` - You can optionally specify the `rate` of the audio. The default - sampling rate is 22,050 Hz. + sampling rate is 24,000 Hz for Natural voices and 22,050 Hz for for all other + voices. * `audio/mpeg` - You can optionally specify the `rate` of the audio. The default - sampling rate is 22,050 Hz. + sampling rate is 24,000 Hz for Natural voices and 22,050 Hz for all other voices. * `audio/mulaw` - You must specify the `rate` of the audio. * `audio/ogg` - The service returns the audio in the `vorbis` codec. You can - optionally specify the `rate` of the audio. The default sampling rate is 22,050 + optionally specify the `rate` of the audio. The default sampling rate is 48,000 Hz. * `audio/ogg;codecs=opus` - You can optionally specify the `rate` of the audio. Only the following values are valid sampling rates: `48000`, `24000`, `16000`, `12000`, or `8000`. If you specify a value other than one of these, the service returns an error. The default sampling rate is 48,000 Hz. * `audio/ogg;codecs=vorbis` - You can optionally specify the `rate` of the audio. - The default sampling rate is 22,050 Hz. + The default sampling rate is 48,000 Hz. * `audio/wav` - You can optionally specify the `rate` of the audio. The default - sampling rate is 22,050 Hz. + sampling rate is 24,000 Hz for Natural voices and 22,050 Hz for all other voices. * `audio/webm` - The service returns the audio in the `opus` codec. The service returns audio with a sampling rate of 48,000 Hz. * `audio/webm;codecs=opus` - The service returns audio with a sampling rate of 48,000 Hz. * `audio/webm;codecs=vorbis` - You can optionally specify the `rate` of the audio. - The default sampling rate is 22,050 Hz. + The default sampling rate is 48,000 Hz. For more information about specifying an audio format, including additional details about some of the formats, see [Using audio formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audio-formats). @@ -1808,10 +1809,12 @@ class Voice(str, Enum): EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive' EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive' EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice' + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive' EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice' EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice' EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive' EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice' + EN_US_ELLIENATURAL = 'en-US_EllieNatural' EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice' EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive' EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice' @@ -1823,6 +1826,7 @@ class Voice(str, Enum): EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice' ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice' ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice' + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive' ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice' ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice' FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice' @@ -1833,6 +1837,7 @@ class Voice(str, Enum): KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice' NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice' PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice' + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive' class SynthesizeEnums: @@ -1883,10 +1888,12 @@ class Voice(str, Enum): EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive' EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive' EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice' + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive' EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice' EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice' EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive' EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice' + EN_US_ELLIENATURAL = 'en-US_EllieNatural' EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice' EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive' EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice' @@ -1898,6 +1905,7 @@ class Voice(str, Enum): EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice' ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice' ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice' + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive' ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice' ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice' FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice' @@ -1908,6 +1916,7 @@ class Voice(str, Enum): KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice' NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice' PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice' + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive' class SpellOutMode(str, Enum): """ @@ -1957,10 +1966,12 @@ class Voice(str, Enum): EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive' EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive' EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice' + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive' EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice' EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice' EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive' EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice' + EN_US_ELLIENATURAL = 'en-US_EllieNatural' EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice' EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive' EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice' @@ -1972,6 +1983,7 @@ class Voice(str, Enum): EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice' ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice' ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice' + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive' ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice' ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice' FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice' @@ -1982,6 +1994,7 @@ class Voice(str, Enum): KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice' NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice' PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice' + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive' class Format(str, Enum): """ diff --git a/test/unit/test_assistant_v2.py b/test/unit/test_assistant_v2.py index 9ae2b0d2..a59ad0d8 100644 --- a/test/unit/test_assistant_v2.py +++ b/test/unit/test_assistant_v2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2019, 2024. +# (C) Copyright IBM Corp. 2019, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1170,7 +1170,7 @@ def test_message_all_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/sessions/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' responses.add( responses.POST, url, @@ -1364,7 +1364,7 @@ def test_message_required_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/sessions/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' responses.add( responses.POST, url, @@ -1406,7 +1406,7 @@ def test_message_value_error(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/sessions/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id", "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}}' responses.add( responses.POST, url, @@ -1453,7 +1453,7 @@ def test_message_stateless_all_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' responses.add( responses.POST, url, @@ -1646,7 +1646,7 @@ def test_message_stateless_required_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' responses.add( responses.POST, url, @@ -1686,7 +1686,7 @@ def test_message_stateless_value_error(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/message') - mock_response = '{"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' + mock_response = '{"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}, "private_action_variables": {"anyKey": "anyValue"}, "private_skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "masked_output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "masked_input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "user_id": "user_id"}' responses.add( responses.POST, url, @@ -2420,7 +2420,7 @@ def test_list_logs_all_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/logs') - mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' + mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' responses.add( responses.GET, url, @@ -2473,7 +2473,7 @@ def test_list_logs_required_params(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/logs') - mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' + mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' responses.add( responses.GET, url, @@ -2511,7 +2511,7 @@ def test_list_logs_value_error(self): """ # Set up mock url = preprocess_url('/v2/assistants/testString/logs') - mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "text", "text": "text", "channels": [{"channel": "channel"}]}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' + mock_response = '{"logs": [{"log_id": "log_id", "request": {"input": {"message_type": "text", "text": "text", "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "suggestion_id": "suggestion_id", "attachments": [{"url": "url", "media_type": "media_type"}], "analytics": {"browser": "browser", "device": "device", "pageUrl": "page_url"}, "options": {"restart": false, "alternate_intents": false, "async_callout": false, "spelling": {"suggestions": false, "auto_correct": true}, "debug": false, "return_context": false, "export": false}}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "response": {"output": {"generic": [{"response_type": "conversation_search", "text": "text", "citations_title": "citations_title", "citations": [{"title": "title", "text": "text", "body": "body", "search_result_index": 19, "ranges": [{"start": 5, "end": 3}]}], "confidence_scores": {"threshold": 9, "pre_gen": 7, "post_gen": 8, "extractiveness": 14}, "response_length_option": "response_length_option", "search_results": [{"result_metadata": {"document_retrieval_source": "document_retrieval_source", "score": 5}, "id": "id", "title": "title", "body": "body"}], "disclaimer": "disclaimer"}], "intents": [{"intent": "intent", "confidence": 10, "skill": "skill"}], "entities": [{"entity": "entity", "location": [8], "value": "value", "confidence": 10, "groups": [{"group": "group", "location": [8]}], "interpretation": {"calendar_type": "calendar_type", "datetime_link": "datetime_link", "festival": "festival", "granularity": "day", "range_link": "range_link", "range_modifier": "range_modifier", "relative_day": 12, "relative_month": 14, "relative_week": 13, "relative_weekend": 16, "relative_year": 13, "specific_day": 12, "specific_day_of_week": "specific_day_of_week", "specific_month": 14, "specific_quarter": 16, "specific_year": 13, "numeric_value": 13, "subtype": "subtype", "part_of_day": "part_of_day", "relative_hour": 13, "relative_minute": 15, "relative_second": 15, "specific_hour": 13, "specific_minute": 15, "specific_second": 15, "timezone": "timezone"}, "alternatives": [{"value": "value", "confidence": 10}], "role": {"type": "date_from"}, "skill": "skill"}], "actions": [{"name": "name", "type": "client", "parameters": {"anyKey": "anyValue"}, "result_variable": "result_variable", "credentials": "credentials"}], "debug": {"nodes_visited": [{"dialog_node": "dialog_node", "title": "title", "conditions": "conditions"}], "log_messages": [{"level": "info", "message": "message", "code": "code", "source": {"type": "dialog_node", "dialog_node": "dialog_node"}}], "branch_exited": false, "branch_exited_reason": "completed", "turn_events": [{"event": "action_visited", "source": {"type": "action", "action": "action", "action_title": "action_title", "condition": "condition"}, "action_start_time": "action_start_time", "condition_type": "user_defined", "reason": "intent", "result_variable": "result_variable"}]}, "user_defined": {"anyKey": "anyValue"}, "spelling": {"text": "text", "original_text": "original_text", "suggested_text": "suggested_text"}, "llm_metadata": [{"task": "task", "model_id": "model_id"}]}, "context": {"global": {"system": {"timezone": "timezone", "user_id": "user_id", "turn_count": 10, "locale": "en-us", "reference_time": "reference_time", "session_start_time": "session_start_time", "state": "state", "skip_user_input": false}, "session_id": "session_id"}, "skills": {"main skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}}, "actions skill": {"user_defined": {"anyKey": "anyValue"}, "system": {"state": "state"}, "action_variables": {"anyKey": "anyValue"}, "skill_variables": {"anyKey": "anyValue"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}, "assistant_id": "assistant_id", "session_id": "session_id", "skill_id": "skill_id", "snapshot": "snapshot", "request_timestamp": "request_timestamp", "response_timestamp": "response_timestamp", "language": "language", "customer_id": "customer_id"}], "pagination": {"next_url": "next_url", "matched": 7, "next_cursor": "next_cursor"}}' responses.add( responses.GET, url, @@ -5816,6 +5816,40 @@ def test_channel_transfer_target_chat_serialization(self): assert channel_transfer_target_chat_model_json2 == channel_transfer_target_chat_model_json +class TestModel_ClientAction: + """ + Test Class for ClientAction + """ + + def test_client_action_serialization(self): + """ + Test serialization/deserialization for ClientAction + """ + + # Construct a json representation of a ClientAction model + client_action_model_json = {} + client_action_model_json['name'] = 'testString' + client_action_model_json['result_variable'] = 'testString' + client_action_model_json['type'] = 'testString' + client_action_model_json['skill'] = 'main skill' + client_action_model_json['parameters'] = {'anyKey': 'anyValue'} + + # Construct a model instance of ClientAction by calling from_dict on the json representation + client_action_model = ClientAction.from_dict(client_action_model_json) + assert client_action_model != False + + # Construct a model instance of ClientAction by calling from_dict on the json representation + client_action_model_dict = ClientAction.from_dict(client_action_model_json).__dict__ + client_action_model2 = ClientAction(**client_action_model_dict) + + # Verify the model instances are equivalent + assert client_action_model == client_action_model2 + + # Convert model instance back to dict and verify no loss of data + client_action_model_json2 = client_action_model.to_dict() + assert client_action_model_json2 == client_action_model_json + + class TestModel_CreateAssistantReleaseImportResponse: """ Test Class for CreateAssistantReleaseImportResponse @@ -6663,49 +6697,55 @@ def test_environment_skill_serialization(self): assert environment_skill_model_json2 == environment_skill_model_json -class TestModel_IntegrationReference: - """ - Test Class for IntegrationReference - """ - - def test_integration_reference_serialization(self): - """ - Test serialization/deserialization for IntegrationReference - """ - - # Construct a json representation of a IntegrationReference model - integration_reference_model_json = {} - integration_reference_model_json['integration_id'] = 'testString' - integration_reference_model_json['type'] = 'testString' - - # Construct a model instance of IntegrationReference by calling from_dict on the json representation - integration_reference_model = IntegrationReference.from_dict(integration_reference_model_json) - assert integration_reference_model != False - - # Construct a model instance of IntegrationReference by calling from_dict on the json representation - integration_reference_model_dict = IntegrationReference.from_dict(integration_reference_model_json).__dict__ - integration_reference_model2 = IntegrationReference(**integration_reference_model_dict) - - # Verify the model instances are equivalent - assert integration_reference_model == integration_reference_model2 - - # Convert model instance back to dict and verify no loss of data - integration_reference_model_json2 = integration_reference_model.to_dict() - assert integration_reference_model_json2 == integration_reference_model_json - - -class TestModel_Log: +class TestModel_FinalResponse: """ - Test Class for Log + Test Class for FinalResponse """ - def test_log_serialization(self): + def test_final_response_serialization(self): """ - Test serialization/deserialization for Log + Test serialization/deserialization for FinalResponse """ # Construct dict forms of any model objects needed in order to build this model. + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + runtime_intent_model = {} # RuntimeIntent runtime_intent_model['intent'] = 'testString' runtime_intent_model['confidence'] = 72.5 @@ -6761,87 +6801,6 @@ def test_log_serialization(self): runtime_entity_model['role'] = runtime_entity_role_model runtime_entity_model['skill'] = 'testString' - message_input_attachment_model = {} # MessageInputAttachment - message_input_attachment_model['url'] = 'testString' - message_input_attachment_model['media_type'] = 'testString' - - request_analytics_model = {} # RequestAnalytics - request_analytics_model['browser'] = 'testString' - request_analytics_model['device'] = 'testString' - request_analytics_model['pageUrl'] = 'testString' - - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True - - message_input_options_model = {} # MessageInputOptions - message_input_options_model['restart'] = False - message_input_options_model['alternate_intents'] = False - message_input_options_model['async_callout'] = False - message_input_options_model['spelling'] = message_input_options_spelling_model - message_input_options_model['debug'] = False - message_input_options_model['return_context'] = False - message_input_options_model['export'] = False - - log_request_input_model = {} # LogRequestInput - log_request_input_model['message_type'] = 'text' - log_request_input_model['text'] = 'testString' - log_request_input_model['intents'] = [runtime_intent_model] - log_request_input_model['entities'] = [runtime_entity_model] - log_request_input_model['suggestion_id'] = 'testString' - log_request_input_model['attachments'] = [message_input_attachment_model] - log_request_input_model['analytics'] = request_analytics_model - log_request_input_model['options'] = message_input_options_model - - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True - - message_context_global_model = {} # MessageContextGlobal - message_context_global_model['system'] = message_context_global_system_model - - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' - - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model - - message_context_action_skill_model = {} # MessageContextActionSkill - message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_dialog_skill_model - message_context_skills_model['actions skill'] = message_context_action_skill_model - - message_context_model = {} # MessageContext - message_context_model['global'] = message_context_global_model - message_context_model['skills'] = message_context_skills_model - message_context_model['integrations'] = {'anyKey': 'anyValue'} - - log_request_model = {} # LogRequest - log_request_model['input'] = log_request_input_model - log_request_model['context'] = message_context_model - log_request_model['user_id'] = 'testString' - - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' - - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' - runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] - dialog_node_action_model = {} # DialogNodeAction dialog_node_action_model['name'] = 'testString' dialog_node_action_model['type'] = 'client' @@ -6890,62 +6849,178 @@ def test_log_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = 'testString' - log_response_output_model = {} # LogResponseOutput - log_response_output_model['generic'] = [runtime_response_generic_model] - log_response_output_model['intents'] = [runtime_intent_model] - log_response_output_model['entities'] = [runtime_entity_model] - log_response_output_model['actions'] = [dialog_node_action_model] - log_response_output_model['debug'] = message_output_debug_model - log_response_output_model['user_defined'] = {'anyKey': 'anyValue'} - log_response_output_model['spelling'] = message_output_spelling_model + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' - log_response_model = {} # LogResponse - log_response_model['output'] = log_response_output_model - log_response_model['context'] = message_context_model - log_response_model['user_id'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - # Construct a json representation of a Log model - log_model_json = {} - log_model_json['log_id'] = 'testString' - log_model_json['request'] = log_request_model - log_model_json['response'] = log_response_model - log_model_json['assistant_id'] = 'testString' - log_model_json['session_id'] = 'testString' - log_model_json['skill_id'] = 'testString' - log_model_json['snapshot'] = 'testString' - log_model_json['request_timestamp'] = 'testString' - log_model_json['response_timestamp'] = 'testString' - log_model_json['language'] = 'testString' - log_model_json['customer_id'] = 'testString' + message_stream_metadata_model = {} # MessageStreamMetadata + message_stream_metadata_model['streaming_metadata'] = metadata_model - # Construct a model instance of Log by calling from_dict on the json representation - log_model = Log.from_dict(log_model_json) - assert log_model != False + final_response_output_model = {} # FinalResponseOutput + final_response_output_model['generic'] = [runtime_response_generic_model] + final_response_output_model['intents'] = [runtime_intent_model] + final_response_output_model['entities'] = [runtime_entity_model] + final_response_output_model['actions'] = [dialog_node_action_model] + final_response_output_model['debug'] = message_output_debug_model + final_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + final_response_output_model['spelling'] = message_output_spelling_model + final_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] + final_response_output_model['streaming_metadata'] = message_stream_metadata_model - # Construct a model instance of Log by calling from_dict on the json representation - log_model_dict = Log.from_dict(log_model_json).__dict__ - log_model2 = Log(**log_model_dict) + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model + + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} + + message_output_model = {} # MessageOutput + message_output_model['generic'] = [runtime_response_generic_model] + message_output_model['intents'] = [runtime_intent_model] + message_output_model['entities'] = [runtime_entity_model] + message_output_model['actions'] = [dialog_node_action_model] + message_output_model['debug'] = message_output_debug_model + message_output_model['user_defined'] = {'anyKey': 'anyValue'} + message_output_model['spelling'] = message_output_spelling_model + message_output_model['llm_metadata'] = [message_output_llm_metadata_model] + + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' + + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True + + message_input_options_model = {} # MessageInputOptions + message_input_options_model['restart'] = False + message_input_options_model['alternate_intents'] = False + message_input_options_model['async_callout'] = False + message_input_options_model['spelling'] = message_input_options_spelling_model + message_input_options_model['debug'] = False + message_input_options_model['return_context'] = False + message_input_options_model['export'] = False + + message_input_model = {} # MessageInput + message_input_model['message_type'] = 'text' + message_input_model['text'] = 'testString' + message_input_model['intents'] = [runtime_intent_model] + message_input_model['entities'] = [runtime_entity_model] + message_input_model['suggestion_id'] = 'testString' + message_input_model['attachments'] = [message_input_attachment_model] + message_input_model['analytics'] = request_analytics_model + message_input_model['options'] = message_input_options_model + + # Construct a json representation of a FinalResponse model + final_response_model_json = {} + final_response_model_json['output'] = final_response_output_model + final_response_model_json['context'] = message_context_model + final_response_model_json['user_id'] = 'testString' + final_response_model_json['masked_output'] = message_output_model + final_response_model_json['masked_input'] = message_input_model + + # Construct a model instance of FinalResponse by calling from_dict on the json representation + final_response_model = FinalResponse.from_dict(final_response_model_json) + assert final_response_model != False + + # Construct a model instance of FinalResponse by calling from_dict on the json representation + final_response_model_dict = FinalResponse.from_dict(final_response_model_json).__dict__ + final_response_model2 = FinalResponse(**final_response_model_dict) # Verify the model instances are equivalent - assert log_model == log_model2 + assert final_response_model == final_response_model2 # Convert model instance back to dict and verify no loss of data - log_model_json2 = log_model.to_dict() - assert log_model_json2 == log_model_json + final_response_model_json2 = final_response_model.to_dict() + assert final_response_model_json2 == final_response_model_json -class TestModel_LogCollection: +class TestModel_FinalResponseOutput: """ - Test Class for LogCollection + Test Class for FinalResponseOutput """ - def test_log_collection_serialization(self): + def test_final_response_output_serialization(self): """ - Test serialization/deserialization for LogCollection + Test serialization/deserialization for FinalResponseOutput """ # Construct dict forms of any model objects needed in order to build this model. + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + runtime_intent_model = {} # RuntimeIntent runtime_intent_model['intent'] = 'testString' runtime_intent_model['confidence'] = 72.5 @@ -7001,87 +7076,6 @@ def test_log_collection_serialization(self): runtime_entity_model['role'] = runtime_entity_role_model runtime_entity_model['skill'] = 'testString' - message_input_attachment_model = {} # MessageInputAttachment - message_input_attachment_model['url'] = 'testString' - message_input_attachment_model['media_type'] = 'testString' - - request_analytics_model = {} # RequestAnalytics - request_analytics_model['browser'] = 'testString' - request_analytics_model['device'] = 'testString' - request_analytics_model['pageUrl'] = 'testString' - - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True - - message_input_options_model = {} # MessageInputOptions - message_input_options_model['restart'] = False - message_input_options_model['alternate_intents'] = False - message_input_options_model['async_callout'] = False - message_input_options_model['spelling'] = message_input_options_spelling_model - message_input_options_model['debug'] = False - message_input_options_model['return_context'] = False - message_input_options_model['export'] = False - - log_request_input_model = {} # LogRequestInput - log_request_input_model['message_type'] = 'text' - log_request_input_model['text'] = 'testString' - log_request_input_model['intents'] = [runtime_intent_model] - log_request_input_model['entities'] = [runtime_entity_model] - log_request_input_model['suggestion_id'] = 'testString' - log_request_input_model['attachments'] = [message_input_attachment_model] - log_request_input_model['analytics'] = request_analytics_model - log_request_input_model['options'] = message_input_options_model - - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True - - message_context_global_model = {} # MessageContextGlobal - message_context_global_model['system'] = message_context_global_system_model - - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' - - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model - - message_context_action_skill_model = {} # MessageContextActionSkill - message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_dialog_skill_model - message_context_skills_model['actions skill'] = message_context_action_skill_model - - message_context_model = {} # MessageContext - message_context_model['global'] = message_context_global_model - message_context_model['skills'] = message_context_skills_model - message_context_model['integrations'] = {'anyKey': 'anyValue'} - - log_request_model = {} # LogRequest - log_request_model['input'] = log_request_input_model - log_request_model['context'] = message_context_model - log_request_model['user_id'] = 'testString' - - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' - - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' - runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] - dialog_node_action_model = {} # DialogNodeAction dialog_node_action_model['name'] = 'testString' dialog_node_action_model['type'] = 'client' @@ -7130,99 +7124,116 @@ def test_log_collection_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = 'testString' - log_response_output_model = {} # LogResponseOutput - log_response_output_model['generic'] = [runtime_response_generic_model] - log_response_output_model['intents'] = [runtime_intent_model] - log_response_output_model['entities'] = [runtime_entity_model] - log_response_output_model['actions'] = [dialog_node_action_model] - log_response_output_model['debug'] = message_output_debug_model - log_response_output_model['user_defined'] = {'anyKey': 'anyValue'} - log_response_output_model['spelling'] = message_output_spelling_model + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' - log_response_model = {} # LogResponse - log_response_model['output'] = log_response_output_model - log_response_model['context'] = message_context_model - log_response_model['user_id'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - log_model = {} # Log - log_model['log_id'] = 'testString' - log_model['request'] = log_request_model - log_model['response'] = log_response_model - log_model['assistant_id'] = 'testString' - log_model['session_id'] = 'testString' - log_model['skill_id'] = 'testString' - log_model['snapshot'] = 'testString' - log_model['request_timestamp'] = 'testString' - log_model['response_timestamp'] = 'testString' - log_model['language'] = 'testString' - log_model['customer_id'] = 'testString' + message_stream_metadata_model = {} # MessageStreamMetadata + message_stream_metadata_model['streaming_metadata'] = metadata_model + + # Construct a json representation of a FinalResponseOutput model + final_response_output_model_json = {} + final_response_output_model_json['generic'] = [runtime_response_generic_model] + final_response_output_model_json['intents'] = [runtime_intent_model] + final_response_output_model_json['entities'] = [runtime_entity_model] + final_response_output_model_json['actions'] = [dialog_node_action_model] + final_response_output_model_json['debug'] = message_output_debug_model + final_response_output_model_json['user_defined'] = {'anyKey': 'anyValue'} + final_response_output_model_json['spelling'] = message_output_spelling_model + final_response_output_model_json['llm_metadata'] = [message_output_llm_metadata_model] + final_response_output_model_json['streaming_metadata'] = message_stream_metadata_model + + # Construct a model instance of FinalResponseOutput by calling from_dict on the json representation + final_response_output_model = FinalResponseOutput.from_dict(final_response_output_model_json) + assert final_response_output_model != False + + # Construct a model instance of FinalResponseOutput by calling from_dict on the json representation + final_response_output_model_dict = FinalResponseOutput.from_dict(final_response_output_model_json).__dict__ + final_response_output_model2 = FinalResponseOutput(**final_response_output_model_dict) - log_pagination_model = {} # LogPagination - log_pagination_model['next_url'] = 'testString' - log_pagination_model['matched'] = 38 - log_pagination_model['next_cursor'] = 'testString' + # Verify the model instances are equivalent + assert final_response_output_model == final_response_output_model2 - # Construct a json representation of a LogCollection model - log_collection_model_json = {} - log_collection_model_json['logs'] = [log_model] - log_collection_model_json['pagination'] = log_pagination_model + # Convert model instance back to dict and verify no loss of data + final_response_output_model_json2 = final_response_output_model.to_dict() + assert final_response_output_model_json2 == final_response_output_model_json - # Construct a model instance of LogCollection by calling from_dict on the json representation - log_collection_model = LogCollection.from_dict(log_collection_model_json) - assert log_collection_model != False - # Construct a model instance of LogCollection by calling from_dict on the json representation - log_collection_model_dict = LogCollection.from_dict(log_collection_model_json).__dict__ - log_collection_model2 = LogCollection(**log_collection_model_dict) +class TestModel_GenerativeAITaskConfidenceScores: + """ + Test Class for GenerativeAITaskConfidenceScores + """ + + def test_generative_ai_task_confidence_scores_serialization(self): + """ + Test serialization/deserialization for GenerativeAITaskConfidenceScores + """ + + # Construct a json representation of a GenerativeAITaskConfidenceScores model + generative_ai_task_confidence_scores_model_json = {} + generative_ai_task_confidence_scores_model_json['pre_gen'] = 72.5 + generative_ai_task_confidence_scores_model_json['pre_gen_threshold'] = 72.5 + generative_ai_task_confidence_scores_model_json['post_gen'] = 72.5 + generative_ai_task_confidence_scores_model_json['post_gen_threshold'] = 72.5 + + # Construct a model instance of GenerativeAITaskConfidenceScores by calling from_dict on the json representation + generative_ai_task_confidence_scores_model = GenerativeAITaskConfidenceScores.from_dict(generative_ai_task_confidence_scores_model_json) + assert generative_ai_task_confidence_scores_model != False + + # Construct a model instance of GenerativeAITaskConfidenceScores by calling from_dict on the json representation + generative_ai_task_confidence_scores_model_dict = GenerativeAITaskConfidenceScores.from_dict(generative_ai_task_confidence_scores_model_json).__dict__ + generative_ai_task_confidence_scores_model2 = GenerativeAITaskConfidenceScores(**generative_ai_task_confidence_scores_model_dict) # Verify the model instances are equivalent - assert log_collection_model == log_collection_model2 + assert generative_ai_task_confidence_scores_model == generative_ai_task_confidence_scores_model2 # Convert model instance back to dict and verify no loss of data - log_collection_model_json2 = log_collection_model.to_dict() - assert log_collection_model_json2 == log_collection_model_json + generative_ai_task_confidence_scores_model_json2 = generative_ai_task_confidence_scores_model.to_dict() + assert generative_ai_task_confidence_scores_model_json2 == generative_ai_task_confidence_scores_model_json -class TestModel_LogPagination: +class TestModel_IntegrationReference: """ - Test Class for LogPagination + Test Class for IntegrationReference """ - def test_log_pagination_serialization(self): + def test_integration_reference_serialization(self): """ - Test serialization/deserialization for LogPagination + Test serialization/deserialization for IntegrationReference """ - # Construct a json representation of a LogPagination model - log_pagination_model_json = {} - log_pagination_model_json['next_url'] = 'testString' - log_pagination_model_json['matched'] = 38 - log_pagination_model_json['next_cursor'] = 'testString' + # Construct a json representation of a IntegrationReference model + integration_reference_model_json = {} + integration_reference_model_json['integration_id'] = 'testString' + integration_reference_model_json['type'] = 'testString' - # Construct a model instance of LogPagination by calling from_dict on the json representation - log_pagination_model = LogPagination.from_dict(log_pagination_model_json) - assert log_pagination_model != False + # Construct a model instance of IntegrationReference by calling from_dict on the json representation + integration_reference_model = IntegrationReference.from_dict(integration_reference_model_json) + assert integration_reference_model != False - # Construct a model instance of LogPagination by calling from_dict on the json representation - log_pagination_model_dict = LogPagination.from_dict(log_pagination_model_json).__dict__ - log_pagination_model2 = LogPagination(**log_pagination_model_dict) + # Construct a model instance of IntegrationReference by calling from_dict on the json representation + integration_reference_model_dict = IntegrationReference.from_dict(integration_reference_model_json).__dict__ + integration_reference_model2 = IntegrationReference(**integration_reference_model_dict) # Verify the model instances are equivalent - assert log_pagination_model == log_pagination_model2 + assert integration_reference_model == integration_reference_model2 # Convert model instance back to dict and verify no loss of data - log_pagination_model_json2 = log_pagination_model.to_dict() - assert log_pagination_model_json2 == log_pagination_model_json + integration_reference_model_json2 = integration_reference_model.to_dict() + assert integration_reference_model_json2 == integration_reference_model_json -class TestModel_LogRequest: +class TestModel_Log: """ - Test Class for LogRequest + Test Class for Log """ - def test_log_request_serialization(self): + def test_log_serialization(self): """ - Test serialization/deserialization for LogRequest + Test serialization/deserialization for Log """ # Construct dict forms of any model objects needed in order to build this model. @@ -7301,12 +7312,12 @@ def test_log_request_serialization(self): message_input_options_model['async_callout'] = False message_input_options_model['spelling'] = message_input_options_spelling_model message_input_options_model['debug'] = False - message_input_options_model['return_context'] = True - message_input_options_model['export'] = True + message_input_options_model['return_context'] = False + message_input_options_model['export'] = False log_request_input_model = {} # LogRequestInput log_request_input_model['message_type'] = 'text' - log_request_input_model['text'] = 'Hello' + log_request_input_model['text'] = 'testString' log_request_input_model['intents'] = [runtime_intent_model] log_request_input_model['entities'] = [runtime_entity_model] log_request_input_model['suggestion_id'] = 'testString' @@ -7316,7 +7327,7 @@ def test_log_request_serialization(self): message_context_global_system_model = {} # MessageContextGlobalSystem message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'my_user_id' + message_context_global_system_model['user_id'] = 'testString' message_context_global_system_model['turn_count'] = 38 message_context_global_system_model['locale'] = 'en-us' message_context_global_system_model['reference_time'] = 'testString' @@ -7350,52 +7361,169 @@ def test_log_request_serialization(self): message_context_model['skills'] = message_context_skills_model message_context_model['integrations'] = {'anyKey': 'anyValue'} - # Construct a json representation of a LogRequest model - log_request_model_json = {} - log_request_model_json['input'] = log_request_input_model - log_request_model_json['context'] = message_context_model - log_request_model_json['user_id'] = 'testString' + log_request_model = {} # LogRequest + log_request_model['input'] = log_request_input_model + log_request_model['context'] = message_context_model + log_request_model['user_id'] = 'testString' - # Construct a model instance of LogRequest by calling from_dict on the json representation - log_request_model = LogRequest.from_dict(log_request_model_json) - assert log_request_model != False + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' - # Construct a model instance of LogRequest by calling from_dict on the json representation - log_request_model_dict = LogRequest.from_dict(log_request_model_json).__dict__ - log_request_model2 = LogRequest(**log_request_model_dict) + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' - # Verify the model instances are equivalent - assert log_request_model == log_request_model2 + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' - # Convert model instance back to dict and verify no loss of data - log_request_model_json2 = log_request_model.to_dict() - assert log_request_model_json2 == log_request_model_json + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model -class TestModel_LogRequestInput: - """ - Test Class for LogRequestInput - """ + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - def test_log_request_input_serialization(self): - """ - Test serialization/deserialization for LogRequestInput - """ + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' - # Construct dict forms of any model objects needed in order to build this model. + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' + log_response_output_model = {} # LogResponseOutput + log_response_output_model['generic'] = [runtime_response_generic_model] + log_response_output_model['intents'] = [runtime_intent_model] + log_response_output_model['entities'] = [runtime_entity_model] + log_response_output_model['actions'] = [dialog_node_action_model] + log_response_output_model['debug'] = message_output_debug_model + log_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + log_response_output_model['spelling'] = message_output_spelling_model + log_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] + + log_response_model = {} # LogResponse + log_response_model['output'] = log_response_output_model + log_response_model['context'] = message_context_model + log_response_model['user_id'] = 'testString' + + # Construct a json representation of a Log model + log_model_json = {} + log_model_json['log_id'] = 'testString' + log_model_json['request'] = log_request_model + log_model_json['response'] = log_response_model + log_model_json['assistant_id'] = 'testString' + log_model_json['session_id'] = 'testString' + log_model_json['skill_id'] = 'testString' + log_model_json['snapshot'] = 'testString' + log_model_json['request_timestamp'] = 'testString' + log_model_json['response_timestamp'] = 'testString' + log_model_json['language'] = 'testString' + log_model_json['customer_id'] = 'testString' + + # Construct a model instance of Log by calling from_dict on the json representation + log_model = Log.from_dict(log_model_json) + assert log_model != False + + # Construct a model instance of Log by calling from_dict on the json representation + log_model_dict = Log.from_dict(log_model_json).__dict__ + log_model2 = Log(**log_model_dict) + + # Verify the model instances are equivalent + assert log_model == log_model2 + + # Convert model instance back to dict and verify no loss of data + log_model_json2 = log_model.to_dict() + assert log_model_json2 == log_model_json + + +class TestModel_LogCollection: + """ + Test Class for LogCollection + """ + + def test_log_collection_serialization(self): + """ + Test serialization/deserialization for LogCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' runtime_entity_interpretation_model['festival'] = 'testString' runtime_entity_interpretation_model['granularity'] = 'day' runtime_entity_interpretation_model['range_link'] = 'testString' @@ -7461,107 +7589,93 @@ def test_log_request_input_serialization(self): message_input_options_model['return_context'] = False message_input_options_model['export'] = False - # Construct a json representation of a LogRequestInput model - log_request_input_model_json = {} - log_request_input_model_json['message_type'] = 'text' - log_request_input_model_json['text'] = 'testString' - log_request_input_model_json['intents'] = [runtime_intent_model] - log_request_input_model_json['entities'] = [runtime_entity_model] - log_request_input_model_json['suggestion_id'] = 'testString' - log_request_input_model_json['attachments'] = [message_input_attachment_model] - log_request_input_model_json['analytics'] = request_analytics_model - log_request_input_model_json['options'] = message_input_options_model - - # Construct a model instance of LogRequestInput by calling from_dict on the json representation - log_request_input_model = LogRequestInput.from_dict(log_request_input_model_json) - assert log_request_input_model != False + log_request_input_model = {} # LogRequestInput + log_request_input_model['message_type'] = 'text' + log_request_input_model['text'] = 'testString' + log_request_input_model['intents'] = [runtime_intent_model] + log_request_input_model['entities'] = [runtime_entity_model] + log_request_input_model['suggestion_id'] = 'testString' + log_request_input_model['attachments'] = [message_input_attachment_model] + log_request_input_model['analytics'] = request_analytics_model + log_request_input_model['options'] = message_input_options_model - # Construct a model instance of LogRequestInput by calling from_dict on the json representation - log_request_input_model_dict = LogRequestInput.from_dict(log_request_input_model_json).__dict__ - log_request_input_model2 = LogRequestInput(**log_request_input_model_dict) + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True - # Verify the model instances are equivalent - assert log_request_input_model == log_request_input_model2 + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model - # Convert model instance back to dict and verify no loss of data - log_request_input_model_json2 = log_request_input_model.to_dict() - assert log_request_input_model_json2 == log_request_input_model_json + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model -class TestModel_LogResponse: - """ - Test Class for LogResponse - """ + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - def test_log_response_serialization(self): - """ - Test serialization/deserialization for LogResponse - """ + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model - # Construct dict forms of any model objects needed in order to build this model. + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' + log_request_model = {} # LogRequest + log_request_model['input'] = log_request_input_model + log_request_model['context'] = message_context_model + log_request_model['user_id'] = 'testString' - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] - - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' - - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] - - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' - runtime_entity_interpretation_model['festival'] = 'testString' - runtime_entity_interpretation_model['granularity'] = 'day' - runtime_entity_interpretation_model['range_link'] = 'testString' - runtime_entity_interpretation_model['range_modifier'] = 'testString' - runtime_entity_interpretation_model['relative_day'] = 72.5 - runtime_entity_interpretation_model['relative_month'] = 72.5 - runtime_entity_interpretation_model['relative_week'] = 72.5 - runtime_entity_interpretation_model['relative_weekend'] = 72.5 - runtime_entity_interpretation_model['relative_year'] = 72.5 - runtime_entity_interpretation_model['specific_day'] = 72.5 - runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model['specific_month'] = 72.5 - runtime_entity_interpretation_model['specific_quarter'] = 72.5 - runtime_entity_interpretation_model['specific_year'] = 72.5 - runtime_entity_interpretation_model['numeric_value'] = 72.5 - runtime_entity_interpretation_model['subtype'] = 'testString' - runtime_entity_interpretation_model['part_of_day'] = 'testString' - runtime_entity_interpretation_model['relative_hour'] = 72.5 - runtime_entity_interpretation_model['relative_minute'] = 72.5 - runtime_entity_interpretation_model['relative_second'] = 72.5 - runtime_entity_interpretation_model['specific_hour'] = 72.5 - runtime_entity_interpretation_model['specific_minute'] = 72.5 - runtime_entity_interpretation_model['specific_second'] = 72.5 - runtime_entity_interpretation_model['timezone'] = 'testString' - - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 - - runtime_entity_role_model = {} # RuntimeEntityRole - runtime_entity_role_model['type'] = 'date_from' - - runtime_entity_model = {} # RuntimeEntity - runtime_entity_model['entity'] = 'testString' - runtime_entity_model['location'] = [38] - runtime_entity_model['value'] = 'testString' - runtime_entity_model['confidence'] = 72.5 - runtime_entity_model['groups'] = [capture_group_model] - runtime_entity_model['interpretation'] = runtime_entity_interpretation_model - runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] - runtime_entity_model['role'] = runtime_entity_role_model - runtime_entity_model['skill'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' dialog_node_action_model = {} # DialogNodeAction dialog_node_action_model['name'] = 'testString' @@ -7611,6 +7725,10 @@ def test_log_response_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = 'testString' + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + log_response_output_model = {} # LogResponseOutput log_response_output_model['generic'] = [runtime_response_generic_model] log_response_output_model['intents'] = [runtime_intent_model] @@ -7619,85 +7737,96 @@ def test_log_response_serialization(self): log_response_output_model['debug'] = message_output_debug_model log_response_output_model['user_defined'] = {'anyKey': 'anyValue'} log_response_output_model['spelling'] = message_output_spelling_model + log_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True + log_response_model = {} # LogResponse + log_response_model['output'] = log_response_output_model + log_response_model['context'] = message_context_model + log_response_model['user_id'] = 'testString' - message_context_global_model = {} # MessageContextGlobal - message_context_global_model['system'] = message_context_global_system_model + log_model = {} # Log + log_model['log_id'] = 'testString' + log_model['request'] = log_request_model + log_model['response'] = log_response_model + log_model['assistant_id'] = 'testString' + log_model['session_id'] = 'testString' + log_model['skill_id'] = 'testString' + log_model['snapshot'] = 'testString' + log_model['request_timestamp'] = 'testString' + log_model['response_timestamp'] = 'testString' + log_model['language'] = 'testString' + log_model['customer_id'] = 'testString' - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + log_pagination_model = {} # LogPagination + log_pagination_model['next_url'] = 'testString' + log_pagination_model['matched'] = 38 + log_pagination_model['next_cursor'] = 'testString' - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model + # Construct a json representation of a LogCollection model + log_collection_model_json = {} + log_collection_model_json['logs'] = [log_model] + log_collection_model_json['pagination'] = log_pagination_model - message_context_action_skill_model = {} # MessageContextActionSkill - message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + # Construct a model instance of LogCollection by calling from_dict on the json representation + log_collection_model = LogCollection.from_dict(log_collection_model_json) + assert log_collection_model != False - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_dialog_skill_model - message_context_skills_model['actions skill'] = message_context_action_skill_model + # Construct a model instance of LogCollection by calling from_dict on the json representation + log_collection_model_dict = LogCollection.from_dict(log_collection_model_json).__dict__ + log_collection_model2 = LogCollection(**log_collection_model_dict) - message_context_model = {} # MessageContext - message_context_model['global'] = message_context_global_model - message_context_model['skills'] = message_context_skills_model - message_context_model['integrations'] = {'anyKey': 'anyValue'} + # Verify the model instances are equivalent + assert log_collection_model == log_collection_model2 - # Construct a json representation of a LogResponse model - log_response_model_json = {} - log_response_model_json['output'] = log_response_output_model - log_response_model_json['context'] = message_context_model - log_response_model_json['user_id'] = 'testString' + # Convert model instance back to dict and verify no loss of data + log_collection_model_json2 = log_collection_model.to_dict() + assert log_collection_model_json2 == log_collection_model_json - # Construct a model instance of LogResponse by calling from_dict on the json representation - log_response_model = LogResponse.from_dict(log_response_model_json) - assert log_response_model != False - # Construct a model instance of LogResponse by calling from_dict on the json representation - log_response_model_dict = LogResponse.from_dict(log_response_model_json).__dict__ - log_response_model2 = LogResponse(**log_response_model_dict) +class TestModel_LogPagination: + """ + Test Class for LogPagination + """ + + def test_log_pagination_serialization(self): + """ + Test serialization/deserialization for LogPagination + """ + + # Construct a json representation of a LogPagination model + log_pagination_model_json = {} + log_pagination_model_json['next_url'] = 'testString' + log_pagination_model_json['matched'] = 38 + log_pagination_model_json['next_cursor'] = 'testString' + + # Construct a model instance of LogPagination by calling from_dict on the json representation + log_pagination_model = LogPagination.from_dict(log_pagination_model_json) + assert log_pagination_model != False + + # Construct a model instance of LogPagination by calling from_dict on the json representation + log_pagination_model_dict = LogPagination.from_dict(log_pagination_model_json).__dict__ + log_pagination_model2 = LogPagination(**log_pagination_model_dict) # Verify the model instances are equivalent - assert log_response_model == log_response_model2 + assert log_pagination_model == log_pagination_model2 # Convert model instance back to dict and verify no loss of data - log_response_model_json2 = log_response_model.to_dict() - assert log_response_model_json2 == log_response_model_json + log_pagination_model_json2 = log_pagination_model.to_dict() + assert log_pagination_model_json2 == log_pagination_model_json -class TestModel_LogResponseOutput: +class TestModel_LogRequest: """ - Test Class for LogResponseOutput + Test Class for LogRequest """ - def test_log_response_output_serialization(self): + def test_log_request_serialization(self): """ - Test serialization/deserialization for LogResponseOutput + Test serialization/deserialization for LogRequest """ # Construct dict forms of any model objects needed in order to build this model. - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' - - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' - runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] - runtime_intent_model = {} # RuntimeIntent runtime_intent_model['intent'] = 'testString' runtime_intent_model['confidence'] = 72.5 @@ -7753,95 +7882,41 @@ def test_log_response_output_serialization(self): runtime_entity_model['role'] = runtime_entity_role_model runtime_entity_model['skill'] = 'testString' - dialog_node_action_model = {} # DialogNodeAction - dialog_node_action_model['name'] = 'testString' - dialog_node_action_model['type'] = 'client' - dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} - dialog_node_action_model['result_variable'] = 'testString' - dialog_node_action_model['credentials'] = 'testString' - - dialog_node_visited_model = {} # DialogNodeVisited - dialog_node_visited_model['dialog_node'] = 'testString' - dialog_node_visited_model['title'] = 'testString' - dialog_node_visited_model['conditions'] = 'testString' - - log_message_source_model = {} # LogMessageSourceDialogNode - log_message_source_model['type'] = 'dialog_node' - log_message_source_model['dialog_node'] = 'testString' - - dialog_log_message_model = {} # DialogLogMessage - dialog_log_message_model['level'] = 'info' - dialog_log_message_model['message'] = 'testString' - dialog_log_message_model['code'] = 'testString' - dialog_log_message_model['source'] = log_message_source_model - - turn_event_action_source_model = {} # TurnEventActionSource - turn_event_action_source_model['type'] = 'action' - turn_event_action_source_model['action'] = 'testString' - turn_event_action_source_model['action_title'] = 'testString' - turn_event_action_source_model['condition'] = 'testString' - - message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited - message_output_debug_turn_event_model['event'] = 'action_visited' - message_output_debug_turn_event_model['source'] = turn_event_action_source_model - message_output_debug_turn_event_model['action_start_time'] = 'testString' - message_output_debug_turn_event_model['condition_type'] = 'user_defined' - message_output_debug_turn_event_model['reason'] = 'intent' - message_output_debug_turn_event_model['result_variable'] = 'testString' - - message_output_debug_model = {} # MessageOutputDebug - message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] - message_output_debug_model['log_messages'] = [dialog_log_message_model] - message_output_debug_model['branch_exited'] = True - message_output_debug_model['branch_exited_reason'] = 'completed' - message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] - - message_output_spelling_model = {} # MessageOutputSpelling - message_output_spelling_model['text'] = 'testString' - message_output_spelling_model['original_text'] = 'testString' - message_output_spelling_model['suggested_text'] = 'testString' - - # Construct a json representation of a LogResponseOutput model - log_response_output_model_json = {} - log_response_output_model_json['generic'] = [runtime_response_generic_model] - log_response_output_model_json['intents'] = [runtime_intent_model] - log_response_output_model_json['entities'] = [runtime_entity_model] - log_response_output_model_json['actions'] = [dialog_node_action_model] - log_response_output_model_json['debug'] = message_output_debug_model - log_response_output_model_json['user_defined'] = {'anyKey': 'anyValue'} - log_response_output_model_json['spelling'] = message_output_spelling_model - - # Construct a model instance of LogResponseOutput by calling from_dict on the json representation - log_response_output_model = LogResponseOutput.from_dict(log_response_output_model_json) - assert log_response_output_model != False - - # Construct a model instance of LogResponseOutput by calling from_dict on the json representation - log_response_output_model_dict = LogResponseOutput.from_dict(log_response_output_model_json).__dict__ - log_response_output_model2 = LogResponseOutput(**log_response_output_model_dict) - - # Verify the model instances are equivalent - assert log_response_output_model == log_response_output_model2 - - # Convert model instance back to dict and verify no loss of data - log_response_output_model_json2 = log_response_output_model.to_dict() - assert log_response_output_model_json2 == log_response_output_model_json + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' -class TestModel_MessageContext: - """ - Test Class for MessageContext - """ + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True - def test_message_context_serialization(self): - """ - Test serialization/deserialization for MessageContext - """ + message_input_options_model = {} # MessageInputOptions + message_input_options_model['restart'] = False + message_input_options_model['alternate_intents'] = False + message_input_options_model['async_callout'] = False + message_input_options_model['spelling'] = message_input_options_spelling_model + message_input_options_model['debug'] = False + message_input_options_model['return_context'] = True + message_input_options_model['export'] = True - # Construct dict forms of any model objects needed in order to build this model. + log_request_input_model = {} # LogRequestInput + log_request_input_model['message_type'] = 'text' + log_request_input_model['text'] = 'Hello' + log_request_input_model['intents'] = [runtime_intent_model] + log_request_input_model['entities'] = [runtime_entity_model] + log_request_input_model['suggestion_id'] = 'testString' + log_request_input_model['attachments'] = [message_input_attachment_model] + log_request_input_model['analytics'] = request_analytics_model + log_request_input_model['options'] = message_input_options_model message_context_global_system_model = {} # MessageContextGlobalSystem message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['user_id'] = 'my_user_id' message_context_global_system_model['turn_count'] = 38 message_context_global_system_model['locale'] = 'en-us' message_context_global_system_model['reference_time'] = 'testString' @@ -7870,287 +7945,49 @@ def test_message_context_serialization(self): message_context_skills_model['main skill'] = message_context_dialog_skill_model message_context_skills_model['actions skill'] = message_context_action_skill_model - # Construct a json representation of a MessageContext model - message_context_model_json = {} - message_context_model_json['global'] = message_context_global_model - message_context_model_json['skills'] = message_context_skills_model - message_context_model_json['integrations'] = {'anyKey': 'anyValue'} - - # Construct a model instance of MessageContext by calling from_dict on the json representation - message_context_model = MessageContext.from_dict(message_context_model_json) - assert message_context_model != False - - # Construct a model instance of MessageContext by calling from_dict on the json representation - message_context_model_dict = MessageContext.from_dict(message_context_model_json).__dict__ - message_context_model2 = MessageContext(**message_context_model_dict) - - # Verify the model instances are equivalent - assert message_context_model == message_context_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_model_json2 = message_context_model.to_dict() - assert message_context_model_json2 == message_context_model_json - - -class TestModel_MessageContextActionSkill: - """ - Test Class for MessageContextActionSkill - """ - - def test_message_context_action_skill_serialization(self): - """ - Test serialization/deserialization for MessageContextActionSkill - """ - - # Construct dict forms of any model objects needed in order to build this model. - - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} - # Construct a json representation of a MessageContextActionSkill model - message_context_action_skill_model_json = {} - message_context_action_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model_json['system'] = message_context_skill_system_model - message_context_action_skill_model_json['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model_json['skill_variables'] = {'anyKey': 'anyValue'} + # Construct a json representation of a LogRequest model + log_request_model_json = {} + log_request_model_json['input'] = log_request_input_model + log_request_model_json['context'] = message_context_model + log_request_model_json['user_id'] = 'testString' - # Construct a model instance of MessageContextActionSkill by calling from_dict on the json representation - message_context_action_skill_model = MessageContextActionSkill.from_dict(message_context_action_skill_model_json) - assert message_context_action_skill_model != False + # Construct a model instance of LogRequest by calling from_dict on the json representation + log_request_model = LogRequest.from_dict(log_request_model_json) + assert log_request_model != False - # Construct a model instance of MessageContextActionSkill by calling from_dict on the json representation - message_context_action_skill_model_dict = MessageContextActionSkill.from_dict(message_context_action_skill_model_json).__dict__ - message_context_action_skill_model2 = MessageContextActionSkill(**message_context_action_skill_model_dict) + # Construct a model instance of LogRequest by calling from_dict on the json representation + log_request_model_dict = LogRequest.from_dict(log_request_model_json).__dict__ + log_request_model2 = LogRequest(**log_request_model_dict) # Verify the model instances are equivalent - assert message_context_action_skill_model == message_context_action_skill_model2 + assert log_request_model == log_request_model2 # Convert model instance back to dict and verify no loss of data - message_context_action_skill_model_json2 = message_context_action_skill_model.to_dict() - assert message_context_action_skill_model_json2 == message_context_action_skill_model_json + log_request_model_json2 = log_request_model.to_dict() + assert log_request_model_json2 == log_request_model_json -class TestModel_MessageContextDialogSkill: +class TestModel_LogRequestInput: """ - Test Class for MessageContextDialogSkill + Test Class for LogRequestInput """ - def test_message_context_dialog_skill_serialization(self): + def test_log_request_input_serialization(self): """ - Test serialization/deserialization for MessageContextDialogSkill + Test serialization/deserialization for LogRequestInput """ # Construct dict forms of any model objects needed in order to build this model. - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' - - # Construct a json representation of a MessageContextDialogSkill model - message_context_dialog_skill_model_json = {} - message_context_dialog_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model_json['system'] = message_context_skill_system_model - - # Construct a model instance of MessageContextDialogSkill by calling from_dict on the json representation - message_context_dialog_skill_model = MessageContextDialogSkill.from_dict(message_context_dialog_skill_model_json) - assert message_context_dialog_skill_model != False - - # Construct a model instance of MessageContextDialogSkill by calling from_dict on the json representation - message_context_dialog_skill_model_dict = MessageContextDialogSkill.from_dict(message_context_dialog_skill_model_json).__dict__ - message_context_dialog_skill_model2 = MessageContextDialogSkill(**message_context_dialog_skill_model_dict) - - # Verify the model instances are equivalent - assert message_context_dialog_skill_model == message_context_dialog_skill_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_dialog_skill_model_json2 = message_context_dialog_skill_model.to_dict() - assert message_context_dialog_skill_model_json2 == message_context_dialog_skill_model_json - - -class TestModel_MessageContextGlobal: - """ - Test Class for MessageContextGlobal - """ - - def test_message_context_global_serialization(self): - """ - Test serialization/deserialization for MessageContextGlobal - """ - - # Construct dict forms of any model objects needed in order to build this model. - - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True - - # Construct a json representation of a MessageContextGlobal model - message_context_global_model_json = {} - message_context_global_model_json['system'] = message_context_global_system_model - - # Construct a model instance of MessageContextGlobal by calling from_dict on the json representation - message_context_global_model = MessageContextGlobal.from_dict(message_context_global_model_json) - assert message_context_global_model != False - - # Construct a model instance of MessageContextGlobal by calling from_dict on the json representation - message_context_global_model_dict = MessageContextGlobal.from_dict(message_context_global_model_json).__dict__ - message_context_global_model2 = MessageContextGlobal(**message_context_global_model_dict) - - # Verify the model instances are equivalent - assert message_context_global_model == message_context_global_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_global_model_json2 = message_context_global_model.to_dict() - assert message_context_global_model_json2 == message_context_global_model_json - - -class TestModel_MessageContextGlobalSystem: - """ - Test Class for MessageContextGlobalSystem - """ - - def test_message_context_global_system_serialization(self): - """ - Test serialization/deserialization for MessageContextGlobalSystem - """ - - # Construct a json representation of a MessageContextGlobalSystem model - message_context_global_system_model_json = {} - message_context_global_system_model_json['timezone'] = 'testString' - message_context_global_system_model_json['user_id'] = 'testString' - message_context_global_system_model_json['turn_count'] = 38 - message_context_global_system_model_json['locale'] = 'en-us' - message_context_global_system_model_json['reference_time'] = 'testString' - message_context_global_system_model_json['session_start_time'] = 'testString' - message_context_global_system_model_json['state'] = 'testString' - message_context_global_system_model_json['skip_user_input'] = True - - # Construct a model instance of MessageContextGlobalSystem by calling from_dict on the json representation - message_context_global_system_model = MessageContextGlobalSystem.from_dict(message_context_global_system_model_json) - assert message_context_global_system_model != False - - # Construct a model instance of MessageContextGlobalSystem by calling from_dict on the json representation - message_context_global_system_model_dict = MessageContextGlobalSystem.from_dict(message_context_global_system_model_json).__dict__ - message_context_global_system_model2 = MessageContextGlobalSystem(**message_context_global_system_model_dict) - - # Verify the model instances are equivalent - assert message_context_global_system_model == message_context_global_system_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_global_system_model_json2 = message_context_global_system_model.to_dict() - assert message_context_global_system_model_json2 == message_context_global_system_model_json - - -class TestModel_MessageContextSkillSystem: - """ - Test Class for MessageContextSkillSystem - """ - - def test_message_context_skill_system_serialization(self): - """ - Test serialization/deserialization for MessageContextSkillSystem - """ - - # Construct a json representation of a MessageContextSkillSystem model - message_context_skill_system_model_json = {} - message_context_skill_system_model_json['state'] = 'testString' - message_context_skill_system_model_json['foo'] = 'testString' - - # Construct a model instance of MessageContextSkillSystem by calling from_dict on the json representation - message_context_skill_system_model = MessageContextSkillSystem.from_dict(message_context_skill_system_model_json) - assert message_context_skill_system_model != False - - # Construct a model instance of MessageContextSkillSystem by calling from_dict on the json representation - message_context_skill_system_model_dict = MessageContextSkillSystem.from_dict(message_context_skill_system_model_json).__dict__ - message_context_skill_system_model2 = MessageContextSkillSystem(**message_context_skill_system_model_dict) - - # Verify the model instances are equivalent - assert message_context_skill_system_model == message_context_skill_system_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_skill_system_model_json2 = message_context_skill_system_model.to_dict() - assert message_context_skill_system_model_json2 == message_context_skill_system_model_json - - # Test get_properties and set_properties methods. - message_context_skill_system_model.set_properties({}) - actual_dict = message_context_skill_system_model.get_properties() - assert actual_dict == {} - - expected_dict = {'foo': 'testString'} - message_context_skill_system_model.set_properties(expected_dict) - actual_dict = message_context_skill_system_model.get_properties() - assert actual_dict.keys() == expected_dict.keys() - - -class TestModel_MessageContextSkills: - """ - Test Class for MessageContextSkills - """ - - def test_message_context_skills_serialization(self): - """ - Test serialization/deserialization for MessageContextSkills - """ - - # Construct dict forms of any model objects needed in order to build this model. - - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' - - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model - - message_context_action_skill_model = {} # MessageContextActionSkill - message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - - # Construct a json representation of a MessageContextSkills model - message_context_skills_model_json = {} - message_context_skills_model_json['main skill'] = message_context_dialog_skill_model - message_context_skills_model_json['actions skill'] = message_context_action_skill_model - - # Construct a model instance of MessageContextSkills by calling from_dict on the json representation - message_context_skills_model = MessageContextSkills.from_dict(message_context_skills_model_json) - assert message_context_skills_model != False - - # Construct a model instance of MessageContextSkills by calling from_dict on the json representation - message_context_skills_model_dict = MessageContextSkills.from_dict(message_context_skills_model_json).__dict__ - message_context_skills_model2 = MessageContextSkills(**message_context_skills_model_dict) - - # Verify the model instances are equivalent - assert message_context_skills_model == message_context_skills_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_skills_model_json2 = message_context_skills_model.to_dict() - assert message_context_skills_model_json2 == message_context_skills_model_json - - -class TestModel_MessageInput: - """ - Test Class for MessageInput - """ - - def test_message_input_serialization(self): - """ - Test serialization/deserialization for MessageInput - """ - - # Construct dict forms of any model objects needed in order to build this model. - - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' capture_group_model = {} # CaptureGroup capture_group_model['group'] = 'testString' @@ -8224,156 +8061,81 @@ def test_message_input_serialization(self): message_input_options_model['return_context'] = False message_input_options_model['export'] = False - # Construct a json representation of a MessageInput model - message_input_model_json = {} - message_input_model_json['message_type'] = 'text' - message_input_model_json['text'] = 'testString' - message_input_model_json['intents'] = [runtime_intent_model] - message_input_model_json['entities'] = [runtime_entity_model] - message_input_model_json['suggestion_id'] = 'testString' - message_input_model_json['attachments'] = [message_input_attachment_model] - message_input_model_json['analytics'] = request_analytics_model - message_input_model_json['options'] = message_input_options_model + # Construct a json representation of a LogRequestInput model + log_request_input_model_json = {} + log_request_input_model_json['message_type'] = 'text' + log_request_input_model_json['text'] = 'testString' + log_request_input_model_json['intents'] = [runtime_intent_model] + log_request_input_model_json['entities'] = [runtime_entity_model] + log_request_input_model_json['suggestion_id'] = 'testString' + log_request_input_model_json['attachments'] = [message_input_attachment_model] + log_request_input_model_json['analytics'] = request_analytics_model + log_request_input_model_json['options'] = message_input_options_model - # Construct a model instance of MessageInput by calling from_dict on the json representation - message_input_model = MessageInput.from_dict(message_input_model_json) - assert message_input_model != False + # Construct a model instance of LogRequestInput by calling from_dict on the json representation + log_request_input_model = LogRequestInput.from_dict(log_request_input_model_json) + assert log_request_input_model != False - # Construct a model instance of MessageInput by calling from_dict on the json representation - message_input_model_dict = MessageInput.from_dict(message_input_model_json).__dict__ - message_input_model2 = MessageInput(**message_input_model_dict) + # Construct a model instance of LogRequestInput by calling from_dict on the json representation + log_request_input_model_dict = LogRequestInput.from_dict(log_request_input_model_json).__dict__ + log_request_input_model2 = LogRequestInput(**log_request_input_model_dict) # Verify the model instances are equivalent - assert message_input_model == message_input_model2 + assert log_request_input_model == log_request_input_model2 # Convert model instance back to dict and verify no loss of data - message_input_model_json2 = message_input_model.to_dict() - assert message_input_model_json2 == message_input_model_json + log_request_input_model_json2 = log_request_input_model.to_dict() + assert log_request_input_model_json2 == log_request_input_model_json -class TestModel_MessageInputAttachment: +class TestModel_LogResponse: """ - Test Class for MessageInputAttachment + Test Class for LogResponse """ - def test_message_input_attachment_serialization(self): + def test_log_response_serialization(self): """ - Test serialization/deserialization for MessageInputAttachment + Test serialization/deserialization for LogResponse """ - # Construct a json representation of a MessageInputAttachment model - message_input_attachment_model_json = {} - message_input_attachment_model_json['url'] = 'testString' - message_input_attachment_model_json['media_type'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of MessageInputAttachment by calling from_dict on the json representation - message_input_attachment_model = MessageInputAttachment.from_dict(message_input_attachment_model_json) - assert message_input_attachment_model != False - - # Construct a model instance of MessageInputAttachment by calling from_dict on the json representation - message_input_attachment_model_dict = MessageInputAttachment.from_dict(message_input_attachment_model_json).__dict__ - message_input_attachment_model2 = MessageInputAttachment(**message_input_attachment_model_dict) - - # Verify the model instances are equivalent - assert message_input_attachment_model == message_input_attachment_model2 - - # Convert model instance back to dict and verify no loss of data - message_input_attachment_model_json2 = message_input_attachment_model.to_dict() - assert message_input_attachment_model_json2 == message_input_attachment_model_json - - -class TestModel_MessageInputOptions: - """ - Test Class for MessageInputOptions - """ - - def test_message_input_options_serialization(self): - """ - Test serialization/deserialization for MessageInputOptions - """ - - # Construct dict forms of any model objects needed in order to build this model. - - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True - - # Construct a json representation of a MessageInputOptions model - message_input_options_model_json = {} - message_input_options_model_json['restart'] = False - message_input_options_model_json['alternate_intents'] = False - message_input_options_model_json['async_callout'] = False - message_input_options_model_json['spelling'] = message_input_options_spelling_model - message_input_options_model_json['debug'] = False - message_input_options_model_json['return_context'] = False - message_input_options_model_json['export'] = False - - # Construct a model instance of MessageInputOptions by calling from_dict on the json representation - message_input_options_model = MessageInputOptions.from_dict(message_input_options_model_json) - assert message_input_options_model != False - - # Construct a model instance of MessageInputOptions by calling from_dict on the json representation - message_input_options_model_dict = MessageInputOptions.from_dict(message_input_options_model_json).__dict__ - message_input_options_model2 = MessageInputOptions(**message_input_options_model_dict) - - # Verify the model instances are equivalent - assert message_input_options_model == message_input_options_model2 - - # Convert model instance back to dict and verify no loss of data - message_input_options_model_json2 = message_input_options_model.to_dict() - assert message_input_options_model_json2 == message_input_options_model_json - - -class TestModel_MessageInputOptionsSpelling: - """ - Test Class for MessageInputOptionsSpelling - """ - - def test_message_input_options_spelling_serialization(self): - """ - Test serialization/deserialization for MessageInputOptionsSpelling - """ - - # Construct a json representation of a MessageInputOptionsSpelling model - message_input_options_spelling_model_json = {} - message_input_options_spelling_model_json['suggestions'] = True - message_input_options_spelling_model_json['auto_correct'] = True - - # Construct a model instance of MessageInputOptionsSpelling by calling from_dict on the json representation - message_input_options_spelling_model = MessageInputOptionsSpelling.from_dict(message_input_options_spelling_model_json) - assert message_input_options_spelling_model != False - - # Construct a model instance of MessageInputOptionsSpelling by calling from_dict on the json representation - message_input_options_spelling_model_dict = MessageInputOptionsSpelling.from_dict(message_input_options_spelling_model_json).__dict__ - message_input_options_spelling_model2 = MessageInputOptionsSpelling(**message_input_options_spelling_model_dict) - - # Verify the model instances are equivalent - assert message_input_options_spelling_model == message_input_options_spelling_model2 - - # Convert model instance back to dict and verify no loss of data - message_input_options_spelling_model_json2 = message_input_options_spelling_model.to_dict() - assert message_input_options_spelling_model_json2 == message_input_options_spelling_model_json - - -class TestModel_MessageOutput: - """ - Test Class for MessageOutput - """ - - def test_message_output_serialization(self): - """ - Test serialization/deserialization for MessageOutput - """ - - # Construct dict forms of any model objects needed in order to build this model. - - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' - - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' runtime_intent_model = {} # RuntimeIntent runtime_intent_model['intent'] = 'testString' @@ -8478,44 +8240,189 @@ def test_message_output_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = 'testString' - # Construct a json representation of a MessageOutput model - message_output_model_json = {} - message_output_model_json['generic'] = [runtime_response_generic_model] - message_output_model_json['intents'] = [runtime_intent_model] - message_output_model_json['entities'] = [runtime_entity_model] - message_output_model_json['actions'] = [dialog_node_action_model] - message_output_model_json['debug'] = message_output_debug_model - message_output_model_json['user_defined'] = {'anyKey': 'anyValue'} - message_output_model_json['spelling'] = message_output_spelling_model + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' - # Construct a model instance of MessageOutput by calling from_dict on the json representation - message_output_model = MessageOutput.from_dict(message_output_model_json) - assert message_output_model != False + log_response_output_model = {} # LogResponseOutput + log_response_output_model['generic'] = [runtime_response_generic_model] + log_response_output_model['intents'] = [runtime_intent_model] + log_response_output_model['entities'] = [runtime_entity_model] + log_response_output_model['actions'] = [dialog_node_action_model] + log_response_output_model['debug'] = message_output_debug_model + log_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + log_response_output_model['spelling'] = message_output_spelling_model + log_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] - # Construct a model instance of MessageOutput by calling from_dict on the json representation - message_output_model_dict = MessageOutput.from_dict(message_output_model_json).__dict__ - message_output_model2 = MessageOutput(**message_output_model_dict) + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model + + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} + + # Construct a json representation of a LogResponse model + log_response_model_json = {} + log_response_model_json['output'] = log_response_output_model + log_response_model_json['context'] = message_context_model + log_response_model_json['user_id'] = 'testString' + + # Construct a model instance of LogResponse by calling from_dict on the json representation + log_response_model = LogResponse.from_dict(log_response_model_json) + assert log_response_model != False + + # Construct a model instance of LogResponse by calling from_dict on the json representation + log_response_model_dict = LogResponse.from_dict(log_response_model_json).__dict__ + log_response_model2 = LogResponse(**log_response_model_dict) # Verify the model instances are equivalent - assert message_output_model == message_output_model2 + assert log_response_model == log_response_model2 # Convert model instance back to dict and verify no loss of data - message_output_model_json2 = message_output_model.to_dict() - assert message_output_model_json2 == message_output_model_json + log_response_model_json2 = log_response_model.to_dict() + assert log_response_model_json2 == log_response_model_json -class TestModel_MessageOutputDebug: +class TestModel_LogResponseOutput: """ - Test Class for MessageOutputDebug + Test Class for LogResponseOutput """ - def test_message_output_debug_serialization(self): + def test_log_response_output_serialization(self): """ - Test serialization/deserialization for MessageOutputDebug + Test serialization/deserialization for LogResponseOutput """ # Construct dict forms of any model objects needed in order to build this model. + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + dialog_node_visited_model = {} # DialogNodeVisited dialog_node_visited_model['dialog_node'] = 'testString' dialog_node_visited_model['title'] = 'testString' @@ -8545,883 +8452,1066 @@ def test_message_output_debug_serialization(self): message_output_debug_turn_event_model['reason'] = 'intent' message_output_debug_turn_event_model['result_variable'] = 'testString' - # Construct a json representation of a MessageOutputDebug model - message_output_debug_model_json = {} - message_output_debug_model_json['nodes_visited'] = [dialog_node_visited_model] - message_output_debug_model_json['log_messages'] = [dialog_log_message_model] - message_output_debug_model_json['branch_exited'] = True - message_output_debug_model_json['branch_exited_reason'] = 'completed' - message_output_debug_model_json['turn_events'] = [message_output_debug_turn_event_model] + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] - # Construct a model instance of MessageOutputDebug by calling from_dict on the json representation - message_output_debug_model = MessageOutputDebug.from_dict(message_output_debug_model_json) - assert message_output_debug_model != False + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' - # Construct a model instance of MessageOutputDebug by calling from_dict on the json representation - message_output_debug_model_dict = MessageOutputDebug.from_dict(message_output_debug_model_json).__dict__ - message_output_debug_model2 = MessageOutputDebug(**message_output_debug_model_dict) + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + # Construct a json representation of a LogResponseOutput model + log_response_output_model_json = {} + log_response_output_model_json['generic'] = [runtime_response_generic_model] + log_response_output_model_json['intents'] = [runtime_intent_model] + log_response_output_model_json['entities'] = [runtime_entity_model] + log_response_output_model_json['actions'] = [dialog_node_action_model] + log_response_output_model_json['debug'] = message_output_debug_model + log_response_output_model_json['user_defined'] = {'anyKey': 'anyValue'} + log_response_output_model_json['spelling'] = message_output_spelling_model + log_response_output_model_json['llm_metadata'] = [message_output_llm_metadata_model] + + # Construct a model instance of LogResponseOutput by calling from_dict on the json representation + log_response_output_model = LogResponseOutput.from_dict(log_response_output_model_json) + assert log_response_output_model != False + + # Construct a model instance of LogResponseOutput by calling from_dict on the json representation + log_response_output_model_dict = LogResponseOutput.from_dict(log_response_output_model_json).__dict__ + log_response_output_model2 = LogResponseOutput(**log_response_output_model_dict) # Verify the model instances are equivalent - assert message_output_debug_model == message_output_debug_model2 + assert log_response_output_model == log_response_output_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_model_json2 = message_output_debug_model.to_dict() - assert message_output_debug_model_json2 == message_output_debug_model_json + log_response_output_model_json2 = log_response_output_model.to_dict() + assert log_response_output_model_json2 == log_response_output_model_json -class TestModel_MessageOutputSpelling: +class TestModel_MessageContext: """ - Test Class for MessageOutputSpelling + Test Class for MessageContext """ - def test_message_output_spelling_serialization(self): + def test_message_context_serialization(self): """ - Test serialization/deserialization for MessageOutputSpelling + Test serialization/deserialization for MessageContext """ - # Construct a json representation of a MessageOutputSpelling model - message_output_spelling_model_json = {} - message_output_spelling_model_json['text'] = 'testString' - message_output_spelling_model_json['original_text'] = 'testString' - message_output_spelling_model_json['suggested_text'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of MessageOutputSpelling by calling from_dict on the json representation - message_output_spelling_model = MessageOutputSpelling.from_dict(message_output_spelling_model_json) - assert message_output_spelling_model != False + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True - # Construct a model instance of MessageOutputSpelling by calling from_dict on the json representation - message_output_spelling_model_dict = MessageOutputSpelling.from_dict(message_output_spelling_model_json).__dict__ - message_output_spelling_model2 = MessageOutputSpelling(**message_output_spelling_model_dict) + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model + + # Construct a json representation of a MessageContext model + message_context_model_json = {} + message_context_model_json['global'] = message_context_global_model + message_context_model_json['skills'] = message_context_skills_model + message_context_model_json['integrations'] = {'anyKey': 'anyValue'} + + # Construct a model instance of MessageContext by calling from_dict on the json representation + message_context_model = MessageContext.from_dict(message_context_model_json) + assert message_context_model != False + + # Construct a model instance of MessageContext by calling from_dict on the json representation + message_context_model_dict = MessageContext.from_dict(message_context_model_json).__dict__ + message_context_model2 = MessageContext(**message_context_model_dict) # Verify the model instances are equivalent - assert message_output_spelling_model == message_output_spelling_model2 + assert message_context_model == message_context_model2 # Convert model instance back to dict and verify no loss of data - message_output_spelling_model_json2 = message_output_spelling_model.to_dict() - assert message_output_spelling_model_json2 == message_output_spelling_model_json + message_context_model_json2 = message_context_model.to_dict() + assert message_context_model_json2 == message_context_model_json -class TestModel_Metadata: +class TestModel_MessageContextActionSkill: """ - Test Class for Metadata + Test Class for MessageContextActionSkill """ - def test_metadata_serialization(self): + def test_message_context_action_skill_serialization(self): """ - Test serialization/deserialization for Metadata + Test serialization/deserialization for MessageContextActionSkill """ - # Construct a json representation of a Metadata model - metadata_model_json = {} - metadata_model_json['id'] = 38 + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of Metadata by calling from_dict on the json representation - metadata_model = Metadata.from_dict(metadata_model_json) - assert metadata_model != False + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' - # Construct a model instance of Metadata by calling from_dict on the json representation - metadata_model_dict = Metadata.from_dict(metadata_model_json).__dict__ - metadata_model2 = Metadata(**metadata_model_dict) + # Construct a json representation of a MessageContextActionSkill model + message_context_action_skill_model_json = {} + message_context_action_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model_json['system'] = message_context_skill_system_model + message_context_action_skill_model_json['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model_json['skill_variables'] = {'anyKey': 'anyValue'} + + # Construct a model instance of MessageContextActionSkill by calling from_dict on the json representation + message_context_action_skill_model = MessageContextActionSkill.from_dict(message_context_action_skill_model_json) + assert message_context_action_skill_model != False + + # Construct a model instance of MessageContextActionSkill by calling from_dict on the json representation + message_context_action_skill_model_dict = MessageContextActionSkill.from_dict(message_context_action_skill_model_json).__dict__ + message_context_action_skill_model2 = MessageContextActionSkill(**message_context_action_skill_model_dict) # Verify the model instances are equivalent - assert metadata_model == metadata_model2 + assert message_context_action_skill_model == message_context_action_skill_model2 # Convert model instance back to dict and verify no loss of data - metadata_model_json2 = metadata_model.to_dict() - assert metadata_model_json2 == metadata_model_json + message_context_action_skill_model_json2 = message_context_action_skill_model.to_dict() + assert message_context_action_skill_model_json2 == message_context_action_skill_model_json -class TestModel_MonitorAssistantReleaseImportArtifactResponse: +class TestModel_MessageContextDialogSkill: """ - Test Class for MonitorAssistantReleaseImportArtifactResponse + Test Class for MessageContextDialogSkill """ - def test_monitor_assistant_release_import_artifact_response_serialization(self): + def test_message_context_dialog_skill_serialization(self): """ - Test serialization/deserialization for MonitorAssistantReleaseImportArtifactResponse + Test serialization/deserialization for MessageContextDialogSkill """ - # Construct a json representation of a MonitorAssistantReleaseImportArtifactResponse model - monitor_assistant_release_import_artifact_response_model_json = {} - monitor_assistant_release_import_artifact_response_model_json['skill_impact_in_draft'] = ['action'] + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of MonitorAssistantReleaseImportArtifactResponse by calling from_dict on the json representation - monitor_assistant_release_import_artifact_response_model = MonitorAssistantReleaseImportArtifactResponse.from_dict(monitor_assistant_release_import_artifact_response_model_json) - assert monitor_assistant_release_import_artifact_response_model != False + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' - # Construct a model instance of MonitorAssistantReleaseImportArtifactResponse by calling from_dict on the json representation - monitor_assistant_release_import_artifact_response_model_dict = MonitorAssistantReleaseImportArtifactResponse.from_dict(monitor_assistant_release_import_artifact_response_model_json).__dict__ - monitor_assistant_release_import_artifact_response_model2 = MonitorAssistantReleaseImportArtifactResponse(**monitor_assistant_release_import_artifact_response_model_dict) + # Construct a json representation of a MessageContextDialogSkill model + message_context_dialog_skill_model_json = {} + message_context_dialog_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model_json['system'] = message_context_skill_system_model + + # Construct a model instance of MessageContextDialogSkill by calling from_dict on the json representation + message_context_dialog_skill_model = MessageContextDialogSkill.from_dict(message_context_dialog_skill_model_json) + assert message_context_dialog_skill_model != False + + # Construct a model instance of MessageContextDialogSkill by calling from_dict on the json representation + message_context_dialog_skill_model_dict = MessageContextDialogSkill.from_dict(message_context_dialog_skill_model_json).__dict__ + message_context_dialog_skill_model2 = MessageContextDialogSkill(**message_context_dialog_skill_model_dict) # Verify the model instances are equivalent - assert monitor_assistant_release_import_artifact_response_model == monitor_assistant_release_import_artifact_response_model2 + assert message_context_dialog_skill_model == message_context_dialog_skill_model2 # Convert model instance back to dict and verify no loss of data - monitor_assistant_release_import_artifact_response_model_json2 = monitor_assistant_release_import_artifact_response_model.to_dict() - assert monitor_assistant_release_import_artifact_response_model_json2 == monitor_assistant_release_import_artifact_response_model_json + message_context_dialog_skill_model_json2 = message_context_dialog_skill_model.to_dict() + assert message_context_dialog_skill_model_json2 == message_context_dialog_skill_model_json -class TestModel_Pagination: +class TestModel_MessageContextGlobal: """ - Test Class for Pagination + Test Class for MessageContextGlobal """ - def test_pagination_serialization(self): + def test_message_context_global_serialization(self): """ - Test serialization/deserialization for Pagination + Test serialization/deserialization for MessageContextGlobal """ - # Construct a json representation of a Pagination model - pagination_model_json = {} - pagination_model_json['refresh_url'] = 'testString' - pagination_model_json['next_url'] = 'testString' - pagination_model_json['total'] = 38 - pagination_model_json['matched'] = 38 - pagination_model_json['refresh_cursor'] = 'testString' - pagination_model_json['next_cursor'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of Pagination by calling from_dict on the json representation - pagination_model = Pagination.from_dict(pagination_model_json) - assert pagination_model != False + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True - # Construct a model instance of Pagination by calling from_dict on the json representation - pagination_model_dict = Pagination.from_dict(pagination_model_json).__dict__ - pagination_model2 = Pagination(**pagination_model_dict) + # Construct a json representation of a MessageContextGlobal model + message_context_global_model_json = {} + message_context_global_model_json['system'] = message_context_global_system_model + + # Construct a model instance of MessageContextGlobal by calling from_dict on the json representation + message_context_global_model = MessageContextGlobal.from_dict(message_context_global_model_json) + assert message_context_global_model != False + + # Construct a model instance of MessageContextGlobal by calling from_dict on the json representation + message_context_global_model_dict = MessageContextGlobal.from_dict(message_context_global_model_json).__dict__ + message_context_global_model2 = MessageContextGlobal(**message_context_global_model_dict) # Verify the model instances are equivalent - assert pagination_model == pagination_model2 + assert message_context_global_model == message_context_global_model2 # Convert model instance back to dict and verify no loss of data - pagination_model_json2 = pagination_model.to_dict() - assert pagination_model_json2 == pagination_model_json + message_context_global_model_json2 = message_context_global_model.to_dict() + assert message_context_global_model_json2 == message_context_global_model_json -class TestModel_ProviderAuthenticationOAuth2: +class TestModel_MessageContextGlobalSystem: """ - Test Class for ProviderAuthenticationOAuth2 + Test Class for MessageContextGlobalSystem """ - def test_provider_authentication_o_auth2_serialization(self): + def test_message_context_global_system_serialization(self): """ - Test serialization/deserialization for ProviderAuthenticationOAuth2 + Test serialization/deserialization for MessageContextGlobalSystem """ - # Construct dict forms of any model objects needed in order to build this model. - - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' - - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - - # Construct a json representation of a ProviderAuthenticationOAuth2 model - provider_authentication_o_auth2_model_json = {} - provider_authentication_o_auth2_model_json['preferred_flow'] = 'password' - provider_authentication_o_auth2_model_json['flows'] = provider_authentication_o_auth2_flows_model + # Construct a json representation of a MessageContextGlobalSystem model + message_context_global_system_model_json = {} + message_context_global_system_model_json['timezone'] = 'testString' + message_context_global_system_model_json['user_id'] = 'testString' + message_context_global_system_model_json['turn_count'] = 38 + message_context_global_system_model_json['locale'] = 'en-us' + message_context_global_system_model_json['reference_time'] = 'testString' + message_context_global_system_model_json['session_start_time'] = 'testString' + message_context_global_system_model_json['state'] = 'testString' + message_context_global_system_model_json['skip_user_input'] = True - # Construct a model instance of ProviderAuthenticationOAuth2 by calling from_dict on the json representation - provider_authentication_o_auth2_model = ProviderAuthenticationOAuth2.from_dict(provider_authentication_o_auth2_model_json) - assert provider_authentication_o_auth2_model != False + # Construct a model instance of MessageContextGlobalSystem by calling from_dict on the json representation + message_context_global_system_model = MessageContextGlobalSystem.from_dict(message_context_global_system_model_json) + assert message_context_global_system_model != False - # Construct a model instance of ProviderAuthenticationOAuth2 by calling from_dict on the json representation - provider_authentication_o_auth2_model_dict = ProviderAuthenticationOAuth2.from_dict(provider_authentication_o_auth2_model_json).__dict__ - provider_authentication_o_auth2_model2 = ProviderAuthenticationOAuth2(**provider_authentication_o_auth2_model_dict) + # Construct a model instance of MessageContextGlobalSystem by calling from_dict on the json representation + message_context_global_system_model_dict = MessageContextGlobalSystem.from_dict(message_context_global_system_model_json).__dict__ + message_context_global_system_model2 = MessageContextGlobalSystem(**message_context_global_system_model_dict) # Verify the model instances are equivalent - assert provider_authentication_o_auth2_model == provider_authentication_o_auth2_model2 + assert message_context_global_system_model == message_context_global_system_model2 # Convert model instance back to dict and verify no loss of data - provider_authentication_o_auth2_model_json2 = provider_authentication_o_auth2_model.to_dict() - assert provider_authentication_o_auth2_model_json2 == provider_authentication_o_auth2_model_json + message_context_global_system_model_json2 = message_context_global_system_model.to_dict() + assert message_context_global_system_model_json2 == message_context_global_system_model_json -class TestModel_ProviderAuthenticationOAuth2PasswordUsername: +class TestModel_MessageContextSkillSystem: """ - Test Class for ProviderAuthenticationOAuth2PasswordUsername + Test Class for MessageContextSkillSystem """ - def test_provider_authentication_o_auth2_password_username_serialization(self): + def test_message_context_skill_system_serialization(self): """ - Test serialization/deserialization for ProviderAuthenticationOAuth2PasswordUsername + Test serialization/deserialization for MessageContextSkillSystem """ - # Construct a json representation of a ProviderAuthenticationOAuth2PasswordUsername model - provider_authentication_o_auth2_password_username_model_json = {} - provider_authentication_o_auth2_password_username_model_json['type'] = 'value' - provider_authentication_o_auth2_password_username_model_json['value'] = 'testString' + # Construct a json representation of a MessageContextSkillSystem model + message_context_skill_system_model_json = {} + message_context_skill_system_model_json['state'] = 'testString' + message_context_skill_system_model_json['foo'] = 'testString' - # Construct a model instance of ProviderAuthenticationOAuth2PasswordUsername by calling from_dict on the json representation - provider_authentication_o_auth2_password_username_model = ProviderAuthenticationOAuth2PasswordUsername.from_dict(provider_authentication_o_auth2_password_username_model_json) - assert provider_authentication_o_auth2_password_username_model != False + # Construct a model instance of MessageContextSkillSystem by calling from_dict on the json representation + message_context_skill_system_model = MessageContextSkillSystem.from_dict(message_context_skill_system_model_json) + assert message_context_skill_system_model != False - # Construct a model instance of ProviderAuthenticationOAuth2PasswordUsername by calling from_dict on the json representation - provider_authentication_o_auth2_password_username_model_dict = ProviderAuthenticationOAuth2PasswordUsername.from_dict(provider_authentication_o_auth2_password_username_model_json).__dict__ - provider_authentication_o_auth2_password_username_model2 = ProviderAuthenticationOAuth2PasswordUsername(**provider_authentication_o_auth2_password_username_model_dict) + # Construct a model instance of MessageContextSkillSystem by calling from_dict on the json representation + message_context_skill_system_model_dict = MessageContextSkillSystem.from_dict(message_context_skill_system_model_json).__dict__ + message_context_skill_system_model2 = MessageContextSkillSystem(**message_context_skill_system_model_dict) # Verify the model instances are equivalent - assert provider_authentication_o_auth2_password_username_model == provider_authentication_o_auth2_password_username_model2 + assert message_context_skill_system_model == message_context_skill_system_model2 # Convert model instance back to dict and verify no loss of data - provider_authentication_o_auth2_password_username_model_json2 = provider_authentication_o_auth2_password_username_model.to_dict() - assert provider_authentication_o_auth2_password_username_model_json2 == provider_authentication_o_auth2_password_username_model_json - - -class TestModel_ProviderAuthenticationTypeAndValue: - """ - Test Class for ProviderAuthenticationTypeAndValue - """ - - def test_provider_authentication_type_and_value_serialization(self): - """ - Test serialization/deserialization for ProviderAuthenticationTypeAndValue - """ - - # Construct a json representation of a ProviderAuthenticationTypeAndValue model - provider_authentication_type_and_value_model_json = {} - provider_authentication_type_and_value_model_json['type'] = 'value' - provider_authentication_type_and_value_model_json['value'] = 'testString' - - # Construct a model instance of ProviderAuthenticationTypeAndValue by calling from_dict on the json representation - provider_authentication_type_and_value_model = ProviderAuthenticationTypeAndValue.from_dict(provider_authentication_type_and_value_model_json) - assert provider_authentication_type_and_value_model != False - - # Construct a model instance of ProviderAuthenticationTypeAndValue by calling from_dict on the json representation - provider_authentication_type_and_value_model_dict = ProviderAuthenticationTypeAndValue.from_dict(provider_authentication_type_and_value_model_json).__dict__ - provider_authentication_type_and_value_model2 = ProviderAuthenticationTypeAndValue(**provider_authentication_type_and_value_model_dict) + message_context_skill_system_model_json2 = message_context_skill_system_model.to_dict() + assert message_context_skill_system_model_json2 == message_context_skill_system_model_json - # Verify the model instances are equivalent - assert provider_authentication_type_and_value_model == provider_authentication_type_and_value_model2 + # Test get_properties and set_properties methods. + message_context_skill_system_model.set_properties({}) + actual_dict = message_context_skill_system_model.get_properties() + assert actual_dict == {} - # Convert model instance back to dict and verify no loss of data - provider_authentication_type_and_value_model_json2 = provider_authentication_type_and_value_model.to_dict() - assert provider_authentication_type_and_value_model_json2 == provider_authentication_type_and_value_model_json + expected_dict = {'foo': 'testString'} + message_context_skill_system_model.set_properties(expected_dict) + actual_dict = message_context_skill_system_model.get_properties() + assert actual_dict.keys() == expected_dict.keys() -class TestModel_ProviderCollection: +class TestModel_MessageContextSkills: """ - Test Class for ProviderCollection + Test Class for MessageContextSkills """ - def test_provider_collection_serialization(self): + def test_message_context_skills_serialization(self): """ - Test serialization/deserialization for ProviderCollection + Test serialization/deserialization for MessageContextSkills """ # Construct dict forms of any model objects needed in order to build this model. - provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem - provider_response_specification_servers_item_model['url'] = 'testString' - - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' - - provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic - provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' - - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - - provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes - provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model - provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - - provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents - provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model - - provider_response_specification_model = {} # ProviderResponseSpecification - provider_response_specification_model['servers'] = [provider_response_specification_servers_item_model] - provider_response_specification_model['components'] = provider_response_specification_components_model + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' - provider_response_model = {} # ProviderResponse - provider_response_model['provider_id'] = 'testString' - provider_response_model['specification'] = provider_response_specification_model + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model - pagination_model = {} # Pagination - pagination_model['refresh_url'] = 'testString' - pagination_model['next_url'] = 'testString' - pagination_model['total'] = 38 - pagination_model['matched'] = 38 - pagination_model['refresh_cursor'] = 'testString' - pagination_model['next_cursor'] = 'testString' + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - # Construct a json representation of a ProviderCollection model - provider_collection_model_json = {} - provider_collection_model_json['conversational_skill_providers'] = [provider_response_model] - provider_collection_model_json['pagination'] = pagination_model + # Construct a json representation of a MessageContextSkills model + message_context_skills_model_json = {} + message_context_skills_model_json['main skill'] = message_context_dialog_skill_model + message_context_skills_model_json['actions skill'] = message_context_action_skill_model - # Construct a model instance of ProviderCollection by calling from_dict on the json representation - provider_collection_model = ProviderCollection.from_dict(provider_collection_model_json) - assert provider_collection_model != False + # Construct a model instance of MessageContextSkills by calling from_dict on the json representation + message_context_skills_model = MessageContextSkills.from_dict(message_context_skills_model_json) + assert message_context_skills_model != False - # Construct a model instance of ProviderCollection by calling from_dict on the json representation - provider_collection_model_dict = ProviderCollection.from_dict(provider_collection_model_json).__dict__ - provider_collection_model2 = ProviderCollection(**provider_collection_model_dict) + # Construct a model instance of MessageContextSkills by calling from_dict on the json representation + message_context_skills_model_dict = MessageContextSkills.from_dict(message_context_skills_model_json).__dict__ + message_context_skills_model2 = MessageContextSkills(**message_context_skills_model_dict) # Verify the model instances are equivalent - assert provider_collection_model == provider_collection_model2 + assert message_context_skills_model == message_context_skills_model2 # Convert model instance back to dict and verify no loss of data - provider_collection_model_json2 = provider_collection_model.to_dict() - assert provider_collection_model_json2 == provider_collection_model_json + message_context_skills_model_json2 = message_context_skills_model.to_dict() + assert message_context_skills_model_json2 == message_context_skills_model_json -class TestModel_ProviderPrivate: +class TestModel_MessageInput: """ - Test Class for ProviderPrivate + Test Class for MessageInput """ - def test_provider_private_serialization(self): + def test_message_input_serialization(self): """ - Test serialization/deserialization for ProviderPrivate + Test serialization/deserialization for MessageInput """ # Construct dict forms of any model objects needed in order to build this model. - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' - provider_private_authentication_model = {} # ProviderPrivateAuthenticationBearerFlow - provider_private_authentication_model['token'] = provider_authentication_type_and_value_model + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] - # Construct a json representation of a ProviderPrivate model - provider_private_model_json = {} - provider_private_model_json['authentication'] = provider_private_authentication_model + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' - # Construct a model instance of ProviderPrivate by calling from_dict on the json representation - provider_private_model = ProviderPrivate.from_dict(provider_private_model_json) - assert provider_private_model != False + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 - # Construct a model instance of ProviderPrivate by calling from_dict on the json representation - provider_private_model_dict = ProviderPrivate.from_dict(provider_private_model_json).__dict__ - provider_private_model2 = ProviderPrivate(**provider_private_model_dict) + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' - # Verify the model instances are equivalent - assert provider_private_model == provider_private_model2 + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' - # Convert model instance back to dict and verify no loss of data - provider_private_model_json2 = provider_private_model.to_dict() - assert provider_private_model_json2 == provider_private_model_json + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' -class TestModel_ProviderPrivateAuthenticationOAuth2PasswordPassword: - """ - Test Class for ProviderPrivateAuthenticationOAuth2PasswordPassword - """ + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True - def test_provider_private_authentication_o_auth2_password_password_serialization(self): - """ - Test serialization/deserialization for ProviderPrivateAuthenticationOAuth2PasswordPassword - """ + message_input_options_model = {} # MessageInputOptions + message_input_options_model['restart'] = False + message_input_options_model['alternate_intents'] = False + message_input_options_model['async_callout'] = False + message_input_options_model['spelling'] = message_input_options_spelling_model + message_input_options_model['debug'] = False + message_input_options_model['return_context'] = False + message_input_options_model['export'] = False - # Construct a json representation of a ProviderPrivateAuthenticationOAuth2PasswordPassword model - provider_private_authentication_o_auth2_password_password_model_json = {} - provider_private_authentication_o_auth2_password_password_model_json['type'] = 'value' - provider_private_authentication_o_auth2_password_password_model_json['value'] = 'testString' + # Construct a json representation of a MessageInput model + message_input_model_json = {} + message_input_model_json['message_type'] = 'text' + message_input_model_json['text'] = 'testString' + message_input_model_json['intents'] = [runtime_intent_model] + message_input_model_json['entities'] = [runtime_entity_model] + message_input_model_json['suggestion_id'] = 'testString' + message_input_model_json['attachments'] = [message_input_attachment_model] + message_input_model_json['analytics'] = request_analytics_model + message_input_model_json['options'] = message_input_options_model - # Construct a model instance of ProviderPrivateAuthenticationOAuth2PasswordPassword by calling from_dict on the json representation - provider_private_authentication_o_auth2_password_password_model = ProviderPrivateAuthenticationOAuth2PasswordPassword.from_dict(provider_private_authentication_o_auth2_password_password_model_json) - assert provider_private_authentication_o_auth2_password_password_model != False + # Construct a model instance of MessageInput by calling from_dict on the json representation + message_input_model = MessageInput.from_dict(message_input_model_json) + assert message_input_model != False - # Construct a model instance of ProviderPrivateAuthenticationOAuth2PasswordPassword by calling from_dict on the json representation - provider_private_authentication_o_auth2_password_password_model_dict = ProviderPrivateAuthenticationOAuth2PasswordPassword.from_dict(provider_private_authentication_o_auth2_password_password_model_json).__dict__ - provider_private_authentication_o_auth2_password_password_model2 = ProviderPrivateAuthenticationOAuth2PasswordPassword(**provider_private_authentication_o_auth2_password_password_model_dict) + # Construct a model instance of MessageInput by calling from_dict on the json representation + message_input_model_dict = MessageInput.from_dict(message_input_model_json).__dict__ + message_input_model2 = MessageInput(**message_input_model_dict) # Verify the model instances are equivalent - assert provider_private_authentication_o_auth2_password_password_model == provider_private_authentication_o_auth2_password_password_model2 + assert message_input_model == message_input_model2 # Convert model instance back to dict and verify no loss of data - provider_private_authentication_o_auth2_password_password_model_json2 = provider_private_authentication_o_auth2_password_password_model.to_dict() - assert provider_private_authentication_o_auth2_password_password_model_json2 == provider_private_authentication_o_auth2_password_password_model_json + message_input_model_json2 = message_input_model.to_dict() + assert message_input_model_json2 == message_input_model_json -class TestModel_ProviderResponse: +class TestModel_MessageInputAttachment: """ - Test Class for ProviderResponse + Test Class for MessageInputAttachment """ - def test_provider_response_serialization(self): + def test_message_input_attachment_serialization(self): """ - Test serialization/deserialization for ProviderResponse + Test serialization/deserialization for MessageInputAttachment """ - # Construct dict forms of any model objects needed in order to build this model. - - provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem - provider_response_specification_servers_item_model['url'] = 'testString' - - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' - - provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic - provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' - - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - - provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes - provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model - provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - - provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents - provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model - - provider_response_specification_model = {} # ProviderResponseSpecification - provider_response_specification_model['servers'] = [provider_response_specification_servers_item_model] - provider_response_specification_model['components'] = provider_response_specification_components_model - - # Construct a json representation of a ProviderResponse model - provider_response_model_json = {} - provider_response_model_json['provider_id'] = 'testString' - provider_response_model_json['specification'] = provider_response_specification_model + # Construct a json representation of a MessageInputAttachment model + message_input_attachment_model_json = {} + message_input_attachment_model_json['url'] = 'testString' + message_input_attachment_model_json['media_type'] = 'testString' - # Construct a model instance of ProviderResponse by calling from_dict on the json representation - provider_response_model = ProviderResponse.from_dict(provider_response_model_json) - assert provider_response_model != False + # Construct a model instance of MessageInputAttachment by calling from_dict on the json representation + message_input_attachment_model = MessageInputAttachment.from_dict(message_input_attachment_model_json) + assert message_input_attachment_model != False - # Construct a model instance of ProviderResponse by calling from_dict on the json representation - provider_response_model_dict = ProviderResponse.from_dict(provider_response_model_json).__dict__ - provider_response_model2 = ProviderResponse(**provider_response_model_dict) + # Construct a model instance of MessageInputAttachment by calling from_dict on the json representation + message_input_attachment_model_dict = MessageInputAttachment.from_dict(message_input_attachment_model_json).__dict__ + message_input_attachment_model2 = MessageInputAttachment(**message_input_attachment_model_dict) # Verify the model instances are equivalent - assert provider_response_model == provider_response_model2 + assert message_input_attachment_model == message_input_attachment_model2 # Convert model instance back to dict and verify no loss of data - provider_response_model_json2 = provider_response_model.to_dict() - assert provider_response_model_json2 == provider_response_model_json + message_input_attachment_model_json2 = message_input_attachment_model.to_dict() + assert message_input_attachment_model_json2 == message_input_attachment_model_json -class TestModel_ProviderResponseSpecification: +class TestModel_MessageInputOptions: """ - Test Class for ProviderResponseSpecification + Test Class for MessageInputOptions """ - def test_provider_response_specification_serialization(self): + def test_message_input_options_serialization(self): """ - Test serialization/deserialization for ProviderResponseSpecification + Test serialization/deserialization for MessageInputOptions """ # Construct dict forms of any model objects needed in order to build this model. - provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem - provider_response_specification_servers_item_model['url'] = 'testString' + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + # Construct a json representation of a MessageInputOptions model + message_input_options_model_json = {} + message_input_options_model_json['restart'] = False + message_input_options_model_json['alternate_intents'] = False + message_input_options_model_json['async_callout'] = False + message_input_options_model_json['spelling'] = message_input_options_spelling_model + message_input_options_model_json['debug'] = False + message_input_options_model_json['return_context'] = False + message_input_options_model_json['export'] = False - provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic - provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + # Construct a model instance of MessageInputOptions by calling from_dict on the json representation + message_input_options_model = MessageInputOptions.from_dict(message_input_options_model_json) + assert message_input_options_model != False - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' + # Construct a model instance of MessageInputOptions by calling from_dict on the json representation + message_input_options_model_dict = MessageInputOptions.from_dict(message_input_options_model_json).__dict__ + message_input_options_model2 = MessageInputOptions(**message_input_options_model_dict) - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + # Verify the model instances are equivalent + assert message_input_options_model == message_input_options_model2 - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + # Convert model instance back to dict and verify no loss of data + message_input_options_model_json2 = message_input_options_model.to_dict() + assert message_input_options_model_json2 == message_input_options_model_json - provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes - provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model - provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents - provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model +class TestModel_MessageInputOptionsSpelling: + """ + Test Class for MessageInputOptionsSpelling + """ - # Construct a json representation of a ProviderResponseSpecification model - provider_response_specification_model_json = {} - provider_response_specification_model_json['servers'] = [provider_response_specification_servers_item_model] - provider_response_specification_model_json['components'] = provider_response_specification_components_model + def test_message_input_options_spelling_serialization(self): + """ + Test serialization/deserialization for MessageInputOptionsSpelling + """ - # Construct a model instance of ProviderResponseSpecification by calling from_dict on the json representation - provider_response_specification_model = ProviderResponseSpecification.from_dict(provider_response_specification_model_json) - assert provider_response_specification_model != False + # Construct a json representation of a MessageInputOptionsSpelling model + message_input_options_spelling_model_json = {} + message_input_options_spelling_model_json['suggestions'] = True + message_input_options_spelling_model_json['auto_correct'] = True - # Construct a model instance of ProviderResponseSpecification by calling from_dict on the json representation - provider_response_specification_model_dict = ProviderResponseSpecification.from_dict(provider_response_specification_model_json).__dict__ - provider_response_specification_model2 = ProviderResponseSpecification(**provider_response_specification_model_dict) + # Construct a model instance of MessageInputOptionsSpelling by calling from_dict on the json representation + message_input_options_spelling_model = MessageInputOptionsSpelling.from_dict(message_input_options_spelling_model_json) + assert message_input_options_spelling_model != False + + # Construct a model instance of MessageInputOptionsSpelling by calling from_dict on the json representation + message_input_options_spelling_model_dict = MessageInputOptionsSpelling.from_dict(message_input_options_spelling_model_json).__dict__ + message_input_options_spelling_model2 = MessageInputOptionsSpelling(**message_input_options_spelling_model_dict) # Verify the model instances are equivalent - assert provider_response_specification_model == provider_response_specification_model2 + assert message_input_options_spelling_model == message_input_options_spelling_model2 # Convert model instance back to dict and verify no loss of data - provider_response_specification_model_json2 = provider_response_specification_model.to_dict() - assert provider_response_specification_model_json2 == provider_response_specification_model_json + message_input_options_spelling_model_json2 = message_input_options_spelling_model.to_dict() + assert message_input_options_spelling_model_json2 == message_input_options_spelling_model_json -class TestModel_ProviderResponseSpecificationComponents: +class TestModel_MessageOutput: """ - Test Class for ProviderResponseSpecificationComponents + Test Class for MessageOutput """ - def test_provider_response_specification_components_serialization(self): + def test_message_output_serialization(self): """ - Test serialization/deserialization for ProviderResponseSpecificationComponents + Test serialization/deserialization for MessageOutput """ # Construct dict forms of any model objects needed in order to build this model. - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' - provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic - provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 - provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes - provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model - provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' - # Construct a json representation of a ProviderResponseSpecificationComponents model - provider_response_specification_components_model_json = {} - provider_response_specification_components_model_json['securitySchemes'] = provider_response_specification_components_security_schemes_model + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' - # Construct a model instance of ProviderResponseSpecificationComponents by calling from_dict on the json representation - provider_response_specification_components_model = ProviderResponseSpecificationComponents.from_dict(provider_response_specification_components_model_json) - assert provider_response_specification_components_model != False + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' - # Construct a model instance of ProviderResponseSpecificationComponents by calling from_dict on the json representation - provider_response_specification_components_model_dict = ProviderResponseSpecificationComponents.from_dict(provider_response_specification_components_model_json).__dict__ - provider_response_specification_components_model2 = ProviderResponseSpecificationComponents(**provider_response_specification_components_model_dict) + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' + + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' + + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + # Construct a json representation of a MessageOutput model + message_output_model_json = {} + message_output_model_json['generic'] = [runtime_response_generic_model] + message_output_model_json['intents'] = [runtime_intent_model] + message_output_model_json['entities'] = [runtime_entity_model] + message_output_model_json['actions'] = [dialog_node_action_model] + message_output_model_json['debug'] = message_output_debug_model + message_output_model_json['user_defined'] = {'anyKey': 'anyValue'} + message_output_model_json['spelling'] = message_output_spelling_model + message_output_model_json['llm_metadata'] = [message_output_llm_metadata_model] + + # Construct a model instance of MessageOutput by calling from_dict on the json representation + message_output_model = MessageOutput.from_dict(message_output_model_json) + assert message_output_model != False + + # Construct a model instance of MessageOutput by calling from_dict on the json representation + message_output_model_dict = MessageOutput.from_dict(message_output_model_json).__dict__ + message_output_model2 = MessageOutput(**message_output_model_dict) # Verify the model instances are equivalent - assert provider_response_specification_components_model == provider_response_specification_components_model2 + assert message_output_model == message_output_model2 # Convert model instance back to dict and verify no loss of data - provider_response_specification_components_model_json2 = provider_response_specification_components_model.to_dict() - assert provider_response_specification_components_model_json2 == provider_response_specification_components_model_json + message_output_model_json2 = message_output_model.to_dict() + assert message_output_model_json2 == message_output_model_json -class TestModel_ProviderResponseSpecificationComponentsSecuritySchemes: +class TestModel_MessageOutputDebug: """ - Test Class for ProviderResponseSpecificationComponentsSecuritySchemes + Test Class for MessageOutputDebug """ - def test_provider_response_specification_components_security_schemes_serialization(self): + def test_message_output_debug_serialization(self): """ - Test serialization/deserialization for ProviderResponseSpecificationComponentsSecuritySchemes + Test serialization/deserialization for MessageOutputDebug """ # Construct dict forms of any model objects needed in order to build this model. - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' - provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic - provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' - # Construct a json representation of a ProviderResponseSpecificationComponentsSecuritySchemes model - provider_response_specification_components_security_schemes_model_json = {} - provider_response_specification_components_security_schemes_model_json['authentication_method'] = 'basic' - provider_response_specification_components_security_schemes_model_json['basic'] = provider_response_specification_components_security_schemes_basic_model - provider_response_specification_components_security_schemes_model_json['oauth2'] = provider_authentication_o_auth2_model + # Construct a json representation of a MessageOutputDebug model + message_output_debug_model_json = {} + message_output_debug_model_json['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model_json['log_messages'] = [dialog_log_message_model] + message_output_debug_model_json['branch_exited'] = True + message_output_debug_model_json['branch_exited_reason'] = 'completed' + message_output_debug_model_json['turn_events'] = [message_output_debug_turn_event_model] - # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemes by calling from_dict on the json representation - provider_response_specification_components_security_schemes_model = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict(provider_response_specification_components_security_schemes_model_json) - assert provider_response_specification_components_security_schemes_model != False + # Construct a model instance of MessageOutputDebug by calling from_dict on the json representation + message_output_debug_model = MessageOutputDebug.from_dict(message_output_debug_model_json) + assert message_output_debug_model != False - # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemes by calling from_dict on the json representation - provider_response_specification_components_security_schemes_model_dict = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict(provider_response_specification_components_security_schemes_model_json).__dict__ - provider_response_specification_components_security_schemes_model2 = ProviderResponseSpecificationComponentsSecuritySchemes(**provider_response_specification_components_security_schemes_model_dict) + # Construct a model instance of MessageOutputDebug by calling from_dict on the json representation + message_output_debug_model_dict = MessageOutputDebug.from_dict(message_output_debug_model_json).__dict__ + message_output_debug_model2 = MessageOutputDebug(**message_output_debug_model_dict) # Verify the model instances are equivalent - assert provider_response_specification_components_security_schemes_model == provider_response_specification_components_security_schemes_model2 + assert message_output_debug_model == message_output_debug_model2 # Convert model instance back to dict and verify no loss of data - provider_response_specification_components_security_schemes_model_json2 = provider_response_specification_components_security_schemes_model.to_dict() - assert provider_response_specification_components_security_schemes_model_json2 == provider_response_specification_components_security_schemes_model_json + message_output_debug_model_json2 = message_output_debug_model.to_dict() + assert message_output_debug_model_json2 == message_output_debug_model_json -class TestModel_ProviderResponseSpecificationComponentsSecuritySchemesBasic: +class TestModel_MessageOutputLLMMetadata: """ - Test Class for ProviderResponseSpecificationComponentsSecuritySchemesBasic + Test Class for MessageOutputLLMMetadata """ - def test_provider_response_specification_components_security_schemes_basic_serialization(self): + def test_message_output_llm_metadata_serialization(self): """ - Test serialization/deserialization for ProviderResponseSpecificationComponentsSecuritySchemesBasic + Test serialization/deserialization for MessageOutputLLMMetadata """ - # Construct dict forms of any model objects needed in order to build this model. - - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' - - # Construct a json representation of a ProviderResponseSpecificationComponentsSecuritySchemesBasic model - provider_response_specification_components_security_schemes_basic_model_json = {} - provider_response_specification_components_security_schemes_basic_model_json['username'] = provider_authentication_type_and_value_model + # Construct a json representation of a MessageOutputLLMMetadata model + message_output_llm_metadata_model_json = {} + message_output_llm_metadata_model_json['task'] = 'testString' + message_output_llm_metadata_model_json['model_id'] = 'testString' - # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation - provider_response_specification_components_security_schemes_basic_model = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict(provider_response_specification_components_security_schemes_basic_model_json) - assert provider_response_specification_components_security_schemes_basic_model != False + # Construct a model instance of MessageOutputLLMMetadata by calling from_dict on the json representation + message_output_llm_metadata_model = MessageOutputLLMMetadata.from_dict(message_output_llm_metadata_model_json) + assert message_output_llm_metadata_model != False - # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation - provider_response_specification_components_security_schemes_basic_model_dict = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict(provider_response_specification_components_security_schemes_basic_model_json).__dict__ - provider_response_specification_components_security_schemes_basic_model2 = ProviderResponseSpecificationComponentsSecuritySchemesBasic(**provider_response_specification_components_security_schemes_basic_model_dict) + # Construct a model instance of MessageOutputLLMMetadata by calling from_dict on the json representation + message_output_llm_metadata_model_dict = MessageOutputLLMMetadata.from_dict(message_output_llm_metadata_model_json).__dict__ + message_output_llm_metadata_model2 = MessageOutputLLMMetadata(**message_output_llm_metadata_model_dict) # Verify the model instances are equivalent - assert provider_response_specification_components_security_schemes_basic_model == provider_response_specification_components_security_schemes_basic_model2 + assert message_output_llm_metadata_model == message_output_llm_metadata_model2 # Convert model instance back to dict and verify no loss of data - provider_response_specification_components_security_schemes_basic_model_json2 = provider_response_specification_components_security_schemes_basic_model.to_dict() - assert provider_response_specification_components_security_schemes_basic_model_json2 == provider_response_specification_components_security_schemes_basic_model_json + message_output_llm_metadata_model_json2 = message_output_llm_metadata_model.to_dict() + assert message_output_llm_metadata_model_json2 == message_output_llm_metadata_model_json -class TestModel_ProviderResponseSpecificationServersItem: +class TestModel_MessageOutputSpelling: """ - Test Class for ProviderResponseSpecificationServersItem + Test Class for MessageOutputSpelling """ - def test_provider_response_specification_servers_item_serialization(self): + def test_message_output_spelling_serialization(self): """ - Test serialization/deserialization for ProviderResponseSpecificationServersItem + Test serialization/deserialization for MessageOutputSpelling """ - # Construct a json representation of a ProviderResponseSpecificationServersItem model - provider_response_specification_servers_item_model_json = {} - provider_response_specification_servers_item_model_json['url'] = 'testString' + # Construct a json representation of a MessageOutputSpelling model + message_output_spelling_model_json = {} + message_output_spelling_model_json['text'] = 'testString' + message_output_spelling_model_json['original_text'] = 'testString' + message_output_spelling_model_json['suggested_text'] = 'testString' - # Construct a model instance of ProviderResponseSpecificationServersItem by calling from_dict on the json representation - provider_response_specification_servers_item_model = ProviderResponseSpecificationServersItem.from_dict(provider_response_specification_servers_item_model_json) - assert provider_response_specification_servers_item_model != False + # Construct a model instance of MessageOutputSpelling by calling from_dict on the json representation + message_output_spelling_model = MessageOutputSpelling.from_dict(message_output_spelling_model_json) + assert message_output_spelling_model != False - # Construct a model instance of ProviderResponseSpecificationServersItem by calling from_dict on the json representation - provider_response_specification_servers_item_model_dict = ProviderResponseSpecificationServersItem.from_dict(provider_response_specification_servers_item_model_json).__dict__ - provider_response_specification_servers_item_model2 = ProviderResponseSpecificationServersItem(**provider_response_specification_servers_item_model_dict) + # Construct a model instance of MessageOutputSpelling by calling from_dict on the json representation + message_output_spelling_model_dict = MessageOutputSpelling.from_dict(message_output_spelling_model_json).__dict__ + message_output_spelling_model2 = MessageOutputSpelling(**message_output_spelling_model_dict) # Verify the model instances are equivalent - assert provider_response_specification_servers_item_model == provider_response_specification_servers_item_model2 + assert message_output_spelling_model == message_output_spelling_model2 # Convert model instance back to dict and verify no loss of data - provider_response_specification_servers_item_model_json2 = provider_response_specification_servers_item_model.to_dict() - assert provider_response_specification_servers_item_model_json2 == provider_response_specification_servers_item_model_json + message_output_spelling_model_json2 = message_output_spelling_model.to_dict() + assert message_output_spelling_model_json2 == message_output_spelling_model_json -class TestModel_ProviderSpecification: +class TestModel_MessageStreamMetadata: """ - Test Class for ProviderSpecification + Test Class for MessageStreamMetadata """ - def test_provider_specification_serialization(self): + def test_message_stream_metadata_serialization(self): """ - Test serialization/deserialization for ProviderSpecification + Test serialization/deserialization for MessageStreamMetadata """ # Construct dict forms of any model objects needed in order to build this model. - provider_specification_servers_item_model = {} # ProviderSpecificationServersItem - provider_specification_servers_item_model['url'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + # Construct a json representation of a MessageStreamMetadata model + message_stream_metadata_model_json = {} + message_stream_metadata_model_json['streaming_metadata'] = metadata_model - provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic - provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + # Construct a model instance of MessageStreamMetadata by calling from_dict on the json representation + message_stream_metadata_model = MessageStreamMetadata.from_dict(message_stream_metadata_model_json) + assert message_stream_metadata_model != False - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' + # Construct a model instance of MessageStreamMetadata by calling from_dict on the json representation + message_stream_metadata_model_dict = MessageStreamMetadata.from_dict(message_stream_metadata_model_json).__dict__ + message_stream_metadata_model2 = MessageStreamMetadata(**message_stream_metadata_model_dict) - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + # Verify the model instances are equivalent + assert message_stream_metadata_model == message_stream_metadata_model2 - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + # Convert model instance back to dict and verify no loss of data + message_stream_metadata_model_json2 = message_stream_metadata_model.to_dict() + assert message_stream_metadata_model_json2 == message_stream_metadata_model_json - provider_specification_components_security_schemes_model = {} # ProviderSpecificationComponentsSecuritySchemes - provider_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_specification_components_security_schemes_model['basic'] = provider_specification_components_security_schemes_basic_model - provider_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - provider_specification_components_model = {} # ProviderSpecificationComponents - provider_specification_components_model['securitySchemes'] = provider_specification_components_security_schemes_model +class TestModel_Metadata: + """ + Test Class for Metadata + """ - # Construct a json representation of a ProviderSpecification model - provider_specification_model_json = {} - provider_specification_model_json['servers'] = [provider_specification_servers_item_model] - provider_specification_model_json['components'] = provider_specification_components_model + def test_metadata_serialization(self): + """ + Test serialization/deserialization for Metadata + """ - # Construct a model instance of ProviderSpecification by calling from_dict on the json representation - provider_specification_model = ProviderSpecification.from_dict(provider_specification_model_json) - assert provider_specification_model != False + # Construct a json representation of a Metadata model + metadata_model_json = {} + metadata_model_json['id'] = 38 - # Construct a model instance of ProviderSpecification by calling from_dict on the json representation - provider_specification_model_dict = ProviderSpecification.from_dict(provider_specification_model_json).__dict__ - provider_specification_model2 = ProviderSpecification(**provider_specification_model_dict) + # Construct a model instance of Metadata by calling from_dict on the json representation + metadata_model = Metadata.from_dict(metadata_model_json) + assert metadata_model != False + + # Construct a model instance of Metadata by calling from_dict on the json representation + metadata_model_dict = Metadata.from_dict(metadata_model_json).__dict__ + metadata_model2 = Metadata(**metadata_model_dict) # Verify the model instances are equivalent - assert provider_specification_model == provider_specification_model2 + assert metadata_model == metadata_model2 # Convert model instance back to dict and verify no loss of data - provider_specification_model_json2 = provider_specification_model.to_dict() - assert provider_specification_model_json2 == provider_specification_model_json + metadata_model_json2 = metadata_model.to_dict() + assert metadata_model_json2 == metadata_model_json -class TestModel_ProviderSpecificationComponents: +class TestModel_MonitorAssistantReleaseImportArtifactResponse: """ - Test Class for ProviderSpecificationComponents + Test Class for MonitorAssistantReleaseImportArtifactResponse """ - def test_provider_specification_components_serialization(self): + def test_monitor_assistant_release_import_artifact_response_serialization(self): """ - Test serialization/deserialization for ProviderSpecificationComponents + Test serialization/deserialization for MonitorAssistantReleaseImportArtifactResponse """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a MonitorAssistantReleaseImportArtifactResponse model + monitor_assistant_release_import_artifact_response_model_json = {} + monitor_assistant_release_import_artifact_response_model_json['skill_impact_in_draft'] = ['action'] - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + # Construct a model instance of MonitorAssistantReleaseImportArtifactResponse by calling from_dict on the json representation + monitor_assistant_release_import_artifact_response_model = MonitorAssistantReleaseImportArtifactResponse.from_dict(monitor_assistant_release_import_artifact_response_model_json) + assert monitor_assistant_release_import_artifact_response_model != False - provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic - provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + # Construct a model instance of MonitorAssistantReleaseImportArtifactResponse by calling from_dict on the json representation + monitor_assistant_release_import_artifact_response_model_dict = MonitorAssistantReleaseImportArtifactResponse.from_dict(monitor_assistant_release_import_artifact_response_model_json).__dict__ + monitor_assistant_release_import_artifact_response_model2 = MonitorAssistantReleaseImportArtifactResponse(**monitor_assistant_release_import_artifact_response_model_dict) - provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername - provider_authentication_o_auth2_password_username_model['type'] = 'value' - provider_authentication_o_auth2_password_username_model['value'] = 'testString' + # Verify the model instances are equivalent + assert monitor_assistant_release_import_artifact_response_model == monitor_assistant_release_import_artifact_response_model2 - provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - provider_authentication_o_auth2_flows_model['token_url'] = 'testString' - provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' - provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' - provider_authentication_o_auth2_flows_model['content_type'] = 'testString' - provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' - provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + # Convert model instance back to dict and verify no loss of data + monitor_assistant_release_import_artifact_response_model_json2 = monitor_assistant_release_import_artifact_response_model.to_dict() + assert monitor_assistant_release_import_artifact_response_model_json2 == monitor_assistant_release_import_artifact_response_model_json - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - provider_specification_components_security_schemes_model = {} # ProviderSpecificationComponentsSecuritySchemes - provider_specification_components_security_schemes_model['authentication_method'] = 'basic' - provider_specification_components_security_schemes_model['basic'] = provider_specification_components_security_schemes_basic_model - provider_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model +class TestModel_Pagination: + """ + Test Class for Pagination + """ - # Construct a json representation of a ProviderSpecificationComponents model - provider_specification_components_model_json = {} - provider_specification_components_model_json['securitySchemes'] = provider_specification_components_security_schemes_model + def test_pagination_serialization(self): + """ + Test serialization/deserialization for Pagination + """ - # Construct a model instance of ProviderSpecificationComponents by calling from_dict on the json representation - provider_specification_components_model = ProviderSpecificationComponents.from_dict(provider_specification_components_model_json) - assert provider_specification_components_model != False + # Construct a json representation of a Pagination model + pagination_model_json = {} + pagination_model_json['refresh_url'] = 'testString' + pagination_model_json['next_url'] = 'testString' + pagination_model_json['total'] = 38 + pagination_model_json['matched'] = 38 + pagination_model_json['refresh_cursor'] = 'testString' + pagination_model_json['next_cursor'] = 'testString' - # Construct a model instance of ProviderSpecificationComponents by calling from_dict on the json representation - provider_specification_components_model_dict = ProviderSpecificationComponents.from_dict(provider_specification_components_model_json).__dict__ - provider_specification_components_model2 = ProviderSpecificationComponents(**provider_specification_components_model_dict) + # Construct a model instance of Pagination by calling from_dict on the json representation + pagination_model = Pagination.from_dict(pagination_model_json) + assert pagination_model != False + + # Construct a model instance of Pagination by calling from_dict on the json representation + pagination_model_dict = Pagination.from_dict(pagination_model_json).__dict__ + pagination_model2 = Pagination(**pagination_model_dict) # Verify the model instances are equivalent - assert provider_specification_components_model == provider_specification_components_model2 + assert pagination_model == pagination_model2 # Convert model instance back to dict and verify no loss of data - provider_specification_components_model_json2 = provider_specification_components_model.to_dict() - assert provider_specification_components_model_json2 == provider_specification_components_model_json + pagination_model_json2 = pagination_model.to_dict() + assert pagination_model_json2 == pagination_model_json -class TestModel_ProviderSpecificationComponentsSecuritySchemes: +class TestModel_PartialItem: """ - Test Class for ProviderSpecificationComponentsSecuritySchemes + Test Class for PartialItem """ - def test_provider_specification_components_security_schemes_serialization(self): + def test_partial_item_serialization(self): """ - Test serialization/deserialization for ProviderSpecificationComponentsSecuritySchemes + Test serialization/deserialization for PartialItem """ # Construct dict forms of any model objects needed in order to build this model. - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic - provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + # Construct a json representation of a PartialItem model + partial_item_model_json = {} + partial_item_model_json['response_type'] = 'testString' + partial_item_model_json['text'] = 'testString' + partial_item_model_json['streaming_metadata'] = metadata_model + + # Construct a model instance of PartialItem by calling from_dict on the json representation + partial_item_model = PartialItem.from_dict(partial_item_model_json) + assert partial_item_model != False + + # Construct a model instance of PartialItem by calling from_dict on the json representation + partial_item_model_dict = PartialItem.from_dict(partial_item_model_json).__dict__ + partial_item_model2 = PartialItem(**partial_item_model_dict) + + # Verify the model instances are equivalent + assert partial_item_model == partial_item_model2 + + # Convert model instance back to dict and verify no loss of data + partial_item_model_json2 = partial_item_model.to_dict() + assert partial_item_model_json2 == partial_item_model_json + + +class TestModel_ProviderAuthenticationOAuth2: + """ + Test Class for ProviderAuthenticationOAuth2 + """ + + def test_provider_authentication_o_auth2_serialization(self): + """ + Test serialization/deserialization for ProviderAuthenticationOAuth2 + """ + + # Construct dict forms of any model objects needed in order to build this model. provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername provider_authentication_o_auth2_password_username_model['type'] = 'value' @@ -9435,142 +9525,142 @@ def test_provider_specification_components_security_schemes_serialization(self): provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 - provider_authentication_o_auth2_model['preferred_flow'] = 'password' - provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - - # Construct a json representation of a ProviderSpecificationComponentsSecuritySchemes model - provider_specification_components_security_schemes_model_json = {} - provider_specification_components_security_schemes_model_json['authentication_method'] = 'basic' - provider_specification_components_security_schemes_model_json['basic'] = provider_specification_components_security_schemes_basic_model - provider_specification_components_security_schemes_model_json['oauth2'] = provider_authentication_o_auth2_model + # Construct a json representation of a ProviderAuthenticationOAuth2 model + provider_authentication_o_auth2_model_json = {} + provider_authentication_o_auth2_model_json['preferred_flow'] = 'password' + provider_authentication_o_auth2_model_json['flows'] = provider_authentication_o_auth2_flows_model - # Construct a model instance of ProviderSpecificationComponentsSecuritySchemes by calling from_dict on the json representation - provider_specification_components_security_schemes_model = ProviderSpecificationComponentsSecuritySchemes.from_dict(provider_specification_components_security_schemes_model_json) - assert provider_specification_components_security_schemes_model != False + # Construct a model instance of ProviderAuthenticationOAuth2 by calling from_dict on the json representation + provider_authentication_o_auth2_model = ProviderAuthenticationOAuth2.from_dict(provider_authentication_o_auth2_model_json) + assert provider_authentication_o_auth2_model != False - # Construct a model instance of ProviderSpecificationComponentsSecuritySchemes by calling from_dict on the json representation - provider_specification_components_security_schemes_model_dict = ProviderSpecificationComponentsSecuritySchemes.from_dict(provider_specification_components_security_schemes_model_json).__dict__ - provider_specification_components_security_schemes_model2 = ProviderSpecificationComponentsSecuritySchemes(**provider_specification_components_security_schemes_model_dict) + # Construct a model instance of ProviderAuthenticationOAuth2 by calling from_dict on the json representation + provider_authentication_o_auth2_model_dict = ProviderAuthenticationOAuth2.from_dict(provider_authentication_o_auth2_model_json).__dict__ + provider_authentication_o_auth2_model2 = ProviderAuthenticationOAuth2(**provider_authentication_o_auth2_model_dict) # Verify the model instances are equivalent - assert provider_specification_components_security_schemes_model == provider_specification_components_security_schemes_model2 + assert provider_authentication_o_auth2_model == provider_authentication_o_auth2_model2 # Convert model instance back to dict and verify no loss of data - provider_specification_components_security_schemes_model_json2 = provider_specification_components_security_schemes_model.to_dict() - assert provider_specification_components_security_schemes_model_json2 == provider_specification_components_security_schemes_model_json + provider_authentication_o_auth2_model_json2 = provider_authentication_o_auth2_model.to_dict() + assert provider_authentication_o_auth2_model_json2 == provider_authentication_o_auth2_model_json -class TestModel_ProviderSpecificationComponentsSecuritySchemesBasic: +class TestModel_ProviderAuthenticationOAuth2PasswordUsername: """ - Test Class for ProviderSpecificationComponentsSecuritySchemesBasic + Test Class for ProviderAuthenticationOAuth2PasswordUsername """ - def test_provider_specification_components_security_schemes_basic_serialization(self): + def test_provider_authentication_o_auth2_password_username_serialization(self): """ - Test serialization/deserialization for ProviderSpecificationComponentsSecuritySchemesBasic + Test serialization/deserialization for ProviderAuthenticationOAuth2PasswordUsername """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a ProviderAuthenticationOAuth2PasswordUsername model + provider_authentication_o_auth2_password_username_model_json = {} + provider_authentication_o_auth2_password_username_model_json['type'] = 'value' + provider_authentication_o_auth2_password_username_model_json['value'] = 'testString' - provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue - provider_authentication_type_and_value_model['type'] = 'value' - provider_authentication_type_and_value_model['value'] = 'testString' - - # Construct a json representation of a ProviderSpecificationComponentsSecuritySchemesBasic model - provider_specification_components_security_schemes_basic_model_json = {} - provider_specification_components_security_schemes_basic_model_json['username'] = provider_authentication_type_and_value_model - - # Construct a model instance of ProviderSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation - provider_specification_components_security_schemes_basic_model = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict(provider_specification_components_security_schemes_basic_model_json) - assert provider_specification_components_security_schemes_basic_model != False + # Construct a model instance of ProviderAuthenticationOAuth2PasswordUsername by calling from_dict on the json representation + provider_authentication_o_auth2_password_username_model = ProviderAuthenticationOAuth2PasswordUsername.from_dict(provider_authentication_o_auth2_password_username_model_json) + assert provider_authentication_o_auth2_password_username_model != False - # Construct a model instance of ProviderSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation - provider_specification_components_security_schemes_basic_model_dict = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict(provider_specification_components_security_schemes_basic_model_json).__dict__ - provider_specification_components_security_schemes_basic_model2 = ProviderSpecificationComponentsSecuritySchemesBasic(**provider_specification_components_security_schemes_basic_model_dict) + # Construct a model instance of ProviderAuthenticationOAuth2PasswordUsername by calling from_dict on the json representation + provider_authentication_o_auth2_password_username_model_dict = ProviderAuthenticationOAuth2PasswordUsername.from_dict(provider_authentication_o_auth2_password_username_model_json).__dict__ + provider_authentication_o_auth2_password_username_model2 = ProviderAuthenticationOAuth2PasswordUsername(**provider_authentication_o_auth2_password_username_model_dict) # Verify the model instances are equivalent - assert provider_specification_components_security_schemes_basic_model == provider_specification_components_security_schemes_basic_model2 + assert provider_authentication_o_auth2_password_username_model == provider_authentication_o_auth2_password_username_model2 # Convert model instance back to dict and verify no loss of data - provider_specification_components_security_schemes_basic_model_json2 = provider_specification_components_security_schemes_basic_model.to_dict() - assert provider_specification_components_security_schemes_basic_model_json2 == provider_specification_components_security_schemes_basic_model_json + provider_authentication_o_auth2_password_username_model_json2 = provider_authentication_o_auth2_password_username_model.to_dict() + assert provider_authentication_o_auth2_password_username_model_json2 == provider_authentication_o_auth2_password_username_model_json -class TestModel_ProviderSpecificationServersItem: +class TestModel_ProviderAuthenticationTypeAndValue: """ - Test Class for ProviderSpecificationServersItem + Test Class for ProviderAuthenticationTypeAndValue """ - def test_provider_specification_servers_item_serialization(self): + def test_provider_authentication_type_and_value_serialization(self): """ - Test serialization/deserialization for ProviderSpecificationServersItem + Test serialization/deserialization for ProviderAuthenticationTypeAndValue """ - # Construct a json representation of a ProviderSpecificationServersItem model - provider_specification_servers_item_model_json = {} - provider_specification_servers_item_model_json['url'] = 'testString' + # Construct a json representation of a ProviderAuthenticationTypeAndValue model + provider_authentication_type_and_value_model_json = {} + provider_authentication_type_and_value_model_json['type'] = 'value' + provider_authentication_type_and_value_model_json['value'] = 'testString' - # Construct a model instance of ProviderSpecificationServersItem by calling from_dict on the json representation - provider_specification_servers_item_model = ProviderSpecificationServersItem.from_dict(provider_specification_servers_item_model_json) - assert provider_specification_servers_item_model != False + # Construct a model instance of ProviderAuthenticationTypeAndValue by calling from_dict on the json representation + provider_authentication_type_and_value_model = ProviderAuthenticationTypeAndValue.from_dict(provider_authentication_type_and_value_model_json) + assert provider_authentication_type_and_value_model != False - # Construct a model instance of ProviderSpecificationServersItem by calling from_dict on the json representation - provider_specification_servers_item_model_dict = ProviderSpecificationServersItem.from_dict(provider_specification_servers_item_model_json).__dict__ - provider_specification_servers_item_model2 = ProviderSpecificationServersItem(**provider_specification_servers_item_model_dict) + # Construct a model instance of ProviderAuthenticationTypeAndValue by calling from_dict on the json representation + provider_authentication_type_and_value_model_dict = ProviderAuthenticationTypeAndValue.from_dict(provider_authentication_type_and_value_model_json).__dict__ + provider_authentication_type_and_value_model2 = ProviderAuthenticationTypeAndValue(**provider_authentication_type_and_value_model_dict) # Verify the model instances are equivalent - assert provider_specification_servers_item_model == provider_specification_servers_item_model2 + assert provider_authentication_type_and_value_model == provider_authentication_type_and_value_model2 # Convert model instance back to dict and verify no loss of data - provider_specification_servers_item_model_json2 = provider_specification_servers_item_model.to_dict() - assert provider_specification_servers_item_model_json2 == provider_specification_servers_item_model_json + provider_authentication_type_and_value_model_json2 = provider_authentication_type_and_value_model.to_dict() + assert provider_authentication_type_and_value_model_json2 == provider_authentication_type_and_value_model_json -class TestModel_Release: +class TestModel_ProviderCollection: """ - Test Class for Release + Test Class for ProviderCollection """ - def test_release_serialization(self): + def test_provider_collection_serialization(self): """ - Test serialization/deserialization for Release + Test serialization/deserialization for ProviderCollection """ - # Construct a json representation of a Release model - release_model_json = {} - release_model_json['description'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of Release by calling from_dict on the json representation - release_model = Release.from_dict(release_model_json) - assert release_model != False + provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem + provider_response_specification_servers_item_model['url'] = 'testString' - # Construct a model instance of Release by calling from_dict on the json representation - release_model_dict = Release.from_dict(release_model_json).__dict__ - release_model2 = Release(**release_model_dict) + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Verify the model instances are equivalent - assert release_model == release_model2 + provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic + provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - # Convert model instance back to dict and verify no loss of data - release_model_json2 = release_model.to_dict() - assert release_model_json2 == release_model_json + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' + + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model -class TestModel_ReleaseCollection: - """ - Test Class for ReleaseCollection - """ + provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes + provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model + provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - def test_release_collection_serialization(self): - """ - Test serialization/deserialization for ReleaseCollection - """ + provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents + provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model - # Construct dict forms of any model objects needed in order to build this model. + provider_response_specification_model = {} # ProviderResponseSpecification + provider_response_specification_model['servers'] = [provider_response_specification_servers_item_model] + provider_response_specification_model['components'] = provider_response_specification_components_model - release_model = {} # Release - release_model['description'] = 'testString' + provider_response_model = {} # ProviderResponse + provider_response_model['provider_id'] = 'testString' + provider_response_model['specification'] = provider_response_specification_model pagination_model = {} # Pagination pagination_model['refresh_url'] = 'testString' @@ -9580,1320 +9670,1454 @@ def test_release_collection_serialization(self): pagination_model['refresh_cursor'] = 'testString' pagination_model['next_cursor'] = 'testString' - # Construct a json representation of a ReleaseCollection model - release_collection_model_json = {} - release_collection_model_json['releases'] = [release_model] - release_collection_model_json['pagination'] = pagination_model + # Construct a json representation of a ProviderCollection model + provider_collection_model_json = {} + provider_collection_model_json['conversational_skill_providers'] = [provider_response_model] + provider_collection_model_json['pagination'] = pagination_model - # Construct a model instance of ReleaseCollection by calling from_dict on the json representation - release_collection_model = ReleaseCollection.from_dict(release_collection_model_json) - assert release_collection_model != False + # Construct a model instance of ProviderCollection by calling from_dict on the json representation + provider_collection_model = ProviderCollection.from_dict(provider_collection_model_json) + assert provider_collection_model != False - # Construct a model instance of ReleaseCollection by calling from_dict on the json representation - release_collection_model_dict = ReleaseCollection.from_dict(release_collection_model_json).__dict__ - release_collection_model2 = ReleaseCollection(**release_collection_model_dict) + # Construct a model instance of ProviderCollection by calling from_dict on the json representation + provider_collection_model_dict = ProviderCollection.from_dict(provider_collection_model_json).__dict__ + provider_collection_model2 = ProviderCollection(**provider_collection_model_dict) # Verify the model instances are equivalent - assert release_collection_model == release_collection_model2 + assert provider_collection_model == provider_collection_model2 # Convert model instance back to dict and verify no loss of data - release_collection_model_json2 = release_collection_model.to_dict() - assert release_collection_model_json2 == release_collection_model_json + provider_collection_model_json2 = provider_collection_model.to_dict() + assert provider_collection_model_json2 == provider_collection_model_json -class TestModel_ReleaseContent: +class TestModel_ProviderPrivate: """ - Test Class for ReleaseContent + Test Class for ProviderPrivate """ - def test_release_content_serialization(self): + def test_provider_private_serialization(self): """ - Test serialization/deserialization for ReleaseContent + Test serialization/deserialization for ProviderPrivate """ - # Construct a json representation of a ReleaseContent model - release_content_model_json = {} + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of ReleaseContent by calling from_dict on the json representation - release_content_model = ReleaseContent.from_dict(release_content_model_json) - assert release_content_model != False + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Construct a model instance of ReleaseContent by calling from_dict on the json representation - release_content_model_dict = ReleaseContent.from_dict(release_content_model_json).__dict__ - release_content_model2 = ReleaseContent(**release_content_model_dict) + provider_private_authentication_model = {} # ProviderPrivateAuthenticationBearerFlow + provider_private_authentication_model['token'] = provider_authentication_type_and_value_model + + # Construct a json representation of a ProviderPrivate model + provider_private_model_json = {} + provider_private_model_json['authentication'] = provider_private_authentication_model + + # Construct a model instance of ProviderPrivate by calling from_dict on the json representation + provider_private_model = ProviderPrivate.from_dict(provider_private_model_json) + assert provider_private_model != False + + # Construct a model instance of ProviderPrivate by calling from_dict on the json representation + provider_private_model_dict = ProviderPrivate.from_dict(provider_private_model_json).__dict__ + provider_private_model2 = ProviderPrivate(**provider_private_model_dict) # Verify the model instances are equivalent - assert release_content_model == release_content_model2 + assert provider_private_model == provider_private_model2 # Convert model instance back to dict and verify no loss of data - release_content_model_json2 = release_content_model.to_dict() - assert release_content_model_json2 == release_content_model_json + provider_private_model_json2 = provider_private_model.to_dict() + assert provider_private_model_json2 == provider_private_model_json -class TestModel_ReleaseSkill: +class TestModel_ProviderPrivateAuthenticationOAuth2PasswordPassword: """ - Test Class for ReleaseSkill + Test Class for ProviderPrivateAuthenticationOAuth2PasswordPassword """ - def test_release_skill_serialization(self): + def test_provider_private_authentication_o_auth2_password_password_serialization(self): """ - Test serialization/deserialization for ReleaseSkill + Test serialization/deserialization for ProviderPrivateAuthenticationOAuth2PasswordPassword """ - # Construct a json representation of a ReleaseSkill model - release_skill_model_json = {} - release_skill_model_json['skill_id'] = 'testString' - release_skill_model_json['type'] = 'dialog' - release_skill_model_json['snapshot'] = 'testString' + # Construct a json representation of a ProviderPrivateAuthenticationOAuth2PasswordPassword model + provider_private_authentication_o_auth2_password_password_model_json = {} + provider_private_authentication_o_auth2_password_password_model_json['type'] = 'value' + provider_private_authentication_o_auth2_password_password_model_json['value'] = 'testString' - # Construct a model instance of ReleaseSkill by calling from_dict on the json representation - release_skill_model = ReleaseSkill.from_dict(release_skill_model_json) - assert release_skill_model != False + # Construct a model instance of ProviderPrivateAuthenticationOAuth2PasswordPassword by calling from_dict on the json representation + provider_private_authentication_o_auth2_password_password_model = ProviderPrivateAuthenticationOAuth2PasswordPassword.from_dict(provider_private_authentication_o_auth2_password_password_model_json) + assert provider_private_authentication_o_auth2_password_password_model != False - # Construct a model instance of ReleaseSkill by calling from_dict on the json representation - release_skill_model_dict = ReleaseSkill.from_dict(release_skill_model_json).__dict__ - release_skill_model2 = ReleaseSkill(**release_skill_model_dict) + # Construct a model instance of ProviderPrivateAuthenticationOAuth2PasswordPassword by calling from_dict on the json representation + provider_private_authentication_o_auth2_password_password_model_dict = ProviderPrivateAuthenticationOAuth2PasswordPassword.from_dict(provider_private_authentication_o_auth2_password_password_model_json).__dict__ + provider_private_authentication_o_auth2_password_password_model2 = ProviderPrivateAuthenticationOAuth2PasswordPassword(**provider_private_authentication_o_auth2_password_password_model_dict) # Verify the model instances are equivalent - assert release_skill_model == release_skill_model2 + assert provider_private_authentication_o_auth2_password_password_model == provider_private_authentication_o_auth2_password_password_model2 # Convert model instance back to dict and verify no loss of data - release_skill_model_json2 = release_skill_model.to_dict() - assert release_skill_model_json2 == release_skill_model_json + provider_private_authentication_o_auth2_password_password_model_json2 = provider_private_authentication_o_auth2_password_password_model.to_dict() + assert provider_private_authentication_o_auth2_password_password_model_json2 == provider_private_authentication_o_auth2_password_password_model_json -class TestModel_RequestAnalytics: +class TestModel_ProviderResponse: """ - Test Class for RequestAnalytics + Test Class for ProviderResponse """ - def test_request_analytics_serialization(self): + def test_provider_response_serialization(self): """ - Test serialization/deserialization for RequestAnalytics + Test serialization/deserialization for ProviderResponse """ - # Construct a json representation of a RequestAnalytics model - request_analytics_model_json = {} - request_analytics_model_json['browser'] = 'testString' - request_analytics_model_json['device'] = 'testString' - request_analytics_model_json['pageUrl'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of RequestAnalytics by calling from_dict on the json representation - request_analytics_model = RequestAnalytics.from_dict(request_analytics_model_json) - assert request_analytics_model != False + provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem + provider_response_specification_servers_item_model['url'] = 'testString' - # Construct a model instance of RequestAnalytics by calling from_dict on the json representation - request_analytics_model_dict = RequestAnalytics.from_dict(request_analytics_model_json).__dict__ - request_analytics_model2 = RequestAnalytics(**request_analytics_model_dict) + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Verify the model instances are equivalent - assert request_analytics_model == request_analytics_model2 + provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic + provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - # Convert model instance back to dict and verify no loss of data - request_analytics_model_json2 = request_analytics_model.to_dict() - assert request_analytics_model_json2 == request_analytics_model_json + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model -class TestModel_ResponseGenericChannel: - """ - Test Class for ResponseGenericChannel - """ + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - def test_response_generic_channel_serialization(self): - """ - Test serialization/deserialization for ResponseGenericChannel - """ + provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes + provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model + provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - # Construct a json representation of a ResponseGenericChannel model - response_generic_channel_model_json = {} - response_generic_channel_model_json['channel'] = 'testString' + provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents + provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model - # Construct a model instance of ResponseGenericChannel by calling from_dict on the json representation - response_generic_channel_model = ResponseGenericChannel.from_dict(response_generic_channel_model_json) - assert response_generic_channel_model != False + provider_response_specification_model = {} # ProviderResponseSpecification + provider_response_specification_model['servers'] = [provider_response_specification_servers_item_model] + provider_response_specification_model['components'] = provider_response_specification_components_model - # Construct a model instance of ResponseGenericChannel by calling from_dict on the json representation - response_generic_channel_model_dict = ResponseGenericChannel.from_dict(response_generic_channel_model_json).__dict__ - response_generic_channel_model2 = ResponseGenericChannel(**response_generic_channel_model_dict) + # Construct a json representation of a ProviderResponse model + provider_response_model_json = {} + provider_response_model_json['provider_id'] = 'testString' + provider_response_model_json['specification'] = provider_response_specification_model + + # Construct a model instance of ProviderResponse by calling from_dict on the json representation + provider_response_model = ProviderResponse.from_dict(provider_response_model_json) + assert provider_response_model != False + + # Construct a model instance of ProviderResponse by calling from_dict on the json representation + provider_response_model_dict = ProviderResponse.from_dict(provider_response_model_json).__dict__ + provider_response_model2 = ProviderResponse(**provider_response_model_dict) # Verify the model instances are equivalent - assert response_generic_channel_model == response_generic_channel_model2 + assert provider_response_model == provider_response_model2 # Convert model instance back to dict and verify no loss of data - response_generic_channel_model_json2 = response_generic_channel_model.to_dict() - assert response_generic_channel_model_json2 == response_generic_channel_model_json + provider_response_model_json2 = provider_response_model.to_dict() + assert provider_response_model_json2 == provider_response_model_json -class TestModel_RuntimeEntity: +class TestModel_ProviderResponseSpecification: """ - Test Class for RuntimeEntity + Test Class for ProviderResponseSpecification """ - def test_runtime_entity_serialization(self): + def test_provider_response_specification_serialization(self): """ - Test serialization/deserialization for RuntimeEntity + Test serialization/deserialization for ProviderResponseSpecification """ # Construct dict forms of any model objects needed in order to build this model. - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + provider_response_specification_servers_item_model = {} # ProviderResponseSpecificationServersItem + provider_response_specification_servers_item_model['url'] = 'testString' - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' - runtime_entity_interpretation_model['festival'] = 'testString' - runtime_entity_interpretation_model['granularity'] = 'day' - runtime_entity_interpretation_model['range_link'] = 'testString' - runtime_entity_interpretation_model['range_modifier'] = 'testString' - runtime_entity_interpretation_model['relative_day'] = 72.5 - runtime_entity_interpretation_model['relative_month'] = 72.5 - runtime_entity_interpretation_model['relative_week'] = 72.5 - runtime_entity_interpretation_model['relative_weekend'] = 72.5 - runtime_entity_interpretation_model['relative_year'] = 72.5 - runtime_entity_interpretation_model['specific_day'] = 72.5 - runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model['specific_month'] = 72.5 - runtime_entity_interpretation_model['specific_quarter'] = 72.5 - runtime_entity_interpretation_model['specific_year'] = 72.5 - runtime_entity_interpretation_model['numeric_value'] = 72.5 - runtime_entity_interpretation_model['subtype'] = 'testString' - runtime_entity_interpretation_model['part_of_day'] = 'testString' - runtime_entity_interpretation_model['relative_hour'] = 72.5 - runtime_entity_interpretation_model['relative_minute'] = 72.5 - runtime_entity_interpretation_model['relative_second'] = 72.5 - runtime_entity_interpretation_model['specific_hour'] = 72.5 - runtime_entity_interpretation_model['specific_minute'] = 72.5 - runtime_entity_interpretation_model['specific_second'] = 72.5 - runtime_entity_interpretation_model['timezone'] = 'testString' + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 + provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic + provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - runtime_entity_role_model = {} # RuntimeEntityRole - runtime_entity_role_model['type'] = 'date_from' + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' - # Construct a json representation of a RuntimeEntity model - runtime_entity_model_json = {} - runtime_entity_model_json['entity'] = 'testString' - runtime_entity_model_json['location'] = [38] - runtime_entity_model_json['value'] = 'testString' - runtime_entity_model_json['confidence'] = 72.5 - runtime_entity_model_json['groups'] = [capture_group_model] - runtime_entity_model_json['interpretation'] = runtime_entity_interpretation_model - runtime_entity_model_json['alternatives'] = [runtime_entity_alternative_model] - runtime_entity_model_json['role'] = runtime_entity_role_model - runtime_entity_model_json['skill'] = 'testString' + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - # Construct a model instance of RuntimeEntity by calling from_dict on the json representation - runtime_entity_model = RuntimeEntity.from_dict(runtime_entity_model_json) - assert runtime_entity_model != False + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - # Construct a model instance of RuntimeEntity by calling from_dict on the json representation - runtime_entity_model_dict = RuntimeEntity.from_dict(runtime_entity_model_json).__dict__ - runtime_entity_model2 = RuntimeEntity(**runtime_entity_model_dict) + provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes + provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model + provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model + + provider_response_specification_components_model = {} # ProviderResponseSpecificationComponents + provider_response_specification_components_model['securitySchemes'] = provider_response_specification_components_security_schemes_model + + # Construct a json representation of a ProviderResponseSpecification model + provider_response_specification_model_json = {} + provider_response_specification_model_json['servers'] = [provider_response_specification_servers_item_model] + provider_response_specification_model_json['components'] = provider_response_specification_components_model + + # Construct a model instance of ProviderResponseSpecification by calling from_dict on the json representation + provider_response_specification_model = ProviderResponseSpecification.from_dict(provider_response_specification_model_json) + assert provider_response_specification_model != False + + # Construct a model instance of ProviderResponseSpecification by calling from_dict on the json representation + provider_response_specification_model_dict = ProviderResponseSpecification.from_dict(provider_response_specification_model_json).__dict__ + provider_response_specification_model2 = ProviderResponseSpecification(**provider_response_specification_model_dict) # Verify the model instances are equivalent - assert runtime_entity_model == runtime_entity_model2 + assert provider_response_specification_model == provider_response_specification_model2 # Convert model instance back to dict and verify no loss of data - runtime_entity_model_json2 = runtime_entity_model.to_dict() - assert runtime_entity_model_json2 == runtime_entity_model_json + provider_response_specification_model_json2 = provider_response_specification_model.to_dict() + assert provider_response_specification_model_json2 == provider_response_specification_model_json -class TestModel_RuntimeEntityAlternative: +class TestModel_ProviderResponseSpecificationComponents: """ - Test Class for RuntimeEntityAlternative + Test Class for ProviderResponseSpecificationComponents """ - def test_runtime_entity_alternative_serialization(self): + def test_provider_response_specification_components_serialization(self): """ - Test serialization/deserialization for RuntimeEntityAlternative + Test serialization/deserialization for ProviderResponseSpecificationComponents """ - # Construct a json representation of a RuntimeEntityAlternative model - runtime_entity_alternative_model_json = {} - runtime_entity_alternative_model_json['value'] = 'testString' - runtime_entity_alternative_model_json['confidence'] = 72.5 + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of RuntimeEntityAlternative by calling from_dict on the json representation - runtime_entity_alternative_model = RuntimeEntityAlternative.from_dict(runtime_entity_alternative_model_json) - assert runtime_entity_alternative_model != False + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Construct a model instance of RuntimeEntityAlternative by calling from_dict on the json representation - runtime_entity_alternative_model_dict = RuntimeEntityAlternative.from_dict(runtime_entity_alternative_model_json).__dict__ - runtime_entity_alternative_model2 = RuntimeEntityAlternative(**runtime_entity_alternative_model_dict) + provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic + provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' + + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + + provider_response_specification_components_security_schemes_model = {} # ProviderResponseSpecificationComponentsSecuritySchemes + provider_response_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_response_specification_components_security_schemes_model['basic'] = provider_response_specification_components_security_schemes_basic_model + provider_response_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model + + # Construct a json representation of a ProviderResponseSpecificationComponents model + provider_response_specification_components_model_json = {} + provider_response_specification_components_model_json['securitySchemes'] = provider_response_specification_components_security_schemes_model + + # Construct a model instance of ProviderResponseSpecificationComponents by calling from_dict on the json representation + provider_response_specification_components_model = ProviderResponseSpecificationComponents.from_dict(provider_response_specification_components_model_json) + assert provider_response_specification_components_model != False + + # Construct a model instance of ProviderResponseSpecificationComponents by calling from_dict on the json representation + provider_response_specification_components_model_dict = ProviderResponseSpecificationComponents.from_dict(provider_response_specification_components_model_json).__dict__ + provider_response_specification_components_model2 = ProviderResponseSpecificationComponents(**provider_response_specification_components_model_dict) # Verify the model instances are equivalent - assert runtime_entity_alternative_model == runtime_entity_alternative_model2 + assert provider_response_specification_components_model == provider_response_specification_components_model2 # Convert model instance back to dict and verify no loss of data - runtime_entity_alternative_model_json2 = runtime_entity_alternative_model.to_dict() - assert runtime_entity_alternative_model_json2 == runtime_entity_alternative_model_json + provider_response_specification_components_model_json2 = provider_response_specification_components_model.to_dict() + assert provider_response_specification_components_model_json2 == provider_response_specification_components_model_json -class TestModel_RuntimeEntityInterpretation: +class TestModel_ProviderResponseSpecificationComponentsSecuritySchemes: """ - Test Class for RuntimeEntityInterpretation + Test Class for ProviderResponseSpecificationComponentsSecuritySchemes """ - def test_runtime_entity_interpretation_serialization(self): + def test_provider_response_specification_components_security_schemes_serialization(self): """ - Test serialization/deserialization for RuntimeEntityInterpretation + Test serialization/deserialization for ProviderResponseSpecificationComponentsSecuritySchemes """ - # Construct a json representation of a RuntimeEntityInterpretation model - runtime_entity_interpretation_model_json = {} - runtime_entity_interpretation_model_json['calendar_type'] = 'testString' - runtime_entity_interpretation_model_json['datetime_link'] = 'testString' - runtime_entity_interpretation_model_json['festival'] = 'testString' - runtime_entity_interpretation_model_json['granularity'] = 'day' - runtime_entity_interpretation_model_json['range_link'] = 'testString' - runtime_entity_interpretation_model_json['range_modifier'] = 'testString' - runtime_entity_interpretation_model_json['relative_day'] = 72.5 - runtime_entity_interpretation_model_json['relative_month'] = 72.5 - runtime_entity_interpretation_model_json['relative_week'] = 72.5 - runtime_entity_interpretation_model_json['relative_weekend'] = 72.5 - runtime_entity_interpretation_model_json['relative_year'] = 72.5 - runtime_entity_interpretation_model_json['specific_day'] = 72.5 - runtime_entity_interpretation_model_json['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model_json['specific_month'] = 72.5 - runtime_entity_interpretation_model_json['specific_quarter'] = 72.5 - runtime_entity_interpretation_model_json['specific_year'] = 72.5 - runtime_entity_interpretation_model_json['numeric_value'] = 72.5 - runtime_entity_interpretation_model_json['subtype'] = 'testString' - runtime_entity_interpretation_model_json['part_of_day'] = 'testString' - runtime_entity_interpretation_model_json['relative_hour'] = 72.5 - runtime_entity_interpretation_model_json['relative_minute'] = 72.5 - runtime_entity_interpretation_model_json['relative_second'] = 72.5 - runtime_entity_interpretation_model_json['specific_hour'] = 72.5 - runtime_entity_interpretation_model_json['specific_minute'] = 72.5 - runtime_entity_interpretation_model_json['specific_second'] = 72.5 - runtime_entity_interpretation_model_json['timezone'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of RuntimeEntityInterpretation by calling from_dict on the json representation - runtime_entity_interpretation_model = RuntimeEntityInterpretation.from_dict(runtime_entity_interpretation_model_json) - assert runtime_entity_interpretation_model != False + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Construct a model instance of RuntimeEntityInterpretation by calling from_dict on the json representation - runtime_entity_interpretation_model_dict = RuntimeEntityInterpretation.from_dict(runtime_entity_interpretation_model_json).__dict__ - runtime_entity_interpretation_model2 = RuntimeEntityInterpretation(**runtime_entity_interpretation_model_dict) + provider_response_specification_components_security_schemes_basic_model = {} # ProviderResponseSpecificationComponentsSecuritySchemesBasic + provider_response_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model + + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' + + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model + + # Construct a json representation of a ProviderResponseSpecificationComponentsSecuritySchemes model + provider_response_specification_components_security_schemes_model_json = {} + provider_response_specification_components_security_schemes_model_json['authentication_method'] = 'basic' + provider_response_specification_components_security_schemes_model_json['basic'] = provider_response_specification_components_security_schemes_basic_model + provider_response_specification_components_security_schemes_model_json['oauth2'] = provider_authentication_o_auth2_model + + # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemes by calling from_dict on the json representation + provider_response_specification_components_security_schemes_model = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict(provider_response_specification_components_security_schemes_model_json) + assert provider_response_specification_components_security_schemes_model != False + + # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemes by calling from_dict on the json representation + provider_response_specification_components_security_schemes_model_dict = ProviderResponseSpecificationComponentsSecuritySchemes.from_dict(provider_response_specification_components_security_schemes_model_json).__dict__ + provider_response_specification_components_security_schemes_model2 = ProviderResponseSpecificationComponentsSecuritySchemes(**provider_response_specification_components_security_schemes_model_dict) # Verify the model instances are equivalent - assert runtime_entity_interpretation_model == runtime_entity_interpretation_model2 + assert provider_response_specification_components_security_schemes_model == provider_response_specification_components_security_schemes_model2 # Convert model instance back to dict and verify no loss of data - runtime_entity_interpretation_model_json2 = runtime_entity_interpretation_model.to_dict() - assert runtime_entity_interpretation_model_json2 == runtime_entity_interpretation_model_json + provider_response_specification_components_security_schemes_model_json2 = provider_response_specification_components_security_schemes_model.to_dict() + assert provider_response_specification_components_security_schemes_model_json2 == provider_response_specification_components_security_schemes_model_json -class TestModel_RuntimeEntityRole: +class TestModel_ProviderResponseSpecificationComponentsSecuritySchemesBasic: """ - Test Class for RuntimeEntityRole + Test Class for ProviderResponseSpecificationComponentsSecuritySchemesBasic """ - def test_runtime_entity_role_serialization(self): + def test_provider_response_specification_components_security_schemes_basic_serialization(self): """ - Test serialization/deserialization for RuntimeEntityRole + Test serialization/deserialization for ProviderResponseSpecificationComponentsSecuritySchemesBasic """ - # Construct a json representation of a RuntimeEntityRole model - runtime_entity_role_model_json = {} - runtime_entity_role_model_json['type'] = 'date_from' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of RuntimeEntityRole by calling from_dict on the json representation - runtime_entity_role_model = RuntimeEntityRole.from_dict(runtime_entity_role_model_json) - assert runtime_entity_role_model != False + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Construct a model instance of RuntimeEntityRole by calling from_dict on the json representation - runtime_entity_role_model_dict = RuntimeEntityRole.from_dict(runtime_entity_role_model_json).__dict__ - runtime_entity_role_model2 = RuntimeEntityRole(**runtime_entity_role_model_dict) + # Construct a json representation of a ProviderResponseSpecificationComponentsSecuritySchemesBasic model + provider_response_specification_components_security_schemes_basic_model_json = {} + provider_response_specification_components_security_schemes_basic_model_json['username'] = provider_authentication_type_and_value_model + + # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation + provider_response_specification_components_security_schemes_basic_model = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict(provider_response_specification_components_security_schemes_basic_model_json) + assert provider_response_specification_components_security_schemes_basic_model != False + + # Construct a model instance of ProviderResponseSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation + provider_response_specification_components_security_schemes_basic_model_dict = ProviderResponseSpecificationComponentsSecuritySchemesBasic.from_dict(provider_response_specification_components_security_schemes_basic_model_json).__dict__ + provider_response_specification_components_security_schemes_basic_model2 = ProviderResponseSpecificationComponentsSecuritySchemesBasic(**provider_response_specification_components_security_schemes_basic_model_dict) # Verify the model instances are equivalent - assert runtime_entity_role_model == runtime_entity_role_model2 + assert provider_response_specification_components_security_schemes_basic_model == provider_response_specification_components_security_schemes_basic_model2 # Convert model instance back to dict and verify no loss of data - runtime_entity_role_model_json2 = runtime_entity_role_model.to_dict() - assert runtime_entity_role_model_json2 == runtime_entity_role_model_json + provider_response_specification_components_security_schemes_basic_model_json2 = provider_response_specification_components_security_schemes_basic_model.to_dict() + assert provider_response_specification_components_security_schemes_basic_model_json2 == provider_response_specification_components_security_schemes_basic_model_json -class TestModel_RuntimeIntent: +class TestModel_ProviderResponseSpecificationServersItem: """ - Test Class for RuntimeIntent + Test Class for ProviderResponseSpecificationServersItem """ - def test_runtime_intent_serialization(self): + def test_provider_response_specification_servers_item_serialization(self): """ - Test serialization/deserialization for RuntimeIntent + Test serialization/deserialization for ProviderResponseSpecificationServersItem """ - # Construct a json representation of a RuntimeIntent model - runtime_intent_model_json = {} - runtime_intent_model_json['intent'] = 'testString' - runtime_intent_model_json['confidence'] = 72.5 - runtime_intent_model_json['skill'] = 'testString' + # Construct a json representation of a ProviderResponseSpecificationServersItem model + provider_response_specification_servers_item_model_json = {} + provider_response_specification_servers_item_model_json['url'] = 'testString' - # Construct a model instance of RuntimeIntent by calling from_dict on the json representation - runtime_intent_model = RuntimeIntent.from_dict(runtime_intent_model_json) - assert runtime_intent_model != False + # Construct a model instance of ProviderResponseSpecificationServersItem by calling from_dict on the json representation + provider_response_specification_servers_item_model = ProviderResponseSpecificationServersItem.from_dict(provider_response_specification_servers_item_model_json) + assert provider_response_specification_servers_item_model != False - # Construct a model instance of RuntimeIntent by calling from_dict on the json representation - runtime_intent_model_dict = RuntimeIntent.from_dict(runtime_intent_model_json).__dict__ - runtime_intent_model2 = RuntimeIntent(**runtime_intent_model_dict) + # Construct a model instance of ProviderResponseSpecificationServersItem by calling from_dict on the json representation + provider_response_specification_servers_item_model_dict = ProviderResponseSpecificationServersItem.from_dict(provider_response_specification_servers_item_model_json).__dict__ + provider_response_specification_servers_item_model2 = ProviderResponseSpecificationServersItem(**provider_response_specification_servers_item_model_dict) # Verify the model instances are equivalent - assert runtime_intent_model == runtime_intent_model2 + assert provider_response_specification_servers_item_model == provider_response_specification_servers_item_model2 # Convert model instance back to dict and verify no loss of data - runtime_intent_model_json2 = runtime_intent_model.to_dict() - assert runtime_intent_model_json2 == runtime_intent_model_json + provider_response_specification_servers_item_model_json2 = provider_response_specification_servers_item_model.to_dict() + assert provider_response_specification_servers_item_model_json2 == provider_response_specification_servers_item_model_json -class TestModel_SearchResult: +class TestModel_ProviderSpecification: """ - Test Class for SearchResult + Test Class for ProviderSpecification """ - def test_search_result_serialization(self): + def test_provider_specification_serialization(self): """ - Test serialization/deserialization for SearchResult + Test serialization/deserialization for ProviderSpecification """ # Construct dict forms of any model objects needed in order to build this model. - search_result_metadata_model = {} # SearchResultMetadata - search_result_metadata_model['confidence'] = 72.5 - search_result_metadata_model['score'] = 72.5 - - search_result_highlight_model = {} # SearchResultHighlight - search_result_highlight_model['body'] = ['testString'] - search_result_highlight_model['title'] = ['testString'] - search_result_highlight_model['url'] = ['testString'] - search_result_highlight_model['foo'] = ['testString'] - - search_result_answer_model = {} # SearchResultAnswer - search_result_answer_model['text'] = 'testString' - search_result_answer_model['confidence'] = 0 - - # Construct a json representation of a SearchResult model - search_result_model_json = {} - search_result_model_json['id'] = 'testString' - search_result_model_json['result_metadata'] = search_result_metadata_model - search_result_model_json['body'] = 'testString' - search_result_model_json['title'] = 'testString' - search_result_model_json['url'] = 'testString' - search_result_model_json['highlight'] = search_result_highlight_model - search_result_model_json['answers'] = [search_result_answer_model] + provider_specification_servers_item_model = {} # ProviderSpecificationServersItem + provider_specification_servers_item_model['url'] = 'testString' - # Construct a model instance of SearchResult by calling from_dict on the json representation - search_result_model = SearchResult.from_dict(search_result_model_json) - assert search_result_model != False + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Construct a model instance of SearchResult by calling from_dict on the json representation - search_result_model_dict = SearchResult.from_dict(search_result_model_json).__dict__ - search_result_model2 = SearchResult(**search_result_model_dict) + provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic + provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - # Verify the model instances are equivalent - assert search_result_model == search_result_model2 + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' - # Convert model instance back to dict and verify no loss of data - search_result_model_json2 = search_result_model.to_dict() - assert search_result_model_json2 == search_result_model_json + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model -class TestModel_SearchResultAnswer: - """ - Test Class for SearchResultAnswer - """ + provider_specification_components_security_schemes_model = {} # ProviderSpecificationComponentsSecuritySchemes + provider_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_specification_components_security_schemes_model['basic'] = provider_specification_components_security_schemes_basic_model + provider_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - def test_search_result_answer_serialization(self): - """ - Test serialization/deserialization for SearchResultAnswer - """ + provider_specification_components_model = {} # ProviderSpecificationComponents + provider_specification_components_model['securitySchemes'] = provider_specification_components_security_schemes_model - # Construct a json representation of a SearchResultAnswer model - search_result_answer_model_json = {} - search_result_answer_model_json['text'] = 'testString' - search_result_answer_model_json['confidence'] = 0 + # Construct a json representation of a ProviderSpecification model + provider_specification_model_json = {} + provider_specification_model_json['servers'] = [provider_specification_servers_item_model] + provider_specification_model_json['components'] = provider_specification_components_model - # Construct a model instance of SearchResultAnswer by calling from_dict on the json representation - search_result_answer_model = SearchResultAnswer.from_dict(search_result_answer_model_json) - assert search_result_answer_model != False + # Construct a model instance of ProviderSpecification by calling from_dict on the json representation + provider_specification_model = ProviderSpecification.from_dict(provider_specification_model_json) + assert provider_specification_model != False - # Construct a model instance of SearchResultAnswer by calling from_dict on the json representation - search_result_answer_model_dict = SearchResultAnswer.from_dict(search_result_answer_model_json).__dict__ - search_result_answer_model2 = SearchResultAnswer(**search_result_answer_model_dict) + # Construct a model instance of ProviderSpecification by calling from_dict on the json representation + provider_specification_model_dict = ProviderSpecification.from_dict(provider_specification_model_json).__dict__ + provider_specification_model2 = ProviderSpecification(**provider_specification_model_dict) # Verify the model instances are equivalent - assert search_result_answer_model == search_result_answer_model2 + assert provider_specification_model == provider_specification_model2 # Convert model instance back to dict and verify no loss of data - search_result_answer_model_json2 = search_result_answer_model.to_dict() - assert search_result_answer_model_json2 == search_result_answer_model_json + provider_specification_model_json2 = provider_specification_model.to_dict() + assert provider_specification_model_json2 == provider_specification_model_json -class TestModel_SearchResultHighlight: +class TestModel_ProviderSpecificationComponents: """ - Test Class for SearchResultHighlight + Test Class for ProviderSpecificationComponents """ - def test_search_result_highlight_serialization(self): + def test_provider_specification_components_serialization(self): """ - Test serialization/deserialization for SearchResultHighlight + Test serialization/deserialization for ProviderSpecificationComponents """ - # Construct a json representation of a SearchResultHighlight model - search_result_highlight_model_json = {} - search_result_highlight_model_json['body'] = ['testString'] - search_result_highlight_model_json['title'] = ['testString'] - search_result_highlight_model_json['url'] = ['testString'] - search_result_highlight_model_json['foo'] = ['testString'] - - # Construct a model instance of SearchResultHighlight by calling from_dict on the json representation - search_result_highlight_model = SearchResultHighlight.from_dict(search_result_highlight_model_json) - assert search_result_highlight_model != False + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of SearchResultHighlight by calling from_dict on the json representation - search_result_highlight_model_dict = SearchResultHighlight.from_dict(search_result_highlight_model_json).__dict__ - search_result_highlight_model2 = SearchResultHighlight(**search_result_highlight_model_dict) + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - # Verify the model instances are equivalent - assert search_result_highlight_model == search_result_highlight_model2 - - # Convert model instance back to dict and verify no loss of data - search_result_highlight_model_json2 = search_result_highlight_model.to_dict() - assert search_result_highlight_model_json2 == search_result_highlight_model_json - - # Test get_properties and set_properties methods. - search_result_highlight_model.set_properties({}) - actual_dict = search_result_highlight_model.get_properties() - assert actual_dict == {} + provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic + provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - expected_dict = {'foo': ['testString']} - search_result_highlight_model.set_properties(expected_dict) - actual_dict = search_result_highlight_model.get_properties() - assert actual_dict.keys() == expected_dict.keys() + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model -class TestModel_SearchResultMetadata: - """ - Test Class for SearchResultMetadata - """ + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - def test_search_result_metadata_serialization(self): - """ - Test serialization/deserialization for SearchResultMetadata - """ + provider_specification_components_security_schemes_model = {} # ProviderSpecificationComponentsSecuritySchemes + provider_specification_components_security_schemes_model['authentication_method'] = 'basic' + provider_specification_components_security_schemes_model['basic'] = provider_specification_components_security_schemes_basic_model + provider_specification_components_security_schemes_model['oauth2'] = provider_authentication_o_auth2_model - # Construct a json representation of a SearchResultMetadata model - search_result_metadata_model_json = {} - search_result_metadata_model_json['confidence'] = 72.5 - search_result_metadata_model_json['score'] = 72.5 + # Construct a json representation of a ProviderSpecificationComponents model + provider_specification_components_model_json = {} + provider_specification_components_model_json['securitySchemes'] = provider_specification_components_security_schemes_model - # Construct a model instance of SearchResultMetadata by calling from_dict on the json representation - search_result_metadata_model = SearchResultMetadata.from_dict(search_result_metadata_model_json) - assert search_result_metadata_model != False + # Construct a model instance of ProviderSpecificationComponents by calling from_dict on the json representation + provider_specification_components_model = ProviderSpecificationComponents.from_dict(provider_specification_components_model_json) + assert provider_specification_components_model != False - # Construct a model instance of SearchResultMetadata by calling from_dict on the json representation - search_result_metadata_model_dict = SearchResultMetadata.from_dict(search_result_metadata_model_json).__dict__ - search_result_metadata_model2 = SearchResultMetadata(**search_result_metadata_model_dict) + # Construct a model instance of ProviderSpecificationComponents by calling from_dict on the json representation + provider_specification_components_model_dict = ProviderSpecificationComponents.from_dict(provider_specification_components_model_json).__dict__ + provider_specification_components_model2 = ProviderSpecificationComponents(**provider_specification_components_model_dict) # Verify the model instances are equivalent - assert search_result_metadata_model == search_result_metadata_model2 + assert provider_specification_components_model == provider_specification_components_model2 # Convert model instance back to dict and verify no loss of data - search_result_metadata_model_json2 = search_result_metadata_model.to_dict() - assert search_result_metadata_model_json2 == search_result_metadata_model_json + provider_specification_components_model_json2 = provider_specification_components_model.to_dict() + assert provider_specification_components_model_json2 == provider_specification_components_model_json -class TestModel_SearchSettings: +class TestModel_ProviderSpecificationComponentsSecuritySchemes: """ - Test Class for SearchSettings + Test Class for ProviderSpecificationComponentsSecuritySchemes """ - def test_search_settings_serialization(self): + def test_provider_specification_components_security_schemes_serialization(self): """ - Test serialization/deserialization for SearchSettings + Test serialization/deserialization for ProviderSpecificationComponentsSecuritySchemes """ # Construct dict forms of any model objects needed in order to build this model. - search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication - search_settings_discovery_authentication_model['basic'] = 'testString' - search_settings_discovery_authentication_model['bearer'] = 'testString' + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' - search_settings_discovery_model = {} # SearchSettingsDiscovery - search_settings_discovery_model['instance_id'] = 'testString' - search_settings_discovery_model['project_id'] = 'testString' - search_settings_discovery_model['url'] = 'testString' - search_settings_discovery_model['max_primary_results'] = 10000 - search_settings_discovery_model['max_total_results'] = 10000 - search_settings_discovery_model['confidence_threshold'] = 0.0 - search_settings_discovery_model['highlight'] = True - search_settings_discovery_model['find_answers'] = True - search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + provider_specification_components_security_schemes_basic_model = {} # ProviderSpecificationComponentsSecuritySchemesBasic + provider_specification_components_security_schemes_basic_model['username'] = provider_authentication_type_and_value_model - search_settings_messages_model = {} # SearchSettingsMessages - search_settings_messages_model['success'] = 'testString' - search_settings_messages_model['error'] = 'testString' - search_settings_messages_model['no_result'] = 'testString' + provider_authentication_o_auth2_password_username_model = {} # ProviderAuthenticationOAuth2PasswordUsername + provider_authentication_o_auth2_password_username_model['type'] = 'value' + provider_authentication_o_auth2_password_username_model['value'] = 'testString' - search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping - search_settings_schema_mapping_model['url'] = 'testString' - search_settings_schema_mapping_model['body'] = 'testString' - search_settings_schema_mapping_model['title'] = 'testString' + provider_authentication_o_auth2_flows_model = {} # ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + provider_authentication_o_auth2_flows_model['token_url'] = 'testString' + provider_authentication_o_auth2_flows_model['refresh_url'] = 'testString' + provider_authentication_o_auth2_flows_model['client_auth_type'] = 'Body' + provider_authentication_o_auth2_flows_model['content_type'] = 'testString' + provider_authentication_o_auth2_flows_model['header_prefix'] = 'testString' + provider_authentication_o_auth2_flows_model['username'] = provider_authentication_o_auth2_password_username_model - search_settings_elastic_search_model = {} # SearchSettingsElasticSearch - search_settings_elastic_search_model['url'] = 'testString' - search_settings_elastic_search_model['port'] = 'testString' - search_settings_elastic_search_model['username'] = 'testString' - search_settings_elastic_search_model['password'] = 'testString' - search_settings_elastic_search_model['index'] = 'testString' - search_settings_elastic_search_model['filter'] = ['testString'] - search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} - search_settings_elastic_search_model['managed_index'] = 'testString' - search_settings_elastic_search_model['apikey'] = 'testString' + provider_authentication_o_auth2_model = {} # ProviderAuthenticationOAuth2 + provider_authentication_o_auth2_model['preferred_flow'] = 'password' + provider_authentication_o_auth2_model['flows'] = provider_authentication_o_auth2_flows_model - search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength - search_settings_conversational_search_response_length_model['option'] = 'moderate' + # Construct a json representation of a ProviderSpecificationComponentsSecuritySchemes model + provider_specification_components_security_schemes_model_json = {} + provider_specification_components_security_schemes_model_json['authentication_method'] = 'basic' + provider_specification_components_security_schemes_model_json['basic'] = provider_specification_components_security_schemes_basic_model + provider_specification_components_security_schemes_model_json['oauth2'] = provider_authentication_o_auth2_model - search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence - search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + # Construct a model instance of ProviderSpecificationComponentsSecuritySchemes by calling from_dict on the json representation + provider_specification_components_security_schemes_model = ProviderSpecificationComponentsSecuritySchemes.from_dict(provider_specification_components_security_schemes_model_json) + assert provider_specification_components_security_schemes_model != False - search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch - search_settings_conversational_search_model['enabled'] = True - search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model - search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + # Construct a model instance of ProviderSpecificationComponentsSecuritySchemes by calling from_dict on the json representation + provider_specification_components_security_schemes_model_dict = ProviderSpecificationComponentsSecuritySchemes.from_dict(provider_specification_components_security_schemes_model_json).__dict__ + provider_specification_components_security_schemes_model2 = ProviderSpecificationComponentsSecuritySchemes(**provider_specification_components_security_schemes_model_dict) - search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch - search_settings_server_side_search_model['url'] = 'testString' - search_settings_server_side_search_model['port'] = 'testString' - search_settings_server_side_search_model['username'] = 'testString' - search_settings_server_side_search_model['password'] = 'testString' - search_settings_server_side_search_model['filter'] = 'testString' - search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} - search_settings_server_side_search_model['apikey'] = 'testString' - search_settings_server_side_search_model['no_auth'] = True - search_settings_server_side_search_model['auth_type'] = 'basic' + # Verify the model instances are equivalent + assert provider_specification_components_security_schemes_model == provider_specification_components_security_schemes_model2 - search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch - search_settings_client_side_search_model['filter'] = 'testString' - search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} + # Convert model instance back to dict and verify no loss of data + provider_specification_components_security_schemes_model_json2 = provider_specification_components_security_schemes_model.to_dict() + assert provider_specification_components_security_schemes_model_json2 == provider_specification_components_security_schemes_model_json - # Construct a json representation of a SearchSettings model - search_settings_model_json = {} - search_settings_model_json['discovery'] = search_settings_discovery_model - search_settings_model_json['messages'] = search_settings_messages_model - search_settings_model_json['schema_mapping'] = search_settings_schema_mapping_model - search_settings_model_json['elastic_search'] = search_settings_elastic_search_model - search_settings_model_json['conversational_search'] = search_settings_conversational_search_model - search_settings_model_json['server_side_search'] = search_settings_server_side_search_model - search_settings_model_json['client_side_search'] = search_settings_client_side_search_model - # Construct a model instance of SearchSettings by calling from_dict on the json representation - search_settings_model = SearchSettings.from_dict(search_settings_model_json) - assert search_settings_model != False +class TestModel_ProviderSpecificationComponentsSecuritySchemesBasic: + """ + Test Class for ProviderSpecificationComponentsSecuritySchemesBasic + """ - # Construct a model instance of SearchSettings by calling from_dict on the json representation - search_settings_model_dict = SearchSettings.from_dict(search_settings_model_json).__dict__ - search_settings_model2 = SearchSettings(**search_settings_model_dict) + def test_provider_specification_components_security_schemes_basic_serialization(self): + """ + Test serialization/deserialization for ProviderSpecificationComponentsSecuritySchemesBasic + """ + + # Construct dict forms of any model objects needed in order to build this model. + + provider_authentication_type_and_value_model = {} # ProviderAuthenticationTypeAndValue + provider_authentication_type_and_value_model['type'] = 'value' + provider_authentication_type_and_value_model['value'] = 'testString' + + # Construct a json representation of a ProviderSpecificationComponentsSecuritySchemesBasic model + provider_specification_components_security_schemes_basic_model_json = {} + provider_specification_components_security_schemes_basic_model_json['username'] = provider_authentication_type_and_value_model + + # Construct a model instance of ProviderSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation + provider_specification_components_security_schemes_basic_model = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict(provider_specification_components_security_schemes_basic_model_json) + assert provider_specification_components_security_schemes_basic_model != False + + # Construct a model instance of ProviderSpecificationComponentsSecuritySchemesBasic by calling from_dict on the json representation + provider_specification_components_security_schemes_basic_model_dict = ProviderSpecificationComponentsSecuritySchemesBasic.from_dict(provider_specification_components_security_schemes_basic_model_json).__dict__ + provider_specification_components_security_schemes_basic_model2 = ProviderSpecificationComponentsSecuritySchemesBasic(**provider_specification_components_security_schemes_basic_model_dict) # Verify the model instances are equivalent - assert search_settings_model == search_settings_model2 + assert provider_specification_components_security_schemes_basic_model == provider_specification_components_security_schemes_basic_model2 # Convert model instance back to dict and verify no loss of data - search_settings_model_json2 = search_settings_model.to_dict() - assert search_settings_model_json2 == search_settings_model_json + provider_specification_components_security_schemes_basic_model_json2 = provider_specification_components_security_schemes_basic_model.to_dict() + assert provider_specification_components_security_schemes_basic_model_json2 == provider_specification_components_security_schemes_basic_model_json -class TestModel_SearchSettingsClientSideSearch: +class TestModel_ProviderSpecificationServersItem: """ - Test Class for SearchSettingsClientSideSearch + Test Class for ProviderSpecificationServersItem """ - def test_search_settings_client_side_search_serialization(self): + def test_provider_specification_servers_item_serialization(self): """ - Test serialization/deserialization for SearchSettingsClientSideSearch + Test serialization/deserialization for ProviderSpecificationServersItem """ - # Construct a json representation of a SearchSettingsClientSideSearch model - search_settings_client_side_search_model_json = {} - search_settings_client_side_search_model_json['filter'] = 'testString' - search_settings_client_side_search_model_json['metadata'] = {'anyKey': 'anyValue'} + # Construct a json representation of a ProviderSpecificationServersItem model + provider_specification_servers_item_model_json = {} + provider_specification_servers_item_model_json['url'] = 'testString' - # Construct a model instance of SearchSettingsClientSideSearch by calling from_dict on the json representation - search_settings_client_side_search_model = SearchSettingsClientSideSearch.from_dict(search_settings_client_side_search_model_json) - assert search_settings_client_side_search_model != False + # Construct a model instance of ProviderSpecificationServersItem by calling from_dict on the json representation + provider_specification_servers_item_model = ProviderSpecificationServersItem.from_dict(provider_specification_servers_item_model_json) + assert provider_specification_servers_item_model != False - # Construct a model instance of SearchSettingsClientSideSearch by calling from_dict on the json representation - search_settings_client_side_search_model_dict = SearchSettingsClientSideSearch.from_dict(search_settings_client_side_search_model_json).__dict__ - search_settings_client_side_search_model2 = SearchSettingsClientSideSearch(**search_settings_client_side_search_model_dict) + # Construct a model instance of ProviderSpecificationServersItem by calling from_dict on the json representation + provider_specification_servers_item_model_dict = ProviderSpecificationServersItem.from_dict(provider_specification_servers_item_model_json).__dict__ + provider_specification_servers_item_model2 = ProviderSpecificationServersItem(**provider_specification_servers_item_model_dict) # Verify the model instances are equivalent - assert search_settings_client_side_search_model == search_settings_client_side_search_model2 + assert provider_specification_servers_item_model == provider_specification_servers_item_model2 # Convert model instance back to dict and verify no loss of data - search_settings_client_side_search_model_json2 = search_settings_client_side_search_model.to_dict() - assert search_settings_client_side_search_model_json2 == search_settings_client_side_search_model_json + provider_specification_servers_item_model_json2 = provider_specification_servers_item_model.to_dict() + assert provider_specification_servers_item_model_json2 == provider_specification_servers_item_model_json -class TestModel_SearchSettingsConversationalSearch: +class TestModel_Release: """ - Test Class for SearchSettingsConversationalSearch + Test Class for Release """ - def test_search_settings_conversational_search_serialization(self): + def test_release_serialization(self): """ - Test serialization/deserialization for SearchSettingsConversationalSearch + Test serialization/deserialization for Release """ - # Construct dict forms of any model objects needed in order to build this model. - - search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength - search_settings_conversational_search_response_length_model['option'] = 'moderate' + # Construct a json representation of a Release model + release_model_json = {} + release_model_json['description'] = 'testString' - search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence - search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' - - # Construct a json representation of a SearchSettingsConversationalSearch model - search_settings_conversational_search_model_json = {} - search_settings_conversational_search_model_json['enabled'] = True - search_settings_conversational_search_model_json['response_length'] = search_settings_conversational_search_response_length_model - search_settings_conversational_search_model_json['search_confidence'] = search_settings_conversational_search_search_confidence_model - - # Construct a model instance of SearchSettingsConversationalSearch by calling from_dict on the json representation - search_settings_conversational_search_model = SearchSettingsConversationalSearch.from_dict(search_settings_conversational_search_model_json) - assert search_settings_conversational_search_model != False + # Construct a model instance of Release by calling from_dict on the json representation + release_model = Release.from_dict(release_model_json) + assert release_model != False - # Construct a model instance of SearchSettingsConversationalSearch by calling from_dict on the json representation - search_settings_conversational_search_model_dict = SearchSettingsConversationalSearch.from_dict(search_settings_conversational_search_model_json).__dict__ - search_settings_conversational_search_model2 = SearchSettingsConversationalSearch(**search_settings_conversational_search_model_dict) + # Construct a model instance of Release by calling from_dict on the json representation + release_model_dict = Release.from_dict(release_model_json).__dict__ + release_model2 = Release(**release_model_dict) # Verify the model instances are equivalent - assert search_settings_conversational_search_model == search_settings_conversational_search_model2 + assert release_model == release_model2 # Convert model instance back to dict and verify no loss of data - search_settings_conversational_search_model_json2 = search_settings_conversational_search_model.to_dict() - assert search_settings_conversational_search_model_json2 == search_settings_conversational_search_model_json + release_model_json2 = release_model.to_dict() + assert release_model_json2 == release_model_json -class TestModel_SearchSettingsConversationalSearchResponseLength: +class TestModel_ReleaseCollection: """ - Test Class for SearchSettingsConversationalSearchResponseLength + Test Class for ReleaseCollection """ - def test_search_settings_conversational_search_response_length_serialization(self): + def test_release_collection_serialization(self): """ - Test serialization/deserialization for SearchSettingsConversationalSearchResponseLength + Test serialization/deserialization for ReleaseCollection """ - # Construct a json representation of a SearchSettingsConversationalSearchResponseLength model - search_settings_conversational_search_response_length_model_json = {} - search_settings_conversational_search_response_length_model_json['option'] = 'moderate' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of SearchSettingsConversationalSearchResponseLength by calling from_dict on the json representation - search_settings_conversational_search_response_length_model = SearchSettingsConversationalSearchResponseLength.from_dict(search_settings_conversational_search_response_length_model_json) - assert search_settings_conversational_search_response_length_model != False + release_model = {} # Release + release_model['description'] = 'testString' - # Construct a model instance of SearchSettingsConversationalSearchResponseLength by calling from_dict on the json representation - search_settings_conversational_search_response_length_model_dict = SearchSettingsConversationalSearchResponseLength.from_dict(search_settings_conversational_search_response_length_model_json).__dict__ - search_settings_conversational_search_response_length_model2 = SearchSettingsConversationalSearchResponseLength(**search_settings_conversational_search_response_length_model_dict) + pagination_model = {} # Pagination + pagination_model['refresh_url'] = 'testString' + pagination_model['next_url'] = 'testString' + pagination_model['total'] = 38 + pagination_model['matched'] = 38 + pagination_model['refresh_cursor'] = 'testString' + pagination_model['next_cursor'] = 'testString' + + # Construct a json representation of a ReleaseCollection model + release_collection_model_json = {} + release_collection_model_json['releases'] = [release_model] + release_collection_model_json['pagination'] = pagination_model + + # Construct a model instance of ReleaseCollection by calling from_dict on the json representation + release_collection_model = ReleaseCollection.from_dict(release_collection_model_json) + assert release_collection_model != False + + # Construct a model instance of ReleaseCollection by calling from_dict on the json representation + release_collection_model_dict = ReleaseCollection.from_dict(release_collection_model_json).__dict__ + release_collection_model2 = ReleaseCollection(**release_collection_model_dict) # Verify the model instances are equivalent - assert search_settings_conversational_search_response_length_model == search_settings_conversational_search_response_length_model2 + assert release_collection_model == release_collection_model2 # Convert model instance back to dict and verify no loss of data - search_settings_conversational_search_response_length_model_json2 = search_settings_conversational_search_response_length_model.to_dict() - assert search_settings_conversational_search_response_length_model_json2 == search_settings_conversational_search_response_length_model_json + release_collection_model_json2 = release_collection_model.to_dict() + assert release_collection_model_json2 == release_collection_model_json -class TestModel_SearchSettingsConversationalSearchSearchConfidence: +class TestModel_ReleaseContent: """ - Test Class for SearchSettingsConversationalSearchSearchConfidence + Test Class for ReleaseContent """ - def test_search_settings_conversational_search_search_confidence_serialization(self): + def test_release_content_serialization(self): """ - Test serialization/deserialization for SearchSettingsConversationalSearchSearchConfidence + Test serialization/deserialization for ReleaseContent """ - # Construct a json representation of a SearchSettingsConversationalSearchSearchConfidence model - search_settings_conversational_search_search_confidence_model_json = {} - search_settings_conversational_search_search_confidence_model_json['threshold'] = 'less_often' + # Construct a json representation of a ReleaseContent model + release_content_model_json = {} - # Construct a model instance of SearchSettingsConversationalSearchSearchConfidence by calling from_dict on the json representation - search_settings_conversational_search_search_confidence_model = SearchSettingsConversationalSearchSearchConfidence.from_dict(search_settings_conversational_search_search_confidence_model_json) - assert search_settings_conversational_search_search_confidence_model != False + # Construct a model instance of ReleaseContent by calling from_dict on the json representation + release_content_model = ReleaseContent.from_dict(release_content_model_json) + assert release_content_model != False - # Construct a model instance of SearchSettingsConversationalSearchSearchConfidence by calling from_dict on the json representation - search_settings_conversational_search_search_confidence_model_dict = SearchSettingsConversationalSearchSearchConfidence.from_dict(search_settings_conversational_search_search_confidence_model_json).__dict__ - search_settings_conversational_search_search_confidence_model2 = SearchSettingsConversationalSearchSearchConfidence(**search_settings_conversational_search_search_confidence_model_dict) + # Construct a model instance of ReleaseContent by calling from_dict on the json representation + release_content_model_dict = ReleaseContent.from_dict(release_content_model_json).__dict__ + release_content_model2 = ReleaseContent(**release_content_model_dict) # Verify the model instances are equivalent - assert search_settings_conversational_search_search_confidence_model == search_settings_conversational_search_search_confidence_model2 + assert release_content_model == release_content_model2 # Convert model instance back to dict and verify no loss of data - search_settings_conversational_search_search_confidence_model_json2 = search_settings_conversational_search_search_confidence_model.to_dict() - assert search_settings_conversational_search_search_confidence_model_json2 == search_settings_conversational_search_search_confidence_model_json + release_content_model_json2 = release_content_model.to_dict() + assert release_content_model_json2 == release_content_model_json -class TestModel_SearchSettingsDiscovery: +class TestModel_ReleaseSkill: """ - Test Class for SearchSettingsDiscovery + Test Class for ReleaseSkill """ - def test_search_settings_discovery_serialization(self): + def test_release_skill_serialization(self): """ - Test serialization/deserialization for SearchSettingsDiscovery + Test serialization/deserialization for ReleaseSkill """ - # Construct dict forms of any model objects needed in order to build this model. - - search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication - search_settings_discovery_authentication_model['basic'] = 'testString' - search_settings_discovery_authentication_model['bearer'] = 'testString' - - # Construct a json representation of a SearchSettingsDiscovery model - search_settings_discovery_model_json = {} - search_settings_discovery_model_json['instance_id'] = 'testString' - search_settings_discovery_model_json['project_id'] = 'testString' - search_settings_discovery_model_json['url'] = 'testString' - search_settings_discovery_model_json['max_primary_results'] = 10000 - search_settings_discovery_model_json['max_total_results'] = 10000 - search_settings_discovery_model_json['confidence_threshold'] = 0.0 - search_settings_discovery_model_json['highlight'] = True - search_settings_discovery_model_json['find_answers'] = True - search_settings_discovery_model_json['authentication'] = search_settings_discovery_authentication_model + # Construct a json representation of a ReleaseSkill model + release_skill_model_json = {} + release_skill_model_json['skill_id'] = 'testString' + release_skill_model_json['type'] = 'dialog' + release_skill_model_json['snapshot'] = 'testString' - # Construct a model instance of SearchSettingsDiscovery by calling from_dict on the json representation - search_settings_discovery_model = SearchSettingsDiscovery.from_dict(search_settings_discovery_model_json) - assert search_settings_discovery_model != False + # Construct a model instance of ReleaseSkill by calling from_dict on the json representation + release_skill_model = ReleaseSkill.from_dict(release_skill_model_json) + assert release_skill_model != False - # Construct a model instance of SearchSettingsDiscovery by calling from_dict on the json representation - search_settings_discovery_model_dict = SearchSettingsDiscovery.from_dict(search_settings_discovery_model_json).__dict__ - search_settings_discovery_model2 = SearchSettingsDiscovery(**search_settings_discovery_model_dict) + # Construct a model instance of ReleaseSkill by calling from_dict on the json representation + release_skill_model_dict = ReleaseSkill.from_dict(release_skill_model_json).__dict__ + release_skill_model2 = ReleaseSkill(**release_skill_model_dict) # Verify the model instances are equivalent - assert search_settings_discovery_model == search_settings_discovery_model2 + assert release_skill_model == release_skill_model2 # Convert model instance back to dict and verify no loss of data - search_settings_discovery_model_json2 = search_settings_discovery_model.to_dict() - assert search_settings_discovery_model_json2 == search_settings_discovery_model_json + release_skill_model_json2 = release_skill_model.to_dict() + assert release_skill_model_json2 == release_skill_model_json -class TestModel_SearchSettingsDiscoveryAuthentication: +class TestModel_RequestAnalytics: """ - Test Class for SearchSettingsDiscoveryAuthentication + Test Class for RequestAnalytics """ - def test_search_settings_discovery_authentication_serialization(self): + def test_request_analytics_serialization(self): """ - Test serialization/deserialization for SearchSettingsDiscoveryAuthentication + Test serialization/deserialization for RequestAnalytics """ - # Construct a json representation of a SearchSettingsDiscoveryAuthentication model - search_settings_discovery_authentication_model_json = {} - search_settings_discovery_authentication_model_json['basic'] = 'testString' - search_settings_discovery_authentication_model_json['bearer'] = 'testString' + # Construct a json representation of a RequestAnalytics model + request_analytics_model_json = {} + request_analytics_model_json['browser'] = 'testString' + request_analytics_model_json['device'] = 'testString' + request_analytics_model_json['pageUrl'] = 'testString' - # Construct a model instance of SearchSettingsDiscoveryAuthentication by calling from_dict on the json representation - search_settings_discovery_authentication_model = SearchSettingsDiscoveryAuthentication.from_dict(search_settings_discovery_authentication_model_json) - assert search_settings_discovery_authentication_model != False + # Construct a model instance of RequestAnalytics by calling from_dict on the json representation + request_analytics_model = RequestAnalytics.from_dict(request_analytics_model_json) + assert request_analytics_model != False - # Construct a model instance of SearchSettingsDiscoveryAuthentication by calling from_dict on the json representation - search_settings_discovery_authentication_model_dict = SearchSettingsDiscoveryAuthentication.from_dict(search_settings_discovery_authentication_model_json).__dict__ - search_settings_discovery_authentication_model2 = SearchSettingsDiscoveryAuthentication(**search_settings_discovery_authentication_model_dict) + # Construct a model instance of RequestAnalytics by calling from_dict on the json representation + request_analytics_model_dict = RequestAnalytics.from_dict(request_analytics_model_json).__dict__ + request_analytics_model2 = RequestAnalytics(**request_analytics_model_dict) # Verify the model instances are equivalent - assert search_settings_discovery_authentication_model == search_settings_discovery_authentication_model2 + assert request_analytics_model == request_analytics_model2 # Convert model instance back to dict and verify no loss of data - search_settings_discovery_authentication_model_json2 = search_settings_discovery_authentication_model.to_dict() - assert search_settings_discovery_authentication_model_json2 == search_settings_discovery_authentication_model_json + request_analytics_model_json2 = request_analytics_model.to_dict() + assert request_analytics_model_json2 == request_analytics_model_json -class TestModel_SearchSettingsElasticSearch: +class TestModel_ResponseGenericChannel: """ - Test Class for SearchSettingsElasticSearch + Test Class for ResponseGenericChannel """ - def test_search_settings_elastic_search_serialization(self): + def test_response_generic_channel_serialization(self): """ - Test serialization/deserialization for SearchSettingsElasticSearch + Test serialization/deserialization for ResponseGenericChannel """ - # Construct a json representation of a SearchSettingsElasticSearch model - search_settings_elastic_search_model_json = {} - search_settings_elastic_search_model_json['url'] = 'testString' - search_settings_elastic_search_model_json['port'] = 'testString' - search_settings_elastic_search_model_json['username'] = 'testString' - search_settings_elastic_search_model_json['password'] = 'testString' - search_settings_elastic_search_model_json['index'] = 'testString' - search_settings_elastic_search_model_json['filter'] = ['testString'] - search_settings_elastic_search_model_json['query_body'] = {'anyKey': 'anyValue'} - search_settings_elastic_search_model_json['managed_index'] = 'testString' - search_settings_elastic_search_model_json['apikey'] = 'testString' + # Construct a json representation of a ResponseGenericChannel model + response_generic_channel_model_json = {} + response_generic_channel_model_json['channel'] = 'testString' - # Construct a model instance of SearchSettingsElasticSearch by calling from_dict on the json representation - search_settings_elastic_search_model = SearchSettingsElasticSearch.from_dict(search_settings_elastic_search_model_json) - assert search_settings_elastic_search_model != False + # Construct a model instance of ResponseGenericChannel by calling from_dict on the json representation + response_generic_channel_model = ResponseGenericChannel.from_dict(response_generic_channel_model_json) + assert response_generic_channel_model != False - # Construct a model instance of SearchSettingsElasticSearch by calling from_dict on the json representation - search_settings_elastic_search_model_dict = SearchSettingsElasticSearch.from_dict(search_settings_elastic_search_model_json).__dict__ - search_settings_elastic_search_model2 = SearchSettingsElasticSearch(**search_settings_elastic_search_model_dict) + # Construct a model instance of ResponseGenericChannel by calling from_dict on the json representation + response_generic_channel_model_dict = ResponseGenericChannel.from_dict(response_generic_channel_model_json).__dict__ + response_generic_channel_model2 = ResponseGenericChannel(**response_generic_channel_model_dict) # Verify the model instances are equivalent - assert search_settings_elastic_search_model == search_settings_elastic_search_model2 + assert response_generic_channel_model == response_generic_channel_model2 # Convert model instance back to dict and verify no loss of data - search_settings_elastic_search_model_json2 = search_settings_elastic_search_model.to_dict() - assert search_settings_elastic_search_model_json2 == search_settings_elastic_search_model_json + response_generic_channel_model_json2 = response_generic_channel_model.to_dict() + assert response_generic_channel_model_json2 == response_generic_channel_model_json -class TestModel_SearchSettingsMessages: +class TestModel_ResponseGenericCitation: """ - Test Class for SearchSettingsMessages + Test Class for ResponseGenericCitation """ - def test_search_settings_messages_serialization(self): + def test_response_generic_citation_serialization(self): """ - Test serialization/deserialization for SearchSettingsMessages + Test serialization/deserialization for ResponseGenericCitation """ - # Construct a json representation of a SearchSettingsMessages model - search_settings_messages_model_json = {} - search_settings_messages_model_json['success'] = 'testString' - search_settings_messages_model_json['error'] = 'testString' - search_settings_messages_model_json['no_result'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of SearchSettingsMessages by calling from_dict on the json representation - search_settings_messages_model = SearchSettingsMessages.from_dict(search_settings_messages_model_json) - assert search_settings_messages_model != False + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 - # Construct a model instance of SearchSettingsMessages by calling from_dict on the json representation - search_settings_messages_model_dict = SearchSettingsMessages.from_dict(search_settings_messages_model_json).__dict__ - search_settings_messages_model2 = SearchSettingsMessages(**search_settings_messages_model_dict) + # Construct a json representation of a ResponseGenericCitation model + response_generic_citation_model_json = {} + response_generic_citation_model_json['title'] = 'testString' + response_generic_citation_model_json['text'] = 'testString' + response_generic_citation_model_json['body'] = 'testString' + response_generic_citation_model_json['search_result_index'] = 38 + response_generic_citation_model_json['ranges'] = [response_generic_citation_ranges_item_model] + + # Construct a model instance of ResponseGenericCitation by calling from_dict on the json representation + response_generic_citation_model = ResponseGenericCitation.from_dict(response_generic_citation_model_json) + assert response_generic_citation_model != False + + # Construct a model instance of ResponseGenericCitation by calling from_dict on the json representation + response_generic_citation_model_dict = ResponseGenericCitation.from_dict(response_generic_citation_model_json).__dict__ + response_generic_citation_model2 = ResponseGenericCitation(**response_generic_citation_model_dict) # Verify the model instances are equivalent - assert search_settings_messages_model == search_settings_messages_model2 + assert response_generic_citation_model == response_generic_citation_model2 # Convert model instance back to dict and verify no loss of data - search_settings_messages_model_json2 = search_settings_messages_model.to_dict() - assert search_settings_messages_model_json2 == search_settings_messages_model_json + response_generic_citation_model_json2 = response_generic_citation_model.to_dict() + assert response_generic_citation_model_json2 == response_generic_citation_model_json -class TestModel_SearchSettingsSchemaMapping: +class TestModel_ResponseGenericCitationRangesItem: """ - Test Class for SearchSettingsSchemaMapping + Test Class for ResponseGenericCitationRangesItem """ - def test_search_settings_schema_mapping_serialization(self): + def test_response_generic_citation_ranges_item_serialization(self): """ - Test serialization/deserialization for SearchSettingsSchemaMapping + Test serialization/deserialization for ResponseGenericCitationRangesItem """ - # Construct a json representation of a SearchSettingsSchemaMapping model - search_settings_schema_mapping_model_json = {} - search_settings_schema_mapping_model_json['url'] = 'testString' - search_settings_schema_mapping_model_json['body'] = 'testString' - search_settings_schema_mapping_model_json['title'] = 'testString' + # Construct a json representation of a ResponseGenericCitationRangesItem model + response_generic_citation_ranges_item_model_json = {} + response_generic_citation_ranges_item_model_json['start'] = 38 + response_generic_citation_ranges_item_model_json['end'] = 38 - # Construct a model instance of SearchSettingsSchemaMapping by calling from_dict on the json representation - search_settings_schema_mapping_model = SearchSettingsSchemaMapping.from_dict(search_settings_schema_mapping_model_json) - assert search_settings_schema_mapping_model != False + # Construct a model instance of ResponseGenericCitationRangesItem by calling from_dict on the json representation + response_generic_citation_ranges_item_model = ResponseGenericCitationRangesItem.from_dict(response_generic_citation_ranges_item_model_json) + assert response_generic_citation_ranges_item_model != False - # Construct a model instance of SearchSettingsSchemaMapping by calling from_dict on the json representation - search_settings_schema_mapping_model_dict = SearchSettingsSchemaMapping.from_dict(search_settings_schema_mapping_model_json).__dict__ - search_settings_schema_mapping_model2 = SearchSettingsSchemaMapping(**search_settings_schema_mapping_model_dict) + # Construct a model instance of ResponseGenericCitationRangesItem by calling from_dict on the json representation + response_generic_citation_ranges_item_model_dict = ResponseGenericCitationRangesItem.from_dict(response_generic_citation_ranges_item_model_json).__dict__ + response_generic_citation_ranges_item_model2 = ResponseGenericCitationRangesItem(**response_generic_citation_ranges_item_model_dict) # Verify the model instances are equivalent - assert search_settings_schema_mapping_model == search_settings_schema_mapping_model2 + assert response_generic_citation_ranges_item_model == response_generic_citation_ranges_item_model2 # Convert model instance back to dict and verify no loss of data - search_settings_schema_mapping_model_json2 = search_settings_schema_mapping_model.to_dict() - assert search_settings_schema_mapping_model_json2 == search_settings_schema_mapping_model_json + response_generic_citation_ranges_item_model_json2 = response_generic_citation_ranges_item_model.to_dict() + assert response_generic_citation_ranges_item_model_json2 == response_generic_citation_ranges_item_model_json -class TestModel_SearchSettingsServerSideSearch: +class TestModel_ResponseGenericConfidenceScores: """ - Test Class for SearchSettingsServerSideSearch + Test Class for ResponseGenericConfidenceScores """ - def test_search_settings_server_side_search_serialization(self): + def test_response_generic_confidence_scores_serialization(self): """ - Test serialization/deserialization for SearchSettingsServerSideSearch + Test serialization/deserialization for ResponseGenericConfidenceScores """ - # Construct a json representation of a SearchSettingsServerSideSearch model - search_settings_server_side_search_model_json = {} - search_settings_server_side_search_model_json['url'] = 'testString' - search_settings_server_side_search_model_json['port'] = 'testString' - search_settings_server_side_search_model_json['username'] = 'testString' - search_settings_server_side_search_model_json['password'] = 'testString' - search_settings_server_side_search_model_json['filter'] = 'testString' - search_settings_server_side_search_model_json['metadata'] = {'anyKey': 'anyValue'} - search_settings_server_side_search_model_json['apikey'] = 'testString' - search_settings_server_side_search_model_json['no_auth'] = True - search_settings_server_side_search_model_json['auth_type'] = 'basic' + # Construct a json representation of a ResponseGenericConfidenceScores model + response_generic_confidence_scores_model_json = {} + response_generic_confidence_scores_model_json['threshold'] = 72.5 + response_generic_confidence_scores_model_json['pre_gen'] = 72.5 + response_generic_confidence_scores_model_json['post_gen'] = 72.5 + response_generic_confidence_scores_model_json['extractiveness'] = 72.5 - # Construct a model instance of SearchSettingsServerSideSearch by calling from_dict on the json representation - search_settings_server_side_search_model = SearchSettingsServerSideSearch.from_dict(search_settings_server_side_search_model_json) - assert search_settings_server_side_search_model != False + # Construct a model instance of ResponseGenericConfidenceScores by calling from_dict on the json representation + response_generic_confidence_scores_model = ResponseGenericConfidenceScores.from_dict(response_generic_confidence_scores_model_json) + assert response_generic_confidence_scores_model != False - # Construct a model instance of SearchSettingsServerSideSearch by calling from_dict on the json representation - search_settings_server_side_search_model_dict = SearchSettingsServerSideSearch.from_dict(search_settings_server_side_search_model_json).__dict__ - search_settings_server_side_search_model2 = SearchSettingsServerSideSearch(**search_settings_server_side_search_model_dict) + # Construct a model instance of ResponseGenericConfidenceScores by calling from_dict on the json representation + response_generic_confidence_scores_model_dict = ResponseGenericConfidenceScores.from_dict(response_generic_confidence_scores_model_json).__dict__ + response_generic_confidence_scores_model2 = ResponseGenericConfidenceScores(**response_generic_confidence_scores_model_dict) # Verify the model instances are equivalent - assert search_settings_server_side_search_model == search_settings_server_side_search_model2 + assert response_generic_confidence_scores_model == response_generic_confidence_scores_model2 # Convert model instance back to dict and verify no loss of data - search_settings_server_side_search_model_json2 = search_settings_server_side_search_model.to_dict() - assert search_settings_server_side_search_model_json2 == search_settings_server_side_search_model_json + response_generic_confidence_scores_model_json2 = response_generic_confidence_scores_model.to_dict() + assert response_generic_confidence_scores_model_json2 == response_generic_confidence_scores_model_json -class TestModel_SearchSkillWarning: +class TestModel_RuntimeEntity: """ - Test Class for SearchSkillWarning + Test Class for RuntimeEntity """ - def test_search_skill_warning_serialization(self): + def test_runtime_entity_serialization(self): """ - Test serialization/deserialization for SearchSkillWarning + Test serialization/deserialization for RuntimeEntity """ - # Construct a json representation of a SearchSkillWarning model - search_skill_warning_model_json = {} - search_skill_warning_model_json['code'] = 'testString' - search_skill_warning_model_json['path'] = 'testString' - search_skill_warning_model_json['message'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of SearchSkillWarning by calling from_dict on the json representation - search_skill_warning_model = SearchSkillWarning.from_dict(search_skill_warning_model_json) - assert search_skill_warning_model != False + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] - # Construct a model instance of SearchSkillWarning by calling from_dict on the json representation - search_skill_warning_model_dict = SearchSkillWarning.from_dict(search_skill_warning_model_json).__dict__ - search_skill_warning_model2 = SearchSkillWarning(**search_skill_warning_model_dict) + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + # Construct a json representation of a RuntimeEntity model + runtime_entity_model_json = {} + runtime_entity_model_json['entity'] = 'testString' + runtime_entity_model_json['location'] = [38] + runtime_entity_model_json['value'] = 'testString' + runtime_entity_model_json['confidence'] = 72.5 + runtime_entity_model_json['groups'] = [capture_group_model] + runtime_entity_model_json['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model_json['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model_json['role'] = runtime_entity_role_model + runtime_entity_model_json['skill'] = 'testString' + + # Construct a model instance of RuntimeEntity by calling from_dict on the json representation + runtime_entity_model = RuntimeEntity.from_dict(runtime_entity_model_json) + assert runtime_entity_model != False + + # Construct a model instance of RuntimeEntity by calling from_dict on the json representation + runtime_entity_model_dict = RuntimeEntity.from_dict(runtime_entity_model_json).__dict__ + runtime_entity_model2 = RuntimeEntity(**runtime_entity_model_dict) # Verify the model instances are equivalent - assert search_skill_warning_model == search_skill_warning_model2 + assert runtime_entity_model == runtime_entity_model2 # Convert model instance back to dict and verify no loss of data - search_skill_warning_model_json2 = search_skill_warning_model.to_dict() - assert search_skill_warning_model_json2 == search_skill_warning_model_json + runtime_entity_model_json2 = runtime_entity_model.to_dict() + assert runtime_entity_model_json2 == runtime_entity_model_json -class TestModel_SessionResponse: +class TestModel_RuntimeEntityAlternative: """ - Test Class for SessionResponse + Test Class for RuntimeEntityAlternative """ - def test_session_response_serialization(self): + def test_runtime_entity_alternative_serialization(self): """ - Test serialization/deserialization for SessionResponse + Test serialization/deserialization for RuntimeEntityAlternative """ - # Construct a json representation of a SessionResponse model - session_response_model_json = {} - session_response_model_json['session_id'] = 'testString' + # Construct a json representation of a RuntimeEntityAlternative model + runtime_entity_alternative_model_json = {} + runtime_entity_alternative_model_json['value'] = 'testString' + runtime_entity_alternative_model_json['confidence'] = 72.5 - # Construct a model instance of SessionResponse by calling from_dict on the json representation - session_response_model = SessionResponse.from_dict(session_response_model_json) - assert session_response_model != False + # Construct a model instance of RuntimeEntityAlternative by calling from_dict on the json representation + runtime_entity_alternative_model = RuntimeEntityAlternative.from_dict(runtime_entity_alternative_model_json) + assert runtime_entity_alternative_model != False - # Construct a model instance of SessionResponse by calling from_dict on the json representation - session_response_model_dict = SessionResponse.from_dict(session_response_model_json).__dict__ - session_response_model2 = SessionResponse(**session_response_model_dict) + # Construct a model instance of RuntimeEntityAlternative by calling from_dict on the json representation + runtime_entity_alternative_model_dict = RuntimeEntityAlternative.from_dict(runtime_entity_alternative_model_json).__dict__ + runtime_entity_alternative_model2 = RuntimeEntityAlternative(**runtime_entity_alternative_model_dict) # Verify the model instances are equivalent - assert session_response_model == session_response_model2 + assert runtime_entity_alternative_model == runtime_entity_alternative_model2 # Convert model instance back to dict and verify no loss of data - session_response_model_json2 = session_response_model.to_dict() - assert session_response_model_json2 == session_response_model_json + runtime_entity_alternative_model_json2 = runtime_entity_alternative_model.to_dict() + assert runtime_entity_alternative_model_json2 == runtime_entity_alternative_model_json -class TestModel_Skill: +class TestModel_RuntimeEntityInterpretation: """ - Test Class for Skill + Test Class for RuntimeEntityInterpretation """ - def test_skill_serialization(self): + def test_runtime_entity_interpretation_serialization(self): """ - Test serialization/deserialization for Skill + Test serialization/deserialization for RuntimeEntityInterpretation """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a RuntimeEntityInterpretation model + runtime_entity_interpretation_model_json = {} + runtime_entity_interpretation_model_json['calendar_type'] = 'testString' + runtime_entity_interpretation_model_json['datetime_link'] = 'testString' + runtime_entity_interpretation_model_json['festival'] = 'testString' + runtime_entity_interpretation_model_json['granularity'] = 'day' + runtime_entity_interpretation_model_json['range_link'] = 'testString' + runtime_entity_interpretation_model_json['range_modifier'] = 'testString' + runtime_entity_interpretation_model_json['relative_day'] = 72.5 + runtime_entity_interpretation_model_json['relative_month'] = 72.5 + runtime_entity_interpretation_model_json['relative_week'] = 72.5 + runtime_entity_interpretation_model_json['relative_weekend'] = 72.5 + runtime_entity_interpretation_model_json['relative_year'] = 72.5 + runtime_entity_interpretation_model_json['specific_day'] = 72.5 + runtime_entity_interpretation_model_json['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model_json['specific_month'] = 72.5 + runtime_entity_interpretation_model_json['specific_quarter'] = 72.5 + runtime_entity_interpretation_model_json['specific_year'] = 72.5 + runtime_entity_interpretation_model_json['numeric_value'] = 72.5 + runtime_entity_interpretation_model_json['subtype'] = 'testString' + runtime_entity_interpretation_model_json['part_of_day'] = 'testString' + runtime_entity_interpretation_model_json['relative_hour'] = 72.5 + runtime_entity_interpretation_model_json['relative_minute'] = 72.5 + runtime_entity_interpretation_model_json['relative_second'] = 72.5 + runtime_entity_interpretation_model_json['specific_hour'] = 72.5 + runtime_entity_interpretation_model_json['specific_minute'] = 72.5 + runtime_entity_interpretation_model_json['specific_second'] = 72.5 + runtime_entity_interpretation_model_json['timezone'] = 'testString' - search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication - search_settings_discovery_authentication_model['basic'] = 'testString' - search_settings_discovery_authentication_model['bearer'] = 'testString' + # Construct a model instance of RuntimeEntityInterpretation by calling from_dict on the json representation + runtime_entity_interpretation_model = RuntimeEntityInterpretation.from_dict(runtime_entity_interpretation_model_json) + assert runtime_entity_interpretation_model != False - search_settings_discovery_model = {} # SearchSettingsDiscovery - search_settings_discovery_model['instance_id'] = 'testString' - search_settings_discovery_model['project_id'] = 'testString' - search_settings_discovery_model['url'] = 'testString' - search_settings_discovery_model['max_primary_results'] = 10000 - search_settings_discovery_model['max_total_results'] = 10000 - search_settings_discovery_model['confidence_threshold'] = 0.0 - search_settings_discovery_model['highlight'] = True - search_settings_discovery_model['find_answers'] = True - search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + # Construct a model instance of RuntimeEntityInterpretation by calling from_dict on the json representation + runtime_entity_interpretation_model_dict = RuntimeEntityInterpretation.from_dict(runtime_entity_interpretation_model_json).__dict__ + runtime_entity_interpretation_model2 = RuntimeEntityInterpretation(**runtime_entity_interpretation_model_dict) - search_settings_messages_model = {} # SearchSettingsMessages - search_settings_messages_model['success'] = 'testString' - search_settings_messages_model['error'] = 'testString' - search_settings_messages_model['no_result'] = 'testString' + # Verify the model instances are equivalent + assert runtime_entity_interpretation_model == runtime_entity_interpretation_model2 - search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping - search_settings_schema_mapping_model['url'] = 'testString' - search_settings_schema_mapping_model['body'] = 'testString' - search_settings_schema_mapping_model['title'] = 'testString' + # Convert model instance back to dict and verify no loss of data + runtime_entity_interpretation_model_json2 = runtime_entity_interpretation_model.to_dict() + assert runtime_entity_interpretation_model_json2 == runtime_entity_interpretation_model_json - search_settings_elastic_search_model = {} # SearchSettingsElasticSearch - search_settings_elastic_search_model['url'] = 'testString' - search_settings_elastic_search_model['port'] = 'testString' - search_settings_elastic_search_model['username'] = 'testString' - search_settings_elastic_search_model['password'] = 'testString' - search_settings_elastic_search_model['index'] = 'testString' - search_settings_elastic_search_model['filter'] = ['testString'] - search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} - search_settings_elastic_search_model['managed_index'] = 'testString' - search_settings_elastic_search_model['apikey'] = 'testString' - search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength - search_settings_conversational_search_response_length_model['option'] = 'moderate' +class TestModel_RuntimeEntityRole: + """ + Test Class for RuntimeEntityRole + """ - search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence - search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + def test_runtime_entity_role_serialization(self): + """ + Test serialization/deserialization for RuntimeEntityRole + """ - search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch - search_settings_conversational_search_model['enabled'] = True - search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model - search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + # Construct a json representation of a RuntimeEntityRole model + runtime_entity_role_model_json = {} + runtime_entity_role_model_json['type'] = 'date_from' - search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch - search_settings_server_side_search_model['url'] = 'testString' - search_settings_server_side_search_model['port'] = 'testString' - search_settings_server_side_search_model['username'] = 'testString' - search_settings_server_side_search_model['password'] = 'testString' - search_settings_server_side_search_model['filter'] = 'testString' - search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} - search_settings_server_side_search_model['apikey'] = 'testString' - search_settings_server_side_search_model['no_auth'] = True - search_settings_server_side_search_model['auth_type'] = 'basic' - - search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch - search_settings_client_side_search_model['filter'] = 'testString' - search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} - - search_settings_model = {} # SearchSettings - search_settings_model['discovery'] = search_settings_discovery_model - search_settings_model['messages'] = search_settings_messages_model - search_settings_model['schema_mapping'] = search_settings_schema_mapping_model - search_settings_model['elastic_search'] = search_settings_elastic_search_model - search_settings_model['conversational_search'] = search_settings_conversational_search_model - search_settings_model['server_side_search'] = search_settings_server_side_search_model - search_settings_model['client_side_search'] = search_settings_client_side_search_model - - # Construct a json representation of a Skill model - skill_model_json = {} - skill_model_json['name'] = 'testString' - skill_model_json['description'] = 'testString' - skill_model_json['workspace'] = {'anyKey': 'anyValue'} - skill_model_json['dialog_settings'] = {'anyKey': 'anyValue'} - skill_model_json['search_settings'] = search_settings_model - skill_model_json['language'] = 'testString' - skill_model_json['type'] = 'action' - - # Construct a model instance of Skill by calling from_dict on the json representation - skill_model = Skill.from_dict(skill_model_json) - assert skill_model != False + # Construct a model instance of RuntimeEntityRole by calling from_dict on the json representation + runtime_entity_role_model = RuntimeEntityRole.from_dict(runtime_entity_role_model_json) + assert runtime_entity_role_model != False - # Construct a model instance of Skill by calling from_dict on the json representation - skill_model_dict = Skill.from_dict(skill_model_json).__dict__ - skill_model2 = Skill(**skill_model_dict) + # Construct a model instance of RuntimeEntityRole by calling from_dict on the json representation + runtime_entity_role_model_dict = RuntimeEntityRole.from_dict(runtime_entity_role_model_json).__dict__ + runtime_entity_role_model2 = RuntimeEntityRole(**runtime_entity_role_model_dict) # Verify the model instances are equivalent - assert skill_model == skill_model2 + assert runtime_entity_role_model == runtime_entity_role_model2 # Convert model instance back to dict and verify no loss of data - skill_model_json2 = skill_model.to_dict() - assert skill_model_json2 == skill_model_json + runtime_entity_role_model_json2 = runtime_entity_role_model.to_dict() + assert runtime_entity_role_model_json2 == runtime_entity_role_model_json -class TestModel_SkillImport: +class TestModel_RuntimeIntent: """ - Test Class for SkillImport + Test Class for RuntimeIntent """ - def test_skill_import_serialization(self): + def test_runtime_intent_serialization(self): """ - Test serialization/deserialization for SkillImport + Test serialization/deserialization for RuntimeIntent """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a RuntimeIntent model + runtime_intent_model_json = {} + runtime_intent_model_json['intent'] = 'testString' + runtime_intent_model_json['confidence'] = 72.5 + runtime_intent_model_json['skill'] = 'testString' - search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication - search_settings_discovery_authentication_model['basic'] = 'testString' - search_settings_discovery_authentication_model['bearer'] = 'testString' + # Construct a model instance of RuntimeIntent by calling from_dict on the json representation + runtime_intent_model = RuntimeIntent.from_dict(runtime_intent_model_json) + assert runtime_intent_model != False - search_settings_discovery_model = {} # SearchSettingsDiscovery - search_settings_discovery_model['instance_id'] = 'testString' - search_settings_discovery_model['project_id'] = 'testString' - search_settings_discovery_model['url'] = 'testString' - search_settings_discovery_model['max_primary_results'] = 10000 - search_settings_discovery_model['max_total_results'] = 10000 - search_settings_discovery_model['confidence_threshold'] = 0.0 - search_settings_discovery_model['highlight'] = True - search_settings_discovery_model['find_answers'] = True - search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + # Construct a model instance of RuntimeIntent by calling from_dict on the json representation + runtime_intent_model_dict = RuntimeIntent.from_dict(runtime_intent_model_json).__dict__ + runtime_intent_model2 = RuntimeIntent(**runtime_intent_model_dict) - search_settings_messages_model = {} # SearchSettingsMessages - search_settings_messages_model['success'] = 'testString' - search_settings_messages_model['error'] = 'testString' - search_settings_messages_model['no_result'] = 'testString' + # Verify the model instances are equivalent + assert runtime_intent_model == runtime_intent_model2 - search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping - search_settings_schema_mapping_model['url'] = 'testString' - search_settings_schema_mapping_model['body'] = 'testString' - search_settings_schema_mapping_model['title'] = 'testString' + # Convert model instance back to dict and verify no loss of data + runtime_intent_model_json2 = runtime_intent_model.to_dict() + assert runtime_intent_model_json2 == runtime_intent_model_json - search_settings_elastic_search_model = {} # SearchSettingsElasticSearch - search_settings_elastic_search_model['url'] = 'testString' - search_settings_elastic_search_model['port'] = 'testString' - search_settings_elastic_search_model['username'] = 'testString' - search_settings_elastic_search_model['password'] = 'testString' - search_settings_elastic_search_model['index'] = 'testString' - search_settings_elastic_search_model['filter'] = ['testString'] - search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} - search_settings_elastic_search_model['managed_index'] = 'testString' - search_settings_elastic_search_model['apikey'] = 'testString' - search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength - search_settings_conversational_search_response_length_model['option'] = 'moderate' +class TestModel_SearchResult: + """ + Test Class for SearchResult + """ - search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence - search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + def test_search_result_serialization(self): + """ + Test serialization/deserialization for SearchResult + """ - search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch - search_settings_conversational_search_model['enabled'] = True - search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model - search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + # Construct dict forms of any model objects needed in order to build this model. - search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch - search_settings_server_side_search_model['url'] = 'testString' - search_settings_server_side_search_model['port'] = 'testString' - search_settings_server_side_search_model['username'] = 'testString' - search_settings_server_side_search_model['password'] = 'testString' - search_settings_server_side_search_model['filter'] = 'testString' - search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} - search_settings_server_side_search_model['apikey'] = 'testString' - search_settings_server_side_search_model['no_auth'] = True - search_settings_server_side_search_model['auth_type'] = 'basic' + search_result_metadata_model = {} # SearchResultMetadata + search_result_metadata_model['confidence'] = 72.5 + search_result_metadata_model['score'] = 72.5 - search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch - search_settings_client_side_search_model['filter'] = 'testString' - search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} + search_result_highlight_model = {} # SearchResultHighlight + search_result_highlight_model['body'] = ['testString'] + search_result_highlight_model['title'] = ['testString'] + search_result_highlight_model['url'] = ['testString'] + search_result_highlight_model['foo'] = ['testString'] - search_settings_model = {} # SearchSettings - search_settings_model['discovery'] = search_settings_discovery_model - search_settings_model['messages'] = search_settings_messages_model - search_settings_model['schema_mapping'] = search_settings_schema_mapping_model - search_settings_model['elastic_search'] = search_settings_elastic_search_model - search_settings_model['conversational_search'] = search_settings_conversational_search_model - search_settings_model['server_side_search'] = search_settings_server_side_search_model - search_settings_model['client_side_search'] = search_settings_client_side_search_model + search_result_answer_model = {} # SearchResultAnswer + search_result_answer_model['text'] = 'testString' + search_result_answer_model['confidence'] = 0 - # Construct a json representation of a SkillImport model - skill_import_model_json = {} - skill_import_model_json['name'] = 'testString' - skill_import_model_json['description'] = 'testString' - skill_import_model_json['workspace'] = {'anyKey': 'anyValue'} - skill_import_model_json['dialog_settings'] = {'anyKey': 'anyValue'} - skill_import_model_json['search_settings'] = search_settings_model - skill_import_model_json['language'] = 'testString' - skill_import_model_json['type'] = 'action' + # Construct a json representation of a SearchResult model + search_result_model_json = {} + search_result_model_json['id'] = 'testString' + search_result_model_json['result_metadata'] = search_result_metadata_model + search_result_model_json['body'] = 'testString' + search_result_model_json['title'] = 'testString' + search_result_model_json['url'] = 'testString' + search_result_model_json['highlight'] = search_result_highlight_model + search_result_model_json['answers'] = [search_result_answer_model] - # Construct a model instance of SkillImport by calling from_dict on the json representation - skill_import_model = SkillImport.from_dict(skill_import_model_json) - assert skill_import_model != False + # Construct a model instance of SearchResult by calling from_dict on the json representation + search_result_model = SearchResult.from_dict(search_result_model_json) + assert search_result_model != False - # Construct a model instance of SkillImport by calling from_dict on the json representation - skill_import_model_dict = SkillImport.from_dict(skill_import_model_json).__dict__ - skill_import_model2 = SkillImport(**skill_import_model_dict) + # Construct a model instance of SearchResult by calling from_dict on the json representation + search_result_model_dict = SearchResult.from_dict(search_result_model_json).__dict__ + search_result_model2 = SearchResult(**search_result_model_dict) # Verify the model instances are equivalent - assert skill_import_model == skill_import_model2 + assert search_result_model == search_result_model2 # Convert model instance back to dict and verify no loss of data - skill_import_model_json2 = skill_import_model.to_dict() - assert skill_import_model_json2 == skill_import_model_json + search_result_model_json2 = search_result_model.to_dict() + assert search_result_model_json2 == search_result_model_json -class TestModel_SkillsAsyncRequestStatus: +class TestModel_SearchResultAnswer: """ - Test Class for SkillsAsyncRequestStatus + Test Class for SearchResultAnswer """ - def test_skills_async_request_status_serialization(self): + def test_search_result_answer_serialization(self): """ - Test serialization/deserialization for SkillsAsyncRequestStatus + Test serialization/deserialization for SearchResultAnswer """ - # Construct a json representation of a SkillsAsyncRequestStatus model - skills_async_request_status_model_json = {} + # Construct a json representation of a SearchResultAnswer model + search_result_answer_model_json = {} + search_result_answer_model_json['text'] = 'testString' + search_result_answer_model_json['confidence'] = 0 - # Construct a model instance of SkillsAsyncRequestStatus by calling from_dict on the json representation - skills_async_request_status_model = SkillsAsyncRequestStatus.from_dict(skills_async_request_status_model_json) - assert skills_async_request_status_model != False + # Construct a model instance of SearchResultAnswer by calling from_dict on the json representation + search_result_answer_model = SearchResultAnswer.from_dict(search_result_answer_model_json) + assert search_result_answer_model != False - # Construct a model instance of SkillsAsyncRequestStatus by calling from_dict on the json representation - skills_async_request_status_model_dict = SkillsAsyncRequestStatus.from_dict(skills_async_request_status_model_json).__dict__ - skills_async_request_status_model2 = SkillsAsyncRequestStatus(**skills_async_request_status_model_dict) + # Construct a model instance of SearchResultAnswer by calling from_dict on the json representation + search_result_answer_model_dict = SearchResultAnswer.from_dict(search_result_answer_model_json).__dict__ + search_result_answer_model2 = SearchResultAnswer(**search_result_answer_model_dict) # Verify the model instances are equivalent - assert skills_async_request_status_model == skills_async_request_status_model2 + assert search_result_answer_model == search_result_answer_model2 # Convert model instance back to dict and verify no loss of data - skills_async_request_status_model_json2 = skills_async_request_status_model.to_dict() - assert skills_async_request_status_model_json2 == skills_async_request_status_model_json + search_result_answer_model_json2 = search_result_answer_model.to_dict() + assert search_result_answer_model_json2 == search_result_answer_model_json -class TestModel_SkillsExport: +class TestModel_SearchResultHighlight: """ - Test Class for SkillsExport + Test Class for SearchResultHighlight """ - def test_skills_export_serialization(self): + def test_search_result_highlight_serialization(self): """ - Test serialization/deserialization for SkillsExport + Test serialization/deserialization for SearchResultHighlight """ - # Construct dict forms of any model objects needed in order to build this model. - - search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication - search_settings_discovery_authentication_model['basic'] = 'testString' - search_settings_discovery_authentication_model['bearer'] = 'testString' + # Construct a json representation of a SearchResultHighlight model + search_result_highlight_model_json = {} + search_result_highlight_model_json['body'] = ['testString'] + search_result_highlight_model_json['title'] = ['testString'] + search_result_highlight_model_json['url'] = ['testString'] + search_result_highlight_model_json['foo'] = ['testString'] - search_settings_discovery_model = {} # SearchSettingsDiscovery - search_settings_discovery_model['instance_id'] = 'testString' - search_settings_discovery_model['project_id'] = 'testString' - search_settings_discovery_model['url'] = 'testString' - search_settings_discovery_model['max_primary_results'] = 10000 - search_settings_discovery_model['max_total_results'] = 10000 - search_settings_discovery_model['confidence_threshold'] = 0.0 - search_settings_discovery_model['highlight'] = True - search_settings_discovery_model['find_answers'] = True - search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + # Construct a model instance of SearchResultHighlight by calling from_dict on the json representation + search_result_highlight_model = SearchResultHighlight.from_dict(search_result_highlight_model_json) + assert search_result_highlight_model != False - search_settings_messages_model = {} # SearchSettingsMessages - search_settings_messages_model['success'] = 'testString' - search_settings_messages_model['error'] = 'testString' - search_settings_messages_model['no_result'] = 'testString' + # Construct a model instance of SearchResultHighlight by calling from_dict on the json representation + search_result_highlight_model_dict = SearchResultHighlight.from_dict(search_result_highlight_model_json).__dict__ + search_result_highlight_model2 = SearchResultHighlight(**search_result_highlight_model_dict) + + # Verify the model instances are equivalent + assert search_result_highlight_model == search_result_highlight_model2 + + # Convert model instance back to dict and verify no loss of data + search_result_highlight_model_json2 = search_result_highlight_model.to_dict() + assert search_result_highlight_model_json2 == search_result_highlight_model_json + + # Test get_properties and set_properties methods. + search_result_highlight_model.set_properties({}) + actual_dict = search_result_highlight_model.get_properties() + assert actual_dict == {} + + expected_dict = {'foo': ['testString']} + search_result_highlight_model.set_properties(expected_dict) + actual_dict = search_result_highlight_model.get_properties() + assert actual_dict.keys() == expected_dict.keys() + + +class TestModel_SearchResultMetadata: + """ + Test Class for SearchResultMetadata + """ + + def test_search_result_metadata_serialization(self): + """ + Test serialization/deserialization for SearchResultMetadata + """ + + # Construct a json representation of a SearchResultMetadata model + search_result_metadata_model_json = {} + search_result_metadata_model_json['confidence'] = 72.5 + search_result_metadata_model_json['score'] = 72.5 + + # Construct a model instance of SearchResultMetadata by calling from_dict on the json representation + search_result_metadata_model = SearchResultMetadata.from_dict(search_result_metadata_model_json) + assert search_result_metadata_model != False + + # Construct a model instance of SearchResultMetadata by calling from_dict on the json representation + search_result_metadata_model_dict = SearchResultMetadata.from_dict(search_result_metadata_model_json).__dict__ + search_result_metadata_model2 = SearchResultMetadata(**search_result_metadata_model_dict) + + # Verify the model instances are equivalent + assert search_result_metadata_model == search_result_metadata_model2 + + # Convert model instance back to dict and verify no loss of data + search_result_metadata_model_json2 = search_result_metadata_model.to_dict() + assert search_result_metadata_model_json2 == search_result_metadata_model_json + + +class TestModel_SearchResults: + """ + Test Class for SearchResults + """ + + def test_search_results_serialization(self): + """ + Test serialization/deserialization for SearchResults + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + # Construct a json representation of a SearchResults model + search_results_model_json = {} + search_results_model_json['result_metadata'] = search_results_result_metadata_model + search_results_model_json['id'] = 'testString' + search_results_model_json['title'] = 'testString' + search_results_model_json['body'] = 'testString' + + # Construct a model instance of SearchResults by calling from_dict on the json representation + search_results_model = SearchResults.from_dict(search_results_model_json) + assert search_results_model != False + + # Construct a model instance of SearchResults by calling from_dict on the json representation + search_results_model_dict = SearchResults.from_dict(search_results_model_json).__dict__ + search_results_model2 = SearchResults(**search_results_model_dict) + + # Verify the model instances are equivalent + assert search_results_model == search_results_model2 + + # Convert model instance back to dict and verify no loss of data + search_results_model_json2 = search_results_model.to_dict() + assert search_results_model_json2 == search_results_model_json + + +class TestModel_SearchResultsResultMetadata: + """ + Test Class for SearchResultsResultMetadata + """ + + def test_search_results_result_metadata_serialization(self): + """ + Test serialization/deserialization for SearchResultsResultMetadata + """ + + # Construct a json representation of a SearchResultsResultMetadata model + search_results_result_metadata_model_json = {} + search_results_result_metadata_model_json['document_retrieval_source'] = 'testString' + search_results_result_metadata_model_json['score'] = 38 + + # Construct a model instance of SearchResultsResultMetadata by calling from_dict on the json representation + search_results_result_metadata_model = SearchResultsResultMetadata.from_dict(search_results_result_metadata_model_json) + assert search_results_result_metadata_model != False + + # Construct a model instance of SearchResultsResultMetadata by calling from_dict on the json representation + search_results_result_metadata_model_dict = SearchResultsResultMetadata.from_dict(search_results_result_metadata_model_json).__dict__ + search_results_result_metadata_model2 = SearchResultsResultMetadata(**search_results_result_metadata_model_dict) + + # Verify the model instances are equivalent + assert search_results_result_metadata_model == search_results_result_metadata_model2 + + # Convert model instance back to dict and verify no loss of data + search_results_result_metadata_model_json2 = search_results_result_metadata_model.to_dict() + assert search_results_result_metadata_model_json2 == search_results_result_metadata_model_json + + +class TestModel_SearchSettings: + """ + Test Class for SearchSettings + """ + + def test_search_settings_serialization(self): + """ + Test serialization/deserialization for SearchSettings + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication + search_settings_discovery_authentication_model['basic'] = 'testString' + search_settings_discovery_authentication_model['bearer'] = 'testString' + + search_settings_discovery_model = {} # SearchSettingsDiscovery + search_settings_discovery_model['instance_id'] = 'testString' + search_settings_discovery_model['project_id'] = 'testString' + search_settings_discovery_model['url'] = 'testString' + search_settings_discovery_model['max_primary_results'] = 10000 + search_settings_discovery_model['max_total_results'] = 10000 + search_settings_discovery_model['confidence_threshold'] = 0.0 + search_settings_discovery_model['highlight'] = True + search_settings_discovery_model['find_answers'] = True + search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + + search_settings_messages_model = {} # SearchSettingsMessages + search_settings_messages_model['success'] = 'testString' + search_settings_messages_model['error'] = 'testString' + search_settings_messages_model['no_result'] = 'testString' search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping search_settings_schema_mapping_model['url'] = 'testString' @@ -10937,111 +11161,1959 @@ def test_skills_export_serialization(self): search_settings_client_side_search_model['filter'] = 'testString' search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} - search_settings_model = {} # SearchSettings - search_settings_model['discovery'] = search_settings_discovery_model - search_settings_model['messages'] = search_settings_messages_model - search_settings_model['schema_mapping'] = search_settings_schema_mapping_model - search_settings_model['elastic_search'] = search_settings_elastic_search_model - search_settings_model['conversational_search'] = search_settings_conversational_search_model - search_settings_model['server_side_search'] = search_settings_server_side_search_model - search_settings_model['client_side_search'] = search_settings_client_side_search_model + # Construct a json representation of a SearchSettings model + search_settings_model_json = {} + search_settings_model_json['discovery'] = search_settings_discovery_model + search_settings_model_json['messages'] = search_settings_messages_model + search_settings_model_json['schema_mapping'] = search_settings_schema_mapping_model + search_settings_model_json['elastic_search'] = search_settings_elastic_search_model + search_settings_model_json['conversational_search'] = search_settings_conversational_search_model + search_settings_model_json['server_side_search'] = search_settings_server_side_search_model + search_settings_model_json['client_side_search'] = search_settings_client_side_search_model - skill_model = {} # Skill - skill_model['name'] = 'testString' - skill_model['description'] = 'testString' - skill_model['workspace'] = {'anyKey': 'anyValue'} - skill_model['dialog_settings'] = {'anyKey': 'anyValue'} - skill_model['search_settings'] = search_settings_model - skill_model['language'] = 'testString' - skill_model['type'] = 'action' + # Construct a model instance of SearchSettings by calling from_dict on the json representation + search_settings_model = SearchSettings.from_dict(search_settings_model_json) + assert search_settings_model != False - assistant_state_model = {} # AssistantState - assistant_state_model['action_disabled'] = True - assistant_state_model['dialog_disabled'] = True + # Construct a model instance of SearchSettings by calling from_dict on the json representation + search_settings_model_dict = SearchSettings.from_dict(search_settings_model_json).__dict__ + search_settings_model2 = SearchSettings(**search_settings_model_dict) - # Construct a json representation of a SkillsExport model - skills_export_model_json = {} - skills_export_model_json['assistant_skills'] = [skill_model] - skills_export_model_json['assistant_state'] = assistant_state_model + # Verify the model instances are equivalent + assert search_settings_model == search_settings_model2 - # Construct a model instance of SkillsExport by calling from_dict on the json representation - skills_export_model = SkillsExport.from_dict(skills_export_model_json) - assert skills_export_model != False + # Convert model instance back to dict and verify no loss of data + search_settings_model_json2 = search_settings_model.to_dict() + assert search_settings_model_json2 == search_settings_model_json - # Construct a model instance of SkillsExport by calling from_dict on the json representation - skills_export_model_dict = SkillsExport.from_dict(skills_export_model_json).__dict__ - skills_export_model2 = SkillsExport(**skills_export_model_dict) + +class TestModel_SearchSettingsClientSideSearch: + """ + Test Class for SearchSettingsClientSideSearch + """ + + def test_search_settings_client_side_search_serialization(self): + """ + Test serialization/deserialization for SearchSettingsClientSideSearch + """ + + # Construct a json representation of a SearchSettingsClientSideSearch model + search_settings_client_side_search_model_json = {} + search_settings_client_side_search_model_json['filter'] = 'testString' + search_settings_client_side_search_model_json['metadata'] = {'anyKey': 'anyValue'} + + # Construct a model instance of SearchSettingsClientSideSearch by calling from_dict on the json representation + search_settings_client_side_search_model = SearchSettingsClientSideSearch.from_dict(search_settings_client_side_search_model_json) + assert search_settings_client_side_search_model != False + + # Construct a model instance of SearchSettingsClientSideSearch by calling from_dict on the json representation + search_settings_client_side_search_model_dict = SearchSettingsClientSideSearch.from_dict(search_settings_client_side_search_model_json).__dict__ + search_settings_client_side_search_model2 = SearchSettingsClientSideSearch(**search_settings_client_side_search_model_dict) # Verify the model instances are equivalent - assert skills_export_model == skills_export_model2 + assert search_settings_client_side_search_model == search_settings_client_side_search_model2 # Convert model instance back to dict and verify no loss of data - skills_export_model_json2 = skills_export_model.to_dict() - assert skills_export_model_json2 == skills_export_model_json + search_settings_client_side_search_model_json2 = search_settings_client_side_search_model.to_dict() + assert search_settings_client_side_search_model_json2 == search_settings_client_side_search_model_json -class TestModel_StatefulMessageResponse: +class TestModel_SearchSettingsConversationalSearch: """ - Test Class for StatefulMessageResponse + Test Class for SearchSettingsConversationalSearch """ - def test_stateful_message_response_serialization(self): + def test_search_settings_conversational_search_serialization(self): """ - Test serialization/deserialization for StatefulMessageResponse + Test serialization/deserialization for SearchSettingsConversationalSearch """ # Construct dict forms of any model objects needed in order to build this model. - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' + search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength + search_settings_conversational_search_response_length_model['option'] = 'moderate' - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' - runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] + search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence + search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + # Construct a json representation of a SearchSettingsConversationalSearch model + search_settings_conversational_search_model_json = {} + search_settings_conversational_search_model_json['enabled'] = True + search_settings_conversational_search_model_json['response_length'] = search_settings_conversational_search_response_length_model + search_settings_conversational_search_model_json['search_confidence'] = search_settings_conversational_search_search_confidence_model - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + # Construct a model instance of SearchSettingsConversationalSearch by calling from_dict on the json representation + search_settings_conversational_search_model = SearchSettingsConversationalSearch.from_dict(search_settings_conversational_search_model_json) + assert search_settings_conversational_search_model != False - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' - runtime_entity_interpretation_model['festival'] = 'testString' - runtime_entity_interpretation_model['granularity'] = 'day' - runtime_entity_interpretation_model['range_link'] = 'testString' - runtime_entity_interpretation_model['range_modifier'] = 'testString' - runtime_entity_interpretation_model['relative_day'] = 72.5 - runtime_entity_interpretation_model['relative_month'] = 72.5 - runtime_entity_interpretation_model['relative_week'] = 72.5 - runtime_entity_interpretation_model['relative_weekend'] = 72.5 - runtime_entity_interpretation_model['relative_year'] = 72.5 - runtime_entity_interpretation_model['specific_day'] = 72.5 - runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model['specific_month'] = 72.5 - runtime_entity_interpretation_model['specific_quarter'] = 72.5 - runtime_entity_interpretation_model['specific_year'] = 72.5 - runtime_entity_interpretation_model['numeric_value'] = 72.5 - runtime_entity_interpretation_model['subtype'] = 'testString' - runtime_entity_interpretation_model['part_of_day'] = 'testString' - runtime_entity_interpretation_model['relative_hour'] = 72.5 - runtime_entity_interpretation_model['relative_minute'] = 72.5 - runtime_entity_interpretation_model['relative_second'] = 72.5 - runtime_entity_interpretation_model['specific_hour'] = 72.5 - runtime_entity_interpretation_model['specific_minute'] = 72.5 - runtime_entity_interpretation_model['specific_second'] = 72.5 - runtime_entity_interpretation_model['timezone'] = 'testString' + # Construct a model instance of SearchSettingsConversationalSearch by calling from_dict on the json representation + search_settings_conversational_search_model_dict = SearchSettingsConversationalSearch.from_dict(search_settings_conversational_search_model_json).__dict__ + search_settings_conversational_search_model2 = SearchSettingsConversationalSearch(**search_settings_conversational_search_model_dict) - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 + # Verify the model instances are equivalent + assert search_settings_conversational_search_model == search_settings_conversational_search_model2 - runtime_entity_role_model = {} # RuntimeEntityRole + # Convert model instance back to dict and verify no loss of data + search_settings_conversational_search_model_json2 = search_settings_conversational_search_model.to_dict() + assert search_settings_conversational_search_model_json2 == search_settings_conversational_search_model_json + + +class TestModel_SearchSettingsConversationalSearchResponseLength: + """ + Test Class for SearchSettingsConversationalSearchResponseLength + """ + + def test_search_settings_conversational_search_response_length_serialization(self): + """ + Test serialization/deserialization for SearchSettingsConversationalSearchResponseLength + """ + + # Construct a json representation of a SearchSettingsConversationalSearchResponseLength model + search_settings_conversational_search_response_length_model_json = {} + search_settings_conversational_search_response_length_model_json['option'] = 'moderate' + + # Construct a model instance of SearchSettingsConversationalSearchResponseLength by calling from_dict on the json representation + search_settings_conversational_search_response_length_model = SearchSettingsConversationalSearchResponseLength.from_dict(search_settings_conversational_search_response_length_model_json) + assert search_settings_conversational_search_response_length_model != False + + # Construct a model instance of SearchSettingsConversationalSearchResponseLength by calling from_dict on the json representation + search_settings_conversational_search_response_length_model_dict = SearchSettingsConversationalSearchResponseLength.from_dict(search_settings_conversational_search_response_length_model_json).__dict__ + search_settings_conversational_search_response_length_model2 = SearchSettingsConversationalSearchResponseLength(**search_settings_conversational_search_response_length_model_dict) + + # Verify the model instances are equivalent + assert search_settings_conversational_search_response_length_model == search_settings_conversational_search_response_length_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_conversational_search_response_length_model_json2 = search_settings_conversational_search_response_length_model.to_dict() + assert search_settings_conversational_search_response_length_model_json2 == search_settings_conversational_search_response_length_model_json + + +class TestModel_SearchSettingsConversationalSearchSearchConfidence: + """ + Test Class for SearchSettingsConversationalSearchSearchConfidence + """ + + def test_search_settings_conversational_search_search_confidence_serialization(self): + """ + Test serialization/deserialization for SearchSettingsConversationalSearchSearchConfidence + """ + + # Construct a json representation of a SearchSettingsConversationalSearchSearchConfidence model + search_settings_conversational_search_search_confidence_model_json = {} + search_settings_conversational_search_search_confidence_model_json['threshold'] = 'less_often' + + # Construct a model instance of SearchSettingsConversationalSearchSearchConfidence by calling from_dict on the json representation + search_settings_conversational_search_search_confidence_model = SearchSettingsConversationalSearchSearchConfidence.from_dict(search_settings_conversational_search_search_confidence_model_json) + assert search_settings_conversational_search_search_confidence_model != False + + # Construct a model instance of SearchSettingsConversationalSearchSearchConfidence by calling from_dict on the json representation + search_settings_conversational_search_search_confidence_model_dict = SearchSettingsConversationalSearchSearchConfidence.from_dict(search_settings_conversational_search_search_confidence_model_json).__dict__ + search_settings_conversational_search_search_confidence_model2 = SearchSettingsConversationalSearchSearchConfidence(**search_settings_conversational_search_search_confidence_model_dict) + + # Verify the model instances are equivalent + assert search_settings_conversational_search_search_confidence_model == search_settings_conversational_search_search_confidence_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_conversational_search_search_confidence_model_json2 = search_settings_conversational_search_search_confidence_model.to_dict() + assert search_settings_conversational_search_search_confidence_model_json2 == search_settings_conversational_search_search_confidence_model_json + + +class TestModel_SearchSettingsDiscovery: + """ + Test Class for SearchSettingsDiscovery + """ + + def test_search_settings_discovery_serialization(self): + """ + Test serialization/deserialization for SearchSettingsDiscovery + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication + search_settings_discovery_authentication_model['basic'] = 'testString' + search_settings_discovery_authentication_model['bearer'] = 'testString' + + # Construct a json representation of a SearchSettingsDiscovery model + search_settings_discovery_model_json = {} + search_settings_discovery_model_json['instance_id'] = 'testString' + search_settings_discovery_model_json['project_id'] = 'testString' + search_settings_discovery_model_json['url'] = 'testString' + search_settings_discovery_model_json['max_primary_results'] = 10000 + search_settings_discovery_model_json['max_total_results'] = 10000 + search_settings_discovery_model_json['confidence_threshold'] = 0.0 + search_settings_discovery_model_json['highlight'] = True + search_settings_discovery_model_json['find_answers'] = True + search_settings_discovery_model_json['authentication'] = search_settings_discovery_authentication_model + + # Construct a model instance of SearchSettingsDiscovery by calling from_dict on the json representation + search_settings_discovery_model = SearchSettingsDiscovery.from_dict(search_settings_discovery_model_json) + assert search_settings_discovery_model != False + + # Construct a model instance of SearchSettingsDiscovery by calling from_dict on the json representation + search_settings_discovery_model_dict = SearchSettingsDiscovery.from_dict(search_settings_discovery_model_json).__dict__ + search_settings_discovery_model2 = SearchSettingsDiscovery(**search_settings_discovery_model_dict) + + # Verify the model instances are equivalent + assert search_settings_discovery_model == search_settings_discovery_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_discovery_model_json2 = search_settings_discovery_model.to_dict() + assert search_settings_discovery_model_json2 == search_settings_discovery_model_json + + +class TestModel_SearchSettingsDiscoveryAuthentication: + """ + Test Class for SearchSettingsDiscoveryAuthentication + """ + + def test_search_settings_discovery_authentication_serialization(self): + """ + Test serialization/deserialization for SearchSettingsDiscoveryAuthentication + """ + + # Construct a json representation of a SearchSettingsDiscoveryAuthentication model + search_settings_discovery_authentication_model_json = {} + search_settings_discovery_authentication_model_json['basic'] = 'testString' + search_settings_discovery_authentication_model_json['bearer'] = 'testString' + + # Construct a model instance of SearchSettingsDiscoveryAuthentication by calling from_dict on the json representation + search_settings_discovery_authentication_model = SearchSettingsDiscoveryAuthentication.from_dict(search_settings_discovery_authentication_model_json) + assert search_settings_discovery_authentication_model != False + + # Construct a model instance of SearchSettingsDiscoveryAuthentication by calling from_dict on the json representation + search_settings_discovery_authentication_model_dict = SearchSettingsDiscoveryAuthentication.from_dict(search_settings_discovery_authentication_model_json).__dict__ + search_settings_discovery_authentication_model2 = SearchSettingsDiscoveryAuthentication(**search_settings_discovery_authentication_model_dict) + + # Verify the model instances are equivalent + assert search_settings_discovery_authentication_model == search_settings_discovery_authentication_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_discovery_authentication_model_json2 = search_settings_discovery_authentication_model.to_dict() + assert search_settings_discovery_authentication_model_json2 == search_settings_discovery_authentication_model_json + + +class TestModel_SearchSettingsElasticSearch: + """ + Test Class for SearchSettingsElasticSearch + """ + + def test_search_settings_elastic_search_serialization(self): + """ + Test serialization/deserialization for SearchSettingsElasticSearch + """ + + # Construct a json representation of a SearchSettingsElasticSearch model + search_settings_elastic_search_model_json = {} + search_settings_elastic_search_model_json['url'] = 'testString' + search_settings_elastic_search_model_json['port'] = 'testString' + search_settings_elastic_search_model_json['username'] = 'testString' + search_settings_elastic_search_model_json['password'] = 'testString' + search_settings_elastic_search_model_json['index'] = 'testString' + search_settings_elastic_search_model_json['filter'] = ['testString'] + search_settings_elastic_search_model_json['query_body'] = {'anyKey': 'anyValue'} + search_settings_elastic_search_model_json['managed_index'] = 'testString' + search_settings_elastic_search_model_json['apikey'] = 'testString' + + # Construct a model instance of SearchSettingsElasticSearch by calling from_dict on the json representation + search_settings_elastic_search_model = SearchSettingsElasticSearch.from_dict(search_settings_elastic_search_model_json) + assert search_settings_elastic_search_model != False + + # Construct a model instance of SearchSettingsElasticSearch by calling from_dict on the json representation + search_settings_elastic_search_model_dict = SearchSettingsElasticSearch.from_dict(search_settings_elastic_search_model_json).__dict__ + search_settings_elastic_search_model2 = SearchSettingsElasticSearch(**search_settings_elastic_search_model_dict) + + # Verify the model instances are equivalent + assert search_settings_elastic_search_model == search_settings_elastic_search_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_elastic_search_model_json2 = search_settings_elastic_search_model.to_dict() + assert search_settings_elastic_search_model_json2 == search_settings_elastic_search_model_json + + +class TestModel_SearchSettingsMessages: + """ + Test Class for SearchSettingsMessages + """ + + def test_search_settings_messages_serialization(self): + """ + Test serialization/deserialization for SearchSettingsMessages + """ + + # Construct a json representation of a SearchSettingsMessages model + search_settings_messages_model_json = {} + search_settings_messages_model_json['success'] = 'testString' + search_settings_messages_model_json['error'] = 'testString' + search_settings_messages_model_json['no_result'] = 'testString' + + # Construct a model instance of SearchSettingsMessages by calling from_dict on the json representation + search_settings_messages_model = SearchSettingsMessages.from_dict(search_settings_messages_model_json) + assert search_settings_messages_model != False + + # Construct a model instance of SearchSettingsMessages by calling from_dict on the json representation + search_settings_messages_model_dict = SearchSettingsMessages.from_dict(search_settings_messages_model_json).__dict__ + search_settings_messages_model2 = SearchSettingsMessages(**search_settings_messages_model_dict) + + # Verify the model instances are equivalent + assert search_settings_messages_model == search_settings_messages_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_messages_model_json2 = search_settings_messages_model.to_dict() + assert search_settings_messages_model_json2 == search_settings_messages_model_json + + +class TestModel_SearchSettingsSchemaMapping: + """ + Test Class for SearchSettingsSchemaMapping + """ + + def test_search_settings_schema_mapping_serialization(self): + """ + Test serialization/deserialization for SearchSettingsSchemaMapping + """ + + # Construct a json representation of a SearchSettingsSchemaMapping model + search_settings_schema_mapping_model_json = {} + search_settings_schema_mapping_model_json['url'] = 'testString' + search_settings_schema_mapping_model_json['body'] = 'testString' + search_settings_schema_mapping_model_json['title'] = 'testString' + + # Construct a model instance of SearchSettingsSchemaMapping by calling from_dict on the json representation + search_settings_schema_mapping_model = SearchSettingsSchemaMapping.from_dict(search_settings_schema_mapping_model_json) + assert search_settings_schema_mapping_model != False + + # Construct a model instance of SearchSettingsSchemaMapping by calling from_dict on the json representation + search_settings_schema_mapping_model_dict = SearchSettingsSchemaMapping.from_dict(search_settings_schema_mapping_model_json).__dict__ + search_settings_schema_mapping_model2 = SearchSettingsSchemaMapping(**search_settings_schema_mapping_model_dict) + + # Verify the model instances are equivalent + assert search_settings_schema_mapping_model == search_settings_schema_mapping_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_schema_mapping_model_json2 = search_settings_schema_mapping_model.to_dict() + assert search_settings_schema_mapping_model_json2 == search_settings_schema_mapping_model_json + + +class TestModel_SearchSettingsServerSideSearch: + """ + Test Class for SearchSettingsServerSideSearch + """ + + def test_search_settings_server_side_search_serialization(self): + """ + Test serialization/deserialization for SearchSettingsServerSideSearch + """ + + # Construct a json representation of a SearchSettingsServerSideSearch model + search_settings_server_side_search_model_json = {} + search_settings_server_side_search_model_json['url'] = 'testString' + search_settings_server_side_search_model_json['port'] = 'testString' + search_settings_server_side_search_model_json['username'] = 'testString' + search_settings_server_side_search_model_json['password'] = 'testString' + search_settings_server_side_search_model_json['filter'] = 'testString' + search_settings_server_side_search_model_json['metadata'] = {'anyKey': 'anyValue'} + search_settings_server_side_search_model_json['apikey'] = 'testString' + search_settings_server_side_search_model_json['no_auth'] = True + search_settings_server_side_search_model_json['auth_type'] = 'basic' + + # Construct a model instance of SearchSettingsServerSideSearch by calling from_dict on the json representation + search_settings_server_side_search_model = SearchSettingsServerSideSearch.from_dict(search_settings_server_side_search_model_json) + assert search_settings_server_side_search_model != False + + # Construct a model instance of SearchSettingsServerSideSearch by calling from_dict on the json representation + search_settings_server_side_search_model_dict = SearchSettingsServerSideSearch.from_dict(search_settings_server_side_search_model_json).__dict__ + search_settings_server_side_search_model2 = SearchSettingsServerSideSearch(**search_settings_server_side_search_model_dict) + + # Verify the model instances are equivalent + assert search_settings_server_side_search_model == search_settings_server_side_search_model2 + + # Convert model instance back to dict and verify no loss of data + search_settings_server_side_search_model_json2 = search_settings_server_side_search_model.to_dict() + assert search_settings_server_side_search_model_json2 == search_settings_server_side_search_model_json + + +class TestModel_SearchSkillWarning: + """ + Test Class for SearchSkillWarning + """ + + def test_search_skill_warning_serialization(self): + """ + Test serialization/deserialization for SearchSkillWarning + """ + + # Construct a json representation of a SearchSkillWarning model + search_skill_warning_model_json = {} + search_skill_warning_model_json['code'] = 'testString' + search_skill_warning_model_json['path'] = 'testString' + search_skill_warning_model_json['message'] = 'testString' + + # Construct a model instance of SearchSkillWarning by calling from_dict on the json representation + search_skill_warning_model = SearchSkillWarning.from_dict(search_skill_warning_model_json) + assert search_skill_warning_model != False + + # Construct a model instance of SearchSkillWarning by calling from_dict on the json representation + search_skill_warning_model_dict = SearchSkillWarning.from_dict(search_skill_warning_model_json).__dict__ + search_skill_warning_model2 = SearchSkillWarning(**search_skill_warning_model_dict) + + # Verify the model instances are equivalent + assert search_skill_warning_model == search_skill_warning_model2 + + # Convert model instance back to dict and verify no loss of data + search_skill_warning_model_json2 = search_skill_warning_model.to_dict() + assert search_skill_warning_model_json2 == search_skill_warning_model_json + + +class TestModel_SessionResponse: + """ + Test Class for SessionResponse + """ + + def test_session_response_serialization(self): + """ + Test serialization/deserialization for SessionResponse + """ + + # Construct a json representation of a SessionResponse model + session_response_model_json = {} + session_response_model_json['session_id'] = 'testString' + + # Construct a model instance of SessionResponse by calling from_dict on the json representation + session_response_model = SessionResponse.from_dict(session_response_model_json) + assert session_response_model != False + + # Construct a model instance of SessionResponse by calling from_dict on the json representation + session_response_model_dict = SessionResponse.from_dict(session_response_model_json).__dict__ + session_response_model2 = SessionResponse(**session_response_model_dict) + + # Verify the model instances are equivalent + assert session_response_model == session_response_model2 + + # Convert model instance back to dict and verify no loss of data + session_response_model_json2 = session_response_model.to_dict() + assert session_response_model_json2 == session_response_model_json + + +class TestModel_Skill: + """ + Test Class for Skill + """ + + def test_skill_serialization(self): + """ + Test serialization/deserialization for Skill + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication + search_settings_discovery_authentication_model['basic'] = 'testString' + search_settings_discovery_authentication_model['bearer'] = 'testString' + + search_settings_discovery_model = {} # SearchSettingsDiscovery + search_settings_discovery_model['instance_id'] = 'testString' + search_settings_discovery_model['project_id'] = 'testString' + search_settings_discovery_model['url'] = 'testString' + search_settings_discovery_model['max_primary_results'] = 10000 + search_settings_discovery_model['max_total_results'] = 10000 + search_settings_discovery_model['confidence_threshold'] = 0.0 + search_settings_discovery_model['highlight'] = True + search_settings_discovery_model['find_answers'] = True + search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + + search_settings_messages_model = {} # SearchSettingsMessages + search_settings_messages_model['success'] = 'testString' + search_settings_messages_model['error'] = 'testString' + search_settings_messages_model['no_result'] = 'testString' + + search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping + search_settings_schema_mapping_model['url'] = 'testString' + search_settings_schema_mapping_model['body'] = 'testString' + search_settings_schema_mapping_model['title'] = 'testString' + + search_settings_elastic_search_model = {} # SearchSettingsElasticSearch + search_settings_elastic_search_model['url'] = 'testString' + search_settings_elastic_search_model['port'] = 'testString' + search_settings_elastic_search_model['username'] = 'testString' + search_settings_elastic_search_model['password'] = 'testString' + search_settings_elastic_search_model['index'] = 'testString' + search_settings_elastic_search_model['filter'] = ['testString'] + search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} + search_settings_elastic_search_model['managed_index'] = 'testString' + search_settings_elastic_search_model['apikey'] = 'testString' + + search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength + search_settings_conversational_search_response_length_model['option'] = 'moderate' + + search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence + search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + + search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch + search_settings_conversational_search_model['enabled'] = True + search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model + search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + + search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch + search_settings_server_side_search_model['url'] = 'testString' + search_settings_server_side_search_model['port'] = 'testString' + search_settings_server_side_search_model['username'] = 'testString' + search_settings_server_side_search_model['password'] = 'testString' + search_settings_server_side_search_model['filter'] = 'testString' + search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} + search_settings_server_side_search_model['apikey'] = 'testString' + search_settings_server_side_search_model['no_auth'] = True + search_settings_server_side_search_model['auth_type'] = 'basic' + + search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch + search_settings_client_side_search_model['filter'] = 'testString' + search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} + + search_settings_model = {} # SearchSettings + search_settings_model['discovery'] = search_settings_discovery_model + search_settings_model['messages'] = search_settings_messages_model + search_settings_model['schema_mapping'] = search_settings_schema_mapping_model + search_settings_model['elastic_search'] = search_settings_elastic_search_model + search_settings_model['conversational_search'] = search_settings_conversational_search_model + search_settings_model['server_side_search'] = search_settings_server_side_search_model + search_settings_model['client_side_search'] = search_settings_client_side_search_model + + # Construct a json representation of a Skill model + skill_model_json = {} + skill_model_json['name'] = 'testString' + skill_model_json['description'] = 'testString' + skill_model_json['workspace'] = {'anyKey': 'anyValue'} + skill_model_json['dialog_settings'] = {'anyKey': 'anyValue'} + skill_model_json['search_settings'] = search_settings_model + skill_model_json['language'] = 'testString' + skill_model_json['type'] = 'action' + + # Construct a model instance of Skill by calling from_dict on the json representation + skill_model = Skill.from_dict(skill_model_json) + assert skill_model != False + + # Construct a model instance of Skill by calling from_dict on the json representation + skill_model_dict = Skill.from_dict(skill_model_json).__dict__ + skill_model2 = Skill(**skill_model_dict) + + # Verify the model instances are equivalent + assert skill_model == skill_model2 + + # Convert model instance back to dict and verify no loss of data + skill_model_json2 = skill_model.to_dict() + assert skill_model_json2 == skill_model_json + + +class TestModel_SkillImport: + """ + Test Class for SkillImport + """ + + def test_skill_import_serialization(self): + """ + Test serialization/deserialization for SkillImport + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication + search_settings_discovery_authentication_model['basic'] = 'testString' + search_settings_discovery_authentication_model['bearer'] = 'testString' + + search_settings_discovery_model = {} # SearchSettingsDiscovery + search_settings_discovery_model['instance_id'] = 'testString' + search_settings_discovery_model['project_id'] = 'testString' + search_settings_discovery_model['url'] = 'testString' + search_settings_discovery_model['max_primary_results'] = 10000 + search_settings_discovery_model['max_total_results'] = 10000 + search_settings_discovery_model['confidence_threshold'] = 0.0 + search_settings_discovery_model['highlight'] = True + search_settings_discovery_model['find_answers'] = True + search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + + search_settings_messages_model = {} # SearchSettingsMessages + search_settings_messages_model['success'] = 'testString' + search_settings_messages_model['error'] = 'testString' + search_settings_messages_model['no_result'] = 'testString' + + search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping + search_settings_schema_mapping_model['url'] = 'testString' + search_settings_schema_mapping_model['body'] = 'testString' + search_settings_schema_mapping_model['title'] = 'testString' + + search_settings_elastic_search_model = {} # SearchSettingsElasticSearch + search_settings_elastic_search_model['url'] = 'testString' + search_settings_elastic_search_model['port'] = 'testString' + search_settings_elastic_search_model['username'] = 'testString' + search_settings_elastic_search_model['password'] = 'testString' + search_settings_elastic_search_model['index'] = 'testString' + search_settings_elastic_search_model['filter'] = ['testString'] + search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} + search_settings_elastic_search_model['managed_index'] = 'testString' + search_settings_elastic_search_model['apikey'] = 'testString' + + search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength + search_settings_conversational_search_response_length_model['option'] = 'moderate' + + search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence + search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + + search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch + search_settings_conversational_search_model['enabled'] = True + search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model + search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + + search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch + search_settings_server_side_search_model['url'] = 'testString' + search_settings_server_side_search_model['port'] = 'testString' + search_settings_server_side_search_model['username'] = 'testString' + search_settings_server_side_search_model['password'] = 'testString' + search_settings_server_side_search_model['filter'] = 'testString' + search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} + search_settings_server_side_search_model['apikey'] = 'testString' + search_settings_server_side_search_model['no_auth'] = True + search_settings_server_side_search_model['auth_type'] = 'basic' + + search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch + search_settings_client_side_search_model['filter'] = 'testString' + search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} + + search_settings_model = {} # SearchSettings + search_settings_model['discovery'] = search_settings_discovery_model + search_settings_model['messages'] = search_settings_messages_model + search_settings_model['schema_mapping'] = search_settings_schema_mapping_model + search_settings_model['elastic_search'] = search_settings_elastic_search_model + search_settings_model['conversational_search'] = search_settings_conversational_search_model + search_settings_model['server_side_search'] = search_settings_server_side_search_model + search_settings_model['client_side_search'] = search_settings_client_side_search_model + + # Construct a json representation of a SkillImport model + skill_import_model_json = {} + skill_import_model_json['name'] = 'testString' + skill_import_model_json['description'] = 'testString' + skill_import_model_json['workspace'] = {'anyKey': 'anyValue'} + skill_import_model_json['dialog_settings'] = {'anyKey': 'anyValue'} + skill_import_model_json['search_settings'] = search_settings_model + skill_import_model_json['language'] = 'testString' + skill_import_model_json['type'] = 'action' + + # Construct a model instance of SkillImport by calling from_dict on the json representation + skill_import_model = SkillImport.from_dict(skill_import_model_json) + assert skill_import_model != False + + # Construct a model instance of SkillImport by calling from_dict on the json representation + skill_import_model_dict = SkillImport.from_dict(skill_import_model_json).__dict__ + skill_import_model2 = SkillImport(**skill_import_model_dict) + + # Verify the model instances are equivalent + assert skill_import_model == skill_import_model2 + + # Convert model instance back to dict and verify no loss of data + skill_import_model_json2 = skill_import_model.to_dict() + assert skill_import_model_json2 == skill_import_model_json + + +class TestModel_SkillsAsyncRequestStatus: + """ + Test Class for SkillsAsyncRequestStatus + """ + + def test_skills_async_request_status_serialization(self): + """ + Test serialization/deserialization for SkillsAsyncRequestStatus + """ + + # Construct a json representation of a SkillsAsyncRequestStatus model + skills_async_request_status_model_json = {} + + # Construct a model instance of SkillsAsyncRequestStatus by calling from_dict on the json representation + skills_async_request_status_model = SkillsAsyncRequestStatus.from_dict(skills_async_request_status_model_json) + assert skills_async_request_status_model != False + + # Construct a model instance of SkillsAsyncRequestStatus by calling from_dict on the json representation + skills_async_request_status_model_dict = SkillsAsyncRequestStatus.from_dict(skills_async_request_status_model_json).__dict__ + skills_async_request_status_model2 = SkillsAsyncRequestStatus(**skills_async_request_status_model_dict) + + # Verify the model instances are equivalent + assert skills_async_request_status_model == skills_async_request_status_model2 + + # Convert model instance back to dict and verify no loss of data + skills_async_request_status_model_json2 = skills_async_request_status_model.to_dict() + assert skills_async_request_status_model_json2 == skills_async_request_status_model_json + + +class TestModel_SkillsExport: + """ + Test Class for SkillsExport + """ + + def test_skills_export_serialization(self): + """ + Test serialization/deserialization for SkillsExport + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_settings_discovery_authentication_model = {} # SearchSettingsDiscoveryAuthentication + search_settings_discovery_authentication_model['basic'] = 'testString' + search_settings_discovery_authentication_model['bearer'] = 'testString' + + search_settings_discovery_model = {} # SearchSettingsDiscovery + search_settings_discovery_model['instance_id'] = 'testString' + search_settings_discovery_model['project_id'] = 'testString' + search_settings_discovery_model['url'] = 'testString' + search_settings_discovery_model['max_primary_results'] = 10000 + search_settings_discovery_model['max_total_results'] = 10000 + search_settings_discovery_model['confidence_threshold'] = 0.0 + search_settings_discovery_model['highlight'] = True + search_settings_discovery_model['find_answers'] = True + search_settings_discovery_model['authentication'] = search_settings_discovery_authentication_model + + search_settings_messages_model = {} # SearchSettingsMessages + search_settings_messages_model['success'] = 'testString' + search_settings_messages_model['error'] = 'testString' + search_settings_messages_model['no_result'] = 'testString' + + search_settings_schema_mapping_model = {} # SearchSettingsSchemaMapping + search_settings_schema_mapping_model['url'] = 'testString' + search_settings_schema_mapping_model['body'] = 'testString' + search_settings_schema_mapping_model['title'] = 'testString' + + search_settings_elastic_search_model = {} # SearchSettingsElasticSearch + search_settings_elastic_search_model['url'] = 'testString' + search_settings_elastic_search_model['port'] = 'testString' + search_settings_elastic_search_model['username'] = 'testString' + search_settings_elastic_search_model['password'] = 'testString' + search_settings_elastic_search_model['index'] = 'testString' + search_settings_elastic_search_model['filter'] = ['testString'] + search_settings_elastic_search_model['query_body'] = {'anyKey': 'anyValue'} + search_settings_elastic_search_model['managed_index'] = 'testString' + search_settings_elastic_search_model['apikey'] = 'testString' + + search_settings_conversational_search_response_length_model = {} # SearchSettingsConversationalSearchResponseLength + search_settings_conversational_search_response_length_model['option'] = 'moderate' + + search_settings_conversational_search_search_confidence_model = {} # SearchSettingsConversationalSearchSearchConfidence + search_settings_conversational_search_search_confidence_model['threshold'] = 'less_often' + + search_settings_conversational_search_model = {} # SearchSettingsConversationalSearch + search_settings_conversational_search_model['enabled'] = True + search_settings_conversational_search_model['response_length'] = search_settings_conversational_search_response_length_model + search_settings_conversational_search_model['search_confidence'] = search_settings_conversational_search_search_confidence_model + + search_settings_server_side_search_model = {} # SearchSettingsServerSideSearch + search_settings_server_side_search_model['url'] = 'testString' + search_settings_server_side_search_model['port'] = 'testString' + search_settings_server_side_search_model['username'] = 'testString' + search_settings_server_side_search_model['password'] = 'testString' + search_settings_server_side_search_model['filter'] = 'testString' + search_settings_server_side_search_model['metadata'] = {'anyKey': 'anyValue'} + search_settings_server_side_search_model['apikey'] = 'testString' + search_settings_server_side_search_model['no_auth'] = True + search_settings_server_side_search_model['auth_type'] = 'basic' + + search_settings_client_side_search_model = {} # SearchSettingsClientSideSearch + search_settings_client_side_search_model['filter'] = 'testString' + search_settings_client_side_search_model['metadata'] = {'anyKey': 'anyValue'} + + search_settings_model = {} # SearchSettings + search_settings_model['discovery'] = search_settings_discovery_model + search_settings_model['messages'] = search_settings_messages_model + search_settings_model['schema_mapping'] = search_settings_schema_mapping_model + search_settings_model['elastic_search'] = search_settings_elastic_search_model + search_settings_model['conversational_search'] = search_settings_conversational_search_model + search_settings_model['server_side_search'] = search_settings_server_side_search_model + search_settings_model['client_side_search'] = search_settings_client_side_search_model + + skill_model = {} # Skill + skill_model['name'] = 'testString' + skill_model['description'] = 'testString' + skill_model['workspace'] = {'anyKey': 'anyValue'} + skill_model['dialog_settings'] = {'anyKey': 'anyValue'} + skill_model['search_settings'] = search_settings_model + skill_model['language'] = 'testString' + skill_model['type'] = 'action' + + assistant_state_model = {} # AssistantState + assistant_state_model['action_disabled'] = True + assistant_state_model['dialog_disabled'] = True + + # Construct a json representation of a SkillsExport model + skills_export_model_json = {} + skills_export_model_json['assistant_skills'] = [skill_model] + skills_export_model_json['assistant_state'] = assistant_state_model + + # Construct a model instance of SkillsExport by calling from_dict on the json representation + skills_export_model = SkillsExport.from_dict(skills_export_model_json) + assert skills_export_model != False + + # Construct a model instance of SkillsExport by calling from_dict on the json representation + skills_export_model_dict = SkillsExport.from_dict(skills_export_model_json).__dict__ + skills_export_model2 = SkillsExport(**skills_export_model_dict) + + # Verify the model instances are equivalent + assert skills_export_model == skills_export_model2 + + # Convert model instance back to dict and verify no loss of data + skills_export_model_json2 = skills_export_model.to_dict() + assert skills_export_model_json2 == skills_export_model_json + + +class TestModel_StatefulMessageResponse: + """ + Test Class for StatefulMessageResponse + """ + + def test_stateful_message_response_serialization(self): + """ + Test serialization/deserialization for StatefulMessageResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' + + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' + + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + message_output_model = {} # MessageOutput + message_output_model['generic'] = [runtime_response_generic_model] + message_output_model['intents'] = [runtime_intent_model] + message_output_model['entities'] = [runtime_entity_model] + message_output_model['actions'] = [dialog_node_action_model] + message_output_model['debug'] = message_output_debug_model + message_output_model['user_defined'] = {'anyKey': 'anyValue'} + message_output_model['spelling'] = message_output_spelling_model + message_output_model['llm_metadata'] = [message_output_llm_metadata_model] + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model + + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} + + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' + + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True + + message_input_options_model = {} # MessageInputOptions + message_input_options_model['restart'] = False + message_input_options_model['alternate_intents'] = False + message_input_options_model['async_callout'] = False + message_input_options_model['spelling'] = message_input_options_spelling_model + message_input_options_model['debug'] = False + message_input_options_model['return_context'] = False + message_input_options_model['export'] = False + + message_input_model = {} # MessageInput + message_input_model['message_type'] = 'text' + message_input_model['text'] = 'testString' + message_input_model['intents'] = [runtime_intent_model] + message_input_model['entities'] = [runtime_entity_model] + message_input_model['suggestion_id'] = 'testString' + message_input_model['attachments'] = [message_input_attachment_model] + message_input_model['analytics'] = request_analytics_model + message_input_model['options'] = message_input_options_model + + # Construct a json representation of a StatefulMessageResponse model + stateful_message_response_model_json = {} + stateful_message_response_model_json['output'] = message_output_model + stateful_message_response_model_json['context'] = message_context_model + stateful_message_response_model_json['user_id'] = 'testString' + stateful_message_response_model_json['masked_output'] = message_output_model + stateful_message_response_model_json['masked_input'] = message_input_model + + # Construct a model instance of StatefulMessageResponse by calling from_dict on the json representation + stateful_message_response_model = StatefulMessageResponse.from_dict(stateful_message_response_model_json) + assert stateful_message_response_model != False + + # Construct a model instance of StatefulMessageResponse by calling from_dict on the json representation + stateful_message_response_model_dict = StatefulMessageResponse.from_dict(stateful_message_response_model_json).__dict__ + stateful_message_response_model2 = StatefulMessageResponse(**stateful_message_response_model_dict) + + # Verify the model instances are equivalent + assert stateful_message_response_model == stateful_message_response_model2 + + # Convert model instance back to dict and verify no loss of data + stateful_message_response_model_json2 = stateful_message_response_model.to_dict() + assert stateful_message_response_model_json2 == stateful_message_response_model_json + + +class TestModel_StatelessFinalResponse: + """ + Test Class for StatelessFinalResponse + """ + + def test_stateless_final_response_serialization(self): + """ + Test serialization/deserialization for StatelessFinalResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' + + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' + + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + stateless_message_context_global_model = {} # StatelessMessageContextGlobal + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + + stateless_message_context_skills_model = {} # StatelessMessageContextSkills + stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model + + stateless_message_context_model = {} # StatelessMessageContext + stateless_message_context_model['global'] = stateless_message_context_global_model + stateless_message_context_model['skills'] = stateless_message_context_skills_model + stateless_message_context_model['integrations'] = {'anyKey': 'anyValue'} + + stateless_final_response_output_model = {} # StatelessFinalResponseOutput + stateless_final_response_output_model['generic'] = [runtime_response_generic_model] + stateless_final_response_output_model['intents'] = [runtime_intent_model] + stateless_final_response_output_model['entities'] = [runtime_entity_model] + stateless_final_response_output_model['actions'] = [dialog_node_action_model] + stateless_final_response_output_model['debug'] = message_output_debug_model + stateless_final_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_final_response_output_model['spelling'] = message_output_spelling_model + stateless_final_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] + stateless_final_response_output_model['streaming_metadata'] = stateless_message_context_model + + # Construct a json representation of a StatelessFinalResponse model + stateless_final_response_model_json = {} + stateless_final_response_model_json['output'] = stateless_final_response_output_model + stateless_final_response_model_json['context'] = stateless_message_context_model + stateless_final_response_model_json['user_id'] = 'testString' + + # Construct a model instance of StatelessFinalResponse by calling from_dict on the json representation + stateless_final_response_model = StatelessFinalResponse.from_dict(stateless_final_response_model_json) + assert stateless_final_response_model != False + + # Construct a model instance of StatelessFinalResponse by calling from_dict on the json representation + stateless_final_response_model_dict = StatelessFinalResponse.from_dict(stateless_final_response_model_json).__dict__ + stateless_final_response_model2 = StatelessFinalResponse(**stateless_final_response_model_dict) + + # Verify the model instances are equivalent + assert stateless_final_response_model == stateless_final_response_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_final_response_model_json2 = stateless_final_response_model.to_dict() + assert stateless_final_response_model_json2 == stateless_final_response_model_json + + +class TestModel_StatelessFinalResponseOutput: + """ + Test Class for StatelessFinalResponseOutput + """ + + def test_stateless_final_response_output_serialization(self): + """ + Test serialization/deserialization for StatelessFinalResponseOutput + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' + + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' + + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + stateless_message_context_global_model = {} # StatelessMessageContextGlobal + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + + stateless_message_context_skills_model = {} # StatelessMessageContextSkills + stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model + + stateless_message_context_model = {} # StatelessMessageContext + stateless_message_context_model['global'] = stateless_message_context_global_model + stateless_message_context_model['skills'] = stateless_message_context_skills_model + stateless_message_context_model['integrations'] = {'anyKey': 'anyValue'} + + # Construct a json representation of a StatelessFinalResponseOutput model + stateless_final_response_output_model_json = {} + stateless_final_response_output_model_json['generic'] = [runtime_response_generic_model] + stateless_final_response_output_model_json['intents'] = [runtime_intent_model] + stateless_final_response_output_model_json['entities'] = [runtime_entity_model] + stateless_final_response_output_model_json['actions'] = [dialog_node_action_model] + stateless_final_response_output_model_json['debug'] = message_output_debug_model + stateless_final_response_output_model_json['user_defined'] = {'anyKey': 'anyValue'} + stateless_final_response_output_model_json['spelling'] = message_output_spelling_model + stateless_final_response_output_model_json['llm_metadata'] = [message_output_llm_metadata_model] + stateless_final_response_output_model_json['streaming_metadata'] = stateless_message_context_model + + # Construct a model instance of StatelessFinalResponseOutput by calling from_dict on the json representation + stateless_final_response_output_model = StatelessFinalResponseOutput.from_dict(stateless_final_response_output_model_json) + assert stateless_final_response_output_model != False + + # Construct a model instance of StatelessFinalResponseOutput by calling from_dict on the json representation + stateless_final_response_output_model_dict = StatelessFinalResponseOutput.from_dict(stateless_final_response_output_model_json).__dict__ + stateless_final_response_output_model2 = StatelessFinalResponseOutput(**stateless_final_response_output_model_dict) + + # Verify the model instances are equivalent + assert stateless_final_response_output_model == stateless_final_response_output_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_final_response_output_model_json2 = stateless_final_response_output_model.to_dict() + assert stateless_final_response_output_model_json2 == stateless_final_response_output_model_json + + +class TestModel_StatelessMessageContext: + """ + Test Class for StatelessMessageContext + """ + + def test_stateless_message_context_serialization(self): + """ + Test serialization/deserialization for StatelessMessageContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + stateless_message_context_global_model = {} # StatelessMessageContextGlobal + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + + stateless_message_context_skills_model = {} # StatelessMessageContextSkills + stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model + + # Construct a json representation of a StatelessMessageContext model + stateless_message_context_model_json = {} + stateless_message_context_model_json['global'] = stateless_message_context_global_model + stateless_message_context_model_json['skills'] = stateless_message_context_skills_model + stateless_message_context_model_json['integrations'] = {'anyKey': 'anyValue'} + + # Construct a model instance of StatelessMessageContext by calling from_dict on the json representation + stateless_message_context_model = StatelessMessageContext.from_dict(stateless_message_context_model_json) + assert stateless_message_context_model != False + + # Construct a model instance of StatelessMessageContext by calling from_dict on the json representation + stateless_message_context_model_dict = StatelessMessageContext.from_dict(stateless_message_context_model_json).__dict__ + stateless_message_context_model2 = StatelessMessageContext(**stateless_message_context_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_context_model == stateless_message_context_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_context_model_json2 = stateless_message_context_model.to_dict() + assert stateless_message_context_model_json2 == stateless_message_context_model_json + + +class TestModel_StatelessMessageContextGlobal: + """ + Test Class for StatelessMessageContextGlobal + """ + + def test_stateless_message_context_global_serialization(self): + """ + Test serialization/deserialization for StatelessMessageContextGlobal + """ + + # Construct dict forms of any model objects needed in order to build this model. + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + # Construct a json representation of a StatelessMessageContextGlobal model + stateless_message_context_global_model_json = {} + stateless_message_context_global_model_json['system'] = message_context_global_system_model + stateless_message_context_global_model_json['session_id'] = 'testString' + + # Construct a model instance of StatelessMessageContextGlobal by calling from_dict on the json representation + stateless_message_context_global_model = StatelessMessageContextGlobal.from_dict(stateless_message_context_global_model_json) + assert stateless_message_context_global_model != False + + # Construct a model instance of StatelessMessageContextGlobal by calling from_dict on the json representation + stateless_message_context_global_model_dict = StatelessMessageContextGlobal.from_dict(stateless_message_context_global_model_json).__dict__ + stateless_message_context_global_model2 = StatelessMessageContextGlobal(**stateless_message_context_global_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_context_global_model == stateless_message_context_global_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_context_global_model_json2 = stateless_message_context_global_model.to_dict() + assert stateless_message_context_global_model_json2 == stateless_message_context_global_model_json + + +class TestModel_StatelessMessageContextSkills: + """ + Test Class for StatelessMessageContextSkills + """ + + def test_stateless_message_context_skills_serialization(self): + """ + Test serialization/deserialization for StatelessMessageContextSkills + """ + + # Construct dict forms of any model objects needed in order to build this model. + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + + # Construct a json representation of a StatelessMessageContextSkills model + stateless_message_context_skills_model_json = {} + stateless_message_context_skills_model_json['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model_json['actions skill'] = stateless_message_context_skills_actions_skill_model + + # Construct a model instance of StatelessMessageContextSkills by calling from_dict on the json representation + stateless_message_context_skills_model = StatelessMessageContextSkills.from_dict(stateless_message_context_skills_model_json) + assert stateless_message_context_skills_model != False + + # Construct a model instance of StatelessMessageContextSkills by calling from_dict on the json representation + stateless_message_context_skills_model_dict = StatelessMessageContextSkills.from_dict(stateless_message_context_skills_model_json).__dict__ + stateless_message_context_skills_model2 = StatelessMessageContextSkills(**stateless_message_context_skills_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_context_skills_model == stateless_message_context_skills_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_context_skills_model_json2 = stateless_message_context_skills_model.to_dict() + assert stateless_message_context_skills_model_json2 == stateless_message_context_skills_model_json + + +class TestModel_StatelessMessageContextSkillsActionsSkill: + """ + Test Class for StatelessMessageContextSkillsActionsSkill + """ + + def test_stateless_message_context_skills_actions_skill_serialization(self): + """ + Test serialization/deserialization for StatelessMessageContextSkillsActionsSkill + """ + + # Construct dict forms of any model objects needed in order to build this model. + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + # Construct a json representation of a StatelessMessageContextSkillsActionsSkill model + stateless_message_context_skills_actions_skill_model_json = {} + stateless_message_context_skills_actions_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model_json['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model_json['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model_json['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model_json['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model_json['private_skill_variables'] = {'anyKey': 'anyValue'} + + # Construct a model instance of StatelessMessageContextSkillsActionsSkill by calling from_dict on the json representation + stateless_message_context_skills_actions_skill_model = StatelessMessageContextSkillsActionsSkill.from_dict(stateless_message_context_skills_actions_skill_model_json) + assert stateless_message_context_skills_actions_skill_model != False + + # Construct a model instance of StatelessMessageContextSkillsActionsSkill by calling from_dict on the json representation + stateless_message_context_skills_actions_skill_model_dict = StatelessMessageContextSkillsActionsSkill.from_dict(stateless_message_context_skills_actions_skill_model_json).__dict__ + stateless_message_context_skills_actions_skill_model2 = StatelessMessageContextSkillsActionsSkill(**stateless_message_context_skills_actions_skill_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_context_skills_actions_skill_model == stateless_message_context_skills_actions_skill_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_context_skills_actions_skill_model_json2 = stateless_message_context_skills_actions_skill_model.to_dict() + assert stateless_message_context_skills_actions_skill_model_json2 == stateless_message_context_skills_actions_skill_model_json + + +class TestModel_StatelessMessageInput: + """ + Test Class for StatelessMessageInput + """ + + def test_stateless_message_input_serialization(self): + """ + Test serialization/deserialization for StatelessMessageInput + """ + + # Construct dict forms of any model objects needed in order to build this model. + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' + + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True + + stateless_message_input_options_model = {} # StatelessMessageInputOptions + stateless_message_input_options_model['restart'] = False + stateless_message_input_options_model['alternate_intents'] = False + stateless_message_input_options_model['async_callout'] = False + stateless_message_input_options_model['spelling'] = message_input_options_spelling_model + stateless_message_input_options_model['debug'] = False + + # Construct a json representation of a StatelessMessageInput model + stateless_message_input_model_json = {} + stateless_message_input_model_json['message_type'] = 'text' + stateless_message_input_model_json['text'] = 'testString' + stateless_message_input_model_json['intents'] = [runtime_intent_model] + stateless_message_input_model_json['entities'] = [runtime_entity_model] + stateless_message_input_model_json['suggestion_id'] = 'testString' + stateless_message_input_model_json['attachments'] = [message_input_attachment_model] + stateless_message_input_model_json['analytics'] = request_analytics_model + stateless_message_input_model_json['options'] = stateless_message_input_options_model + + # Construct a model instance of StatelessMessageInput by calling from_dict on the json representation + stateless_message_input_model = StatelessMessageInput.from_dict(stateless_message_input_model_json) + assert stateless_message_input_model != False + + # Construct a model instance of StatelessMessageInput by calling from_dict on the json representation + stateless_message_input_model_dict = StatelessMessageInput.from_dict(stateless_message_input_model_json).__dict__ + stateless_message_input_model2 = StatelessMessageInput(**stateless_message_input_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_input_model == stateless_message_input_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_input_model_json2 = stateless_message_input_model.to_dict() + assert stateless_message_input_model_json2 == stateless_message_input_model_json + + +class TestModel_StatelessMessageInputOptions: + """ + Test Class for StatelessMessageInputOptions + """ + + def test_stateless_message_input_options_serialization(self): + """ + Test serialization/deserialization for StatelessMessageInputOptions + """ + + # Construct dict forms of any model objects needed in order to build this model. + + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True + + # Construct a json representation of a StatelessMessageInputOptions model + stateless_message_input_options_model_json = {} + stateless_message_input_options_model_json['restart'] = False + stateless_message_input_options_model_json['alternate_intents'] = False + stateless_message_input_options_model_json['async_callout'] = False + stateless_message_input_options_model_json['spelling'] = message_input_options_spelling_model + stateless_message_input_options_model_json['debug'] = False + + # Construct a model instance of StatelessMessageInputOptions by calling from_dict on the json representation + stateless_message_input_options_model = StatelessMessageInputOptions.from_dict(stateless_message_input_options_model_json) + assert stateless_message_input_options_model != False + + # Construct a model instance of StatelessMessageInputOptions by calling from_dict on the json representation + stateless_message_input_options_model_dict = StatelessMessageInputOptions.from_dict(stateless_message_input_options_model_json).__dict__ + stateless_message_input_options_model2 = StatelessMessageInputOptions(**stateless_message_input_options_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_input_options_model == stateless_message_input_options_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_input_options_model_json2 = stateless_message_input_options_model.to_dict() + assert stateless_message_input_options_model_json2 == stateless_message_input_options_model_json + + +class TestModel_StatelessMessageResponse: + """ + Test Class for StatelessMessageResponse + """ + + def test_stateless_message_response_serialization(self): + """ + Test serialization/deserialization for StatelessMessageResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole runtime_entity_role_model['type'] = 'date_from' runtime_entity_model = {} # RuntimeEntity @@ -11103,6 +13175,10 @@ def test_stateful_message_response_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = 'testString' + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + message_output_model = {} # MessageOutput message_output_model['generic'] = [runtime_response_generic_model] message_output_model['intents'] = [runtime_intent_model] @@ -11111,6 +13187,7 @@ def test_stateful_message_response_serialization(self): message_output_model['debug'] = message_output_debug_model message_output_model['user_defined'] = {'anyKey': 'anyValue'} message_output_model['spelling'] = message_output_spelling_model + message_output_model['llm_metadata'] = [message_output_llm_metadata_model] message_context_global_system_model = {} # MessageContextGlobalSystem message_context_global_system_model['timezone'] = 'testString' @@ -11122,8 +13199,9 @@ def test_stateful_message_response_serialization(self): message_context_global_system_model['state'] = 'testString' message_context_global_system_model['skip_user_input'] = True - message_context_global_model = {} # MessageContextGlobal - message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model = {} # StatelessMessageContextGlobal + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' message_context_skill_system_model = {} # MessageContextSkillSystem message_context_skill_system_model['state'] = 'testString' @@ -11133,20 +13211,22 @@ def test_stateful_message_response_serialization(self): message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} message_context_dialog_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model = {} # MessageContextActionSkill - message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['system'] = message_context_skill_system_model - message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_dialog_skill_model - message_context_skills_model['actions skill'] = message_context_action_skill_model + stateless_message_context_skills_model = {} # StatelessMessageContextSkills + stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model - message_context_model = {} # MessageContext - message_context_model['global'] = message_context_global_model - message_context_model['skills'] = message_context_skills_model - message_context_model['integrations'] = {'anyKey': 'anyValue'} + stateless_message_context_model = {} # StatelessMessageContext + stateless_message_context_model['global'] = stateless_message_context_global_model + stateless_message_context_model['skills'] = stateless_message_context_skills_model + stateless_message_context_model['integrations'] = {'anyKey': 'anyValue'} message_input_attachment_model = {} # MessageInputAttachment message_input_attachment_model['url'] = 'testString' @@ -11180,1114 +13260,1512 @@ def test_stateful_message_response_serialization(self): message_input_model['analytics'] = request_analytics_model message_input_model['options'] = message_input_options_model - # Construct a json representation of a StatefulMessageResponse model - stateful_message_response_model_json = {} - stateful_message_response_model_json['output'] = message_output_model - stateful_message_response_model_json['context'] = message_context_model - stateful_message_response_model_json['user_id'] = 'testString' - stateful_message_response_model_json['masked_output'] = message_output_model - stateful_message_response_model_json['masked_input'] = message_input_model + # Construct a json representation of a StatelessMessageResponse model + stateless_message_response_model_json = {} + stateless_message_response_model_json['output'] = message_output_model + stateless_message_response_model_json['context'] = stateless_message_context_model + stateless_message_response_model_json['masked_output'] = message_output_model + stateless_message_response_model_json['masked_input'] = message_input_model + stateless_message_response_model_json['user_id'] = 'testString' - # Construct a model instance of StatefulMessageResponse by calling from_dict on the json representation - stateful_message_response_model = StatefulMessageResponse.from_dict(stateful_message_response_model_json) - assert stateful_message_response_model != False + # Construct a model instance of StatelessMessageResponse by calling from_dict on the json representation + stateless_message_response_model = StatelessMessageResponse.from_dict(stateless_message_response_model_json) + assert stateless_message_response_model != False + + # Construct a model instance of StatelessMessageResponse by calling from_dict on the json representation + stateless_message_response_model_dict = StatelessMessageResponse.from_dict(stateless_message_response_model_json).__dict__ + stateless_message_response_model2 = StatelessMessageResponse(**stateless_message_response_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_response_model == stateless_message_response_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_response_model_json2 = stateless_message_response_model.to_dict() + assert stateless_message_response_model_json2 == stateless_message_response_model_json + + +class TestModel_StatusError: + """ + Test Class for StatusError + """ + + def test_status_error_serialization(self): + """ + Test serialization/deserialization for StatusError + """ + + # Construct a json representation of a StatusError model + status_error_model_json = {} + status_error_model_json['message'] = 'testString' + + # Construct a model instance of StatusError by calling from_dict on the json representation + status_error_model = StatusError.from_dict(status_error_model_json) + assert status_error_model != False + + # Construct a model instance of StatusError by calling from_dict on the json representation + status_error_model_dict = StatusError.from_dict(status_error_model_json).__dict__ + status_error_model2 = StatusError(**status_error_model_dict) + + # Verify the model instances are equivalent + assert status_error_model == status_error_model2 + + # Convert model instance back to dict and verify no loss of data + status_error_model_json2 = status_error_model.to_dict() + assert status_error_model_json2 == status_error_model_json + + +class TestModel_TurnEventActionSource: + """ + Test Class for TurnEventActionSource + """ + + def test_turn_event_action_source_serialization(self): + """ + Test serialization/deserialization for TurnEventActionSource + """ + + # Construct a json representation of a TurnEventActionSource model + turn_event_action_source_model_json = {} + turn_event_action_source_model_json['type'] = 'action' + turn_event_action_source_model_json['action'] = 'testString' + turn_event_action_source_model_json['action_title'] = 'testString' + turn_event_action_source_model_json['condition'] = 'testString' + + # Construct a model instance of TurnEventActionSource by calling from_dict on the json representation + turn_event_action_source_model = TurnEventActionSource.from_dict(turn_event_action_source_model_json) + assert turn_event_action_source_model != False + + # Construct a model instance of TurnEventActionSource by calling from_dict on the json representation + turn_event_action_source_model_dict = TurnEventActionSource.from_dict(turn_event_action_source_model_json).__dict__ + turn_event_action_source_model2 = TurnEventActionSource(**turn_event_action_source_model_dict) + + # Verify the model instances are equivalent + assert turn_event_action_source_model == turn_event_action_source_model2 + + # Convert model instance back to dict and verify no loss of data + turn_event_action_source_model_json2 = turn_event_action_source_model.to_dict() + assert turn_event_action_source_model_json2 == turn_event_action_source_model_json + + +class TestModel_TurnEventCalloutCallout: + """ + Test Class for TurnEventCalloutCallout + """ + + def test_turn_event_callout_callout_serialization(self): + """ + Test serialization/deserialization for TurnEventCalloutCallout + """ + + # Construct dict forms of any model objects needed in order to build this model. + + turn_event_callout_callout_request_model = {} # TurnEventCalloutCalloutRequest + turn_event_callout_callout_request_model['method'] = 'get' + turn_event_callout_callout_request_model['url'] = 'testString' + turn_event_callout_callout_request_model['path'] = 'testString' + turn_event_callout_callout_request_model['query_parameters'] = 'testString' + turn_event_callout_callout_request_model['headers'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_request_model['body'] = {'anyKey': 'anyValue'} + + turn_event_callout_callout_response_model = {} # TurnEventCalloutCalloutResponse + turn_event_callout_callout_response_model['body'] = 'testString' + turn_event_callout_callout_response_model['status_code'] = 38 + turn_event_callout_callout_response_model['last_event'] = {'anyKey': 'anyValue'} + + # Construct a json representation of a TurnEventCalloutCallout model + turn_event_callout_callout_model_json = {} + turn_event_callout_callout_model_json['type'] = 'integration_interaction' + turn_event_callout_callout_model_json['internal'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_model_json['result_variable'] = 'testString' + turn_event_callout_callout_model_json['request'] = turn_event_callout_callout_request_model + turn_event_callout_callout_model_json['response'] = turn_event_callout_callout_response_model + + # Construct a model instance of TurnEventCalloutCallout by calling from_dict on the json representation + turn_event_callout_callout_model = TurnEventCalloutCallout.from_dict(turn_event_callout_callout_model_json) + assert turn_event_callout_callout_model != False + + # Construct a model instance of TurnEventCalloutCallout by calling from_dict on the json representation + turn_event_callout_callout_model_dict = TurnEventCalloutCallout.from_dict(turn_event_callout_callout_model_json).__dict__ + turn_event_callout_callout_model2 = TurnEventCalloutCallout(**turn_event_callout_callout_model_dict) + + # Verify the model instances are equivalent + assert turn_event_callout_callout_model == turn_event_callout_callout_model2 + + # Convert model instance back to dict and verify no loss of data + turn_event_callout_callout_model_json2 = turn_event_callout_callout_model.to_dict() + assert turn_event_callout_callout_model_json2 == turn_event_callout_callout_model_json + + +class TestModel_TurnEventCalloutCalloutRequest: + """ + Test Class for TurnEventCalloutCalloutRequest + """ + + def test_turn_event_callout_callout_request_serialization(self): + """ + Test serialization/deserialization for TurnEventCalloutCalloutRequest + """ + + # Construct a json representation of a TurnEventCalloutCalloutRequest model + turn_event_callout_callout_request_model_json = {} + turn_event_callout_callout_request_model_json['method'] = 'get' + turn_event_callout_callout_request_model_json['url'] = 'testString' + turn_event_callout_callout_request_model_json['path'] = 'testString' + turn_event_callout_callout_request_model_json['query_parameters'] = 'testString' + turn_event_callout_callout_request_model_json['headers'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_request_model_json['body'] = {'anyKey': 'anyValue'} + + # Construct a model instance of TurnEventCalloutCalloutRequest by calling from_dict on the json representation + turn_event_callout_callout_request_model = TurnEventCalloutCalloutRequest.from_dict(turn_event_callout_callout_request_model_json) + assert turn_event_callout_callout_request_model != False + + # Construct a model instance of TurnEventCalloutCalloutRequest by calling from_dict on the json representation + turn_event_callout_callout_request_model_dict = TurnEventCalloutCalloutRequest.from_dict(turn_event_callout_callout_request_model_json).__dict__ + turn_event_callout_callout_request_model2 = TurnEventCalloutCalloutRequest(**turn_event_callout_callout_request_model_dict) + + # Verify the model instances are equivalent + assert turn_event_callout_callout_request_model == turn_event_callout_callout_request_model2 + + # Convert model instance back to dict and verify no loss of data + turn_event_callout_callout_request_model_json2 = turn_event_callout_callout_request_model.to_dict() + assert turn_event_callout_callout_request_model_json2 == turn_event_callout_callout_request_model_json + + +class TestModel_TurnEventCalloutCalloutResponse: + """ + Test Class for TurnEventCalloutCalloutResponse + """ + + def test_turn_event_callout_callout_response_serialization(self): + """ + Test serialization/deserialization for TurnEventCalloutCalloutResponse + """ + + # Construct a json representation of a TurnEventCalloutCalloutResponse model + turn_event_callout_callout_response_model_json = {} + turn_event_callout_callout_response_model_json['body'] = 'testString' + turn_event_callout_callout_response_model_json['status_code'] = 38 + turn_event_callout_callout_response_model_json['last_event'] = {'anyKey': 'anyValue'} + + # Construct a model instance of TurnEventCalloutCalloutResponse by calling from_dict on the json representation + turn_event_callout_callout_response_model = TurnEventCalloutCalloutResponse.from_dict(turn_event_callout_callout_response_model_json) + assert turn_event_callout_callout_response_model != False + + # Construct a model instance of TurnEventCalloutCalloutResponse by calling from_dict on the json representation + turn_event_callout_callout_response_model_dict = TurnEventCalloutCalloutResponse.from_dict(turn_event_callout_callout_response_model_json).__dict__ + turn_event_callout_callout_response_model2 = TurnEventCalloutCalloutResponse(**turn_event_callout_callout_response_model_dict) + + # Verify the model instances are equivalent + assert turn_event_callout_callout_response_model == turn_event_callout_callout_response_model2 + + # Convert model instance back to dict and verify no loss of data + turn_event_callout_callout_response_model_json2 = turn_event_callout_callout_response_model.to_dict() + assert turn_event_callout_callout_response_model_json2 == turn_event_callout_callout_response_model_json + + +class TestModel_TurnEventCalloutError: + """ + Test Class for TurnEventCalloutError + """ + + def test_turn_event_callout_error_serialization(self): + """ + Test serialization/deserialization for TurnEventCalloutError + """ + + # Construct a json representation of a TurnEventCalloutError model + turn_event_callout_error_model_json = {} + turn_event_callout_error_model_json['message'] = 'testString' + + # Construct a model instance of TurnEventCalloutError by calling from_dict on the json representation + turn_event_callout_error_model = TurnEventCalloutError.from_dict(turn_event_callout_error_model_json) + assert turn_event_callout_error_model != False + + # Construct a model instance of TurnEventCalloutError by calling from_dict on the json representation + turn_event_callout_error_model_dict = TurnEventCalloutError.from_dict(turn_event_callout_error_model_json).__dict__ + turn_event_callout_error_model2 = TurnEventCalloutError(**turn_event_callout_error_model_dict) + + # Verify the model instances are equivalent + assert turn_event_callout_error_model == turn_event_callout_error_model2 + + # Convert model instance back to dict and verify no loss of data + turn_event_callout_error_model_json2 = turn_event_callout_error_model.to_dict() + assert turn_event_callout_error_model_json2 == turn_event_callout_error_model_json + + +class TestModel_TurnEventGenerativeAICalledCallout: + """ + Test Class for TurnEventGenerativeAICalledCallout + """ + + def test_turn_event_generative_ai_called_callout_serialization(self): + """ + Test serialization/deserialization for TurnEventGenerativeAICalledCallout + """ - # Construct a model instance of StatefulMessageResponse by calling from_dict on the json representation - stateful_message_response_model_dict = StatefulMessageResponse.from_dict(stateful_message_response_model_json).__dict__ - stateful_message_response_model2 = StatefulMessageResponse(**stateful_message_response_model_dict) + # Construct dict forms of any model objects needed in order to build this model. + + turn_event_generative_ai_called_callout_request_model = {} # TurnEventGenerativeAICalledCalloutRequest + turn_event_generative_ai_called_callout_request_model['method'] = 'GET' + turn_event_generative_ai_called_callout_request_model['url'] = 'testString' + turn_event_generative_ai_called_callout_request_model['port'] = 'testString' + turn_event_generative_ai_called_callout_request_model['path'] = 'testString' + turn_event_generative_ai_called_callout_request_model['query_parameters'] = 'testString' + turn_event_generative_ai_called_callout_request_model['headers'] = {'anyKey': 'anyValue'} + turn_event_generative_ai_called_callout_request_model['body'] = {'anyKey': 'anyValue'} + + turn_event_generative_ai_called_callout_response_model = {} # TurnEventGenerativeAICalledCalloutResponse + turn_event_generative_ai_called_callout_response_model['body'] = 'testString' + turn_event_generative_ai_called_callout_response_model['status_code'] = 38 + + turn_event_generative_ai_called_callout_search_model = {} # TurnEventGenerativeAICalledCalloutSearch + turn_event_generative_ai_called_callout_search_model['engine'] = 'testString' + turn_event_generative_ai_called_callout_search_model['index'] = 'testString' + turn_event_generative_ai_called_callout_search_model['query'] = 'testString' + turn_event_generative_ai_called_callout_search_model['request'] = turn_event_generative_ai_called_callout_request_model + turn_event_generative_ai_called_callout_search_model['response'] = turn_event_generative_ai_called_callout_response_model + + turn_event_generative_ai_called_callout_llm_response_model = {} # TurnEventGenerativeAICalledCalloutLlmResponse + turn_event_generative_ai_called_callout_llm_response_model['text'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['response_type'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['is_idk_response'] = True + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + turn_event_generative_ai_called_callout_llm_model = {} # TurnEventGenerativeAICalledCalloutLlm + turn_event_generative_ai_called_callout_llm_model['type'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['model_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['model_class_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['generated_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model['input_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model['success'] = True + turn_event_generative_ai_called_callout_llm_model['response'] = turn_event_generative_ai_called_callout_llm_response_model + turn_event_generative_ai_called_callout_llm_model['request'] = [search_results_model] + + # Construct a json representation of a TurnEventGenerativeAICalledCallout model + turn_event_generative_ai_called_callout_model_json = {} + turn_event_generative_ai_called_callout_model_json['search_called'] = True + turn_event_generative_ai_called_callout_model_json['llm_called'] = True + turn_event_generative_ai_called_callout_model_json['search'] = turn_event_generative_ai_called_callout_search_model + turn_event_generative_ai_called_callout_model_json['llm'] = turn_event_generative_ai_called_callout_llm_model + turn_event_generative_ai_called_callout_model_json['idk_reason_code'] = 'testString' + + # Construct a model instance of TurnEventGenerativeAICalledCallout by calling from_dict on the json representation + turn_event_generative_ai_called_callout_model = TurnEventGenerativeAICalledCallout.from_dict(turn_event_generative_ai_called_callout_model_json) + assert turn_event_generative_ai_called_callout_model != False + + # Construct a model instance of TurnEventGenerativeAICalledCallout by calling from_dict on the json representation + turn_event_generative_ai_called_callout_model_dict = TurnEventGenerativeAICalledCallout.from_dict(turn_event_generative_ai_called_callout_model_json).__dict__ + turn_event_generative_ai_called_callout_model2 = TurnEventGenerativeAICalledCallout(**turn_event_generative_ai_called_callout_model_dict) # Verify the model instances are equivalent - assert stateful_message_response_model == stateful_message_response_model2 + assert turn_event_generative_ai_called_callout_model == turn_event_generative_ai_called_callout_model2 # Convert model instance back to dict and verify no loss of data - stateful_message_response_model_json2 = stateful_message_response_model.to_dict() - assert stateful_message_response_model_json2 == stateful_message_response_model_json + turn_event_generative_ai_called_callout_model_json2 = turn_event_generative_ai_called_callout_model.to_dict() + assert turn_event_generative_ai_called_callout_model_json2 == turn_event_generative_ai_called_callout_model_json -class TestModel_StatelessMessageContext: +class TestModel_TurnEventGenerativeAICalledCalloutLlm: """ - Test Class for StatelessMessageContext + Test Class for TurnEventGenerativeAICalledCalloutLlm """ - def test_stateless_message_context_serialization(self): + def test_turn_event_generative_ai_called_callout_llm_serialization(self): """ - Test serialization/deserialization for StatelessMessageContext + Test serialization/deserialization for TurnEventGenerativeAICalledCalloutLlm """ # Construct dict forms of any model objects needed in order to build this model. - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True + turn_event_generative_ai_called_callout_llm_response_model = {} # TurnEventGenerativeAICalledCalloutLlmResponse + turn_event_generative_ai_called_callout_llm_response_model['text'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['response_type'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['is_idk_response'] = True + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + # Construct a json representation of a TurnEventGenerativeAICalledCalloutLlm model + turn_event_generative_ai_called_callout_llm_model_json = {} + turn_event_generative_ai_called_callout_llm_model_json['type'] = 'testString' + turn_event_generative_ai_called_callout_llm_model_json['model_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model_json['model_class_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model_json['generated_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model_json['input_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model_json['success'] = True + turn_event_generative_ai_called_callout_llm_model_json['response'] = turn_event_generative_ai_called_callout_llm_response_model + turn_event_generative_ai_called_callout_llm_model_json['request'] = [search_results_model] + + # Construct a model instance of TurnEventGenerativeAICalledCalloutLlm by calling from_dict on the json representation + turn_event_generative_ai_called_callout_llm_model = TurnEventGenerativeAICalledCalloutLlm.from_dict(turn_event_generative_ai_called_callout_llm_model_json) + assert turn_event_generative_ai_called_callout_llm_model != False + + # Construct a model instance of TurnEventGenerativeAICalledCalloutLlm by calling from_dict on the json representation + turn_event_generative_ai_called_callout_llm_model_dict = TurnEventGenerativeAICalledCalloutLlm.from_dict(turn_event_generative_ai_called_callout_llm_model_json).__dict__ + turn_event_generative_ai_called_callout_llm_model2 = TurnEventGenerativeAICalledCalloutLlm(**turn_event_generative_ai_called_callout_llm_model_dict) - stateless_message_context_global_model = {} # StatelessMessageContextGlobal - stateless_message_context_global_model['system'] = message_context_global_system_model - stateless_message_context_global_model['session_id'] = 'testString' + # Verify the model instances are equivalent + assert turn_event_generative_ai_called_callout_llm_model == turn_event_generative_ai_called_callout_llm_model2 - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + # Convert model instance back to dict and verify no loss of data + turn_event_generative_ai_called_callout_llm_model_json2 = turn_event_generative_ai_called_callout_llm_model.to_dict() + assert turn_event_generative_ai_called_callout_llm_model_json2 == turn_event_generative_ai_called_callout_llm_model_json - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model - stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill - stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model - stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} +class TestModel_TurnEventGenerativeAICalledCalloutLlmResponse: + """ + Test Class for TurnEventGenerativeAICalledCalloutLlmResponse + """ - stateless_message_context_skills_model = {} # StatelessMessageContextSkills - stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model - stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model + def test_turn_event_generative_ai_called_callout_llm_response_serialization(self): + """ + Test serialization/deserialization for TurnEventGenerativeAICalledCalloutLlmResponse + """ - # Construct a json representation of a StatelessMessageContext model - stateless_message_context_model_json = {} - stateless_message_context_model_json['global'] = stateless_message_context_global_model - stateless_message_context_model_json['skills'] = stateless_message_context_skills_model - stateless_message_context_model_json['integrations'] = {'anyKey': 'anyValue'} + # Construct a json representation of a TurnEventGenerativeAICalledCalloutLlmResponse model + turn_event_generative_ai_called_callout_llm_response_model_json = {} + turn_event_generative_ai_called_callout_llm_response_model_json['text'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model_json['response_type'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model_json['is_idk_response'] = True - # Construct a model instance of StatelessMessageContext by calling from_dict on the json representation - stateless_message_context_model = StatelessMessageContext.from_dict(stateless_message_context_model_json) - assert stateless_message_context_model != False + # Construct a model instance of TurnEventGenerativeAICalledCalloutLlmResponse by calling from_dict on the json representation + turn_event_generative_ai_called_callout_llm_response_model = TurnEventGenerativeAICalledCalloutLlmResponse.from_dict(turn_event_generative_ai_called_callout_llm_response_model_json) + assert turn_event_generative_ai_called_callout_llm_response_model != False - # Construct a model instance of StatelessMessageContext by calling from_dict on the json representation - stateless_message_context_model_dict = StatelessMessageContext.from_dict(stateless_message_context_model_json).__dict__ - stateless_message_context_model2 = StatelessMessageContext(**stateless_message_context_model_dict) + # Construct a model instance of TurnEventGenerativeAICalledCalloutLlmResponse by calling from_dict on the json representation + turn_event_generative_ai_called_callout_llm_response_model_dict = TurnEventGenerativeAICalledCalloutLlmResponse.from_dict(turn_event_generative_ai_called_callout_llm_response_model_json).__dict__ + turn_event_generative_ai_called_callout_llm_response_model2 = TurnEventGenerativeAICalledCalloutLlmResponse(**turn_event_generative_ai_called_callout_llm_response_model_dict) # Verify the model instances are equivalent - assert stateless_message_context_model == stateless_message_context_model2 + assert turn_event_generative_ai_called_callout_llm_response_model == turn_event_generative_ai_called_callout_llm_response_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_context_model_json2 = stateless_message_context_model.to_dict() - assert stateless_message_context_model_json2 == stateless_message_context_model_json + turn_event_generative_ai_called_callout_llm_response_model_json2 = turn_event_generative_ai_called_callout_llm_response_model.to_dict() + assert turn_event_generative_ai_called_callout_llm_response_model_json2 == turn_event_generative_ai_called_callout_llm_response_model_json -class TestModel_StatelessMessageContextGlobal: +class TestModel_TurnEventGenerativeAICalledCalloutRequest: """ - Test Class for StatelessMessageContextGlobal + Test Class for TurnEventGenerativeAICalledCalloutRequest """ - def test_stateless_message_context_global_serialization(self): + def test_turn_event_generative_ai_called_callout_request_serialization(self): """ - Test serialization/deserialization for StatelessMessageContextGlobal + Test serialization/deserialization for TurnEventGenerativeAICalledCalloutRequest """ - # Construct dict forms of any model objects needed in order to build this model. - - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True - - # Construct a json representation of a StatelessMessageContextGlobal model - stateless_message_context_global_model_json = {} - stateless_message_context_global_model_json['system'] = message_context_global_system_model - stateless_message_context_global_model_json['session_id'] = 'testString' + # Construct a json representation of a TurnEventGenerativeAICalledCalloutRequest model + turn_event_generative_ai_called_callout_request_model_json = {} + turn_event_generative_ai_called_callout_request_model_json['method'] = 'GET' + turn_event_generative_ai_called_callout_request_model_json['url'] = 'testString' + turn_event_generative_ai_called_callout_request_model_json['port'] = 'testString' + turn_event_generative_ai_called_callout_request_model_json['path'] = 'testString' + turn_event_generative_ai_called_callout_request_model_json['query_parameters'] = 'testString' + turn_event_generative_ai_called_callout_request_model_json['headers'] = {'anyKey': 'anyValue'} + turn_event_generative_ai_called_callout_request_model_json['body'] = {'anyKey': 'anyValue'} - # Construct a model instance of StatelessMessageContextGlobal by calling from_dict on the json representation - stateless_message_context_global_model = StatelessMessageContextGlobal.from_dict(stateless_message_context_global_model_json) - assert stateless_message_context_global_model != False + # Construct a model instance of TurnEventGenerativeAICalledCalloutRequest by calling from_dict on the json representation + turn_event_generative_ai_called_callout_request_model = TurnEventGenerativeAICalledCalloutRequest.from_dict(turn_event_generative_ai_called_callout_request_model_json) + assert turn_event_generative_ai_called_callout_request_model != False - # Construct a model instance of StatelessMessageContextGlobal by calling from_dict on the json representation - stateless_message_context_global_model_dict = StatelessMessageContextGlobal.from_dict(stateless_message_context_global_model_json).__dict__ - stateless_message_context_global_model2 = StatelessMessageContextGlobal(**stateless_message_context_global_model_dict) + # Construct a model instance of TurnEventGenerativeAICalledCalloutRequest by calling from_dict on the json representation + turn_event_generative_ai_called_callout_request_model_dict = TurnEventGenerativeAICalledCalloutRequest.from_dict(turn_event_generative_ai_called_callout_request_model_json).__dict__ + turn_event_generative_ai_called_callout_request_model2 = TurnEventGenerativeAICalledCalloutRequest(**turn_event_generative_ai_called_callout_request_model_dict) # Verify the model instances are equivalent - assert stateless_message_context_global_model == stateless_message_context_global_model2 + assert turn_event_generative_ai_called_callout_request_model == turn_event_generative_ai_called_callout_request_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_context_global_model_json2 = stateless_message_context_global_model.to_dict() - assert stateless_message_context_global_model_json2 == stateless_message_context_global_model_json + turn_event_generative_ai_called_callout_request_model_json2 = turn_event_generative_ai_called_callout_request_model.to_dict() + assert turn_event_generative_ai_called_callout_request_model_json2 == turn_event_generative_ai_called_callout_request_model_json -class TestModel_StatelessMessageContextSkills: +class TestModel_TurnEventGenerativeAICalledCalloutResponse: """ - Test Class for StatelessMessageContextSkills + Test Class for TurnEventGenerativeAICalledCalloutResponse """ - def test_stateless_message_context_skills_serialization(self): + def test_turn_event_generative_ai_called_callout_response_serialization(self): """ - Test serialization/deserialization for StatelessMessageContextSkills + Test serialization/deserialization for TurnEventGenerativeAICalledCalloutResponse """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a TurnEventGenerativeAICalledCalloutResponse model + turn_event_generative_ai_called_callout_response_model_json = {} + turn_event_generative_ai_called_callout_response_model_json['body'] = 'testString' + turn_event_generative_ai_called_callout_response_model_json['status_code'] = 38 - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + # Construct a model instance of TurnEventGenerativeAICalledCalloutResponse by calling from_dict on the json representation + turn_event_generative_ai_called_callout_response_model = TurnEventGenerativeAICalledCalloutResponse.from_dict(turn_event_generative_ai_called_callout_response_model_json) + assert turn_event_generative_ai_called_callout_response_model != False - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model + # Construct a model instance of TurnEventGenerativeAICalledCalloutResponse by calling from_dict on the json representation + turn_event_generative_ai_called_callout_response_model_dict = TurnEventGenerativeAICalledCalloutResponse.from_dict(turn_event_generative_ai_called_callout_response_model_json).__dict__ + turn_event_generative_ai_called_callout_response_model2 = TurnEventGenerativeAICalledCalloutResponse(**turn_event_generative_ai_called_callout_response_model_dict) - stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill - stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model - stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + # Verify the model instances are equivalent + assert turn_event_generative_ai_called_callout_response_model == turn_event_generative_ai_called_callout_response_model2 - # Construct a json representation of a StatelessMessageContextSkills model - stateless_message_context_skills_model_json = {} - stateless_message_context_skills_model_json['main skill'] = message_context_dialog_skill_model - stateless_message_context_skills_model_json['actions skill'] = stateless_message_context_skills_actions_skill_model + # Convert model instance back to dict and verify no loss of data + turn_event_generative_ai_called_callout_response_model_json2 = turn_event_generative_ai_called_callout_response_model.to_dict() + assert turn_event_generative_ai_called_callout_response_model_json2 == turn_event_generative_ai_called_callout_response_model_json - # Construct a model instance of StatelessMessageContextSkills by calling from_dict on the json representation - stateless_message_context_skills_model = StatelessMessageContextSkills.from_dict(stateless_message_context_skills_model_json) - assert stateless_message_context_skills_model != False - # Construct a model instance of StatelessMessageContextSkills by calling from_dict on the json representation - stateless_message_context_skills_model_dict = StatelessMessageContextSkills.from_dict(stateless_message_context_skills_model_json).__dict__ - stateless_message_context_skills_model2 = StatelessMessageContextSkills(**stateless_message_context_skills_model_dict) +class TestModel_TurnEventGenerativeAICalledCalloutSearch: + """ + Test Class for TurnEventGenerativeAICalledCalloutSearch + """ + + def test_turn_event_generative_ai_called_callout_search_serialization(self): + """ + Test serialization/deserialization for TurnEventGenerativeAICalledCalloutSearch + """ + + # Construct dict forms of any model objects needed in order to build this model. + + turn_event_generative_ai_called_callout_request_model = {} # TurnEventGenerativeAICalledCalloutRequest + turn_event_generative_ai_called_callout_request_model['method'] = 'GET' + turn_event_generative_ai_called_callout_request_model['url'] = 'testString' + turn_event_generative_ai_called_callout_request_model['port'] = 'testString' + turn_event_generative_ai_called_callout_request_model['path'] = 'testString' + turn_event_generative_ai_called_callout_request_model['query_parameters'] = 'testString' + turn_event_generative_ai_called_callout_request_model['headers'] = {'anyKey': 'anyValue'} + turn_event_generative_ai_called_callout_request_model['body'] = {'anyKey': 'anyValue'} + + turn_event_generative_ai_called_callout_response_model = {} # TurnEventGenerativeAICalledCalloutResponse + turn_event_generative_ai_called_callout_response_model['body'] = 'testString' + turn_event_generative_ai_called_callout_response_model['status_code'] = 38 + + # Construct a json representation of a TurnEventGenerativeAICalledCalloutSearch model + turn_event_generative_ai_called_callout_search_model_json = {} + turn_event_generative_ai_called_callout_search_model_json['engine'] = 'testString' + turn_event_generative_ai_called_callout_search_model_json['index'] = 'testString' + turn_event_generative_ai_called_callout_search_model_json['query'] = 'testString' + turn_event_generative_ai_called_callout_search_model_json['request'] = turn_event_generative_ai_called_callout_request_model + turn_event_generative_ai_called_callout_search_model_json['response'] = turn_event_generative_ai_called_callout_response_model + + # Construct a model instance of TurnEventGenerativeAICalledCalloutSearch by calling from_dict on the json representation + turn_event_generative_ai_called_callout_search_model = TurnEventGenerativeAICalledCalloutSearch.from_dict(turn_event_generative_ai_called_callout_search_model_json) + assert turn_event_generative_ai_called_callout_search_model != False + + # Construct a model instance of TurnEventGenerativeAICalledCalloutSearch by calling from_dict on the json representation + turn_event_generative_ai_called_callout_search_model_dict = TurnEventGenerativeAICalledCalloutSearch.from_dict(turn_event_generative_ai_called_callout_search_model_json).__dict__ + turn_event_generative_ai_called_callout_search_model2 = TurnEventGenerativeAICalledCalloutSearch(**turn_event_generative_ai_called_callout_search_model_dict) # Verify the model instances are equivalent - assert stateless_message_context_skills_model == stateless_message_context_skills_model2 + assert turn_event_generative_ai_called_callout_search_model == turn_event_generative_ai_called_callout_search_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_context_skills_model_json2 = stateless_message_context_skills_model.to_dict() - assert stateless_message_context_skills_model_json2 == stateless_message_context_skills_model_json + turn_event_generative_ai_called_callout_search_model_json2 = turn_event_generative_ai_called_callout_search_model.to_dict() + assert turn_event_generative_ai_called_callout_search_model_json2 == turn_event_generative_ai_called_callout_search_model_json -class TestModel_StatelessMessageContextSkillsActionsSkill: +class TestModel_TurnEventGenerativeAICalledMetrics: """ - Test Class for StatelessMessageContextSkillsActionsSkill + Test Class for TurnEventGenerativeAICalledMetrics """ - def test_stateless_message_context_skills_actions_skill_serialization(self): + def test_turn_event_generative_ai_called_metrics_serialization(self): """ - Test serialization/deserialization for StatelessMessageContextSkillsActionsSkill + Test serialization/deserialization for TurnEventGenerativeAICalledMetrics """ - # Construct dict forms of any model objects needed in order to build this model. - - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' - - # Construct a json representation of a StatelessMessageContextSkillsActionsSkill model - stateless_message_context_skills_actions_skill_model_json = {} - stateless_message_context_skills_actions_skill_model_json['user_defined'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model_json['system'] = message_context_skill_system_model - stateless_message_context_skills_actions_skill_model_json['action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model_json['skill_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model_json['private_action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model_json['private_skill_variables'] = {'anyKey': 'anyValue'} + # Construct a json representation of a TurnEventGenerativeAICalledMetrics model + turn_event_generative_ai_called_metrics_model_json = {} + turn_event_generative_ai_called_metrics_model_json['search_time_ms'] = 'unknown type: float' + turn_event_generative_ai_called_metrics_model_json['answer_generation_time_ms'] = 'unknown type: float' + turn_event_generative_ai_called_metrics_model_json['total_time_ms'] = 'unknown type: float' - # Construct a model instance of StatelessMessageContextSkillsActionsSkill by calling from_dict on the json representation - stateless_message_context_skills_actions_skill_model = StatelessMessageContextSkillsActionsSkill.from_dict(stateless_message_context_skills_actions_skill_model_json) - assert stateless_message_context_skills_actions_skill_model != False + # Construct a model instance of TurnEventGenerativeAICalledMetrics by calling from_dict on the json representation + turn_event_generative_ai_called_metrics_model = TurnEventGenerativeAICalledMetrics.from_dict(turn_event_generative_ai_called_metrics_model_json) + assert turn_event_generative_ai_called_metrics_model != False - # Construct a model instance of StatelessMessageContextSkillsActionsSkill by calling from_dict on the json representation - stateless_message_context_skills_actions_skill_model_dict = StatelessMessageContextSkillsActionsSkill.from_dict(stateless_message_context_skills_actions_skill_model_json).__dict__ - stateless_message_context_skills_actions_skill_model2 = StatelessMessageContextSkillsActionsSkill(**stateless_message_context_skills_actions_skill_model_dict) + # Construct a model instance of TurnEventGenerativeAICalledMetrics by calling from_dict on the json representation + turn_event_generative_ai_called_metrics_model_dict = TurnEventGenerativeAICalledMetrics.from_dict(turn_event_generative_ai_called_metrics_model_json).__dict__ + turn_event_generative_ai_called_metrics_model2 = TurnEventGenerativeAICalledMetrics(**turn_event_generative_ai_called_metrics_model_dict) # Verify the model instances are equivalent - assert stateless_message_context_skills_actions_skill_model == stateless_message_context_skills_actions_skill_model2 + assert turn_event_generative_ai_called_metrics_model == turn_event_generative_ai_called_metrics_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_context_skills_actions_skill_model_json2 = stateless_message_context_skills_actions_skill_model.to_dict() - assert stateless_message_context_skills_actions_skill_model_json2 == stateless_message_context_skills_actions_skill_model_json + turn_event_generative_ai_called_metrics_model_json2 = turn_event_generative_ai_called_metrics_model.to_dict() + assert turn_event_generative_ai_called_metrics_model_json2 == turn_event_generative_ai_called_metrics_model_json -class TestModel_StatelessMessageInput: +class TestModel_TurnEventNodeSource: """ - Test Class for StatelessMessageInput + Test Class for TurnEventNodeSource """ - def test_stateless_message_input_serialization(self): + def test_turn_event_node_source_serialization(self): """ - Test serialization/deserialization for StatelessMessageInput + Test serialization/deserialization for TurnEventNodeSource """ - # Construct dict forms of any model objects needed in order to build this model. - - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' - - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] - - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' - runtime_entity_interpretation_model['festival'] = 'testString' - runtime_entity_interpretation_model['granularity'] = 'day' - runtime_entity_interpretation_model['range_link'] = 'testString' - runtime_entity_interpretation_model['range_modifier'] = 'testString' - runtime_entity_interpretation_model['relative_day'] = 72.5 - runtime_entity_interpretation_model['relative_month'] = 72.5 - runtime_entity_interpretation_model['relative_week'] = 72.5 - runtime_entity_interpretation_model['relative_weekend'] = 72.5 - runtime_entity_interpretation_model['relative_year'] = 72.5 - runtime_entity_interpretation_model['specific_day'] = 72.5 - runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model['specific_month'] = 72.5 - runtime_entity_interpretation_model['specific_quarter'] = 72.5 - runtime_entity_interpretation_model['specific_year'] = 72.5 - runtime_entity_interpretation_model['numeric_value'] = 72.5 - runtime_entity_interpretation_model['subtype'] = 'testString' - runtime_entity_interpretation_model['part_of_day'] = 'testString' - runtime_entity_interpretation_model['relative_hour'] = 72.5 - runtime_entity_interpretation_model['relative_minute'] = 72.5 - runtime_entity_interpretation_model['relative_second'] = 72.5 - runtime_entity_interpretation_model['specific_hour'] = 72.5 - runtime_entity_interpretation_model['specific_minute'] = 72.5 - runtime_entity_interpretation_model['specific_second'] = 72.5 - runtime_entity_interpretation_model['timezone'] = 'testString' + # Construct a json representation of a TurnEventNodeSource model + turn_event_node_source_model_json = {} + turn_event_node_source_model_json['type'] = 'dialog_node' + turn_event_node_source_model_json['dialog_node'] = 'testString' + turn_event_node_source_model_json['title'] = 'testString' + turn_event_node_source_model_json['condition'] = 'testString' - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 + # Construct a model instance of TurnEventNodeSource by calling from_dict on the json representation + turn_event_node_source_model = TurnEventNodeSource.from_dict(turn_event_node_source_model_json) + assert turn_event_node_source_model != False - runtime_entity_role_model = {} # RuntimeEntityRole - runtime_entity_role_model['type'] = 'date_from' + # Construct a model instance of TurnEventNodeSource by calling from_dict on the json representation + turn_event_node_source_model_dict = TurnEventNodeSource.from_dict(turn_event_node_source_model_json).__dict__ + turn_event_node_source_model2 = TurnEventNodeSource(**turn_event_node_source_model_dict) - runtime_entity_model = {} # RuntimeEntity - runtime_entity_model['entity'] = 'testString' - runtime_entity_model['location'] = [38] - runtime_entity_model['value'] = 'testString' - runtime_entity_model['confidence'] = 72.5 - runtime_entity_model['groups'] = [capture_group_model] - runtime_entity_model['interpretation'] = runtime_entity_interpretation_model - runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] - runtime_entity_model['role'] = runtime_entity_role_model - runtime_entity_model['skill'] = 'testString' + # Verify the model instances are equivalent + assert turn_event_node_source_model == turn_event_node_source_model2 - message_input_attachment_model = {} # MessageInputAttachment - message_input_attachment_model['url'] = 'testString' - message_input_attachment_model['media_type'] = 'testString' + # Convert model instance back to dict and verify no loss of data + turn_event_node_source_model_json2 = turn_event_node_source_model.to_dict() + assert turn_event_node_source_model_json2 == turn_event_node_source_model_json - request_analytics_model = {} # RequestAnalytics - request_analytics_model['browser'] = 'testString' - request_analytics_model['device'] = 'testString' - request_analytics_model['pageUrl'] = 'testString' - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True +class TestModel_TurnEventSearchError: + """ + Test Class for TurnEventSearchError + """ - stateless_message_input_options_model = {} # StatelessMessageInputOptions - stateless_message_input_options_model['restart'] = False - stateless_message_input_options_model['alternate_intents'] = False - stateless_message_input_options_model['async_callout'] = False - stateless_message_input_options_model['spelling'] = message_input_options_spelling_model - stateless_message_input_options_model['debug'] = False + def test_turn_event_search_error_serialization(self): + """ + Test serialization/deserialization for TurnEventSearchError + """ - # Construct a json representation of a StatelessMessageInput model - stateless_message_input_model_json = {} - stateless_message_input_model_json['message_type'] = 'text' - stateless_message_input_model_json['text'] = 'testString' - stateless_message_input_model_json['intents'] = [runtime_intent_model] - stateless_message_input_model_json['entities'] = [runtime_entity_model] - stateless_message_input_model_json['suggestion_id'] = 'testString' - stateless_message_input_model_json['attachments'] = [message_input_attachment_model] - stateless_message_input_model_json['analytics'] = request_analytics_model - stateless_message_input_model_json['options'] = stateless_message_input_options_model + # Construct a json representation of a TurnEventSearchError model + turn_event_search_error_model_json = {} + turn_event_search_error_model_json['message'] = 'testString' - # Construct a model instance of StatelessMessageInput by calling from_dict on the json representation - stateless_message_input_model = StatelessMessageInput.from_dict(stateless_message_input_model_json) - assert stateless_message_input_model != False + # Construct a model instance of TurnEventSearchError by calling from_dict on the json representation + turn_event_search_error_model = TurnEventSearchError.from_dict(turn_event_search_error_model_json) + assert turn_event_search_error_model != False - # Construct a model instance of StatelessMessageInput by calling from_dict on the json representation - stateless_message_input_model_dict = StatelessMessageInput.from_dict(stateless_message_input_model_json).__dict__ - stateless_message_input_model2 = StatelessMessageInput(**stateless_message_input_model_dict) + # Construct a model instance of TurnEventSearchError by calling from_dict on the json representation + turn_event_search_error_model_dict = TurnEventSearchError.from_dict(turn_event_search_error_model_json).__dict__ + turn_event_search_error_model2 = TurnEventSearchError(**turn_event_search_error_model_dict) # Verify the model instances are equivalent - assert stateless_message_input_model == stateless_message_input_model2 + assert turn_event_search_error_model == turn_event_search_error_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_input_model_json2 = stateless_message_input_model.to_dict() - assert stateless_message_input_model_json2 == stateless_message_input_model_json + turn_event_search_error_model_json2 = turn_event_search_error_model.to_dict() + assert turn_event_search_error_model_json2 == turn_event_search_error_model_json -class TestModel_StatelessMessageInputOptions: +class TestModel_TurnEventStepSource: """ - Test Class for StatelessMessageInputOptions + Test Class for TurnEventStepSource """ - def test_stateless_message_input_options_serialization(self): + def test_turn_event_step_source_serialization(self): """ - Test serialization/deserialization for StatelessMessageInputOptions + Test serialization/deserialization for TurnEventStepSource """ - # Construct dict forms of any model objects needed in order to build this model. - - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True - - # Construct a json representation of a StatelessMessageInputOptions model - stateless_message_input_options_model_json = {} - stateless_message_input_options_model_json['restart'] = False - stateless_message_input_options_model_json['alternate_intents'] = False - stateless_message_input_options_model_json['async_callout'] = False - stateless_message_input_options_model_json['spelling'] = message_input_options_spelling_model - stateless_message_input_options_model_json['debug'] = False + # Construct a json representation of a TurnEventStepSource model + turn_event_step_source_model_json = {} + turn_event_step_source_model_json['type'] = 'step' + turn_event_step_source_model_json['action'] = 'testString' + turn_event_step_source_model_json['action_title'] = 'testString' + turn_event_step_source_model_json['step'] = 'testString' + turn_event_step_source_model_json['is_ai_guided'] = True + turn_event_step_source_model_json['is_skill_based'] = True - # Construct a model instance of StatelessMessageInputOptions by calling from_dict on the json representation - stateless_message_input_options_model = StatelessMessageInputOptions.from_dict(stateless_message_input_options_model_json) - assert stateless_message_input_options_model != False + # Construct a model instance of TurnEventStepSource by calling from_dict on the json representation + turn_event_step_source_model = TurnEventStepSource.from_dict(turn_event_step_source_model_json) + assert turn_event_step_source_model != False - # Construct a model instance of StatelessMessageInputOptions by calling from_dict on the json representation - stateless_message_input_options_model_dict = StatelessMessageInputOptions.from_dict(stateless_message_input_options_model_json).__dict__ - stateless_message_input_options_model2 = StatelessMessageInputOptions(**stateless_message_input_options_model_dict) + # Construct a model instance of TurnEventStepSource by calling from_dict on the json representation + turn_event_step_source_model_dict = TurnEventStepSource.from_dict(turn_event_step_source_model_json).__dict__ + turn_event_step_source_model2 = TurnEventStepSource(**turn_event_step_source_model_dict) # Verify the model instances are equivalent - assert stateless_message_input_options_model == stateless_message_input_options_model2 + assert turn_event_step_source_model == turn_event_step_source_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_input_options_model_json2 = stateless_message_input_options_model.to_dict() - assert stateless_message_input_options_model_json2 == stateless_message_input_options_model_json + turn_event_step_source_model_json2 = turn_event_step_source_model.to_dict() + assert turn_event_step_source_model_json2 == turn_event_step_source_model_json -class TestModel_StatelessMessageResponse: +class TestModel_UpdateEnvironmentOrchestration: """ - Test Class for StatelessMessageResponse + Test Class for UpdateEnvironmentOrchestration """ - def test_stateless_message_response_serialization(self): + def test_update_environment_orchestration_serialization(self): """ - Test serialization/deserialization for StatelessMessageResponse + Test serialization/deserialization for UpdateEnvironmentOrchestration """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a UpdateEnvironmentOrchestration model + update_environment_orchestration_model_json = {} + update_environment_orchestration_model_json['search_skill_fallback'] = True - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' + # Construct a model instance of UpdateEnvironmentOrchestration by calling from_dict on the json representation + update_environment_orchestration_model = UpdateEnvironmentOrchestration.from_dict(update_environment_orchestration_model_json) + assert update_environment_orchestration_model != False - runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeText - runtime_response_generic_model['response_type'] = 'text' - runtime_response_generic_model['text'] = 'testString' - runtime_response_generic_model['channels'] = [response_generic_channel_model] + # Construct a model instance of UpdateEnvironmentOrchestration by calling from_dict on the json representation + update_environment_orchestration_model_dict = UpdateEnvironmentOrchestration.from_dict(update_environment_orchestration_model_json).__dict__ + update_environment_orchestration_model2 = UpdateEnvironmentOrchestration(**update_environment_orchestration_model_dict) - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + # Verify the model instances are equivalent + assert update_environment_orchestration_model == update_environment_orchestration_model2 - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + # Convert model instance back to dict and verify no loss of data + update_environment_orchestration_model_json2 = update_environment_orchestration_model.to_dict() + assert update_environment_orchestration_model_json2 == update_environment_orchestration_model_json - runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation - runtime_entity_interpretation_model['calendar_type'] = 'testString' - runtime_entity_interpretation_model['datetime_link'] = 'testString' - runtime_entity_interpretation_model['festival'] = 'testString' - runtime_entity_interpretation_model['granularity'] = 'day' - runtime_entity_interpretation_model['range_link'] = 'testString' - runtime_entity_interpretation_model['range_modifier'] = 'testString' - runtime_entity_interpretation_model['relative_day'] = 72.5 - runtime_entity_interpretation_model['relative_month'] = 72.5 - runtime_entity_interpretation_model['relative_week'] = 72.5 - runtime_entity_interpretation_model['relative_weekend'] = 72.5 - runtime_entity_interpretation_model['relative_year'] = 72.5 - runtime_entity_interpretation_model['specific_day'] = 72.5 - runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' - runtime_entity_interpretation_model['specific_month'] = 72.5 - runtime_entity_interpretation_model['specific_quarter'] = 72.5 - runtime_entity_interpretation_model['specific_year'] = 72.5 - runtime_entity_interpretation_model['numeric_value'] = 72.5 - runtime_entity_interpretation_model['subtype'] = 'testString' - runtime_entity_interpretation_model['part_of_day'] = 'testString' - runtime_entity_interpretation_model['relative_hour'] = 72.5 - runtime_entity_interpretation_model['relative_minute'] = 72.5 - runtime_entity_interpretation_model['relative_second'] = 72.5 - runtime_entity_interpretation_model['specific_hour'] = 72.5 - runtime_entity_interpretation_model['specific_minute'] = 72.5 - runtime_entity_interpretation_model['specific_second'] = 72.5 - runtime_entity_interpretation_model['timezone'] = 'testString' - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 +class TestModel_UpdateEnvironmentReleaseReference: + """ + Test Class for UpdateEnvironmentReleaseReference + """ - runtime_entity_role_model = {} # RuntimeEntityRole - runtime_entity_role_model['type'] = 'date_from' + def test_update_environment_release_reference_serialization(self): + """ + Test serialization/deserialization for UpdateEnvironmentReleaseReference + """ - runtime_entity_model = {} # RuntimeEntity - runtime_entity_model['entity'] = 'testString' - runtime_entity_model['location'] = [38] - runtime_entity_model['value'] = 'testString' - runtime_entity_model['confidence'] = 72.5 - runtime_entity_model['groups'] = [capture_group_model] - runtime_entity_model['interpretation'] = runtime_entity_interpretation_model - runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] - runtime_entity_model['role'] = runtime_entity_role_model - runtime_entity_model['skill'] = 'testString' + # Construct a json representation of a UpdateEnvironmentReleaseReference model + update_environment_release_reference_model_json = {} + update_environment_release_reference_model_json['release'] = 'testString' - dialog_node_action_model = {} # DialogNodeAction - dialog_node_action_model['name'] = 'testString' - dialog_node_action_model['type'] = 'client' - dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} - dialog_node_action_model['result_variable'] = 'testString' - dialog_node_action_model['credentials'] = 'testString' + # Construct a model instance of UpdateEnvironmentReleaseReference by calling from_dict on the json representation + update_environment_release_reference_model = UpdateEnvironmentReleaseReference.from_dict(update_environment_release_reference_model_json) + assert update_environment_release_reference_model != False - dialog_node_visited_model = {} # DialogNodeVisited - dialog_node_visited_model['dialog_node'] = 'testString' - dialog_node_visited_model['title'] = 'testString' - dialog_node_visited_model['conditions'] = 'testString' + # Construct a model instance of UpdateEnvironmentReleaseReference by calling from_dict on the json representation + update_environment_release_reference_model_dict = UpdateEnvironmentReleaseReference.from_dict(update_environment_release_reference_model_json).__dict__ + update_environment_release_reference_model2 = UpdateEnvironmentReleaseReference(**update_environment_release_reference_model_dict) - log_message_source_model = {} # LogMessageSourceDialogNode - log_message_source_model['type'] = 'dialog_node' - log_message_source_model['dialog_node'] = 'testString' + # Verify the model instances are equivalent + assert update_environment_release_reference_model == update_environment_release_reference_model2 - dialog_log_message_model = {} # DialogLogMessage - dialog_log_message_model['level'] = 'info' - dialog_log_message_model['message'] = 'testString' - dialog_log_message_model['code'] = 'testString' - dialog_log_message_model['source'] = log_message_source_model + # Convert model instance back to dict and verify no loss of data + update_environment_release_reference_model_json2 = update_environment_release_reference_model.to_dict() + assert update_environment_release_reference_model_json2 == update_environment_release_reference_model_json - turn_event_action_source_model = {} # TurnEventActionSource - turn_event_action_source_model['type'] = 'action' - turn_event_action_source_model['action'] = 'testString' - turn_event_action_source_model['action_title'] = 'testString' - turn_event_action_source_model['condition'] = 'testString' - message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited - message_output_debug_turn_event_model['event'] = 'action_visited' - message_output_debug_turn_event_model['source'] = turn_event_action_source_model - message_output_debug_turn_event_model['action_start_time'] = 'testString' - message_output_debug_turn_event_model['condition_type'] = 'user_defined' - message_output_debug_turn_event_model['reason'] = 'intent' - message_output_debug_turn_event_model['result_variable'] = 'testString' +class TestModel_CompleteItem: + """ + Test Class for CompleteItem + """ - message_output_debug_model = {} # MessageOutputDebug - message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] - message_output_debug_model['log_messages'] = [dialog_log_message_model] - message_output_debug_model['branch_exited'] = True - message_output_debug_model['branch_exited_reason'] = 'completed' - message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + def test_complete_item_serialization(self): + """ + Test serialization/deserialization for CompleteItem + """ - message_output_spelling_model = {} # MessageOutputSpelling - message_output_spelling_model['text'] = 'testString' - message_output_spelling_model['original_text'] = 'testString' - message_output_spelling_model['suggested_text'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - message_output_model = {} # MessageOutput - message_output_model['generic'] = [runtime_response_generic_model] - message_output_model['intents'] = [runtime_intent_model] - message_output_model['entities'] = [runtime_entity_model] - message_output_model['actions'] = [dialog_node_action_model] - message_output_model['debug'] = message_output_debug_model - message_output_model['user_defined'] = {'anyKey': 'anyValue'} - message_output_model['spelling'] = message_output_spelling_model + metadata_model = {} # Metadata + metadata_model['id'] = 38 - message_context_global_system_model = {} # MessageContextGlobalSystem - message_context_global_system_model['timezone'] = 'testString' - message_context_global_system_model['user_id'] = 'testString' - message_context_global_system_model['turn_count'] = 38 - message_context_global_system_model['locale'] = 'en-us' - message_context_global_system_model['reference_time'] = 'testString' - message_context_global_system_model['session_start_time'] = 'testString' - message_context_global_system_model['state'] = 'testString' - message_context_global_system_model['skip_user_input'] = True + # Construct a json representation of a CompleteItem model + complete_item_model_json = {} + complete_item_model_json['streaming_metadata'] = metadata_model - stateless_message_context_global_model = {} # StatelessMessageContextGlobal - stateless_message_context_global_model['system'] = message_context_global_system_model - stateless_message_context_global_model['session_id'] = 'testString' + # Construct a model instance of CompleteItem by calling from_dict on the json representation + complete_item_model = CompleteItem.from_dict(complete_item_model_json) + assert complete_item_model != False - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + # Construct a model instance of CompleteItem by calling from_dict on the json representation + complete_item_model_dict = CompleteItem.from_dict(complete_item_model_json).__dict__ + complete_item_model2 = CompleteItem(**complete_item_model_dict) - message_context_dialog_skill_model = {} # MessageContextDialogSkill - message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_dialog_skill_model['system'] = message_context_skill_system_model + # Verify the model instances are equivalent + assert complete_item_model == complete_item_model2 - stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill - stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model - stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} - stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + # Convert model instance back to dict and verify no loss of data + complete_item_model_json2 = complete_item_model.to_dict() + assert complete_item_model_json2 == complete_item_model_json - stateless_message_context_skills_model = {} # StatelessMessageContextSkills - stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model - stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model - stateless_message_context_model = {} # StatelessMessageContext - stateless_message_context_model['global'] = stateless_message_context_global_model - stateless_message_context_model['skills'] = stateless_message_context_skills_model - stateless_message_context_model['integrations'] = {'anyKey': 'anyValue'} +class TestModel_GenerativeAITaskContentGroundedAnswering: + """ + Test Class for GenerativeAITaskContentGroundedAnswering + """ - message_input_attachment_model = {} # MessageInputAttachment - message_input_attachment_model['url'] = 'testString' - message_input_attachment_model['media_type'] = 'testString' + def test_generative_ai_task_content_grounded_answering_serialization(self): + """ + Test serialization/deserialization for GenerativeAITaskContentGroundedAnswering + """ - request_analytics_model = {} # RequestAnalytics - request_analytics_model['browser'] = 'testString' - request_analytics_model['device'] = 'testString' - request_analytics_model['pageUrl'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True + generative_ai_task_confidence_scores_model = {} # GenerativeAITaskConfidenceScores + generative_ai_task_confidence_scores_model['pre_gen'] = 72.5 + generative_ai_task_confidence_scores_model['pre_gen_threshold'] = 72.5 + generative_ai_task_confidence_scores_model['post_gen'] = 72.5 + generative_ai_task_confidence_scores_model['post_gen_threshold'] = 72.5 + + # Construct a json representation of a GenerativeAITaskContentGroundedAnswering model + generative_ai_task_content_grounded_answering_model_json = {} + generative_ai_task_content_grounded_answering_model_json['task'] = 'content_grounded_answering' + generative_ai_task_content_grounded_answering_model_json['is_idk_response'] = True + generative_ai_task_content_grounded_answering_model_json['is_hap_detected'] = True + generative_ai_task_content_grounded_answering_model_json['confidence_scores'] = generative_ai_task_confidence_scores_model + generative_ai_task_content_grounded_answering_model_json['original_response'] = 'testString' + generative_ai_task_content_grounded_answering_model_json['inferred_query'] = 'testString' + + # Construct a model instance of GenerativeAITaskContentGroundedAnswering by calling from_dict on the json representation + generative_ai_task_content_grounded_answering_model = GenerativeAITaskContentGroundedAnswering.from_dict(generative_ai_task_content_grounded_answering_model_json) + assert generative_ai_task_content_grounded_answering_model != False + + # Construct a model instance of GenerativeAITaskContentGroundedAnswering by calling from_dict on the json representation + generative_ai_task_content_grounded_answering_model_dict = GenerativeAITaskContentGroundedAnswering.from_dict(generative_ai_task_content_grounded_answering_model_json).__dict__ + generative_ai_task_content_grounded_answering_model2 = GenerativeAITaskContentGroundedAnswering(**generative_ai_task_content_grounded_answering_model_dict) - message_input_options_model = {} # MessageInputOptions - message_input_options_model['restart'] = False - message_input_options_model['alternate_intents'] = False - message_input_options_model['async_callout'] = False - message_input_options_model['spelling'] = message_input_options_spelling_model - message_input_options_model['debug'] = False - message_input_options_model['return_context'] = False - message_input_options_model['export'] = False + # Verify the model instances are equivalent + assert generative_ai_task_content_grounded_answering_model == generative_ai_task_content_grounded_answering_model2 - message_input_model = {} # MessageInput - message_input_model['message_type'] = 'text' - message_input_model['text'] = 'testString' - message_input_model['intents'] = [runtime_intent_model] - message_input_model['entities'] = [runtime_entity_model] - message_input_model['suggestion_id'] = 'testString' - message_input_model['attachments'] = [message_input_attachment_model] - message_input_model['analytics'] = request_analytics_model - message_input_model['options'] = message_input_options_model + # Convert model instance back to dict and verify no loss of data + generative_ai_task_content_grounded_answering_model_json2 = generative_ai_task_content_grounded_answering_model.to_dict() + assert generative_ai_task_content_grounded_answering_model_json2 == generative_ai_task_content_grounded_answering_model_json - # Construct a json representation of a StatelessMessageResponse model - stateless_message_response_model_json = {} - stateless_message_response_model_json['output'] = message_output_model - stateless_message_response_model_json['context'] = stateless_message_context_model - stateless_message_response_model_json['masked_output'] = message_output_model - stateless_message_response_model_json['masked_input'] = message_input_model - stateless_message_response_model_json['user_id'] = 'testString' - # Construct a model instance of StatelessMessageResponse by calling from_dict on the json representation - stateless_message_response_model = StatelessMessageResponse.from_dict(stateless_message_response_model_json) - assert stateless_message_response_model != False +class TestModel_GenerativeAITaskGeneralPurposeAnswering: + """ + Test Class for GenerativeAITaskGeneralPurposeAnswering + """ - # Construct a model instance of StatelessMessageResponse by calling from_dict on the json representation - stateless_message_response_model_dict = StatelessMessageResponse.from_dict(stateless_message_response_model_json).__dict__ - stateless_message_response_model2 = StatelessMessageResponse(**stateless_message_response_model_dict) + def test_generative_ai_task_general_purpose_answering_serialization(self): + """ + Test serialization/deserialization for GenerativeAITaskGeneralPurposeAnswering + """ + + # Construct a json representation of a GenerativeAITaskGeneralPurposeAnswering model + generative_ai_task_general_purpose_answering_model_json = {} + generative_ai_task_general_purpose_answering_model_json['task'] = 'general_purpose_answering' + generative_ai_task_general_purpose_answering_model_json['is_idk_response'] = True + generative_ai_task_general_purpose_answering_model_json['is_hap_detected'] = True + + # Construct a model instance of GenerativeAITaskGeneralPurposeAnswering by calling from_dict on the json representation + generative_ai_task_general_purpose_answering_model = GenerativeAITaskGeneralPurposeAnswering.from_dict(generative_ai_task_general_purpose_answering_model_json) + assert generative_ai_task_general_purpose_answering_model != False + + # Construct a model instance of GenerativeAITaskGeneralPurposeAnswering by calling from_dict on the json representation + generative_ai_task_general_purpose_answering_model_dict = GenerativeAITaskGeneralPurposeAnswering.from_dict(generative_ai_task_general_purpose_answering_model_json).__dict__ + generative_ai_task_general_purpose_answering_model2 = GenerativeAITaskGeneralPurposeAnswering(**generative_ai_task_general_purpose_answering_model_dict) # Verify the model instances are equivalent - assert stateless_message_response_model == stateless_message_response_model2 + assert generative_ai_task_general_purpose_answering_model == generative_ai_task_general_purpose_answering_model2 # Convert model instance back to dict and verify no loss of data - stateless_message_response_model_json2 = stateless_message_response_model.to_dict() - assert stateless_message_response_model_json2 == stateless_message_response_model_json + generative_ai_task_general_purpose_answering_model_json2 = generative_ai_task_general_purpose_answering_model.to_dict() + assert generative_ai_task_general_purpose_answering_model_json2 == generative_ai_task_general_purpose_answering_model_json -class TestModel_StatusError: +class TestModel_LogMessageSourceAction: """ - Test Class for StatusError + Test Class for LogMessageSourceAction """ - def test_status_error_serialization(self): + def test_log_message_source_action_serialization(self): """ - Test serialization/deserialization for StatusError + Test serialization/deserialization for LogMessageSourceAction """ - # Construct a json representation of a StatusError model - status_error_model_json = {} - status_error_model_json['message'] = 'testString' + # Construct a json representation of a LogMessageSourceAction model + log_message_source_action_model_json = {} + log_message_source_action_model_json['type'] = 'action' + log_message_source_action_model_json['action'] = 'testString' - # Construct a model instance of StatusError by calling from_dict on the json representation - status_error_model = StatusError.from_dict(status_error_model_json) - assert status_error_model != False + # Construct a model instance of LogMessageSourceAction by calling from_dict on the json representation + log_message_source_action_model = LogMessageSourceAction.from_dict(log_message_source_action_model_json) + assert log_message_source_action_model != False - # Construct a model instance of StatusError by calling from_dict on the json representation - status_error_model_dict = StatusError.from_dict(status_error_model_json).__dict__ - status_error_model2 = StatusError(**status_error_model_dict) + # Construct a model instance of LogMessageSourceAction by calling from_dict on the json representation + log_message_source_action_model_dict = LogMessageSourceAction.from_dict(log_message_source_action_model_json).__dict__ + log_message_source_action_model2 = LogMessageSourceAction(**log_message_source_action_model_dict) # Verify the model instances are equivalent - assert status_error_model == status_error_model2 + assert log_message_source_action_model == log_message_source_action_model2 # Convert model instance back to dict and verify no loss of data - status_error_model_json2 = status_error_model.to_dict() - assert status_error_model_json2 == status_error_model_json + log_message_source_action_model_json2 = log_message_source_action_model.to_dict() + assert log_message_source_action_model_json2 == log_message_source_action_model_json -class TestModel_TurnEventActionSource: +class TestModel_LogMessageSourceDialogNode: """ - Test Class for TurnEventActionSource + Test Class for LogMessageSourceDialogNode """ - def test_turn_event_action_source_serialization(self): + def test_log_message_source_dialog_node_serialization(self): """ - Test serialization/deserialization for TurnEventActionSource + Test serialization/deserialization for LogMessageSourceDialogNode """ - # Construct a json representation of a TurnEventActionSource model - turn_event_action_source_model_json = {} - turn_event_action_source_model_json['type'] = 'action' - turn_event_action_source_model_json['action'] = 'testString' - turn_event_action_source_model_json['action_title'] = 'testString' - turn_event_action_source_model_json['condition'] = 'testString' + # Construct a json representation of a LogMessageSourceDialogNode model + log_message_source_dialog_node_model_json = {} + log_message_source_dialog_node_model_json['type'] = 'dialog_node' + log_message_source_dialog_node_model_json['dialog_node'] = 'testString' - # Construct a model instance of TurnEventActionSource by calling from_dict on the json representation - turn_event_action_source_model = TurnEventActionSource.from_dict(turn_event_action_source_model_json) - assert turn_event_action_source_model != False + # Construct a model instance of LogMessageSourceDialogNode by calling from_dict on the json representation + log_message_source_dialog_node_model = LogMessageSourceDialogNode.from_dict(log_message_source_dialog_node_model_json) + assert log_message_source_dialog_node_model != False - # Construct a model instance of TurnEventActionSource by calling from_dict on the json representation - turn_event_action_source_model_dict = TurnEventActionSource.from_dict(turn_event_action_source_model_json).__dict__ - turn_event_action_source_model2 = TurnEventActionSource(**turn_event_action_source_model_dict) + # Construct a model instance of LogMessageSourceDialogNode by calling from_dict on the json representation + log_message_source_dialog_node_model_dict = LogMessageSourceDialogNode.from_dict(log_message_source_dialog_node_model_json).__dict__ + log_message_source_dialog_node_model2 = LogMessageSourceDialogNode(**log_message_source_dialog_node_model_dict) # Verify the model instances are equivalent - assert turn_event_action_source_model == turn_event_action_source_model2 + assert log_message_source_dialog_node_model == log_message_source_dialog_node_model2 # Convert model instance back to dict and verify no loss of data - turn_event_action_source_model_json2 = turn_event_action_source_model.to_dict() - assert turn_event_action_source_model_json2 == turn_event_action_source_model_json + log_message_source_dialog_node_model_json2 = log_message_source_dialog_node_model.to_dict() + assert log_message_source_dialog_node_model_json2 == log_message_source_dialog_node_model_json -class TestModel_TurnEventCalloutCallout: +class TestModel_LogMessageSourceHandler: """ - Test Class for TurnEventCalloutCallout + Test Class for LogMessageSourceHandler """ - def test_turn_event_callout_callout_serialization(self): + def test_log_message_source_handler_serialization(self): """ - Test serialization/deserialization for TurnEventCalloutCallout + Test serialization/deserialization for LogMessageSourceHandler """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a LogMessageSourceHandler model + log_message_source_handler_model_json = {} + log_message_source_handler_model_json['type'] = 'handler' + log_message_source_handler_model_json['action'] = 'testString' + log_message_source_handler_model_json['step'] = 'testString' + log_message_source_handler_model_json['handler'] = 'testString' - turn_event_callout_callout_request_model = {} # TurnEventCalloutCalloutRequest - turn_event_callout_callout_request_model['method'] = 'get' - turn_event_callout_callout_request_model['url'] = 'testString' - turn_event_callout_callout_request_model['path'] = 'testString' - turn_event_callout_callout_request_model['query_parameters'] = 'testString' - turn_event_callout_callout_request_model['headers'] = {'anyKey': 'anyValue'} - turn_event_callout_callout_request_model['body'] = {'anyKey': 'anyValue'} + # Construct a model instance of LogMessageSourceHandler by calling from_dict on the json representation + log_message_source_handler_model = LogMessageSourceHandler.from_dict(log_message_source_handler_model_json) + assert log_message_source_handler_model != False - turn_event_callout_callout_response_model = {} # TurnEventCalloutCalloutResponse - turn_event_callout_callout_response_model['body'] = 'testString' - turn_event_callout_callout_response_model['status_code'] = 38 - turn_event_callout_callout_response_model['last_event'] = {'anyKey': 'anyValue'} + # Construct a model instance of LogMessageSourceHandler by calling from_dict on the json representation + log_message_source_handler_model_dict = LogMessageSourceHandler.from_dict(log_message_source_handler_model_json).__dict__ + log_message_source_handler_model2 = LogMessageSourceHandler(**log_message_source_handler_model_dict) - # Construct a json representation of a TurnEventCalloutCallout model - turn_event_callout_callout_model_json = {} - turn_event_callout_callout_model_json['type'] = 'integration_interaction' - turn_event_callout_callout_model_json['internal'] = {'anyKey': 'anyValue'} - turn_event_callout_callout_model_json['result_variable'] = 'testString' - turn_event_callout_callout_model_json['request'] = turn_event_callout_callout_request_model - turn_event_callout_callout_model_json['response'] = turn_event_callout_callout_response_model + # Verify the model instances are equivalent + assert log_message_source_handler_model == log_message_source_handler_model2 - # Construct a model instance of TurnEventCalloutCallout by calling from_dict on the json representation - turn_event_callout_callout_model = TurnEventCalloutCallout.from_dict(turn_event_callout_callout_model_json) - assert turn_event_callout_callout_model != False + # Convert model instance back to dict and verify no loss of data + log_message_source_handler_model_json2 = log_message_source_handler_model.to_dict() + assert log_message_source_handler_model_json2 == log_message_source_handler_model_json - # Construct a model instance of TurnEventCalloutCallout by calling from_dict on the json representation - turn_event_callout_callout_model_dict = TurnEventCalloutCallout.from_dict(turn_event_callout_callout_model_json).__dict__ - turn_event_callout_callout_model2 = TurnEventCalloutCallout(**turn_event_callout_callout_model_dict) + +class TestModel_LogMessageSourceStep: + """ + Test Class for LogMessageSourceStep + """ + + def test_log_message_source_step_serialization(self): + """ + Test serialization/deserialization for LogMessageSourceStep + """ + + # Construct a json representation of a LogMessageSourceStep model + log_message_source_step_model_json = {} + log_message_source_step_model_json['type'] = 'step' + log_message_source_step_model_json['action'] = 'testString' + log_message_source_step_model_json['step'] = 'testString' + + # Construct a model instance of LogMessageSourceStep by calling from_dict on the json representation + log_message_source_step_model = LogMessageSourceStep.from_dict(log_message_source_step_model_json) + assert log_message_source_step_model != False + + # Construct a model instance of LogMessageSourceStep by calling from_dict on the json representation + log_message_source_step_model_dict = LogMessageSourceStep.from_dict(log_message_source_step_model_json).__dict__ + log_message_source_step_model2 = LogMessageSourceStep(**log_message_source_step_model_dict) # Verify the model instances are equivalent - assert turn_event_callout_callout_model == turn_event_callout_callout_model2 + assert log_message_source_step_model == log_message_source_step_model2 # Convert model instance back to dict and verify no loss of data - turn_event_callout_callout_model_json2 = turn_event_callout_callout_model.to_dict() - assert turn_event_callout_callout_model_json2 == turn_event_callout_callout_model_json + log_message_source_step_model_json2 = log_message_source_step_model.to_dict() + assert log_message_source_step_model_json2 == log_message_source_step_model_json -class TestModel_TurnEventCalloutCalloutRequest: +class TestModel_MessageOutputDebugTurnEventTurnEventActionFinished: """ - Test Class for TurnEventCalloutCalloutRequest + Test Class for MessageOutputDebugTurnEventTurnEventActionFinished """ - def test_turn_event_callout_callout_request_serialization(self): + def test_message_output_debug_turn_event_turn_event_action_finished_serialization(self): """ - Test serialization/deserialization for TurnEventCalloutCalloutRequest + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventActionFinished """ - # Construct a json representation of a TurnEventCalloutCalloutRequest model - turn_event_callout_callout_request_model_json = {} - turn_event_callout_callout_request_model_json['method'] = 'get' - turn_event_callout_callout_request_model_json['url'] = 'testString' - turn_event_callout_callout_request_model_json['path'] = 'testString' - turn_event_callout_callout_request_model_json['query_parameters'] = 'testString' - turn_event_callout_callout_request_model_json['headers'] = {'anyKey': 'anyValue'} - turn_event_callout_callout_request_model_json['body'] = {'anyKey': 'anyValue'} + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of TurnEventCalloutCalloutRequest by calling from_dict on the json representation - turn_event_callout_callout_request_model = TurnEventCalloutCalloutRequest.from_dict(turn_event_callout_callout_request_model_json) - assert turn_event_callout_callout_request_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Construct a model instance of TurnEventCalloutCalloutRequest by calling from_dict on the json representation - turn_event_callout_callout_request_model_dict = TurnEventCalloutCalloutRequest.from_dict(turn_event_callout_callout_request_model_json).__dict__ - turn_event_callout_callout_request_model2 = TurnEventCalloutCalloutRequest(**turn_event_callout_callout_request_model_dict) + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventActionFinished model + message_output_debug_turn_event_turn_event_action_finished_model_json = {} + message_output_debug_turn_event_turn_event_action_finished_model_json['event'] = 'action_finished' + message_output_debug_turn_event_turn_event_action_finished_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_action_finished_model_json['action_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_action_finished_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_action_finished_model_json['reason'] = 'all_steps_done' + message_output_debug_turn_event_turn_event_action_finished_model_json['action_variables'] = {'anyKey': 'anyValue'} + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionFinished by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_finished_model = MessageOutputDebugTurnEventTurnEventActionFinished.from_dict(message_output_debug_turn_event_turn_event_action_finished_model_json) + assert message_output_debug_turn_event_turn_event_action_finished_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionFinished by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_finished_model_dict = MessageOutputDebugTurnEventTurnEventActionFinished.from_dict(message_output_debug_turn_event_turn_event_action_finished_model_json).__dict__ + message_output_debug_turn_event_turn_event_action_finished_model2 = MessageOutputDebugTurnEventTurnEventActionFinished(**message_output_debug_turn_event_turn_event_action_finished_model_dict) # Verify the model instances are equivalent - assert turn_event_callout_callout_request_model == turn_event_callout_callout_request_model2 + assert message_output_debug_turn_event_turn_event_action_finished_model == message_output_debug_turn_event_turn_event_action_finished_model2 # Convert model instance back to dict and verify no loss of data - turn_event_callout_callout_request_model_json2 = turn_event_callout_callout_request_model.to_dict() - assert turn_event_callout_callout_request_model_json2 == turn_event_callout_callout_request_model_json + message_output_debug_turn_event_turn_event_action_finished_model_json2 = message_output_debug_turn_event_turn_event_action_finished_model.to_dict() + assert message_output_debug_turn_event_turn_event_action_finished_model_json2 == message_output_debug_turn_event_turn_event_action_finished_model_json -class TestModel_TurnEventCalloutCalloutResponse: +class TestModel_MessageOutputDebugTurnEventTurnEventActionRoutingDenied: """ - Test Class for TurnEventCalloutCalloutResponse + Test Class for MessageOutputDebugTurnEventTurnEventActionRoutingDenied """ - def test_turn_event_callout_callout_response_serialization(self): + def test_message_output_debug_turn_event_turn_event_action_routing_denied_serialization(self): """ - Test serialization/deserialization for TurnEventCalloutCalloutResponse + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventActionRoutingDenied """ - # Construct a json representation of a TurnEventCalloutCalloutResponse model - turn_event_callout_callout_response_model_json = {} - turn_event_callout_callout_response_model_json['body'] = 'testString' - turn_event_callout_callout_response_model_json['status_code'] = 38 - turn_event_callout_callout_response_model_json['last_event'] = {'anyKey': 'anyValue'} + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of TurnEventCalloutCalloutResponse by calling from_dict on the json representation - turn_event_callout_callout_response_model = TurnEventCalloutCalloutResponse.from_dict(turn_event_callout_callout_response_model_json) - assert turn_event_callout_callout_response_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Construct a model instance of TurnEventCalloutCalloutResponse by calling from_dict on the json representation - turn_event_callout_callout_response_model_dict = TurnEventCalloutCalloutResponse.from_dict(turn_event_callout_callout_response_model_json).__dict__ - turn_event_callout_callout_response_model2 = TurnEventCalloutCalloutResponse(**turn_event_callout_callout_response_model_dict) + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventActionRoutingDenied model + message_output_debug_turn_event_turn_event_action_routing_denied_model_json = {} + message_output_debug_turn_event_turn_event_action_routing_denied_model_json['event'] = 'action_routing_denied' + message_output_debug_turn_event_turn_event_action_routing_denied_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_action_routing_denied_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_action_routing_denied_model_json['reason'] = 'action_conditions_failed' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionRoutingDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_routing_denied_model = MessageOutputDebugTurnEventTurnEventActionRoutingDenied.from_dict(message_output_debug_turn_event_turn_event_action_routing_denied_model_json) + assert message_output_debug_turn_event_turn_event_action_routing_denied_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionRoutingDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_routing_denied_model_dict = MessageOutputDebugTurnEventTurnEventActionRoutingDenied.from_dict(message_output_debug_turn_event_turn_event_action_routing_denied_model_json).__dict__ + message_output_debug_turn_event_turn_event_action_routing_denied_model2 = MessageOutputDebugTurnEventTurnEventActionRoutingDenied(**message_output_debug_turn_event_turn_event_action_routing_denied_model_dict) # Verify the model instances are equivalent - assert turn_event_callout_callout_response_model == turn_event_callout_callout_response_model2 + assert message_output_debug_turn_event_turn_event_action_routing_denied_model == message_output_debug_turn_event_turn_event_action_routing_denied_model2 # Convert model instance back to dict and verify no loss of data - turn_event_callout_callout_response_model_json2 = turn_event_callout_callout_response_model.to_dict() - assert turn_event_callout_callout_response_model_json2 == turn_event_callout_callout_response_model_json + message_output_debug_turn_event_turn_event_action_routing_denied_model_json2 = message_output_debug_turn_event_turn_event_action_routing_denied_model.to_dict() + assert message_output_debug_turn_event_turn_event_action_routing_denied_model_json2 == message_output_debug_turn_event_turn_event_action_routing_denied_model_json -class TestModel_TurnEventCalloutError: +class TestModel_MessageOutputDebugTurnEventTurnEventActionVisited: """ - Test Class for TurnEventCalloutError + Test Class for MessageOutputDebugTurnEventTurnEventActionVisited """ - def test_turn_event_callout_error_serialization(self): + def test_message_output_debug_turn_event_turn_event_action_visited_serialization(self): """ - Test serialization/deserialization for TurnEventCalloutError + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventActionVisited """ - # Construct a json representation of a TurnEventCalloutError model - turn_event_callout_error_model_json = {} - turn_event_callout_error_model_json['message'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of TurnEventCalloutError by calling from_dict on the json representation - turn_event_callout_error_model = TurnEventCalloutError.from_dict(turn_event_callout_error_model_json) - assert turn_event_callout_error_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Construct a model instance of TurnEventCalloutError by calling from_dict on the json representation - turn_event_callout_error_model_dict = TurnEventCalloutError.from_dict(turn_event_callout_error_model_json).__dict__ - turn_event_callout_error_model2 = TurnEventCalloutError(**turn_event_callout_error_model_dict) + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventActionVisited model + message_output_debug_turn_event_turn_event_action_visited_model_json = {} + message_output_debug_turn_event_turn_event_action_visited_model_json['event'] = 'action_visited' + message_output_debug_turn_event_turn_event_action_visited_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_action_visited_model_json['action_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_action_visited_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_action_visited_model_json['reason'] = 'intent' + message_output_debug_turn_event_turn_event_action_visited_model_json['result_variable'] = 'testString' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_visited_model = MessageOutputDebugTurnEventTurnEventActionVisited.from_dict(message_output_debug_turn_event_turn_event_action_visited_model_json) + assert message_output_debug_turn_event_turn_event_action_visited_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_action_visited_model_dict = MessageOutputDebugTurnEventTurnEventActionVisited.from_dict(message_output_debug_turn_event_turn_event_action_visited_model_json).__dict__ + message_output_debug_turn_event_turn_event_action_visited_model2 = MessageOutputDebugTurnEventTurnEventActionVisited(**message_output_debug_turn_event_turn_event_action_visited_model_dict) # Verify the model instances are equivalent - assert turn_event_callout_error_model == turn_event_callout_error_model2 + assert message_output_debug_turn_event_turn_event_action_visited_model == message_output_debug_turn_event_turn_event_action_visited_model2 # Convert model instance back to dict and verify no loss of data - turn_event_callout_error_model_json2 = turn_event_callout_error_model.to_dict() - assert turn_event_callout_error_model_json2 == turn_event_callout_error_model_json + message_output_debug_turn_event_turn_event_action_visited_model_json2 = message_output_debug_turn_event_turn_event_action_visited_model.to_dict() + assert message_output_debug_turn_event_turn_event_action_visited_model_json2 == message_output_debug_turn_event_turn_event_action_visited_model_json -class TestModel_TurnEventNodeSource: +class TestModel_MessageOutputDebugTurnEventTurnEventCallout: """ - Test Class for TurnEventNodeSource + Test Class for MessageOutputDebugTurnEventTurnEventCallout """ - def test_turn_event_node_source_serialization(self): + def test_message_output_debug_turn_event_turn_event_callout_serialization(self): """ - Test serialization/deserialization for TurnEventNodeSource + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventCallout """ - # Construct a json representation of a TurnEventNodeSource model - turn_event_node_source_model_json = {} - turn_event_node_source_model_json['type'] = 'dialog_node' - turn_event_node_source_model_json['dialog_node'] = 'testString' - turn_event_node_source_model_json['title'] = 'testString' - turn_event_node_source_model_json['condition'] = 'testString' - - # Construct a model instance of TurnEventNodeSource by calling from_dict on the json representation - turn_event_node_source_model = TurnEventNodeSource.from_dict(turn_event_node_source_model_json) - assert turn_event_node_source_model != False - - # Construct a model instance of TurnEventNodeSource by calling from_dict on the json representation - turn_event_node_source_model_dict = TurnEventNodeSource.from_dict(turn_event_node_source_model_json).__dict__ - turn_event_node_source_model2 = TurnEventNodeSource(**turn_event_node_source_model_dict) + # Construct dict forms of any model objects needed in order to build this model. - # Verify the model instances are equivalent - assert turn_event_node_source_model == turn_event_node_source_model2 + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Convert model instance back to dict and verify no loss of data - turn_event_node_source_model_json2 = turn_event_node_source_model.to_dict() - assert turn_event_node_source_model_json2 == turn_event_node_source_model_json + turn_event_callout_callout_request_model = {} # TurnEventCalloutCalloutRequest + turn_event_callout_callout_request_model['method'] = 'get' + turn_event_callout_callout_request_model['url'] = 'testString' + turn_event_callout_callout_request_model['path'] = 'testString' + turn_event_callout_callout_request_model['query_parameters'] = 'testString' + turn_event_callout_callout_request_model['headers'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_request_model['body'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_response_model = {} # TurnEventCalloutCalloutResponse + turn_event_callout_callout_response_model['body'] = 'testString' + turn_event_callout_callout_response_model['status_code'] = 38 + turn_event_callout_callout_response_model['last_event'] = {'anyKey': 'anyValue'} -class TestModel_TurnEventSearchError: - """ - Test Class for TurnEventSearchError - """ + turn_event_callout_callout_model = {} # TurnEventCalloutCallout + turn_event_callout_callout_model['type'] = 'integration_interaction' + turn_event_callout_callout_model['internal'] = {'anyKey': 'anyValue'} + turn_event_callout_callout_model['result_variable'] = 'testString' + turn_event_callout_callout_model['request'] = turn_event_callout_callout_request_model + turn_event_callout_callout_model['response'] = turn_event_callout_callout_response_model - def test_turn_event_search_error_serialization(self): - """ - Test serialization/deserialization for TurnEventSearchError - """ + turn_event_callout_error_model = {} # TurnEventCalloutError + turn_event_callout_error_model['message'] = 'testString' - # Construct a json representation of a TurnEventSearchError model - turn_event_search_error_model_json = {} - turn_event_search_error_model_json['message'] = 'testString' + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventCallout model + message_output_debug_turn_event_turn_event_callout_model_json = {} + message_output_debug_turn_event_turn_event_callout_model_json['event'] = 'callout' + message_output_debug_turn_event_turn_event_callout_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_callout_model_json['callout'] = turn_event_callout_callout_model + message_output_debug_turn_event_turn_event_callout_model_json['error'] = turn_event_callout_error_model - # Construct a model instance of TurnEventSearchError by calling from_dict on the json representation - turn_event_search_error_model = TurnEventSearchError.from_dict(turn_event_search_error_model_json) - assert turn_event_search_error_model != False + # Construct a model instance of MessageOutputDebugTurnEventTurnEventCallout by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_callout_model = MessageOutputDebugTurnEventTurnEventCallout.from_dict(message_output_debug_turn_event_turn_event_callout_model_json) + assert message_output_debug_turn_event_turn_event_callout_model != False - # Construct a model instance of TurnEventSearchError by calling from_dict on the json representation - turn_event_search_error_model_dict = TurnEventSearchError.from_dict(turn_event_search_error_model_json).__dict__ - turn_event_search_error_model2 = TurnEventSearchError(**turn_event_search_error_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventCallout by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_callout_model_dict = MessageOutputDebugTurnEventTurnEventCallout.from_dict(message_output_debug_turn_event_turn_event_callout_model_json).__dict__ + message_output_debug_turn_event_turn_event_callout_model2 = MessageOutputDebugTurnEventTurnEventCallout(**message_output_debug_turn_event_turn_event_callout_model_dict) # Verify the model instances are equivalent - assert turn_event_search_error_model == turn_event_search_error_model2 + assert message_output_debug_turn_event_turn_event_callout_model == message_output_debug_turn_event_turn_event_callout_model2 # Convert model instance back to dict and verify no loss of data - turn_event_search_error_model_json2 = turn_event_search_error_model.to_dict() - assert turn_event_search_error_model_json2 == turn_event_search_error_model_json + message_output_debug_turn_event_turn_event_callout_model_json2 = message_output_debug_turn_event_turn_event_callout_model.to_dict() + assert message_output_debug_turn_event_turn_event_callout_model_json2 == message_output_debug_turn_event_turn_event_callout_model_json -class TestModel_UpdateEnvironmentOrchestration: +class TestModel_MessageOutputDebugTurnEventTurnEventClientActions: """ - Test Class for UpdateEnvironmentOrchestration + Test Class for MessageOutputDebugTurnEventTurnEventClientActions """ - def test_update_environment_orchestration_serialization(self): + def test_message_output_debug_turn_event_turn_event_client_actions_serialization(self): """ - Test serialization/deserialization for UpdateEnvironmentOrchestration + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventClientActions """ - # Construct a json representation of a UpdateEnvironmentOrchestration model - update_environment_orchestration_model_json = {} - update_environment_orchestration_model_json['search_skill_fallback'] = True - - # Construct a model instance of UpdateEnvironmentOrchestration by calling from_dict on the json representation - update_environment_orchestration_model = UpdateEnvironmentOrchestration.from_dict(update_environment_orchestration_model_json) - assert update_environment_orchestration_model != False + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of UpdateEnvironmentOrchestration by calling from_dict on the json representation - update_environment_orchestration_model_dict = UpdateEnvironmentOrchestration.from_dict(update_environment_orchestration_model_json).__dict__ - update_environment_orchestration_model2 = UpdateEnvironmentOrchestration(**update_environment_orchestration_model_dict) + turn_event_step_source_model = {} # TurnEventStepSource + turn_event_step_source_model['type'] = 'step' + turn_event_step_source_model['action'] = 'testString' + turn_event_step_source_model['action_title'] = 'testString' + turn_event_step_source_model['step'] = 'testString' + turn_event_step_source_model['is_ai_guided'] = True + turn_event_step_source_model['is_skill_based'] = True + + client_action_model = {} # ClientAction + client_action_model['name'] = 'testString' + client_action_model['result_variable'] = 'testString' + client_action_model['type'] = 'testString' + client_action_model['skill'] = 'main skill' + client_action_model['parameters'] = {'anyKey': 'anyValue'} + + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventClientActions model + message_output_debug_turn_event_turn_event_client_actions_model_json = {} + message_output_debug_turn_event_turn_event_client_actions_model_json['event'] = 'client_actions' + message_output_debug_turn_event_turn_event_client_actions_model_json['source'] = turn_event_step_source_model + message_output_debug_turn_event_turn_event_client_actions_model_json['client_actions'] = [client_action_model] + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventClientActions by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_client_actions_model = MessageOutputDebugTurnEventTurnEventClientActions.from_dict(message_output_debug_turn_event_turn_event_client_actions_model_json) + assert message_output_debug_turn_event_turn_event_client_actions_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventClientActions by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_client_actions_model_dict = MessageOutputDebugTurnEventTurnEventClientActions.from_dict(message_output_debug_turn_event_turn_event_client_actions_model_json).__dict__ + message_output_debug_turn_event_turn_event_client_actions_model2 = MessageOutputDebugTurnEventTurnEventClientActions(**message_output_debug_turn_event_turn_event_client_actions_model_dict) # Verify the model instances are equivalent - assert update_environment_orchestration_model == update_environment_orchestration_model2 + assert message_output_debug_turn_event_turn_event_client_actions_model == message_output_debug_turn_event_turn_event_client_actions_model2 # Convert model instance back to dict and verify no loss of data - update_environment_orchestration_model_json2 = update_environment_orchestration_model.to_dict() - assert update_environment_orchestration_model_json2 == update_environment_orchestration_model_json + message_output_debug_turn_event_turn_event_client_actions_model_json2 = message_output_debug_turn_event_turn_event_client_actions_model.to_dict() + assert message_output_debug_turn_event_turn_event_client_actions_model_json2 == message_output_debug_turn_event_turn_event_client_actions_model_json -class TestModel_UpdateEnvironmentReleaseReference: +class TestModel_MessageOutputDebugTurnEventTurnEventConversationalSearchEnd: """ - Test Class for UpdateEnvironmentReleaseReference + Test Class for MessageOutputDebugTurnEventTurnEventConversationalSearchEnd """ - def test_update_environment_release_reference_serialization(self): + def test_message_output_debug_turn_event_turn_event_conversational_search_end_serialization(self): """ - Test serialization/deserialization for UpdateEnvironmentReleaseReference + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventConversationalSearchEnd """ - # Construct a json representation of a UpdateEnvironmentReleaseReference model - update_environment_release_reference_model_json = {} - update_environment_release_reference_model_json['release'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of UpdateEnvironmentReleaseReference by calling from_dict on the json representation - update_environment_release_reference_model = UpdateEnvironmentReleaseReference.from_dict(update_environment_release_reference_model_json) - assert update_environment_release_reference_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Construct a model instance of UpdateEnvironmentReleaseReference by calling from_dict on the json representation - update_environment_release_reference_model_dict = UpdateEnvironmentReleaseReference.from_dict(update_environment_release_reference_model_json).__dict__ - update_environment_release_reference_model2 = UpdateEnvironmentReleaseReference(**update_environment_release_reference_model_dict) + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventConversationalSearchEnd model + message_output_debug_turn_event_turn_event_conversational_search_end_model_json = {} + message_output_debug_turn_event_turn_event_conversational_search_end_model_json['event'] = 'conversational_search_end' + message_output_debug_turn_event_turn_event_conversational_search_end_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_conversational_search_end_model_json['condition_type'] = 'user_defined' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventConversationalSearchEnd by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_conversational_search_end_model = MessageOutputDebugTurnEventTurnEventConversationalSearchEnd.from_dict(message_output_debug_turn_event_turn_event_conversational_search_end_model_json) + assert message_output_debug_turn_event_turn_event_conversational_search_end_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventConversationalSearchEnd by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_conversational_search_end_model_dict = MessageOutputDebugTurnEventTurnEventConversationalSearchEnd.from_dict(message_output_debug_turn_event_turn_event_conversational_search_end_model_json).__dict__ + message_output_debug_turn_event_turn_event_conversational_search_end_model2 = MessageOutputDebugTurnEventTurnEventConversationalSearchEnd(**message_output_debug_turn_event_turn_event_conversational_search_end_model_dict) # Verify the model instances are equivalent - assert update_environment_release_reference_model == update_environment_release_reference_model2 + assert message_output_debug_turn_event_turn_event_conversational_search_end_model == message_output_debug_turn_event_turn_event_conversational_search_end_model2 # Convert model instance back to dict and verify no loss of data - update_environment_release_reference_model_json2 = update_environment_release_reference_model.to_dict() - assert update_environment_release_reference_model_json2 == update_environment_release_reference_model_json + message_output_debug_turn_event_turn_event_conversational_search_end_model_json2 = message_output_debug_turn_event_turn_event_conversational_search_end_model.to_dict() + assert message_output_debug_turn_event_turn_event_conversational_search_end_model_json2 == message_output_debug_turn_event_turn_event_conversational_search_end_model_json -class TestModel_CompleteItem: +class TestModel_MessageOutputDebugTurnEventTurnEventGenerativeAICalled: """ - Test Class for CompleteItem + Test Class for MessageOutputDebugTurnEventTurnEventGenerativeAICalled """ - def test_complete_item_serialization(self): + def test_message_output_debug_turn_event_turn_event_generative_ai_called_serialization(self): """ - Test serialization/deserialization for CompleteItem + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventGenerativeAICalled """ # Construct dict forms of any model objects needed in order to build this model. - metadata_model = {} # Metadata - metadata_model['id'] = 38 - - # Construct a json representation of a CompleteItem model - complete_item_model_json = {} - complete_item_model_json['streaming_metadata'] = metadata_model - - # Construct a model instance of CompleteItem by calling from_dict on the json representation - complete_item_model = CompleteItem.from_dict(complete_item_model_json) - assert complete_item_model != False - - # Construct a model instance of CompleteItem by calling from_dict on the json representation - complete_item_model_dict = CompleteItem.from_dict(complete_item_model_json).__dict__ - complete_item_model2 = CompleteItem(**complete_item_model_dict) + generative_ai_task_confidence_scores_model = {} # GenerativeAITaskConfidenceScores + generative_ai_task_confidence_scores_model['pre_gen'] = 72.5 + generative_ai_task_confidence_scores_model['pre_gen_threshold'] = 72.5 + generative_ai_task_confidence_scores_model['post_gen'] = 72.5 + generative_ai_task_confidence_scores_model['post_gen_threshold'] = 72.5 + + generative_ai_task_model = {} # GenerativeAITaskContentGroundedAnswering + generative_ai_task_model['task'] = 'content_grounded_answering' + generative_ai_task_model['is_idk_response'] = True + generative_ai_task_model['is_hap_detected'] = True + generative_ai_task_model['confidence_scores'] = generative_ai_task_confidence_scores_model + generative_ai_task_model['original_response'] = 'testString' + generative_ai_task_model['inferred_query'] = 'testString' + + turn_event_generative_ai_called_callout_request_model = {} # TurnEventGenerativeAICalledCalloutRequest + turn_event_generative_ai_called_callout_request_model['method'] = 'GET' + turn_event_generative_ai_called_callout_request_model['url'] = 'testString' + turn_event_generative_ai_called_callout_request_model['port'] = 'testString' + turn_event_generative_ai_called_callout_request_model['path'] = 'testString' + turn_event_generative_ai_called_callout_request_model['query_parameters'] = 'testString' + turn_event_generative_ai_called_callout_request_model['headers'] = {'anyKey': 'anyValue'} + turn_event_generative_ai_called_callout_request_model['body'] = {'anyKey': 'anyValue'} + + turn_event_generative_ai_called_callout_response_model = {} # TurnEventGenerativeAICalledCalloutResponse + turn_event_generative_ai_called_callout_response_model['body'] = 'testString' + turn_event_generative_ai_called_callout_response_model['status_code'] = 38 + + turn_event_generative_ai_called_callout_search_model = {} # TurnEventGenerativeAICalledCalloutSearch + turn_event_generative_ai_called_callout_search_model['engine'] = 'testString' + turn_event_generative_ai_called_callout_search_model['index'] = 'testString' + turn_event_generative_ai_called_callout_search_model['query'] = 'testString' + turn_event_generative_ai_called_callout_search_model['request'] = turn_event_generative_ai_called_callout_request_model + turn_event_generative_ai_called_callout_search_model['response'] = turn_event_generative_ai_called_callout_response_model + + turn_event_generative_ai_called_callout_llm_response_model = {} # TurnEventGenerativeAICalledCalloutLlmResponse + turn_event_generative_ai_called_callout_llm_response_model['text'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['response_type'] = 'testString' + turn_event_generative_ai_called_callout_llm_response_model['is_idk_response'] = True + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + turn_event_generative_ai_called_callout_llm_model = {} # TurnEventGenerativeAICalledCalloutLlm + turn_event_generative_ai_called_callout_llm_model['type'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['model_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['model_class_id'] = 'testString' + turn_event_generative_ai_called_callout_llm_model['generated_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model['input_token_count'] = 38 + turn_event_generative_ai_called_callout_llm_model['success'] = True + turn_event_generative_ai_called_callout_llm_model['response'] = turn_event_generative_ai_called_callout_llm_response_model + turn_event_generative_ai_called_callout_llm_model['request'] = [search_results_model] + + turn_event_generative_ai_called_callout_model = {} # TurnEventGenerativeAICalledCallout + turn_event_generative_ai_called_callout_model['search_called'] = True + turn_event_generative_ai_called_callout_model['llm_called'] = True + turn_event_generative_ai_called_callout_model['search'] = turn_event_generative_ai_called_callout_search_model + turn_event_generative_ai_called_callout_model['llm'] = turn_event_generative_ai_called_callout_llm_model + turn_event_generative_ai_called_callout_model['idk_reason_code'] = 'testString' + + turn_event_generative_ai_called_metrics_model = {} # TurnEventGenerativeAICalledMetrics + turn_event_generative_ai_called_metrics_model['search_time_ms'] = 'unknown type: float' + turn_event_generative_ai_called_metrics_model['answer_generation_time_ms'] = 'unknown type: float' + turn_event_generative_ai_called_metrics_model['total_time_ms'] = 'unknown type: float' + + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventGenerativeAICalled model + message_output_debug_turn_event_turn_event_generative_ai_called_model_json = {} + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['event'] = 'generative_ai_called' + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['source'] = {'anyKey': 'anyValue'} + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['generative_ai_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['generative_ai'] = generative_ai_task_model + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['callout'] = turn_event_generative_ai_called_callout_model + message_output_debug_turn_event_turn_event_generative_ai_called_model_json['metrics'] = turn_event_generative_ai_called_metrics_model + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventGenerativeAICalled by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_generative_ai_called_model = MessageOutputDebugTurnEventTurnEventGenerativeAICalled.from_dict(message_output_debug_turn_event_turn_event_generative_ai_called_model_json) + assert message_output_debug_turn_event_turn_event_generative_ai_called_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventGenerativeAICalled by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_generative_ai_called_model_dict = MessageOutputDebugTurnEventTurnEventGenerativeAICalled.from_dict(message_output_debug_turn_event_turn_event_generative_ai_called_model_json).__dict__ + message_output_debug_turn_event_turn_event_generative_ai_called_model2 = MessageOutputDebugTurnEventTurnEventGenerativeAICalled(**message_output_debug_turn_event_turn_event_generative_ai_called_model_dict) # Verify the model instances are equivalent - assert complete_item_model == complete_item_model2 + assert message_output_debug_turn_event_turn_event_generative_ai_called_model == message_output_debug_turn_event_turn_event_generative_ai_called_model2 # Convert model instance back to dict and verify no loss of data - complete_item_model_json2 = complete_item_model.to_dict() - assert complete_item_model_json2 == complete_item_model_json + message_output_debug_turn_event_turn_event_generative_ai_called_model_json2 = message_output_debug_turn_event_turn_event_generative_ai_called_model.to_dict() + assert message_output_debug_turn_event_turn_event_generative_ai_called_model_json2 == message_output_debug_turn_event_turn_event_generative_ai_called_model_json -class TestModel_LogMessageSourceAction: +class TestModel_MessageOutputDebugTurnEventTurnEventHandlerVisited: """ - Test Class for LogMessageSourceAction + Test Class for MessageOutputDebugTurnEventTurnEventHandlerVisited """ - def test_log_message_source_action_serialization(self): + def test_message_output_debug_turn_event_turn_event_handler_visited_serialization(self): """ - Test serialization/deserialization for LogMessageSourceAction + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventHandlerVisited """ - # Construct a json representation of a LogMessageSourceAction model - log_message_source_action_model_json = {} - log_message_source_action_model_json['type'] = 'action' - log_message_source_action_model_json['action'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of LogMessageSourceAction by calling from_dict on the json representation - log_message_source_action_model = LogMessageSourceAction.from_dict(log_message_source_action_model_json) - assert log_message_source_action_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventHandlerVisited model + message_output_debug_turn_event_turn_event_handler_visited_model_json = {} + message_output_debug_turn_event_turn_event_handler_visited_model_json['event'] = 'handler_visited' + message_output_debug_turn_event_turn_event_handler_visited_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_handler_visited_model_json['action_start_time'] = 'testString' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventHandlerVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_handler_visited_model = MessageOutputDebugTurnEventTurnEventHandlerVisited.from_dict(message_output_debug_turn_event_turn_event_handler_visited_model_json) + assert message_output_debug_turn_event_turn_event_handler_visited_model != False - # Construct a model instance of LogMessageSourceAction by calling from_dict on the json representation - log_message_source_action_model_dict = LogMessageSourceAction.from_dict(log_message_source_action_model_json).__dict__ - log_message_source_action_model2 = LogMessageSourceAction(**log_message_source_action_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventHandlerVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_handler_visited_model_dict = MessageOutputDebugTurnEventTurnEventHandlerVisited.from_dict(message_output_debug_turn_event_turn_event_handler_visited_model_json).__dict__ + message_output_debug_turn_event_turn_event_handler_visited_model2 = MessageOutputDebugTurnEventTurnEventHandlerVisited(**message_output_debug_turn_event_turn_event_handler_visited_model_dict) # Verify the model instances are equivalent - assert log_message_source_action_model == log_message_source_action_model2 + assert message_output_debug_turn_event_turn_event_handler_visited_model == message_output_debug_turn_event_turn_event_handler_visited_model2 # Convert model instance back to dict and verify no loss of data - log_message_source_action_model_json2 = log_message_source_action_model.to_dict() - assert log_message_source_action_model_json2 == log_message_source_action_model_json + message_output_debug_turn_event_turn_event_handler_visited_model_json2 = message_output_debug_turn_event_turn_event_handler_visited_model.to_dict() + assert message_output_debug_turn_event_turn_event_handler_visited_model_json2 == message_output_debug_turn_event_turn_event_handler_visited_model_json -class TestModel_LogMessageSourceDialogNode: +class TestModel_MessageOutputDebugTurnEventTurnEventManualRoute: """ - Test Class for LogMessageSourceDialogNode + Test Class for MessageOutputDebugTurnEventTurnEventManualRoute """ - def test_log_message_source_dialog_node_serialization(self): + def test_message_output_debug_turn_event_turn_event_manual_route_serialization(self): """ - Test serialization/deserialization for LogMessageSourceDialogNode + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventManualRoute """ - # Construct a json representation of a LogMessageSourceDialogNode model - log_message_source_dialog_node_model_json = {} - log_message_source_dialog_node_model_json['type'] = 'dialog_node' - log_message_source_dialog_node_model_json['dialog_node'] = 'testString' - - # Construct a model instance of LogMessageSourceDialogNode by calling from_dict on the json representation - log_message_source_dialog_node_model = LogMessageSourceDialogNode.from_dict(log_message_source_dialog_node_model_json) - assert log_message_source_dialog_node_model != False + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of LogMessageSourceDialogNode by calling from_dict on the json representation - log_message_source_dialog_node_model_dict = LogMessageSourceDialogNode.from_dict(log_message_source_dialog_node_model_json).__dict__ - log_message_source_dialog_node_model2 = LogMessageSourceDialogNode(**log_message_source_dialog_node_model_dict) + turn_event_step_source_model = {} # TurnEventStepSource + turn_event_step_source_model['type'] = 'step' + turn_event_step_source_model['action'] = 'testString' + turn_event_step_source_model['action_title'] = 'testString' + turn_event_step_source_model['step'] = 'testString' + turn_event_step_source_model['is_ai_guided'] = True + turn_event_step_source_model['is_skill_based'] = True + + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventManualRoute model + message_output_debug_turn_event_turn_event_manual_route_model_json = {} + message_output_debug_turn_event_turn_event_manual_route_model_json['event'] = 'manual_route' + message_output_debug_turn_event_turn_event_manual_route_model_json['source'] = turn_event_step_source_model + message_output_debug_turn_event_turn_event_manual_route_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_manual_route_model_json['action_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_manual_route_model_json['route_name'] = 'testString' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventManualRoute by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_manual_route_model = MessageOutputDebugTurnEventTurnEventManualRoute.from_dict(message_output_debug_turn_event_turn_event_manual_route_model_json) + assert message_output_debug_turn_event_turn_event_manual_route_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventManualRoute by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_manual_route_model_dict = MessageOutputDebugTurnEventTurnEventManualRoute.from_dict(message_output_debug_turn_event_turn_event_manual_route_model_json).__dict__ + message_output_debug_turn_event_turn_event_manual_route_model2 = MessageOutputDebugTurnEventTurnEventManualRoute(**message_output_debug_turn_event_turn_event_manual_route_model_dict) # Verify the model instances are equivalent - assert log_message_source_dialog_node_model == log_message_source_dialog_node_model2 + assert message_output_debug_turn_event_turn_event_manual_route_model == message_output_debug_turn_event_turn_event_manual_route_model2 # Convert model instance back to dict and verify no loss of data - log_message_source_dialog_node_model_json2 = log_message_source_dialog_node_model.to_dict() - assert log_message_source_dialog_node_model_json2 == log_message_source_dialog_node_model_json + message_output_debug_turn_event_turn_event_manual_route_model_json2 = message_output_debug_turn_event_turn_event_manual_route_model.to_dict() + assert message_output_debug_turn_event_turn_event_manual_route_model_json2 == message_output_debug_turn_event_turn_event_manual_route_model_json -class TestModel_LogMessageSourceHandler: +class TestModel_MessageOutputDebugTurnEventTurnEventNodeVisited: """ - Test Class for LogMessageSourceHandler + Test Class for MessageOutputDebugTurnEventTurnEventNodeVisited """ - def test_log_message_source_handler_serialization(self): + def test_message_output_debug_turn_event_turn_event_node_visited_serialization(self): """ - Test serialization/deserialization for LogMessageSourceHandler + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventNodeVisited """ - # Construct a json representation of a LogMessageSourceHandler model - log_message_source_handler_model_json = {} - log_message_source_handler_model_json['type'] = 'handler' - log_message_source_handler_model_json['action'] = 'testString' - log_message_source_handler_model_json['step'] = 'testString' - log_message_source_handler_model_json['handler'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of LogMessageSourceHandler by calling from_dict on the json representation - log_message_source_handler_model = LogMessageSourceHandler.from_dict(log_message_source_handler_model_json) - assert log_message_source_handler_model != False + turn_event_node_source_model = {} # TurnEventNodeSource + turn_event_node_source_model['type'] = 'dialog_node' + turn_event_node_source_model['dialog_node'] = 'testString' + turn_event_node_source_model['title'] = 'testString' + turn_event_node_source_model['condition'] = 'testString' - # Construct a model instance of LogMessageSourceHandler by calling from_dict on the json representation - log_message_source_handler_model_dict = LogMessageSourceHandler.from_dict(log_message_source_handler_model_json).__dict__ - log_message_source_handler_model2 = LogMessageSourceHandler(**log_message_source_handler_model_dict) + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventNodeVisited model + message_output_debug_turn_event_turn_event_node_visited_model_json = {} + message_output_debug_turn_event_turn_event_node_visited_model_json['event'] = 'node_visited' + message_output_debug_turn_event_turn_event_node_visited_model_json['source'] = turn_event_node_source_model + message_output_debug_turn_event_turn_event_node_visited_model_json['reason'] = 'welcome' + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventNodeVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_node_visited_model = MessageOutputDebugTurnEventTurnEventNodeVisited.from_dict(message_output_debug_turn_event_turn_event_node_visited_model_json) + assert message_output_debug_turn_event_turn_event_node_visited_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventNodeVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_node_visited_model_dict = MessageOutputDebugTurnEventTurnEventNodeVisited.from_dict(message_output_debug_turn_event_turn_event_node_visited_model_json).__dict__ + message_output_debug_turn_event_turn_event_node_visited_model2 = MessageOutputDebugTurnEventTurnEventNodeVisited(**message_output_debug_turn_event_turn_event_node_visited_model_dict) # Verify the model instances are equivalent - assert log_message_source_handler_model == log_message_source_handler_model2 + assert message_output_debug_turn_event_turn_event_node_visited_model == message_output_debug_turn_event_turn_event_node_visited_model2 # Convert model instance back to dict and verify no loss of data - log_message_source_handler_model_json2 = log_message_source_handler_model.to_dict() - assert log_message_source_handler_model_json2 == log_message_source_handler_model_json + message_output_debug_turn_event_turn_event_node_visited_model_json2 = message_output_debug_turn_event_turn_event_node_visited_model.to_dict() + assert message_output_debug_turn_event_turn_event_node_visited_model_json2 == message_output_debug_turn_event_turn_event_node_visited_model_json -class TestModel_LogMessageSourceStep: +class TestModel_MessageOutputDebugTurnEventTurnEventSearch: """ - Test Class for LogMessageSourceStep + Test Class for MessageOutputDebugTurnEventTurnEventSearch """ - def test_log_message_source_step_serialization(self): + def test_message_output_debug_turn_event_turn_event_search_serialization(self): """ - Test serialization/deserialization for LogMessageSourceStep + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventSearch """ - # Construct a json representation of a LogMessageSourceStep model - log_message_source_step_model_json = {} - log_message_source_step_model_json['type'] = 'step' - log_message_source_step_model_json['action'] = 'testString' - log_message_source_step_model_json['step'] = 'testString' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of LogMessageSourceStep by calling from_dict on the json representation - log_message_source_step_model = LogMessageSourceStep.from_dict(log_message_source_step_model_json) - assert log_message_source_step_model != False + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' - # Construct a model instance of LogMessageSourceStep by calling from_dict on the json representation - log_message_source_step_model_dict = LogMessageSourceStep.from_dict(log_message_source_step_model_json).__dict__ - log_message_source_step_model2 = LogMessageSourceStep(**log_message_source_step_model_dict) + turn_event_search_error_model = {} # TurnEventSearchError + turn_event_search_error_model['message'] = 'testString' + + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventSearch model + message_output_debug_turn_event_turn_event_search_model_json = {} + message_output_debug_turn_event_turn_event_search_model_json['event'] = 'search' + message_output_debug_turn_event_turn_event_search_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_search_model_json['error'] = turn_event_search_error_model + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventSearch by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_search_model = MessageOutputDebugTurnEventTurnEventSearch.from_dict(message_output_debug_turn_event_turn_event_search_model_json) + assert message_output_debug_turn_event_turn_event_search_model != False + + # Construct a model instance of MessageOutputDebugTurnEventTurnEventSearch by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_search_model_dict = MessageOutputDebugTurnEventTurnEventSearch.from_dict(message_output_debug_turn_event_turn_event_search_model_json).__dict__ + message_output_debug_turn_event_turn_event_search_model2 = MessageOutputDebugTurnEventTurnEventSearch(**message_output_debug_turn_event_turn_event_search_model_dict) # Verify the model instances are equivalent - assert log_message_source_step_model == log_message_source_step_model2 + assert message_output_debug_turn_event_turn_event_search_model == message_output_debug_turn_event_turn_event_search_model2 # Convert model instance back to dict and verify no loss of data - log_message_source_step_model_json2 = log_message_source_step_model.to_dict() - assert log_message_source_step_model_json2 == log_message_source_step_model_json + message_output_debug_turn_event_turn_event_search_model_json2 = message_output_debug_turn_event_turn_event_search_model.to_dict() + assert message_output_debug_turn_event_turn_event_search_model_json2 == message_output_debug_turn_event_turn_event_search_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventActionFinished: +class TestModel_MessageOutputDebugTurnEventTurnEventStepAnswered: """ - Test Class for MessageOutputDebugTurnEventTurnEventActionFinished + Test Class for MessageOutputDebugTurnEventTurnEventStepAnswered """ - def test_message_output_debug_turn_event_turn_event_action_finished_serialization(self): + def test_message_output_debug_turn_event_turn_event_step_answered_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventActionFinished + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventStepAnswered """ # Construct dict forms of any model objects needed in order to build this model. @@ -12298,39 +14776,38 @@ def test_message_output_debug_turn_event_turn_event_action_finished_serializatio turn_event_action_source_model['action_title'] = 'testString' turn_event_action_source_model['condition'] = 'testString' - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventActionFinished model - message_output_debug_turn_event_turn_event_action_finished_model_json = {} - message_output_debug_turn_event_turn_event_action_finished_model_json['event'] = 'action_finished' - message_output_debug_turn_event_turn_event_action_finished_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_action_finished_model_json['action_start_time'] = 'testString' - message_output_debug_turn_event_turn_event_action_finished_model_json['condition_type'] = 'user_defined' - message_output_debug_turn_event_turn_event_action_finished_model_json['reason'] = 'all_steps_done' - message_output_debug_turn_event_turn_event_action_finished_model_json['action_variables'] = {'anyKey': 'anyValue'} + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventStepAnswered model + message_output_debug_turn_event_turn_event_step_answered_model_json = {} + message_output_debug_turn_event_turn_event_step_answered_model_json['event'] = 'step_answered' + message_output_debug_turn_event_turn_event_step_answered_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_step_answered_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_step_answered_model_json['action_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_step_answered_model_json['prompted'] = True - # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionFinished by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_action_finished_model = MessageOutputDebugTurnEventTurnEventActionFinished.from_dict(message_output_debug_turn_event_turn_event_action_finished_model_json) - assert message_output_debug_turn_event_turn_event_action_finished_model != False + # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepAnswered by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_step_answered_model = MessageOutputDebugTurnEventTurnEventStepAnswered.from_dict(message_output_debug_turn_event_turn_event_step_answered_model_json) + assert message_output_debug_turn_event_turn_event_step_answered_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionFinished by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_action_finished_model_dict = MessageOutputDebugTurnEventTurnEventActionFinished.from_dict(message_output_debug_turn_event_turn_event_action_finished_model_json).__dict__ - message_output_debug_turn_event_turn_event_action_finished_model2 = MessageOutputDebugTurnEventTurnEventActionFinished(**message_output_debug_turn_event_turn_event_action_finished_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepAnswered by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_step_answered_model_dict = MessageOutputDebugTurnEventTurnEventStepAnswered.from_dict(message_output_debug_turn_event_turn_event_step_answered_model_json).__dict__ + message_output_debug_turn_event_turn_event_step_answered_model2 = MessageOutputDebugTurnEventTurnEventStepAnswered(**message_output_debug_turn_event_turn_event_step_answered_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_action_finished_model == message_output_debug_turn_event_turn_event_action_finished_model2 + assert message_output_debug_turn_event_turn_event_step_answered_model == message_output_debug_turn_event_turn_event_step_answered_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_action_finished_model_json2 = message_output_debug_turn_event_turn_event_action_finished_model.to_dict() - assert message_output_debug_turn_event_turn_event_action_finished_model_json2 == message_output_debug_turn_event_turn_event_action_finished_model_json + message_output_debug_turn_event_turn_event_step_answered_model_json2 = message_output_debug_turn_event_turn_event_step_answered_model.to_dict() + assert message_output_debug_turn_event_turn_event_step_answered_model_json2 == message_output_debug_turn_event_turn_event_step_answered_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventActionVisited: +class TestModel_MessageOutputDebugTurnEventTurnEventStepVisited: """ - Test Class for MessageOutputDebugTurnEventTurnEventActionVisited + Test Class for MessageOutputDebugTurnEventTurnEventStepVisited """ - def test_message_output_debug_turn_event_turn_event_action_visited_serialization(self): + def test_message_output_debug_turn_event_turn_event_step_visited_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventActionVisited + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventStepVisited """ # Construct dict forms of any model objects needed in order to build this model. @@ -12341,103 +14818,76 @@ def test_message_output_debug_turn_event_turn_event_action_visited_serialization turn_event_action_source_model['action_title'] = 'testString' turn_event_action_source_model['condition'] = 'testString' - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventActionVisited model - message_output_debug_turn_event_turn_event_action_visited_model_json = {} - message_output_debug_turn_event_turn_event_action_visited_model_json['event'] = 'action_visited' - message_output_debug_turn_event_turn_event_action_visited_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_action_visited_model_json['action_start_time'] = 'testString' - message_output_debug_turn_event_turn_event_action_visited_model_json['condition_type'] = 'user_defined' - message_output_debug_turn_event_turn_event_action_visited_model_json['reason'] = 'intent' - message_output_debug_turn_event_turn_event_action_visited_model_json['result_variable'] = 'testString' + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventStepVisited model + message_output_debug_turn_event_turn_event_step_visited_model_json = {} + message_output_debug_turn_event_turn_event_step_visited_model_json['event'] = 'step_visited' + message_output_debug_turn_event_turn_event_step_visited_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_step_visited_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_step_visited_model_json['action_start_time'] = 'testString' + message_output_debug_turn_event_turn_event_step_visited_model_json['has_question'] = True - # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_action_visited_model = MessageOutputDebugTurnEventTurnEventActionVisited.from_dict(message_output_debug_turn_event_turn_event_action_visited_model_json) - assert message_output_debug_turn_event_turn_event_action_visited_model != False + # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_step_visited_model = MessageOutputDebugTurnEventTurnEventStepVisited.from_dict(message_output_debug_turn_event_turn_event_step_visited_model_json) + assert message_output_debug_turn_event_turn_event_step_visited_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventActionVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_action_visited_model_dict = MessageOutputDebugTurnEventTurnEventActionVisited.from_dict(message_output_debug_turn_event_turn_event_action_visited_model_json).__dict__ - message_output_debug_turn_event_turn_event_action_visited_model2 = MessageOutputDebugTurnEventTurnEventActionVisited(**message_output_debug_turn_event_turn_event_action_visited_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepVisited by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_step_visited_model_dict = MessageOutputDebugTurnEventTurnEventStepVisited.from_dict(message_output_debug_turn_event_turn_event_step_visited_model_json).__dict__ + message_output_debug_turn_event_turn_event_step_visited_model2 = MessageOutputDebugTurnEventTurnEventStepVisited(**message_output_debug_turn_event_turn_event_step_visited_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_action_visited_model == message_output_debug_turn_event_turn_event_action_visited_model2 + assert message_output_debug_turn_event_turn_event_step_visited_model == message_output_debug_turn_event_turn_event_step_visited_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_action_visited_model_json2 = message_output_debug_turn_event_turn_event_action_visited_model.to_dict() - assert message_output_debug_turn_event_turn_event_action_visited_model_json2 == message_output_debug_turn_event_turn_event_action_visited_model_json + message_output_debug_turn_event_turn_event_step_visited_model_json2 = message_output_debug_turn_event_turn_event_step_visited_model.to_dict() + assert message_output_debug_turn_event_turn_event_step_visited_model_json2 == message_output_debug_turn_event_turn_event_step_visited_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventCallout: +class TestModel_MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied: """ - Test Class for MessageOutputDebugTurnEventTurnEventCallout + Test Class for MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied """ - def test_message_output_debug_turn_event_turn_event_callout_serialization(self): + def test_message_output_debug_turn_event_turn_event_suggestion_intents_denied_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventCallout + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied """ # Construct dict forms of any model objects needed in order to build this model. - turn_event_action_source_model = {} # TurnEventActionSource - turn_event_action_source_model['type'] = 'action' - turn_event_action_source_model['action'] = 'testString' - turn_event_action_source_model['action_title'] = 'testString' - turn_event_action_source_model['condition'] = 'testString' - - turn_event_callout_callout_request_model = {} # TurnEventCalloutCalloutRequest - turn_event_callout_callout_request_model['method'] = 'get' - turn_event_callout_callout_request_model['url'] = 'testString' - turn_event_callout_callout_request_model['path'] = 'testString' - turn_event_callout_callout_request_model['query_parameters'] = 'testString' - turn_event_callout_callout_request_model['headers'] = {'anyKey': 'anyValue'} - turn_event_callout_callout_request_model['body'] = {'anyKey': 'anyValue'} - - turn_event_callout_callout_response_model = {} # TurnEventCalloutCalloutResponse - turn_event_callout_callout_response_model['body'] = 'testString' - turn_event_callout_callout_response_model['status_code'] = 38 - turn_event_callout_callout_response_model['last_event'] = {'anyKey': 'anyValue'} - - turn_event_callout_callout_model = {} # TurnEventCalloutCallout - turn_event_callout_callout_model['type'] = 'integration_interaction' - turn_event_callout_callout_model['internal'] = {'anyKey': 'anyValue'} - turn_event_callout_callout_model['result_variable'] = 'testString' - turn_event_callout_callout_model['request'] = turn_event_callout_callout_request_model - turn_event_callout_callout_model['response'] = turn_event_callout_callout_response_model - - turn_event_callout_error_model = {} # TurnEventCalloutError - turn_event_callout_error_model['message'] = 'testString' + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventCallout model - message_output_debug_turn_event_turn_event_callout_model_json = {} - message_output_debug_turn_event_turn_event_callout_model_json['event'] = 'callout' - message_output_debug_turn_event_turn_event_callout_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_callout_model_json['callout'] = turn_event_callout_callout_model - message_output_debug_turn_event_turn_event_callout_model_json['error'] = turn_event_callout_error_model + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied model + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json = {} + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json['event'] = 'suggestion_intents_denied' + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json['intents_denied'] = [runtime_intent_model] - # Construct a model instance of MessageOutputDebugTurnEventTurnEventCallout by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_callout_model = MessageOutputDebugTurnEventTurnEventCallout.from_dict(message_output_debug_turn_event_turn_event_callout_model_json) - assert message_output_debug_turn_event_turn_event_callout_model != False + # Construct a model instance of MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model = MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied.from_dict(message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json) + assert message_output_debug_turn_event_turn_event_suggestion_intents_denied_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventCallout by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_callout_model_dict = MessageOutputDebugTurnEventTurnEventCallout.from_dict(message_output_debug_turn_event_turn_event_callout_model_json).__dict__ - message_output_debug_turn_event_turn_event_callout_model2 = MessageOutputDebugTurnEventTurnEventCallout(**message_output_debug_turn_event_turn_event_callout_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_dict = MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied.from_dict(message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json).__dict__ + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model2 = MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied(**message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_callout_model == message_output_debug_turn_event_turn_event_callout_model2 + assert message_output_debug_turn_event_turn_event_suggestion_intents_denied_model == message_output_debug_turn_event_turn_event_suggestion_intents_denied_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_callout_model_json2 = message_output_debug_turn_event_turn_event_callout_model.to_dict() - assert message_output_debug_turn_event_turn_event_callout_model_json2 == message_output_debug_turn_event_turn_event_callout_model_json + message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json2 = message_output_debug_turn_event_turn_event_suggestion_intents_denied_model.to_dict() + assert message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json2 == message_output_debug_turn_event_turn_event_suggestion_intents_denied_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventHandlerVisited: +class TestModel_MessageOutputDebugTurnEventTurnEventTopicSwitchDenied: """ - Test Class for MessageOutputDebugTurnEventTurnEventHandlerVisited + Test Class for MessageOutputDebugTurnEventTurnEventTopicSwitchDenied """ - def test_message_output_debug_turn_event_turn_event_handler_visited_serialization(self): + def test_message_output_debug_turn_event_turn_event_topic_switch_denied_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventHandlerVisited + Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventTopicSwitchDenied """ # Construct dict forms of any model objects needed in order to build this model. @@ -12448,193 +14898,383 @@ def test_message_output_debug_turn_event_turn_event_handler_visited_serializatio turn_event_action_source_model['action_title'] = 'testString' turn_event_action_source_model['condition'] = 'testString' - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventHandlerVisited model - message_output_debug_turn_event_turn_event_handler_visited_model_json = {} - message_output_debug_turn_event_turn_event_handler_visited_model_json['event'] = 'handler_visited' - message_output_debug_turn_event_turn_event_handler_visited_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_handler_visited_model_json['action_start_time'] = 'testString' + # Construct a json representation of a MessageOutputDebugTurnEventTurnEventTopicSwitchDenied model + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json = {} + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json['event'] = 'topic_switch_denied' + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json['source'] = turn_event_action_source_model + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json['condition_type'] = 'user_defined' + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json['reason'] = 'action_conditions_failed' - # Construct a model instance of MessageOutputDebugTurnEventTurnEventHandlerVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_handler_visited_model = MessageOutputDebugTurnEventTurnEventHandlerVisited.from_dict(message_output_debug_turn_event_turn_event_handler_visited_model_json) - assert message_output_debug_turn_event_turn_event_handler_visited_model != False + # Construct a model instance of MessageOutputDebugTurnEventTurnEventTopicSwitchDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_topic_switch_denied_model = MessageOutputDebugTurnEventTurnEventTopicSwitchDenied.from_dict(message_output_debug_turn_event_turn_event_topic_switch_denied_model_json) + assert message_output_debug_turn_event_turn_event_topic_switch_denied_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventHandlerVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_handler_visited_model_dict = MessageOutputDebugTurnEventTurnEventHandlerVisited.from_dict(message_output_debug_turn_event_turn_event_handler_visited_model_json).__dict__ - message_output_debug_turn_event_turn_event_handler_visited_model2 = MessageOutputDebugTurnEventTurnEventHandlerVisited(**message_output_debug_turn_event_turn_event_handler_visited_model_dict) + # Construct a model instance of MessageOutputDebugTurnEventTurnEventTopicSwitchDenied by calling from_dict on the json representation + message_output_debug_turn_event_turn_event_topic_switch_denied_model_dict = MessageOutputDebugTurnEventTurnEventTopicSwitchDenied.from_dict(message_output_debug_turn_event_turn_event_topic_switch_denied_model_json).__dict__ + message_output_debug_turn_event_turn_event_topic_switch_denied_model2 = MessageOutputDebugTurnEventTurnEventTopicSwitchDenied(**message_output_debug_turn_event_turn_event_topic_switch_denied_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_handler_visited_model == message_output_debug_turn_event_turn_event_handler_visited_model2 + assert message_output_debug_turn_event_turn_event_topic_switch_denied_model == message_output_debug_turn_event_turn_event_topic_switch_denied_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_handler_visited_model_json2 = message_output_debug_turn_event_turn_event_handler_visited_model.to_dict() - assert message_output_debug_turn_event_turn_event_handler_visited_model_json2 == message_output_debug_turn_event_turn_event_handler_visited_model_json + message_output_debug_turn_event_turn_event_topic_switch_denied_model_json2 = message_output_debug_turn_event_turn_event_topic_switch_denied_model.to_dict() + assert message_output_debug_turn_event_turn_event_topic_switch_denied_model_json2 == message_output_debug_turn_event_turn_event_topic_switch_denied_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventNodeVisited: +class TestModel_MessageStreamResponseMessageStreamCompleteItem: """ - Test Class for MessageOutputDebugTurnEventTurnEventNodeVisited + Test Class for MessageStreamResponseMessageStreamCompleteItem """ - def test_message_output_debug_turn_event_turn_event_node_visited_serialization(self): + def test_message_stream_response_message_stream_complete_item_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventNodeVisited + Test serialization/deserialization for MessageStreamResponseMessageStreamCompleteItem """ # Construct dict forms of any model objects needed in order to build this model. - turn_event_node_source_model = {} # TurnEventNodeSource - turn_event_node_source_model['type'] = 'dialog_node' - turn_event_node_source_model['dialog_node'] = 'testString' - turn_event_node_source_model['title'] = 'testString' - turn_event_node_source_model['condition'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventNodeVisited model - message_output_debug_turn_event_turn_event_node_visited_model_json = {} - message_output_debug_turn_event_turn_event_node_visited_model_json['event'] = 'node_visited' - message_output_debug_turn_event_turn_event_node_visited_model_json['source'] = turn_event_node_source_model - message_output_debug_turn_event_turn_event_node_visited_model_json['reason'] = 'welcome' + complete_item_model = {} # CompleteItem + complete_item_model['streaming_metadata'] = metadata_model - # Construct a model instance of MessageOutputDebugTurnEventTurnEventNodeVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_node_visited_model = MessageOutputDebugTurnEventTurnEventNodeVisited.from_dict(message_output_debug_turn_event_turn_event_node_visited_model_json) - assert message_output_debug_turn_event_turn_event_node_visited_model != False + # Construct a json representation of a MessageStreamResponseMessageStreamCompleteItem model + message_stream_response_message_stream_complete_item_model_json = {} + message_stream_response_message_stream_complete_item_model_json['complete_item'] = complete_item_model - # Construct a model instance of MessageOutputDebugTurnEventTurnEventNodeVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_node_visited_model_dict = MessageOutputDebugTurnEventTurnEventNodeVisited.from_dict(message_output_debug_turn_event_turn_event_node_visited_model_json).__dict__ - message_output_debug_turn_event_turn_event_node_visited_model2 = MessageOutputDebugTurnEventTurnEventNodeVisited(**message_output_debug_turn_event_turn_event_node_visited_model_dict) + # Construct a model instance of MessageStreamResponseMessageStreamCompleteItem by calling from_dict on the json representation + message_stream_response_message_stream_complete_item_model = MessageStreamResponseMessageStreamCompleteItem.from_dict(message_stream_response_message_stream_complete_item_model_json) + assert message_stream_response_message_stream_complete_item_model != False + + # Construct a model instance of MessageStreamResponseMessageStreamCompleteItem by calling from_dict on the json representation + message_stream_response_message_stream_complete_item_model_dict = MessageStreamResponseMessageStreamCompleteItem.from_dict(message_stream_response_message_stream_complete_item_model_json).__dict__ + message_stream_response_message_stream_complete_item_model2 = MessageStreamResponseMessageStreamCompleteItem(**message_stream_response_message_stream_complete_item_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_node_visited_model == message_output_debug_turn_event_turn_event_node_visited_model2 + assert message_stream_response_message_stream_complete_item_model == message_stream_response_message_stream_complete_item_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_node_visited_model_json2 = message_output_debug_turn_event_turn_event_node_visited_model.to_dict() - assert message_output_debug_turn_event_turn_event_node_visited_model_json2 == message_output_debug_turn_event_turn_event_node_visited_model_json + message_stream_response_message_stream_complete_item_model_json2 = message_stream_response_message_stream_complete_item_model.to_dict() + assert message_stream_response_message_stream_complete_item_model_json2 == message_stream_response_message_stream_complete_item_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventSearch: +class TestModel_MessageStreamResponseMessageStreamPartialItem: """ - Test Class for MessageOutputDebugTurnEventTurnEventSearch + Test Class for MessageStreamResponseMessageStreamPartialItem """ - def test_message_output_debug_turn_event_turn_event_search_serialization(self): + def test_message_stream_response_message_stream_partial_item_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventSearch + Test serialization/deserialization for MessageStreamResponseMessageStreamPartialItem """ # Construct dict forms of any model objects needed in order to build this model. - turn_event_action_source_model = {} # TurnEventActionSource - turn_event_action_source_model['type'] = 'action' - turn_event_action_source_model['action'] = 'testString' - turn_event_action_source_model['action_title'] = 'testString' - turn_event_action_source_model['condition'] = 'testString' + metadata_model = {} # Metadata + metadata_model['id'] = 38 - turn_event_search_error_model = {} # TurnEventSearchError - turn_event_search_error_model['message'] = 'testString' + partial_item_model = {} # PartialItem + partial_item_model['response_type'] = 'testString' + partial_item_model['text'] = 'testString' + partial_item_model['streaming_metadata'] = metadata_model - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventSearch model - message_output_debug_turn_event_turn_event_search_model_json = {} - message_output_debug_turn_event_turn_event_search_model_json['event'] = 'search' - message_output_debug_turn_event_turn_event_search_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_search_model_json['error'] = turn_event_search_error_model + # Construct a json representation of a MessageStreamResponseMessageStreamPartialItem model + message_stream_response_message_stream_partial_item_model_json = {} + message_stream_response_message_stream_partial_item_model_json['partial_item'] = partial_item_model - # Construct a model instance of MessageOutputDebugTurnEventTurnEventSearch by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_search_model = MessageOutputDebugTurnEventTurnEventSearch.from_dict(message_output_debug_turn_event_turn_event_search_model_json) - assert message_output_debug_turn_event_turn_event_search_model != False + # Construct a model instance of MessageStreamResponseMessageStreamPartialItem by calling from_dict on the json representation + message_stream_response_message_stream_partial_item_model = MessageStreamResponseMessageStreamPartialItem.from_dict(message_stream_response_message_stream_partial_item_model_json) + assert message_stream_response_message_stream_partial_item_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventSearch by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_search_model_dict = MessageOutputDebugTurnEventTurnEventSearch.from_dict(message_output_debug_turn_event_turn_event_search_model_json).__dict__ - message_output_debug_turn_event_turn_event_search_model2 = MessageOutputDebugTurnEventTurnEventSearch(**message_output_debug_turn_event_turn_event_search_model_dict) + # Construct a model instance of MessageStreamResponseMessageStreamPartialItem by calling from_dict on the json representation + message_stream_response_message_stream_partial_item_model_dict = MessageStreamResponseMessageStreamPartialItem.from_dict(message_stream_response_message_stream_partial_item_model_json).__dict__ + message_stream_response_message_stream_partial_item_model2 = MessageStreamResponseMessageStreamPartialItem(**message_stream_response_message_stream_partial_item_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_search_model == message_output_debug_turn_event_turn_event_search_model2 + assert message_stream_response_message_stream_partial_item_model == message_stream_response_message_stream_partial_item_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_search_model_json2 = message_output_debug_turn_event_turn_event_search_model.to_dict() - assert message_output_debug_turn_event_turn_event_search_model_json2 == message_output_debug_turn_event_turn_event_search_model_json + message_stream_response_message_stream_partial_item_model_json2 = message_stream_response_message_stream_partial_item_model.to_dict() + assert message_stream_response_message_stream_partial_item_model_json2 == message_stream_response_message_stream_partial_item_model_json -class TestModel_MessageOutputDebugTurnEventTurnEventStepAnswered: +class TestModel_MessageStreamResponseStatefulMessageStreamFinalResponse: """ - Test Class for MessageOutputDebugTurnEventTurnEventStepAnswered + Test Class for MessageStreamResponseStatefulMessageStreamFinalResponse """ - def test_message_output_debug_turn_event_turn_event_step_answered_serialization(self): + def test_message_stream_response_stateful_message_stream_final_response_serialization(self): """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventStepAnswered + Test serialization/deserialization for MessageStreamResponseStatefulMessageStreamFinalResponse """ # Construct dict forms of any model objects needed in order to build this model. + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + turn_event_action_source_model = {} # TurnEventActionSource turn_event_action_source_model['type'] = 'action' turn_event_action_source_model['action'] = 'testString' turn_event_action_source_model['action_title'] = 'testString' turn_event_action_source_model['condition'] = 'testString' - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventStepAnswered model - message_output_debug_turn_event_turn_event_step_answered_model_json = {} - message_output_debug_turn_event_turn_event_step_answered_model_json['event'] = 'step_answered' - message_output_debug_turn_event_turn_event_step_answered_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_step_answered_model_json['condition_type'] = 'user_defined' - message_output_debug_turn_event_turn_event_step_answered_model_json['action_start_time'] = 'testString' - message_output_debug_turn_event_turn_event_step_answered_model_json['prompted'] = True + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' - # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepAnswered by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_step_answered_model = MessageOutputDebugTurnEventTurnEventStepAnswered.from_dict(message_output_debug_turn_event_turn_event_step_answered_model_json) - assert message_output_debug_turn_event_turn_event_step_answered_model != False + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] - # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepAnswered by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_step_answered_model_dict = MessageOutputDebugTurnEventTurnEventStepAnswered.from_dict(message_output_debug_turn_event_turn_event_step_answered_model_json).__dict__ - message_output_debug_turn_event_turn_event_step_answered_model2 = MessageOutputDebugTurnEventTurnEventStepAnswered(**message_output_debug_turn_event_turn_event_step_answered_model_dict) + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' - # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_step_answered_model == message_output_debug_turn_event_turn_event_step_answered_model2 + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' - # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_step_answered_model_json2 = message_output_debug_turn_event_turn_event_step_answered_model.to_dict() - assert message_output_debug_turn_event_turn_event_step_answered_model_json2 == message_output_debug_turn_event_turn_event_step_answered_model_json + metadata_model = {} # Metadata + metadata_model['id'] = 38 + message_stream_metadata_model = {} # MessageStreamMetadata + message_stream_metadata_model['streaming_metadata'] = metadata_model -class TestModel_MessageOutputDebugTurnEventTurnEventStepVisited: - """ - Test Class for MessageOutputDebugTurnEventTurnEventStepVisited - """ + final_response_output_model = {} # FinalResponseOutput + final_response_output_model['generic'] = [runtime_response_generic_model] + final_response_output_model['intents'] = [runtime_intent_model] + final_response_output_model['entities'] = [runtime_entity_model] + final_response_output_model['actions'] = [dialog_node_action_model] + final_response_output_model['debug'] = message_output_debug_model + final_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + final_response_output_model['spelling'] = message_output_spelling_model + final_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] + final_response_output_model['streaming_metadata'] = message_stream_metadata_model + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + message_context_global_model = {} # MessageContextGlobal + message_context_global_model['system'] = message_context_global_system_model + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + message_context_action_skill_model = {} # MessageContextActionSkill + message_context_action_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['system'] = message_context_skill_system_model + message_context_action_skill_model['action_variables'] = {'anyKey': 'anyValue'} + message_context_action_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + + message_context_skills_model = {} # MessageContextSkills + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model + + message_context_model = {} # MessageContext + message_context_model['global'] = message_context_global_model + message_context_model['skills'] = message_context_skills_model + message_context_model['integrations'] = {'anyKey': 'anyValue'} + + message_output_model = {} # MessageOutput + message_output_model['generic'] = [runtime_response_generic_model] + message_output_model['intents'] = [runtime_intent_model] + message_output_model['entities'] = [runtime_entity_model] + message_output_model['actions'] = [dialog_node_action_model] + message_output_model['debug'] = message_output_debug_model + message_output_model['user_defined'] = {'anyKey': 'anyValue'} + message_output_model['spelling'] = message_output_spelling_model + message_output_model['llm_metadata'] = [message_output_llm_metadata_model] + + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = 'testString' + + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' + + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True - def test_message_output_debug_turn_event_turn_event_step_visited_serialization(self): - """ - Test serialization/deserialization for MessageOutputDebugTurnEventTurnEventStepVisited - """ + message_input_options_model = {} # MessageInputOptions + message_input_options_model['restart'] = False + message_input_options_model['alternate_intents'] = False + message_input_options_model['async_callout'] = False + message_input_options_model['spelling'] = message_input_options_spelling_model + message_input_options_model['debug'] = False + message_input_options_model['return_context'] = False + message_input_options_model['export'] = False - # Construct dict forms of any model objects needed in order to build this model. + message_input_model = {} # MessageInput + message_input_model['message_type'] = 'text' + message_input_model['text'] = 'testString' + message_input_model['intents'] = [runtime_intent_model] + message_input_model['entities'] = [runtime_entity_model] + message_input_model['suggestion_id'] = 'testString' + message_input_model['attachments'] = [message_input_attachment_model] + message_input_model['analytics'] = request_analytics_model + message_input_model['options'] = message_input_options_model - turn_event_action_source_model = {} # TurnEventActionSource - turn_event_action_source_model['type'] = 'action' - turn_event_action_source_model['action'] = 'testString' - turn_event_action_source_model['action_title'] = 'testString' - turn_event_action_source_model['condition'] = 'testString' + final_response_model = {} # FinalResponse + final_response_model['output'] = final_response_output_model + final_response_model['context'] = message_context_model + final_response_model['user_id'] = 'testString' + final_response_model['masked_output'] = message_output_model + final_response_model['masked_input'] = message_input_model - # Construct a json representation of a MessageOutputDebugTurnEventTurnEventStepVisited model - message_output_debug_turn_event_turn_event_step_visited_model_json = {} - message_output_debug_turn_event_turn_event_step_visited_model_json['event'] = 'step_visited' - message_output_debug_turn_event_turn_event_step_visited_model_json['source'] = turn_event_action_source_model - message_output_debug_turn_event_turn_event_step_visited_model_json['condition_type'] = 'user_defined' - message_output_debug_turn_event_turn_event_step_visited_model_json['action_start_time'] = 'testString' - message_output_debug_turn_event_turn_event_step_visited_model_json['has_question'] = True + # Construct a json representation of a MessageStreamResponseStatefulMessageStreamFinalResponse model + message_stream_response_stateful_message_stream_final_response_model_json = {} + message_stream_response_stateful_message_stream_final_response_model_json['final_response'] = final_response_model - # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_step_visited_model = MessageOutputDebugTurnEventTurnEventStepVisited.from_dict(message_output_debug_turn_event_turn_event_step_visited_model_json) - assert message_output_debug_turn_event_turn_event_step_visited_model != False + # Construct a model instance of MessageStreamResponseStatefulMessageStreamFinalResponse by calling from_dict on the json representation + message_stream_response_stateful_message_stream_final_response_model = MessageStreamResponseStatefulMessageStreamFinalResponse.from_dict(message_stream_response_stateful_message_stream_final_response_model_json) + assert message_stream_response_stateful_message_stream_final_response_model != False - # Construct a model instance of MessageOutputDebugTurnEventTurnEventStepVisited by calling from_dict on the json representation - message_output_debug_turn_event_turn_event_step_visited_model_dict = MessageOutputDebugTurnEventTurnEventStepVisited.from_dict(message_output_debug_turn_event_turn_event_step_visited_model_json).__dict__ - message_output_debug_turn_event_turn_event_step_visited_model2 = MessageOutputDebugTurnEventTurnEventStepVisited(**message_output_debug_turn_event_turn_event_step_visited_model_dict) + # Construct a model instance of MessageStreamResponseStatefulMessageStreamFinalResponse by calling from_dict on the json representation + message_stream_response_stateful_message_stream_final_response_model_dict = MessageStreamResponseStatefulMessageStreamFinalResponse.from_dict(message_stream_response_stateful_message_stream_final_response_model_json).__dict__ + message_stream_response_stateful_message_stream_final_response_model2 = MessageStreamResponseStatefulMessageStreamFinalResponse(**message_stream_response_stateful_message_stream_final_response_model_dict) # Verify the model instances are equivalent - assert message_output_debug_turn_event_turn_event_step_visited_model == message_output_debug_turn_event_turn_event_step_visited_model2 + assert message_stream_response_stateful_message_stream_final_response_model == message_stream_response_stateful_message_stream_final_response_model2 # Convert model instance back to dict and verify no loss of data - message_output_debug_turn_event_turn_event_step_visited_model_json2 = message_output_debug_turn_event_turn_event_step_visited_model.to_dict() - assert message_output_debug_turn_event_turn_event_step_visited_model_json2 == message_output_debug_turn_event_turn_event_step_visited_model_json + message_stream_response_stateful_message_stream_final_response_model_json2 = message_stream_response_stateful_message_stream_final_response_model.to_dict() + assert message_stream_response_stateful_message_stream_final_response_model_json2 == message_stream_response_stateful_message_stream_final_response_model_json class TestModel_ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode: @@ -13105,6 +15745,72 @@ def test_runtime_response_generic_runtime_response_type_connect_to_agent_seriali assert runtime_response_generic_runtime_response_type_connect_to_agent_model_json2 == runtime_response_generic_runtime_response_type_connect_to_agent_model_json +class TestModel_RuntimeResponseGenericRuntimeResponseTypeConversationalSearch: + """ + Test Class for RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + """ + + def test_runtime_response_generic_runtime_response_type_conversational_search_serialization(self): + """ + Test serialization/deserialization for RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + # Construct a json representation of a RuntimeResponseGenericRuntimeResponseTypeConversationalSearch model + runtime_response_generic_runtime_response_type_conversational_search_model_json = {} + runtime_response_generic_runtime_response_type_conversational_search_model_json['response_type'] = 'conversation_search' + runtime_response_generic_runtime_response_type_conversational_search_model_json['text'] = 'testString' + runtime_response_generic_runtime_response_type_conversational_search_model_json['citations_title'] = 'testString' + runtime_response_generic_runtime_response_type_conversational_search_model_json['citations'] = [response_generic_citation_model] + runtime_response_generic_runtime_response_type_conversational_search_model_json['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_runtime_response_type_conversational_search_model_json['response_length_option'] = 'testString' + runtime_response_generic_runtime_response_type_conversational_search_model_json['search_results'] = [search_results_model] + runtime_response_generic_runtime_response_type_conversational_search_model_json['disclaimer'] = 'testString' + + # Construct a model instance of RuntimeResponseGenericRuntimeResponseTypeConversationalSearch by calling from_dict on the json representation + runtime_response_generic_runtime_response_type_conversational_search_model = RuntimeResponseGenericRuntimeResponseTypeConversationalSearch.from_dict(runtime_response_generic_runtime_response_type_conversational_search_model_json) + assert runtime_response_generic_runtime_response_type_conversational_search_model != False + + # Construct a model instance of RuntimeResponseGenericRuntimeResponseTypeConversationalSearch by calling from_dict on the json representation + runtime_response_generic_runtime_response_type_conversational_search_model_dict = RuntimeResponseGenericRuntimeResponseTypeConversationalSearch.from_dict(runtime_response_generic_runtime_response_type_conversational_search_model_json).__dict__ + runtime_response_generic_runtime_response_type_conversational_search_model2 = RuntimeResponseGenericRuntimeResponseTypeConversationalSearch(**runtime_response_generic_runtime_response_type_conversational_search_model_dict) + + # Verify the model instances are equivalent + assert runtime_response_generic_runtime_response_type_conversational_search_model == runtime_response_generic_runtime_response_type_conversational_search_model2 + + # Convert model instance back to dict and verify no loss of data + runtime_response_generic_runtime_response_type_conversational_search_model_json2 = runtime_response_generic_runtime_response_type_conversational_search_model.to_dict() + assert runtime_response_generic_runtime_response_type_conversational_search_model_json2 == runtime_response_generic_runtime_response_type_conversational_search_model_json + + class TestModel_RuntimeResponseGenericRuntimeResponseTypeDate: """ Test Class for RuntimeResponseGenericRuntimeResponseTypeDate @@ -13697,6 +16403,315 @@ def test_runtime_response_generic_runtime_response_type_video_serialization(self assert runtime_response_generic_runtime_response_type_video_model_json2 == runtime_response_generic_runtime_response_type_video_model_json +class TestModel_StatelessMessageStreamResponseMessageStreamCompleteItem: + """ + Test Class for StatelessMessageStreamResponseMessageStreamCompleteItem + """ + + def test_stateless_message_stream_response_message_stream_complete_item_serialization(self): + """ + Test serialization/deserialization for StatelessMessageStreamResponseMessageStreamCompleteItem + """ + + # Construct dict forms of any model objects needed in order to build this model. + + metadata_model = {} # Metadata + metadata_model['id'] = 38 + + complete_item_model = {} # CompleteItem + complete_item_model['streaming_metadata'] = metadata_model + + # Construct a json representation of a StatelessMessageStreamResponseMessageStreamCompleteItem model + stateless_message_stream_response_message_stream_complete_item_model_json = {} + stateless_message_stream_response_message_stream_complete_item_model_json['complete_item'] = complete_item_model + + # Construct a model instance of StatelessMessageStreamResponseMessageStreamCompleteItem by calling from_dict on the json representation + stateless_message_stream_response_message_stream_complete_item_model = StatelessMessageStreamResponseMessageStreamCompleteItem.from_dict(stateless_message_stream_response_message_stream_complete_item_model_json) + assert stateless_message_stream_response_message_stream_complete_item_model != False + + # Construct a model instance of StatelessMessageStreamResponseMessageStreamCompleteItem by calling from_dict on the json representation + stateless_message_stream_response_message_stream_complete_item_model_dict = StatelessMessageStreamResponseMessageStreamCompleteItem.from_dict(stateless_message_stream_response_message_stream_complete_item_model_json).__dict__ + stateless_message_stream_response_message_stream_complete_item_model2 = StatelessMessageStreamResponseMessageStreamCompleteItem(**stateless_message_stream_response_message_stream_complete_item_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_stream_response_message_stream_complete_item_model == stateless_message_stream_response_message_stream_complete_item_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_stream_response_message_stream_complete_item_model_json2 = stateless_message_stream_response_message_stream_complete_item_model.to_dict() + assert stateless_message_stream_response_message_stream_complete_item_model_json2 == stateless_message_stream_response_message_stream_complete_item_model_json + + +class TestModel_StatelessMessageStreamResponseMessageStreamPartialItem: + """ + Test Class for StatelessMessageStreamResponseMessageStreamPartialItem + """ + + def test_stateless_message_stream_response_message_stream_partial_item_serialization(self): + """ + Test serialization/deserialization for StatelessMessageStreamResponseMessageStreamPartialItem + """ + + # Construct dict forms of any model objects needed in order to build this model. + + metadata_model = {} # Metadata + metadata_model['id'] = 38 + + partial_item_model = {} # PartialItem + partial_item_model['response_type'] = 'testString' + partial_item_model['text'] = 'testString' + partial_item_model['streaming_metadata'] = metadata_model + + # Construct a json representation of a StatelessMessageStreamResponseMessageStreamPartialItem model + stateless_message_stream_response_message_stream_partial_item_model_json = {} + stateless_message_stream_response_message_stream_partial_item_model_json['partial_item'] = partial_item_model + + # Construct a model instance of StatelessMessageStreamResponseMessageStreamPartialItem by calling from_dict on the json representation + stateless_message_stream_response_message_stream_partial_item_model = StatelessMessageStreamResponseMessageStreamPartialItem.from_dict(stateless_message_stream_response_message_stream_partial_item_model_json) + assert stateless_message_stream_response_message_stream_partial_item_model != False + + # Construct a model instance of StatelessMessageStreamResponseMessageStreamPartialItem by calling from_dict on the json representation + stateless_message_stream_response_message_stream_partial_item_model_dict = StatelessMessageStreamResponseMessageStreamPartialItem.from_dict(stateless_message_stream_response_message_stream_partial_item_model_json).__dict__ + stateless_message_stream_response_message_stream_partial_item_model2 = StatelessMessageStreamResponseMessageStreamPartialItem(**stateless_message_stream_response_message_stream_partial_item_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_stream_response_message_stream_partial_item_model == stateless_message_stream_response_message_stream_partial_item_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_stream_response_message_stream_partial_item_model_json2 = stateless_message_stream_response_message_stream_partial_item_model.to_dict() + assert stateless_message_stream_response_message_stream_partial_item_model_json2 == stateless_message_stream_response_message_stream_partial_item_model_json + + +class TestModel_StatelessMessageStreamResponseStatelessMessageStreamFinalResponse: + """ + Test Class for StatelessMessageStreamResponseStatelessMessageStreamFinalResponse + """ + + def test_stateless_message_stream_response_stateless_message_stream_final_response_serialization(self): + """ + Test serialization/deserialization for StatelessMessageStreamResponseStatelessMessageStreamFinalResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_generic_citation_ranges_item_model = {} # ResponseGenericCitationRangesItem + response_generic_citation_ranges_item_model['start'] = 38 + response_generic_citation_ranges_item_model['end'] = 38 + + response_generic_citation_model = {} # ResponseGenericCitation + response_generic_citation_model['title'] = 'testString' + response_generic_citation_model['text'] = 'testString' + response_generic_citation_model['body'] = 'testString' + response_generic_citation_model['search_result_index'] = 38 + response_generic_citation_model['ranges'] = [response_generic_citation_ranges_item_model] + + response_generic_confidence_scores_model = {} # ResponseGenericConfidenceScores + response_generic_confidence_scores_model['threshold'] = 72.5 + response_generic_confidence_scores_model['pre_gen'] = 72.5 + response_generic_confidence_scores_model['post_gen'] = 72.5 + response_generic_confidence_scores_model['extractiveness'] = 72.5 + + search_results_result_metadata_model = {} # SearchResultsResultMetadata + search_results_result_metadata_model['document_retrieval_source'] = 'testString' + search_results_result_metadata_model['score'] = 38 + + search_results_model = {} # SearchResults + search_results_model['result_metadata'] = search_results_result_metadata_model + search_results_model['id'] = 'testString' + search_results_model['title'] = 'testString' + search_results_model['body'] = 'testString' + + runtime_response_generic_model = {} # RuntimeResponseGenericRuntimeResponseTypeConversationalSearch + runtime_response_generic_model['response_type'] = 'conversation_search' + runtime_response_generic_model['text'] = 'testString' + runtime_response_generic_model['citations_title'] = 'testString' + runtime_response_generic_model['citations'] = [response_generic_citation_model] + runtime_response_generic_model['confidence_scores'] = response_generic_confidence_scores_model + runtime_response_generic_model['response_length_option'] = 'testString' + runtime_response_generic_model['search_results'] = [search_results_model] + runtime_response_generic_model['disclaimer'] = 'testString' + + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' + + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] + + runtime_entity_interpretation_model = {} # RuntimeEntityInterpretation + runtime_entity_interpretation_model['calendar_type'] = 'testString' + runtime_entity_interpretation_model['datetime_link'] = 'testString' + runtime_entity_interpretation_model['festival'] = 'testString' + runtime_entity_interpretation_model['granularity'] = 'day' + runtime_entity_interpretation_model['range_link'] = 'testString' + runtime_entity_interpretation_model['range_modifier'] = 'testString' + runtime_entity_interpretation_model['relative_day'] = 72.5 + runtime_entity_interpretation_model['relative_month'] = 72.5 + runtime_entity_interpretation_model['relative_week'] = 72.5 + runtime_entity_interpretation_model['relative_weekend'] = 72.5 + runtime_entity_interpretation_model['relative_year'] = 72.5 + runtime_entity_interpretation_model['specific_day'] = 72.5 + runtime_entity_interpretation_model['specific_day_of_week'] = 'testString' + runtime_entity_interpretation_model['specific_month'] = 72.5 + runtime_entity_interpretation_model['specific_quarter'] = 72.5 + runtime_entity_interpretation_model['specific_year'] = 72.5 + runtime_entity_interpretation_model['numeric_value'] = 72.5 + runtime_entity_interpretation_model['subtype'] = 'testString' + runtime_entity_interpretation_model['part_of_day'] = 'testString' + runtime_entity_interpretation_model['relative_hour'] = 72.5 + runtime_entity_interpretation_model['relative_minute'] = 72.5 + runtime_entity_interpretation_model['relative_second'] = 72.5 + runtime_entity_interpretation_model['specific_hour'] = 72.5 + runtime_entity_interpretation_model['specific_minute'] = 72.5 + runtime_entity_interpretation_model['specific_second'] = 72.5 + runtime_entity_interpretation_model['timezone'] = 'testString' + + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 + + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' + + runtime_entity_model = {} # RuntimeEntity + runtime_entity_model['entity'] = 'testString' + runtime_entity_model['location'] = [38] + runtime_entity_model['value'] = 'testString' + runtime_entity_model['confidence'] = 72.5 + runtime_entity_model['groups'] = [capture_group_model] + runtime_entity_model['interpretation'] = runtime_entity_interpretation_model + runtime_entity_model['alternatives'] = [runtime_entity_alternative_model] + runtime_entity_model['role'] = runtime_entity_role_model + runtime_entity_model['skill'] = 'testString' + + dialog_node_action_model = {} # DialogNodeAction + dialog_node_action_model['name'] = 'testString' + dialog_node_action_model['type'] = 'client' + dialog_node_action_model['parameters'] = {'anyKey': 'anyValue'} + dialog_node_action_model['result_variable'] = 'testString' + dialog_node_action_model['credentials'] = 'testString' + + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' + + log_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = 'testString' + + dialog_log_message_model = {} # DialogLogMessage + dialog_log_message_model['level'] = 'info' + dialog_log_message_model['message'] = 'testString' + dialog_log_message_model['code'] = 'testString' + dialog_log_message_model['source'] = log_message_source_model + + turn_event_action_source_model = {} # TurnEventActionSource + turn_event_action_source_model['type'] = 'action' + turn_event_action_source_model['action'] = 'testString' + turn_event_action_source_model['action_title'] = 'testString' + turn_event_action_source_model['condition'] = 'testString' + + message_output_debug_turn_event_model = {} # MessageOutputDebugTurnEventTurnEventActionVisited + message_output_debug_turn_event_model['event'] = 'action_visited' + message_output_debug_turn_event_model['source'] = turn_event_action_source_model + message_output_debug_turn_event_model['action_start_time'] = 'testString' + message_output_debug_turn_event_model['condition_type'] = 'user_defined' + message_output_debug_turn_event_model['reason'] = 'intent' + message_output_debug_turn_event_model['result_variable'] = 'testString' + + message_output_debug_model = {} # MessageOutputDebug + message_output_debug_model['nodes_visited'] = [dialog_node_visited_model] + message_output_debug_model['log_messages'] = [dialog_log_message_model] + message_output_debug_model['branch_exited'] = True + message_output_debug_model['branch_exited_reason'] = 'completed' + message_output_debug_model['turn_events'] = [message_output_debug_turn_event_model] + + message_output_spelling_model = {} # MessageOutputSpelling + message_output_spelling_model['text'] = 'testString' + message_output_spelling_model['original_text'] = 'testString' + message_output_spelling_model['suggested_text'] = 'testString' + + message_output_llm_metadata_model = {} # MessageOutputLLMMetadata + message_output_llm_metadata_model['task'] = 'testString' + message_output_llm_metadata_model['model_id'] = 'testString' + + message_context_global_system_model = {} # MessageContextGlobalSystem + message_context_global_system_model['timezone'] = 'testString' + message_context_global_system_model['user_id'] = 'testString' + message_context_global_system_model['turn_count'] = 38 + message_context_global_system_model['locale'] = 'en-us' + message_context_global_system_model['reference_time'] = 'testString' + message_context_global_system_model['session_start_time'] = 'testString' + message_context_global_system_model['state'] = 'testString' + message_context_global_system_model['skip_user_input'] = True + + stateless_message_context_global_model = {} # StatelessMessageContextGlobal + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' + + message_context_skill_system_model = {} # MessageContextSkillSystem + message_context_skill_system_model['state'] = 'testString' + message_context_skill_system_model['foo'] = 'testString' + + message_context_dialog_skill_model = {} # MessageContextDialogSkill + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + stateless_message_context_skills_actions_skill_model = {} # StatelessMessageContextSkillsActionsSkill + stateless_message_context_skills_actions_skill_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['system'] = message_context_skill_system_model + stateless_message_context_skills_actions_skill_model['action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['skill_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_action_variables'] = {'anyKey': 'anyValue'} + stateless_message_context_skills_actions_skill_model['private_skill_variables'] = {'anyKey': 'anyValue'} + + stateless_message_context_skills_model = {} # StatelessMessageContextSkills + stateless_message_context_skills_model['main skill'] = message_context_dialog_skill_model + stateless_message_context_skills_model['actions skill'] = stateless_message_context_skills_actions_skill_model + + stateless_message_context_model = {} # StatelessMessageContext + stateless_message_context_model['global'] = stateless_message_context_global_model + stateless_message_context_model['skills'] = stateless_message_context_skills_model + stateless_message_context_model['integrations'] = {'anyKey': 'anyValue'} + + stateless_final_response_output_model = {} # StatelessFinalResponseOutput + stateless_final_response_output_model['generic'] = [runtime_response_generic_model] + stateless_final_response_output_model['intents'] = [runtime_intent_model] + stateless_final_response_output_model['entities'] = [runtime_entity_model] + stateless_final_response_output_model['actions'] = [dialog_node_action_model] + stateless_final_response_output_model['debug'] = message_output_debug_model + stateless_final_response_output_model['user_defined'] = {'anyKey': 'anyValue'} + stateless_final_response_output_model['spelling'] = message_output_spelling_model + stateless_final_response_output_model['llm_metadata'] = [message_output_llm_metadata_model] + stateless_final_response_output_model['streaming_metadata'] = stateless_message_context_model + + stateless_final_response_model = {} # StatelessFinalResponse + stateless_final_response_model['output'] = stateless_final_response_output_model + stateless_final_response_model['context'] = stateless_message_context_model + stateless_final_response_model['user_id'] = 'testString' + + # Construct a json representation of a StatelessMessageStreamResponseStatelessMessageStreamFinalResponse model + stateless_message_stream_response_stateless_message_stream_final_response_model_json = {} + stateless_message_stream_response_stateless_message_stream_final_response_model_json['final_response'] = stateless_final_response_model + + # Construct a model instance of StatelessMessageStreamResponseStatelessMessageStreamFinalResponse by calling from_dict on the json representation + stateless_message_stream_response_stateless_message_stream_final_response_model = StatelessMessageStreamResponseStatelessMessageStreamFinalResponse.from_dict(stateless_message_stream_response_stateless_message_stream_final_response_model_json) + assert stateless_message_stream_response_stateless_message_stream_final_response_model != False + + # Construct a model instance of StatelessMessageStreamResponseStatelessMessageStreamFinalResponse by calling from_dict on the json representation + stateless_message_stream_response_stateless_message_stream_final_response_model_dict = StatelessMessageStreamResponseStatelessMessageStreamFinalResponse.from_dict(stateless_message_stream_response_stateless_message_stream_final_response_model_json).__dict__ + stateless_message_stream_response_stateless_message_stream_final_response_model2 = StatelessMessageStreamResponseStatelessMessageStreamFinalResponse(**stateless_message_stream_response_stateless_message_stream_final_response_model_dict) + + # Verify the model instances are equivalent + assert stateless_message_stream_response_stateless_message_stream_final_response_model == stateless_message_stream_response_stateless_message_stream_final_response_model2 + + # Convert model instance back to dict and verify no loss of data + stateless_message_stream_response_stateless_message_stream_final_response_model_json2 = stateless_message_stream_response_stateless_message_stream_final_response_model.to_dict() + assert stateless_message_stream_response_stateless_message_stream_final_response_model_json2 == stateless_message_stream_response_stateless_message_stream_final_response_model_json + + # endregion ############################################################################## # End of Model Tests