diff --git a/ibm_watson/assistant_v2.py b/ibm_watson/assistant_v2.py index bcb616c0..764f567f 100644 --- a/ibm_watson/assistant_v2.py +++ b/ibm_watson/assistant_v2.py @@ -530,8 +530,8 @@ def message_stateless( self, assistant_id: str, *, - input: Optional['MessageInputStateless'] = None, - context: Optional['MessageContextStateless'] = None, + input: Optional['StatelessMessageInput'] = None, + context: Optional['StatelessMessageContext'] = None, user_id: Optional[str] = None, **kwargs, ) -> DetailedResponse: @@ -4233,9 +4233,9 @@ class Log: Log. :param str log_id: A unique identifier for the logged event. - :param MessageRequest request: A stateful message request formatted for the - Watson Assistant service. - :param MessageResponse response: A response from the Watson Assistant service. + :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 @@ -4254,8 +4254,8 @@ class Log: def __init__( self, log_id: str, - request: 'MessageRequest', - response: 'MessageResponse', + request: 'LogRequest', + response: 'LogResponse', assistant_id: str, session_id: str, skill_id: str, @@ -4270,10 +4270,9 @@ def __init__( Initialize a Log object. :param str log_id: A unique identifier for the logged event. - :param MessageRequest request: A stateful message request formatted for the - Watson Assistant service. - :param MessageResponse response: A response from the Watson Assistant - service. + :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 @@ -4310,12 +4309,12 @@ def from_dict(cls, _dict: Dict) -> 'Log': raise ValueError( 'Required property \'log_id\' not present in Log JSON') if (request := _dict.get('request')) is not None: - args['request'] = MessageRequest.from_dict(request) + 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'] = MessageResponse.from_dict(response) + args['response'] = LogResponse.from_dict(response) else: raise ValueError( 'Required property \'response\' not present in Log JSON') @@ -4640,73 +4639,95 @@ def __ne__(self, other: 'LogPagination') -> bool: 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): @@ -4714,70 +4735,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 MessageContextGlobal: +class LogRequestInput: """ - Session context data that is shared by all skills used by the assistant. + An input object that includes the input text. 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 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, *, - system: Optional['MessageContextGlobalSystem'] = None, - session_id: 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['MessageInputOptions'] = None, ) -> None: """ - Initialize a MessageContextGlobal object. + Initialize a LogRequestInput object. - :param MessageContextGlobalSystem system: (optional) Built-in system - properties that apply to 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. """ - self.system = system - self.session_id = session_id + 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) -> 'MessageContextGlobal': - """Initialize a MessageContextGlobal object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogRequestInput': + """Initialize a LogRequestInput 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_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 MessageContextGlobal 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, '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, 'session_id') and getattr(self, - 'session_id') is not None: - _dict['session_id'] = getattr(self, 'session_id') + _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): @@ -4785,70 +4911,126 @@ 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 LogRequestInput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextGlobal') -> 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: 'MessageContextGlobal') -> bool: + def __ne__(self, other: 'LogRequestInput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class MessageContextGlobalStateless: - """ - Session context data that is shared by all skills used by the assistant. - - :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. + 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 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. """ def __init__( self, + output: 'LogResponseOutput', + user_id: str, *, - system: Optional['MessageContextGlobalSystem'] = None, - session_id: Optional[str] = None, + context: Optional['MessageContext'] = None, ) -> None: """ - Initialize a MessageContextGlobalStateless object. + Initialize a LogResponse 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 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.system = system - self.session_id = session_id + self.output = output + self.context = context + self.user_id = user_id @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalStateless': - """Initialize a MessageContextGlobalStateless object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogResponse': + """Initialize a LogResponse 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 (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 MessageContextGlobalStateless 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, '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() - if hasattr(self, 'session_id') and self.session_id is not None: - _dict['session_id'] = self.session_id + _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): @@ -4856,196 +5038,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextGlobalStateless object.""" + """Return a `str` version of this LogResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextGlobalStateless') -> 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: 'MessageContextGlobalStateless') -> bool: + def __ne__(self, other: 'LogResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextGlobalSystem: +class LogResponseOutput: """ - Built-in system properties that apply to all skills used by the assistant. + Assistant output to be rendered or processed by the client. All private data is masked + or removed. - :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 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, *, - 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, + 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, ) -> None: """ - Initialize a MessageContextGlobalSystem object. + Initialize a LogResponseOutput 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 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. """ - 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.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions + self.debug = debug + self.user_defined = user_defined + self.spelling = spelling @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalSystem': - """Initialize a MessageContextGlobalSystem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LogResponseOutput': + """Initialize a LogResponseOutput 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 (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) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextGlobalSystem 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, '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, '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() return _dict def _to_dict(self): @@ -5053,49 +5196,112 @@ 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 LogResponseOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextGlobalSystem') -> 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: 'MessageContextGlobalSystem') -> bool: + def __ne__(self, other: 'LogResponseOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LocaleEnum(str, Enum): + +class MessageContext: + """ + MessageContext. + + :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, + *, + global_: Optional['MessageContextGlobal'] = None, + skills: Optional['MessageContextSkills'] = None, + integrations: Optional[dict] = None, + ) -> None: """ - 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. + Initialize a MessageContext 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). """ + self.global_ = global_ + self.skills = skills + self.integrations = integrations - 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' + @classmethod + def from_dict(cls, _dict: Dict) -> 'MessageContext': + """Initialize a MessageContext 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 + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, '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): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this MessageContext object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'MessageContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class MessageContextSkillAction: +class MessageContextActionSkill: """ - Context variables that are used by the action skill. + 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. @@ -5105,7 +5311,7 @@ class MessageContextSkillAction: 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 Watson Assistant user interface, skill variables are called _session + (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. """ @@ -5119,7 +5325,7 @@ def __init__( skill_variables: Optional[dict] = None, ) -> None: """ - Initialize a MessageContextSkillAction object. + Initialize a MessageContextActionSkill object. :param dict user_defined: (optional) An object containing any arbitrary variables that can be read and written by a particular skill. @@ -5129,7 +5335,7 @@ def __init__( 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 Watson Assistant user interface, skill variables are + 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. """ @@ -5139,8 +5345,8 @@ def __init__( self.skill_variables = skill_variables @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextSkillAction': - """Initialize a MessageContextSkillAction object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextActionSkill': + """Initialize a MessageContextActionSkill object from a json dictionary.""" args = {} if (user_defined := _dict.get('user_defined')) is not None: args['user_defined'] = user_defined @@ -5154,7 +5360,7 @@ def from_dict(cls, _dict: Dict) -> 'MessageContextSkillAction': @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextSkillAction object from a json dictionary.""" + """Initialize a MessageContextActionSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -5180,21 +5386,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextSkillAction object.""" + """Return a `str` version of this MessageContextActionSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkillAction') -> 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: 'MessageContextSkillAction') -> bool: + def __ne__(self, other: 'MessageContextActionSkill') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextSkillDialog: +class MessageContextDialogSkill: """ Context variables that are used by the dialog skill. @@ -5211,7 +5417,7 @@ def __init__( system: Optional['MessageContextSkillSystem'] = None, ) -> None: """ - Initialize a MessageContextSkillDialog object. + Initialize a MessageContextDialogSkill object. :param dict user_defined: (optional) An object containing any arbitrary variables that can be read and written by a particular skill. @@ -5222,8 +5428,8 @@ def __init__( self.system = system @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextSkillDialog': - """Initialize a MessageContextSkillDialog object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextDialogSkill': + """Initialize a MessageContextDialogSkill object from a json dictionary.""" args = {} if (user_defined := _dict.get('user_defined')) is not None: args['user_defined'] = user_defined @@ -5233,7 +5439,7 @@ def from_dict(cls, _dict: Dict) -> 'MessageContextSkillDialog': @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextSkillDialog object from a json dictionary.""" + """Initialize a MessageContextDialogSkill object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -5253,179 +5459,267 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextSkillDialog object.""" + """Return a `str` version of this MessageContextDialogSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkillDialog') -> 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: 'MessageContextSkillDialog') -> bool: + def __ne__(self, other: 'MessageContextDialogSkill') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextSkillSystem: +class MessageContextGlobal: """ - System context data used by the skill. + Session context data that is shared by all skills used by the assistant. - :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 MessageContextGlobalSystem system: (optional) Built-in system properties + that apply to all skills used by the assistant. + :param str session_id: (optional) The session ID. """ - # The set of defined properties for the class - _properties = frozenset(['state']) - def __init__( self, *, - state: Optional[str] = None, - **kwargs, + system: Optional['MessageContextGlobalSystem'] = None, + session_id: Optional[str] = None, ) -> None: """ - Initialize a MessageContextSkillSystem object. + Initialize a MessageContextGlobal 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 **kwargs: (optional) Any additional properties. + :param MessageContextGlobalSystem system: (optional) Built-in system + properties that apply to all skills used by the assistant. """ - self.state = state - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + self.system = system + self.session_id = session_id @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextSkillSystem': - """Initialize a MessageContextSkillSystem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextGlobal': + """Initialize a MessageContextGlobal object from a json dictionary.""" args = {} - if (state := _dict.get('state')) is not None: - args['state'] = state - args.update( - {k: v for (k, v) in _dict.items() if k not in cls._properties}) + 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 MessageContextSkillSystem 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, 'state') and self.state is not None: - _dict['state'] = self.state - for _key in [ - k for k in vars(self).keys() - if k not in MessageContextSkillSystem._properties - ]: - _dict[_key] = getattr(self, _key) + 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 getattr(self, + 'session_id') is not None: + _dict['session_id'] = getattr(self, 'session_id') return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() - def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of MessageContextSkillSystem""" - _dict = {} - - for _key in [ - k for k in vars(self).keys() - if k not in MessageContextSkillSystem._properties - ]: - _dict[_key] = getattr(self, _key) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of MessageContextSkillSystem""" - for _key in [ - k for k in vars(self).keys() - if k not in MessageContextSkillSystem._properties - ]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in MessageContextSkillSystem._properties: - setattr(self, _key, _value) - def __str__(self) -> str: - """Return a `str` version of this MessageContextSkillSystem object.""" + """Return a `str` version of this MessageContextGlobal object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkillSystem') -> 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: 'MessageContextSkillSystem') -> bool: + def __ne__(self, other: 'MessageContextGlobal') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageContextSkills: +class MessageContextGlobalSystem: """ - Context data specific to particular skills used by the assistant. + Built-in system properties that apply to all skills used by the assistant. - :param MessageContextSkillDialog main_skill: (optional) Context variables that - are used by the dialog skill. - :param MessageContextSkillAction actions_skill: (optional) Context variables - that are used by the action skill. + :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, *, - main_skill: Optional['MessageContextSkillDialog'] = None, - actions_skill: Optional['MessageContextSkillAction'] = None, + 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 MessageContextSkills object. + Initialize a MessageContextGlobalSystem object. - :param MessageContextSkillDialog main_skill: (optional) Context variables - that are used by the dialog skill. - :param MessageContextSkillAction actions_skill: (optional) Context - variables that are used by the action skill. + :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.main_skill = main_skill - self.actions_skill = actions_skill + 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) -> 'MessageContextSkills': - """Initialize a MessageContextSkills object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalSystem': + """Initialize a MessageContextGlobalSystem object from a json dictionary.""" args = {} - if (main_skill := _dict.get('main skill')) is not None: - args['main_skill'] = MessageContextSkillDialog.from_dict(main_skill) - if (actions_skill := _dict.get('actions skill')) is not None: - args['actions_skill'] = MessageContextSkillAction.from_dict( - actions_skill) + 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 MessageContextSkills 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, '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, '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): @@ -5433,87 +5727,207 @@ 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 MessageContextGlobalSystem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextSkills') -> 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: 'MessageContextSkills') -> 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. + """ + + 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 MessageContextStateless: - """ - MessageContextStateless. - :param MessageContextGlobalStateless 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). +class MessageContextSkillSystem: """ + 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. + """ + + # The set of defined properties for the class + _properties = frozenset(['state']) def __init__( self, *, - global_: Optional['MessageContextGlobalStateless'] = None, - skills: Optional['MessageContextSkills'] = None, - integrations: Optional[dict] = None, + state: Optional[str] = None, + **kwargs, ) -> None: """ - Initialize a MessageContextStateless object. + Initialize a MessageContextSkillSystem object. - :param MessageContextGlobalStateless 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 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 **kwargs: (optional) Any additional properties. """ - self.global_ = global_ - self.skills = skills - self.integrations = integrations + self.state = state + for _key, _value in kwargs.items(): + setattr(self, _key, _value) @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageContextStateless': - """Initialize a MessageContextStateless object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageContextSkillSystem': + """Initialize a MessageContextSkillSystem object from a json dictionary.""" args = {} - if (global_ := _dict.get('global')) is not None: - args['global_'] = MessageContextGlobalStateless.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 (state := _dict.get('state')) is not None: + args['state'] = state + args.update( + {k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageContextStateless 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, 'global_') and self.global_ is not None: - if isinstance(self.global_, dict): - _dict['global'] = self.global_ + if hasattr(self, 'state') and self.state is not None: + _dict['state'] = self.state + for _key in [ + k for k in vars(self).keys() + if k not in MessageContextSkillSystem._properties + ]: + _dict[_key] = getattr(self, _key) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def get_properties(self) -> Dict: + """Return a dictionary of arbitrary properties from this instance of MessageContextSkillSystem""" + _dict = {} + + for _key in [ + k for k in vars(self).keys() + if k not in MessageContextSkillSystem._properties + ]: + _dict[_key] = getattr(self, _key) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of arbitrary properties to this instance of MessageContextSkillSystem""" + for _key in [ + k for k in vars(self).keys() + if k not in MessageContextSkillSystem._properties + ]: + delattr(self, _key) + + for _key, _value in _dict.items(): + if _key not in MessageContextSkillSystem._properties: + setattr(self, _key, _value) + + def __str__(self) -> str: + """Return a `str` version of this MessageContextSkillSystem object.""" + return json.dumps(self.to_dict(), indent=2) + + 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: 'MessageContextSkillSystem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class MessageContextSkills: + """ + Context data specific to particular skills used by the assistant. + + :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, + *, + main_skill: Optional['MessageContextDialogSkill'] = None, + actions_skill: Optional['MessageContextActionSkill'] = None, + ) -> None: + """ + Initialize a MessageContextSkills 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 + + @classmethod + def from_dict(cls, _dict: Dict) -> 'MessageContextSkills': + """Initialize a MessageContextSkills 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) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """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, 'main_skill') and self.main_skill is not None: + if isinstance(self.main_skill, dict): + _dict['main skill'] = self.main_skill 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['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['skills'] = self.skills.to_dict() - if hasattr(self, 'integrations') and self.integrations is not None: - _dict['integrations'] = self.integrations + _dict['actions skill'] = self.actions_skill.to_dict() return _dict def _to_dict(self): @@ -5521,16 +5935,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageContextStateless object.""" + """Return a `str` version of this MessageContextSkills object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageContextStateless') -> 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: 'MessageContextStateless') -> bool: + def __ne__(self, other: 'MessageContextSkills') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -6039,85 +6453,142 @@ def __ne__(self, other: 'MessageInputOptionsSpelling') -> bool: return not self == other -class MessageInputOptionsStateless: +class MessageOutput: """ - Optional properties that control how the assistant responds. + Assistant output to be rendered or processed by the client. - :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 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 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, *, - restart: Optional[bool] = None, - alternate_intents: Optional[bool] = None, - spelling: Optional['MessageInputOptionsSpelling'] = None, - debug: Optional[bool] = 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, ) -> None: """ - Initialize a MessageInputOptionsStateless object. + Initialize a MessageOutput 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 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 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. """ - self.restart = restart - self.alternate_intents = alternate_intents - self.spelling = spelling + self.generic = generic + self.intents = intents + self.entities = entities + self.actions = actions self.debug = debug + self.user_defined = user_defined + self.spelling = spelling @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageInputOptionsStateless': - """Initialize a MessageInputOptionsStateless object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutput': + """Initialize a MessageOutput 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 (spelling := _dict.get('spelling')) is not None: - args['spelling'] = MessageInputOptionsSpelling.from_dict(spelling) + 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'] = debug + 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) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInputOptionsStateless 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, '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, '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, 'debug') and self.debug is not None: - _dict['debug'] = self.debug return _dict def _to_dict(self): @@ -6125,175 +6596,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageInputOptionsStateless object.""" + """Return a `str` version of this MessageOutput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInputOptionsStateless') -> 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: 'MessageInputOptionsStateless') -> bool: + def __ne__(self, other: 'MessageOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageInputStateless: +class MessageOutputDebug: """ - An input object that includes the input text. + Additional detailed information about a message response and how it was generated. - :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 MessageInputOptionsStateless options: (optional) Optional properties that - control how the assistant responds. + :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, *, - 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['MessageInputOptionsStateless'] = 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 MessageInputStateless object. + Initialize a MessageOutputDebug 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 MessageInputOptionsStateless options: (optional) Optional properties - that control how the assistant responds. + :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.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.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) -> 'MessageInputStateless': - """Initialize a MessageInputStateless object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutputDebug': + """Initialize a MessageOutputDebug 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 (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 (analytics := _dict.get('analytics')) is not None: - args['analytics'] = RequestAnalytics.from_dict(analytics) - if (options := _dict.get('options')) is not None: - args['options'] = MessageInputOptionsStateless.from_dict(options) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageInputStateless 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, '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 hasattr(self, 'nodes_visited') and self.nodes_visited is not None: + nodes_visited_list = [] + for v in self.nodes_visited: if isinstance(v, dict): - intents_list.append(v) + nodes_visited_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: + 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): - entities_list.append(v) + log_messages_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: + 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): - attachments_list.append(v) + turn_events_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() + turn_events_list.append(v.to_dict()) + _dict['turn_events'] = turn_events_list return _dict def _to_dict(self): @@ -6301,169 +6730,173 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageInputStateless object.""" + """Return a `str` version of this MessageOutputDebug object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageInputStateless') -> 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: 'MessageInputStateless') -> bool: + def __ne__(self, other: 'MessageOutputDebug') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MessageTypeEnum(str, Enum): + class BranchExitedReasonEnum(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. + When `branch_exited` is set to `true` by the assistant, the `branch_exited_reason` + specifies whether the dialog completed by itself or got interrupted. """ - TEXT = 'text' - SEARCH = 'search' + COMPLETED = 'completed' + FALLBACK = 'fallback' -class MessageOutput: +class MessageOutputDebugTurnEvent: """ - Assistant output to be rendered or processed by the client. + MessageOutputDebugTurnEvent. - :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 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: + """ + Properties describing any spelling corrections in the user input that was received. + + :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, *, - 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, + text: Optional[str] = None, + original_text: Optional[str] = None, + suggested_text: Optional[str] = None, ) -> None: """ - Initialize a MessageOutput object. + Initialize a MessageOutputSpelling 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 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.generic = generic - self.intents = intents - self.entities = entities - self.actions = actions - self.debug = debug - self.user_defined = user_defined - self.spelling = spelling + self.text = text + self.original_text = original_text + self.suggested_text = suggested_text @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutput': - """Initialize a MessageOutput object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MessageOutputSpelling': + """Initialize a MessageOutputSpelling 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 (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 MessageOutput 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, '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, '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): @@ -6471,133 +6904,111 @@ 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 MessageOutputSpelling object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutput') -> 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: 'MessageOutput') -> bool: + def __ne__(self, other: 'MessageOutputSpelling') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageOutputDebug: +class Pagination: """ - Additional detailed information about a message response and how it was generated. + The pagination data for the returned objects. For more information about using + pagination, see [Pagination](#pagination). - :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 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, *, - 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, + 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 MessageOutputDebug object. + Initialize a Pagination 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 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.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.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) -> 'MessageOutputDebug': - """Initialize a MessageOutputDebug object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Pagination': + """Initialize a Pagination 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 (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 MessageOutputDebug 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, '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, '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): @@ -6605,173 +7016,120 @@ 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 Pagination object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutputDebug') -> 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: 'MessageOutputDebug') -> bool: + def __ne__(self, other: 'Pagination') -> 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: +class Release: """ - MessageOutputDebugTurnEvent. + Release. + :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,) -> None: + def __init__( + self, + *, + 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 MessageOutputDebugTurnEvent object. + Initialize a Release object. + :param str description: (optional) The description of the release. """ - 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) + 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 _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: - """ - Properties describing any spelling corrections in the user input that was received. - - :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, - *, - text: Optional[str] = None, - original_text: Optional[str] = None, - suggested_text: Optional[str] = None, - ) -> None: - """ - Initialize a MessageOutputSpelling 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. - """ - self.text = text - self.original_text = original_text - self.suggested_text = suggested_text - - @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageOutputSpelling': - """Initialize a MessageOutputSpelling object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Release': + """Initialize a Release 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 (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 MessageOutputSpelling 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, '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, '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 _to_dict(self): @@ -6779,109 +7137,97 @@ 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 Release object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageOutputSpelling') -> bool: + 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: 'MessageOutputSpelling') -> bool: + 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 MessageRequest: +class ReleaseCollection: """ - A stateful message request formatted for the Watson Assistant service. + ReleaseCollection. - :param MessageInput input: (optional) An input object that includes the input - text. - :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 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, - *, - input: Optional['MessageInput'] = None, - context: Optional['MessageContext'] = None, - user_id: Optional[str] = None, + releases: List['Release'], + pagination: 'Pagination', ) -> None: """ - Initialize a MessageRequest object. + Initialize a ReleaseCollection object. - :param MessageInput input: (optional) An input object that includes the - input text. - :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 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.input = input - self.context = context - self.user_id = user_id + self.releases = releases + self.pagination = pagination @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageRequest': - """Initialize a MessageRequest object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseCollection': + """Initialize a ReleaseCollection object from a json dictionary.""" args = {} - if (input := _dict.get('input')) is not None: - args['input'] = MessageInput.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 (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' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MessageRequest 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, '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 + 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 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): @@ -6889,115 +7235,64 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageRequest object.""" + """Return a `str` version of this ReleaseCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageRequest') -> 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: 'MessageRequest') -> bool: + def __ne__(self, other: 'ReleaseCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageResponse: +class ReleaseContent: """ - A response from the Watson Assistant service. + An object identifying the versionable content objects (such as skill snapshots) that + are included in the release. - :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 List[ReleaseSkill] skills: (optional) The skill snapshots that are + included in the release. """ def __init__( self, - output: 'MessageOutput', - user_id: str, *, - context: Optional['MessageContext'] = None, + skills: Optional[List['ReleaseSkill']] = None, ) -> None: """ - Initialize a MessageResponse object. + Initialize a ReleaseContent 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. """ - self.output = output - self.context = context - self.user_id = user_id + self.skills = skills @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageResponse': - """Initialize a MessageResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseContent': + """Initialize a ReleaseContent 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 MessageResponse 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 MessageResponse JSON' - ) + 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 MessageResponse 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, '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, '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): @@ -7005,111 +7300,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageResponse object.""" + """Return a `str` version of this ReleaseContent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageResponse') -> 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: 'MessageResponse') -> bool: + def __ne__(self, other: 'ReleaseContent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MessageResponseStateless: +class ReleaseSkill: """ - A stateless response from the Watson Assistant service. + ReleaseSkill. - :param MessageOutput output: Assistant output to be rendered or processed by the - client. - :param MessageContextStateless 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 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 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, - output: 'MessageOutput', - context: 'MessageContextStateless', + skill_id: str, *, - user_id: Optional[str] = None, + type: Optional[str] = None, + snapshot: Optional[str] = None, ) -> None: """ - Initialize a MessageResponseStateless object. + Initialize a ReleaseSkill object. - :param MessageOutput output: Assistant output to be rendered or processed - by the client. - :param MessageContextStateless 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 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 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.output = output - self.context = context - self.user_id = user_id + self.skill_id = skill_id + self.type = type + self.snapshot = snapshot @classmethod - def from_dict(cls, _dict: Dict) -> 'MessageResponseStateless': - """Initialize a MessageResponseStateless object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReleaseSkill': + """Initialize a ReleaseSkill 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 MessageResponseStateless JSON' - ) - if (context := _dict.get('context')) is not None: - args['context'] = MessageContextStateless.from_dict(context) + if (skill_id := _dict.get('skill_id')) is not None: + args['skill_id'] = skill_id else: raise ValueError( - 'Required property \'context\' not present in MessageResponseStateless JSON' + 'Required property \'skill_id\' not present in ReleaseSkill JSON' ) - if (user_id := _dict.get('user_id')) is not None: - args['user_id'] = user_id + 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 MessageResponseStateless 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, '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, '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): @@ -7117,111 +7380,89 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MessageResponseStateless object.""" + """Return a `str` version of this ReleaseSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MessageResponseStateless') -> bool: + 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: 'MessageResponseStateless') -> bool: + 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. + """ -class Pagination: + DIALOG = 'dialog' + ACTION = 'action' + SEARCH = 'search' + + +class RequestAnalytics: """ - The pagination data for the returned objects. For more information about using - pagination, see [Pagination](#pagination). + An optional object containing analytics data. Currently, this data is used only for + events sent to the Segment extension. - :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 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, - 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, + browser: Optional[str] = None, + device: Optional[str] = None, + page_url: Optional[str] = None, ) -> None: """ - Initialize a Pagination object. + Initialize a RequestAnalytics 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 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.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.browser = browser + self.device = device + self.page_url = page_url @classmethod - def from_dict(cls, _dict: Dict) -> 'Pagination': - """Initialize a Pagination object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RequestAnalytics': + """Initialize a RequestAnalytics 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 (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 Pagination object from a json dictionary.""" + """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, '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, '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): @@ -7229,120 +7470,58 @@ 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 RequestAnalytics object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Pagination') -> bool: + 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: 'Pagination') -> bool: + def __ne__(self, other: 'RequestAnalytics') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Release: +class ResponseGenericChannel: """ - Release. + ResponseGenericChannel. - :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 str channel: (optional) A channel for which the response is intended. """ def __init__( self, *, - 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, + channel: Optional[str] = None, ) -> None: """ - Initialize a Release object. + Initialize a ResponseGenericChannel object. - :param str description: (optional) The description of the release. + :param str channel: (optional) A channel for which the response is + intended. """ - self.release = release - self.description = description - self.environment_references = environment_references - self.content = content - self.status = status - self.created = created - self.updated = updated + self.channel = channel @classmethod - def from_dict(cls, _dict: Dict) -> 'Release': - """Initialize a Release object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ResponseGenericChannel': + """Initialize a ResponseGenericChannel 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 (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) + if (channel := _dict.get('channel')) is not None: + args['channel'] = channel return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Release object from a json dictionary.""" + """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, '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')) + if hasattr(self, 'channel') and self.channel is not None: + _dict['channel'] = self.channel return _dict def _to_dict(self): @@ -7350,97 +7529,194 @@ 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 ResponseGenericChannel object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Release') -> bool: + 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: 'Release') -> bool: + def __ne__(self, other: 'ResponseGenericChannel') -> 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 RuntimeEntity: """ - ReleaseCollection. + The entity value that was recognized in the user input. - :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 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, - releases: List['Release'], - pagination: 'Pagination', + 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 ReleaseCollection object. + Initialize a RuntimeEntity 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 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.releases = releases - self.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 @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseCollection': - """Initialize a ReleaseCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RuntimeEntity': + """Initialize a RuntimeEntity object from a json dictionary.""" args = {} - if (releases := _dict.get('releases')) is not None: - args['releases'] = [Release.from_dict(v) for v in releases] + if (entity := _dict.get('entity')) is not None: + args['entity'] = entity else: raise ValueError( - 'Required property \'releases\' not present in ReleaseCollection JSON' + 'Required property \'entity\' not present in RuntimeEntity JSON' ) - if (pagination := _dict.get('pagination')) is not None: - args['pagination'] = Pagination.from_dict(pagination) + 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 \'pagination\' not present in ReleaseCollection JSON' - ) - return cls(**args) - - @classmethod + '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 ReleaseCollection object from a json dictionary.""" + """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, 'releases') and self.releases is not None: - releases_list = [] - for v in self.releases: + 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): - releases_list.append(v) + groups_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 + 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['pagination'] = self.pagination.to_dict() + _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): @@ -7448,64 +7724,69 @@ 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 RuntimeEntity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseCollection') -> bool: + 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: 'ReleaseCollection') -> bool: + def __ne__(self, other: 'RuntimeEntity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReleaseContent: +class RuntimeEntityAlternative: """ - An object identifying the versionable content objects (such as skill snapshots) that - are included in the release. + An alternative value for the recognized entity. - :param List[ReleaseSkill] skills: (optional) The 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. """ def __init__( self, *, - skills: Optional[List['ReleaseSkill']] = None, + value: Optional[str] = None, + confidence: Optional[float] = None, ) -> None: """ - Initialize a ReleaseContent object. + 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.skills = skills + self.value = value + self.confidence = confidence @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseContent': - """Initialize a ReleaseContent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RuntimeEntityAlternative': + """Initialize a RuntimeEntityAlternative 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 (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 ReleaseContent object from a json dictionary.""" + """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, '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 + 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): @@ -7513,79 +7794,354 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReleaseContent object.""" + """Return a `str` version of this RuntimeEntityAlternative object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseContent') -> bool: + 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: 'ReleaseContent') -> bool: + def __ne__(self, other: 'RuntimeEntityAlternative') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReleaseSkill: +class RuntimeEntityInterpretation: """ - ReleaseSkill. + RuntimeEntityInterpretation. - :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 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, - skill_id: str, *, - type: Optional[str] = None, - snapshot: Optional[str] = None, + 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 ReleaseSkill 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`). - """ - self.skill_id = skill_id - self.type = type - self.snapshot = snapshot - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReleaseSkill': - """Initialize a ReleaseSkill 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 - return cls(**args) + Initialize a RuntimeEntityInterpretation object. - @classmethod + :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 ReleaseSkill object from a json dictionary.""" + """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, '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, '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): @@ -7593,89 +8149,77 @@ 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 RuntimeEntityInterpretation object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReleaseSkill') -> bool: + 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: 'ReleaseSkill') -> bool: + def __ne__(self, other: 'RuntimeEntityInterpretation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class GranularityEnum(str, Enum): """ - The type of the skill. + The precision or duration of a time range specified by a recognized `@sys-time` or + `@sys-date` entity. """ - DIALOG = 'dialog' - ACTION = 'action' - SEARCH = 'search' + DAY = 'day' + FORTNIGHT = 'fortnight' + HOUR = 'hour' + INSTANT = 'instant' + MINUTE = 'minute' + MONTH = 'month' + QUARTER = 'quarter' + SECOND = 'second' + WEEK = 'week' + WEEKEND = 'weekend' + YEAR = 'year' -class RequestAnalytics: +class RuntimeEntityRole: """ - An optional object containing analytics data. Currently, this data is used only for - events sent to the Segment extension. + 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 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 type: (optional) The relationship of the entity to the range. """ def __init__( self, *, - browser: Optional[str] = None, - device: Optional[str] = None, - page_url: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a RequestAnalytics object. + Initialize a RuntimeEntityRole 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 type: (optional) The relationship of the entity to the range. """ - self.browser = browser - self.device = device - self.page_url = page_url + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'RequestAnalytics': - """Initialize a RequestAnalytics object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RuntimeEntityRole': + """Initialize a RuntimeEntityRole 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 (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RequestAnalytics object from a json dictionary.""" + """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, '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, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -7683,58 +8227,101 @@ 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 RuntimeEntityRole object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RequestAnalytics') -> bool: + 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: 'RequestAnalytics') -> bool: + 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. + """ -class ResponseGenericChannel: + 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: """ - ResponseGenericChannel. + An intent identified in the user input. - :param str channel: (optional) A channel for which the response is intended. + :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, *, - channel: Optional[str] = None, + confidence: Optional[float] = None, + skill: Optional[str] = None, ) -> None: """ - Initialize a ResponseGenericChannel object. + Initialize a RuntimeIntent object. - :param str channel: (optional) A channel for which the response is - intended. + :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.channel = channel + self.intent = intent + self.confidence = confidence + self.skill = skill @classmethod - def from_dict(cls, _dict: Dict) -> 'ResponseGenericChannel': - """Initialize a ResponseGenericChannel object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RuntimeIntent': + """Initialize a RuntimeIntent object from a json dictionary.""" args = {} - if (channel := _dict.get('channel')) is not None: - args['channel'] = channel + 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 ResponseGenericChannel object from a json dictionary.""" + """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, 'channel') and self.channel is not None: - _dict['channel'] = self.channel + 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): @@ -7742,194 +8329,255 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResponseGenericChannel object.""" + """Return a `str` version of this RuntimeIntent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResponseGenericChannel') -> bool: + 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: 'ResponseGenericChannel') -> bool: + def __ne__(self, other: 'RuntimeIntent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeEntity: +class RuntimeResponseGeneric: """ - The entity value that was recognized in the user input. + RuntimeResponseGeneric. - :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: + def __init__(self,) -> None: """ - Initialize a RuntimeEntity object. + Initialize a RuntimeResponseGeneric 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 + 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) -> '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 + 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: + """ + 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 \'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 \'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 RuntimeEntity object from a json dictionary.""" + """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, '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 + 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['interpretation'] = self.interpretation.to_dict() - if hasattr(self, 'alternatives') and self.alternatives is not None: - alternatives_list = [] - for v in self.alternatives: + _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): - alternatives_list.append(v) + answers_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 + answers_list.append(v.to_dict()) + _dict['answers'] = answers_list return _dict def _to_dict(self): @@ -7937,67 +8585,73 @@ 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 SearchResult object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntity') -> bool: + 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: 'RuntimeEntity') -> bool: + def __ne__(self, other: 'SearchResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeEntityAlternative: +class SearchResultAnswer: """ - An alternative value for the recognized entity. + An object specifing a segment of text that was identified as a direct answer to the + search query. - :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 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, - *, - value: Optional[str] = None, - confidence: Optional[float] = None, + text: str, + confidence: float, ) -> None: """ - Initialize a RuntimeEntityAlternative object. + Initialize a SearchResultAnswer 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. + :param str text: The text of the answer. + :param float confidence: The confidence score for the answer, as returned + by the Discovery service. """ - self.value = value + self.text = text self.confidence = confidence @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntityAlternative': - """Initialize a RuntimeEntityAlternative object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SearchResultAnswer': + """Initialize a SearchResultAnswer object from a json dictionary.""" args = {} - if (value := _dict.get('value')) is not None: - args['value'] = value + 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 RuntimeEntityAlternative object from a json dictionary.""" + """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, '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, 'confidence') and self.confidence is not None: _dict['confidence'] = self.confidence return _dict @@ -8007,354 +8661,478 @@ 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 SearchResultAnswer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityAlternative') -> bool: + 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: 'RuntimeEntityAlternative') -> bool: + def __ne__(self, other: 'SearchResultAnswer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RuntimeEntityInterpretation: +class SearchResultHighlight: """ - RuntimeEntityInterpretation. + An object containing segments of text from search results with query-matching text + highlighted using HTML `` tags. - :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 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. """ + # The set of defined properties for the class + _properties = frozenset(['body', 'title', 'url']) + 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, + body: Optional[List[str]] = None, + title: Optional[List[str]] = None, + url: Optional[List[str]] = None, + **kwargs, ) -> None: """ - Initialize a RuntimeEntityInterpretation object. + Initialize a SearchResultHighlight 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 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 **kwargs: (optional) Any additional properties. """ - 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.body = body + self.title = title + self.url = url + for _key, _value in kwargs.items(): + setattr(self, _key, _value) + + @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 + args.update( + {k: v for (k, v) in _dict.items() if k not in cls._properties}) + 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 _key in [ + k for k in vars(self).keys() + if k not in SearchResultHighlight._properties + ]: + _dict[_key] = getattr(self, _key) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def get_properties(self) -> Dict: + """Return a dictionary of arbitrary properties from this instance of SearchResultHighlight""" + _dict = {} + + for _key in [ + k for k in vars(self).keys() + if k not in SearchResultHighlight._properties + ]: + _dict[_key] = getattr(self, _key) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of arbitrary properties to this instance of SearchResultHighlight""" + for _key in [ + k for k in vars(self).keys() + if k not in SearchResultHighlight._properties + ]: + delattr(self, _key) + + for _key, _value in _dict.items(): + if _key not in SearchResultHighlight._properties: + setattr(self, _key, _value) + + 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 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: 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. + """ + + def __init__( + self, + discovery: 'SearchSettingsDiscovery', + messages: 'SearchSettingsMessages', + schema_mapping: 'SearchSettingsSchemaMapping', + ) -> None: + """ + Initialize a SearchSettings 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. + """ + self.discovery = discovery + self.messages = messages + self.schema_mapping = schema_mapping + + @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) + 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' + ) + 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() + 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 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) -> 'RuntimeEntityInterpretation': - """Initialize a RuntimeEntityInterpretation object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscovery': + """Initialize a SearchSettingsDiscovery 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 (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 RuntimeEntityInterpretation object from a json dictionary.""" + """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, '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, '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, - '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 + '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): @@ -8362,77 +9140,74 @@ 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 SearchSettingsDiscovery object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityInterpretation') -> bool: + 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: 'RuntimeEntityInterpretation') -> bool: + def __ne__(self, other: 'SearchSettingsDiscovery') -> 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: +class SearchSettingsDiscoveryAuthentication: """ - 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. + 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 type: (optional) The relationship of the entity to the range. + :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, *, - type: Optional[str] = None, + basic: Optional[str] = None, + bearer: Optional[str] = None, ) -> None: """ - Initialize a RuntimeEntityRole object. + Initialize a SearchSettingsDiscoveryAuthentication object. - :param str type: (optional) The relationship of the entity to the range. + :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.type = type + self.basic = basic + self.bearer = bearer - @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeEntityRole': - """Initialize a RuntimeEntityRole object from a json dictionary.""" + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscoveryAuthentication': + """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type + 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 RuntimeEntityRole object from a json dictionary.""" + """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, 'type') and self.type is not None: - _dict['type'] = self.type + 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): @@ -8440,101 +9215,90 @@ 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 SearchSettingsDiscoveryAuthentication object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeEntityRole') -> bool: + 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: 'RuntimeEntityRole') -> bool: + def __ne__(self, other: 'SearchSettingsDiscoveryAuthentication') -> 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: +class SearchSettingsMessages: """ - An intent identified in the user input. + The messages included with responses from the search integration. - :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 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, - intent: str, - *, - confidence: Optional[float] = None, - skill: Optional[str] = None, + success: str, + error: str, + no_result: str, ) -> None: """ - Initialize a RuntimeIntent object. + Initialize a SearchSettingsMessages 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 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.intent = intent - self.confidence = confidence - self.skill = skill + self.success = success + self.error = error + self.no_result = no_result @classmethod - def from_dict(cls, _dict: Dict) -> 'RuntimeIntent': - """Initialize a RuntimeIntent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SearchSettingsMessages': + """Initialize a SearchSettingsMessages object from a json dictionary.""" args = {} - if (intent := _dict.get('intent')) is not None: - args['intent'] = intent + if (success := _dict.get('success')) is not None: + args['success'] = success else: raise ValueError( - 'Required property \'intent\' not present in RuntimeIntent JSON' + '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 (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 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, '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, '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): @@ -8542,255 +9306,91 @@ 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 SearchSettingsMessages object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RuntimeIntent') -> bool: + 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: '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([ - '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: - """ - 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 __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, - 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, + url: str, + body: str, + title: str, ) -> None: """ - Initialize a SearchResult object. + Initialize a SearchSettingsSchemaMapping 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 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.id = id - self.result_metadata = result_metadata + self.url = url 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.""" + def from_dict(cls, _dict: Dict) -> 'SearchSettingsSchemaMapping': + """Initialize a SearchSettingsSchemaMapping 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) + if (url := _dict.get('url')) is not None: + args['url'] = url else: raise ValueError( - 'Required property \'result_metadata\' not present in SearchResult JSON' + '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 - 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] + else: + raise ValueError( + 'Required property \'title\' not present in SearchSettingsSchemaMapping JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchResult object from a json dictionary.""" + """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, '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, '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 - 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): @@ -8798,75 +9398,75 @@ 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 SearchSettingsSchemaMapping object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResult') -> bool: + 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: 'SearchResult') -> bool: + def __ne__(self, other: 'SearchSettingsSchemaMapping') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultAnswer: +class SearchSkillWarning: """ - An object specifing a segment of text that was identified as a direct answer to the - search query. + A warning describing an error in the search skill configuration. - :param str text: The text of the answer. - :param float confidence: The confidence score for the answer, as returned by the - Discovery service. + :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, - text: str, - confidence: float, + *, + code: Optional[str] = None, + path: Optional[str] = None, + message: Optional[str] = None, ) -> None: """ - Initialize a SearchResultAnswer object. + Initialize a SearchSkillWarning 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 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.text = text - self.confidence = confidence + self.code = code + self.path = path + self.message = message @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchResultAnswer': - """Initialize a SearchResultAnswer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SearchSkillWarning': + """Initialize a SearchSkillWarning 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 (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 SearchResultAnswer object from a json dictionary.""" + """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, '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, '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): @@ -8874,194 +9474,300 @@ 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 SearchSkillWarning object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultAnswer') -> bool: + 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: 'SearchResultAnswer') -> bool: + def __ne__(self, other: 'SearchSkillWarning') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultHighlight: +class SessionResponse: """ - An object containing segments of text from search results with query-matching text - highlighted using HTML `` tags. + SessionResponse. - :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 str session_id: The session ID. """ - # 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, + session_id: str, ) -> None: """ - Initialize a SearchResultHighlight object. + Initialize a SessionResponse 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 **kwargs: (optional) Any additional properties. + :param str session_id: The session ID. """ - self.body = body - self.title = title - self.url = url - for _key, _value in kwargs.items(): - setattr(self, _key, _value) - - @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 - args.update( - {k: v for (k, v) in _dict.items() if k not in cls._properties}) + 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 SearchResultHighlight object from a json dictionary.""" + """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, '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 _key in [ - k for k in vars(self).keys() - if k not in SearchResultHighlight._properties - ]: - _dict[_key] = getattr(self, _key) + 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 get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of SearchResultHighlight""" - _dict = {} - - for _key in [ - k for k in vars(self).keys() - if k not in SearchResultHighlight._properties - ]: - _dict[_key] = getattr(self, _key) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of SearchResultHighlight""" - for _key in [ - k for k in vars(self).keys() - if k not in SearchResultHighlight._properties - ]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in SearchResultHighlight._properties: - setattr(self, _key, _value) - def __str__(self) -> str: - """Return a `str` version of this SearchResultHighlight object.""" + """Return a `str` version of this SessionResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultHighlight') -> bool: + 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: 'SearchResultHighlight') -> bool: + def __ne__(self, other: 'SessionResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultMetadata: +class Skill: """ - An object containing search result metadata from the Discovery service. + Skill. - :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 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, *, - confidence: Optional[float] = None, - score: Optional[float] = None, + 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 SearchResultMetadata object. + Initialize a Skill 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 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.confidence = confidence - self.score = score + 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) -> 'SearchResultMetadata': - """Initialize a SearchResultMetadata object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Skill': + """Initialize a Skill 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 (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 SearchResultMetadata object from a json dictionary.""" + """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, '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, '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): @@ -9069,103 +9775,267 @@ 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 Skill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchResultMetadata') -> bool: + 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: 'SearchResultMetadata') -> bool: + 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 SearchSettings: + class TypeEnum(str, Enum): + """ + The type of skill. + """ + + ACTION = 'action' + DIALOG = 'dialog' + SEARCH = 'search' + + +class SkillImport: """ - 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. + SkillImport. - :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 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, - discovery: 'SearchSettingsDiscovery', - messages: 'SearchSettingsMessages', - schema_mapping: 'SearchSettingsSchemaMapping', + 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 SearchSettings object. + Initialize a SkillImport 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 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.discovery = discovery - self.messages = messages - self.schema_mapping = schema_mapping + 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) -> 'SearchSettings': - """Initialize a SearchSettings object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SkillImport': + """Initialize a SkillImport 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) + 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 \'messages\' not present in SearchSettings JSON' + 'Required property \'language\' not present in SkillImport JSON' ) - if (schema_mapping := _dict.get('schema_mapping')) is not None: - args['schema_mapping'] = SearchSettingsSchemaMapping.from_dict( - schema_mapping) + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError( - 'Required property \'schema_mapping\' not present in SearchSettings JSON' - ) + 'Required property \'type\' not present in SkillImport JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettings object from a json dictionary.""" + """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, '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 + 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['schema_mapping'] = self.schema_mapping.to_dict() + _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): @@ -9173,179 +10043,122 @@ 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 SkillImport object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettings') -> 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: 'SearchSettings') -> bool: + def __ne__(self, other: 'SkillImport') -> 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 SearchSettingsDiscovery: + class TypeEnum(str, Enum): + """ + The type of skill. + """ + + ACTION = 'action' + DIALOG = 'dialog' + + +class SkillsAsyncRequestStatus: """ - Configuration settings for the Watson Discovery service instance used by the search - integration. + SkillsAsyncRequestStatus. - :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 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, - 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, + assistant_id: Optional[str] = None, + status: Optional[str] = None, + status_description: Optional[str] = None, + status_errors: Optional[List['StatusError']] = None, ) -> None: """ - Initialize a SearchSettingsDiscovery object. + Initialize a SkillsAsyncRequestStatus 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 + 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) -> 'SearchSettingsDiscovery': - """Initialize a SearchSettingsDiscovery object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SkillsAsyncRequestStatus': + """Initialize a SkillsAsyncRequestStatus 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' - ) + 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 SearchSettingsDiscovery 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, '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() + 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): @@ -9353,74 +10166,105 @@ 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 SkillsAsyncRequestStatus object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsDiscovery') -> 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: 'SearchSettingsDiscovery') -> bool: + def __ne__(self, other: 'SkillsAsyncRequestStatus') -> 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. + """ -class SearchSettingsDiscoveryAuthentication: + AVAILABLE = 'Available' + COMPLETED = 'Completed' + FAILED = 'Failed' + PROCESSING = 'Processing' + + +class SkillsExport: """ - 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. + SkillsExport. - :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 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, - *, - basic: Optional[str] = None, - bearer: Optional[str] = None, + assistant_skills: List['Skill'], + assistant_state: 'AssistantState', ) -> None: """ - Initialize a SearchSettingsDiscoveryAuthentication object. + Initialize a SkillsExport 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 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.basic = basic - self.bearer = bearer + self.assistant_skills = assistant_skills + self.assistant_state = assistant_state @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsDiscoveryAuthentication': - """Initialize a SearchSettingsDiscoveryAuthentication object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SkillsExport': + """Initialize a SkillsExport 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 (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' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsDiscoveryAuthentication 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, '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, + '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): @@ -9428,90 +10272,141 @@ 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 SkillsExport object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsDiscoveryAuthentication') -> 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: 'SearchSettingsDiscoveryAuthentication') -> bool: + def __ne__(self, other: 'SkillsExport') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsMessages: +class StatefulMessageResponse: """ - The messages included with responses from the search integration. + A response from the watsonx Assistant service. - :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 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, - success: str, - error: str, - no_result: str, + output: 'MessageOutput', + user_id: str, + *, + context: Optional['MessageContext'] = None, + masked_output: Optional['MessageOutput'] = None, + masked_input: Optional['MessageInput'] = None, ) -> None: """ - Initialize a SearchSettingsMessages object. + Initialize a StatefulMessageResponse 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 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.success = success - self.error = error - self.no_result = no_result + 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) -> 'SearchSettingsMessages': - """Initialize a SearchSettingsMessages object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatefulMessageResponse': + """Initialize a StatefulMessageResponse 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 + if (output := _dict.get('output')) is not None: + args['output'] = MessageOutput.from_dict(output) else: raise ValueError( - 'Required property \'error\' not present in SearchSettingsMessages JSON' + 'Required property \'output\' not present in StatefulMessageResponse JSON' ) - if (no_result := _dict.get('no_result')) is not None: - args['no_result'] = no_result + 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 \'no_result\' not present in SearchSettingsMessages JSON' + '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) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SearchSettingsMessages 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, '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, '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): @@ -9519,91 +10414,87 @@ 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 StatefulMessageResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsMessages') -> 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: 'SearchSettingsMessages') -> bool: + def __ne__(self, other: 'StatefulMessageResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSettingsSchemaMapping: +class StatelessMessageContext: """ - The mapping between fields in the Watson Discovery collection and properties in the - search response. + StatelessMessageContext. - :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 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, - url: str, - body: str, - title: str, + *, + global_: Optional['StatelessMessageContextGlobal'] = None, + skills: Optional['StatelessMessageContextSkills'] = None, + integrations: Optional[dict] = None, ) -> None: """ - Initialize a SearchSettingsSchemaMapping object. + Initialize a StatelessMessageContext 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 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.url = url - self.body = body - self.title = title + self.global_ = global_ + self.skills = skills + self.integrations = integrations @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSettingsSchemaMapping': - """Initialize a SearchSettingsSchemaMapping object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContext': + """Initialize a StatelessMessageContext 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' - ) + 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 SearchSettingsSchemaMapping 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, '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 + 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): @@ -9611,75 +10502,70 @@ 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 StatelessMessageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSettingsSchemaMapping') -> 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: 'SearchSettingsSchemaMapping') -> bool: + def __ne__(self, other: 'StatelessMessageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchSkillWarning: +class StatelessMessageContextGlobal: """ - A warning describing an error in the search skill configuration. + Session context data that is shared by all skills used by the assistant. - :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 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, *, - code: Optional[str] = None, - path: Optional[str] = None, - message: Optional[str] = None, + system: Optional['MessageContextGlobalSystem'] = None, + session_id: Optional[str] = None, ) -> None: """ - Initialize a SearchSkillWarning object. + Initialize a StatelessMessageContextGlobal 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 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.code = code - self.path = path - self.message = message + self.system = system + self.session_id = session_id @classmethod - def from_dict(cls, _dict: Dict) -> 'SearchSkillWarning': - """Initialize a SearchSkillWarning object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextGlobal': + """Initialize a StatelessMessageContextGlobal 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 + 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 SearchSkillWarning 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, '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 + 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 return _dict def _to_dict(self): @@ -9687,60 +10573,78 @@ 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 StatelessMessageContextGlobal object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SearchSkillWarning') -> 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: 'SearchSkillWarning') -> bool: + def __ne__(self, other: 'StatelessMessageContextGlobal') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SessionResponse: +class StatelessMessageContextSkills: """ - SessionResponse. + Context data specific to particular skills used by the assistant. - :param str session_id: The session ID. + :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, - session_id: str, + *, + main_skill: Optional['MessageContextDialogSkill'] = None, + actions_skill: Optional[ + 'StatelessMessageContextSkillsActionsSkill'] = None, ) -> None: """ - Initialize a SessionResponse object. + Initialize a StatelessMessageContextSkills object. - :param str session_id: The session ID. + :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.session_id = session_id + self.main_skill = main_skill + self.actions_skill = actions_skill @classmethod - def from_dict(cls, _dict: Dict) -> 'SessionResponse': - """Initialize a SessionResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageContextSkills': + """Initialize a StatelessMessageContextSkills 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 (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 SessionResponse 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, 'session_id') and self.session_id is not None: - _dict['session_id'] = self.session_id + 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): @@ -9748,239 +10652,134 @@ 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 StatelessMessageContextSkills object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SessionResponse') -> 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: 'SessionResponse') -> bool: + def __ne__(self, other: 'StatelessMessageContextSkills') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Skill: +class StatelessMessageContextSkillsActionsSkill: """ - Skill. + Context variables that are used by the action 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. + :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, - 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, + 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 Skill object. + Initialize a StatelessMessageContextSkillsActionsSkill 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 + :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.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) -> 'Skill': - """Initialize a Skill object from a json dictionary.""" + def from_dict(cls, + _dict: Dict) -> 'StatelessMessageContextSkillsActionsSkill': + """Initialize a StatelessMessageContextSkillsActionsSkill 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') + 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 Skill 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, '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, '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, - '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') + 'action_variables') and self.action_variables is not None: + _dict['action_variables'] = self.action_variables 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 + '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): @@ -9988,267 +10787,177 @@ 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 StatelessMessageContextSkillsActionsSkill object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Skill') -> 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: 'Skill') -> bool: + def __ne__(self, + other: 'StatelessMessageContextSkillsActionsSkill') -> 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. +class StatelessMessageInput: """ + An input object that includes the input text. - 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, + :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, + *, + 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 SkillImport object. + Initialize a StatelessMessageInput 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 + :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 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 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.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.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) -> 'SkillImport': - """Initialize a SkillImport object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageInput': + """Initialize a StatelessMessageInput 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 (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 (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 (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 SkillImport 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, '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 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): - status_errors_list.append(v) + intents_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'): + 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): - warnings_list.append(v) + entities_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 + 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): @@ -10256,122 +10965,133 @@ 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 StatelessMessageInput object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillImport') -> 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: 'SkillImport') -> 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' + return self.__dict__ == other.__dict__ - class TypeEnum(str, Enum): + def __ne__(self, other: 'StatelessMessageInput') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class MessageTypeEnum(str, Enum): """ - The type of skill. + 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. """ - ACTION = 'action' - DIALOG = 'dialog' + TEXT = 'text' + SEARCH = 'search' -class SkillsAsyncRequestStatus: +class StatelessMessageInputOptions: """ - SkillsAsyncRequestStatus. + Optional properties that control how the assistant responds. - :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 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, *, - assistant_id: Optional[str] = None, - status: Optional[str] = None, - status_description: Optional[str] = None, - status_errors: Optional[List['StatusError']] = 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 SkillsAsyncRequestStatus object. + 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.assistant_id = assistant_id - self.status = status - self.status_description = status_description - self.status_errors = status_errors + 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) -> 'SkillsAsyncRequestStatus': - """Initialize a SkillsAsyncRequestStatus object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageInputOptions': + """Initialize a StatelessMessageInputOptions 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 (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 SkillsAsyncRequestStatus 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, '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, '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): @@ -10379,105 +11099,137 @@ 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 StatelessMessageInputOptions object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillsAsyncRequestStatus') -> 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: 'SkillsAsyncRequestStatus') -> bool: + def __ne__(self, other: 'StatelessMessageInputOptions') -> 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 StatelessMessageResponse: """ - SkillsExport. + A stateless response from the watsonx Assistant service. - :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 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, - assistant_skills: List['Skill'], - assistant_state: 'AssistantState', + output: 'MessageOutput', + context: 'StatelessMessageContext', + *, + masked_output: Optional['MessageOutput'] = None, + masked_input: Optional['MessageInput'] = None, + user_id: Optional[str] = None, ) -> None: """ - Initialize a SkillsExport object. + Initialize a StatelessMessageResponse 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 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.assistant_skills = assistant_skills - self.assistant_state = assistant_state + 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) -> 'SkillsExport': - """Initialize a SkillsExport object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'StatelessMessageResponse': + """Initialize a StatelessMessageResponse 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 - ] + if (output := _dict.get('output')) is not None: + args['output'] = MessageOutput.from_dict(output) else: raise ValueError( - 'Required property \'assistant_skills\' not present in SkillsExport JSON' + 'Required property \'output\' not present in StatelessMessageResponse JSON' ) - if (assistant_state := _dict.get('assistant_state')) is not None: - args['assistant_state'] = AssistantState.from_dict(assistant_state) + if (context := _dict.get('context')) is not None: + args['context'] = StatelessMessageContext.from_dict(context) else: raise ValueError( - 'Required property \'assistant_state\' not present in SkillsExport 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 SkillsExport 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, - '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, 'output') and self.output is not None: + if isinstance(self.output, dict): + _dict['output'] = self.output else: - _dict['assistant_state'] = self.assistant_state.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): @@ -10485,16 +11237,16 @@ 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 StatelessMessageResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SkillsExport') -> 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: 'SkillsExport') -> bool: + def __ne__(self, other: 'StatelessMessageResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other diff --git a/test/unit/test_assistant_v2.py b/test/unit/test_assistant_v2.py index 0e6681be..181ca3b5 100644 --- a/test/unit/test_assistant_v2.py +++ b/test/unit/test_assistant_v2.py @@ -632,7 +632,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"}' + 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}}}' responses.add( responses.POST, url, @@ -722,6 +722,7 @@ def test_message_all_params(self): message_input_options_model = {} 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 @@ -758,22 +759,22 @@ def test_message_all_params(self): message_context_skill_system_model['state'] = 'testString' message_context_skill_system_model['foo'] = 'testString' - # Construct a dict representation of a MessageContextSkillDialog model - message_context_skill_dialog_model = {} - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_model + # Construct a dict representation of a MessageContextDialogSkill model + message_context_dialog_skill_model = {} + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model - # Construct a dict representation of a MessageContextSkillAction model - message_context_skill_action_model = {} - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + # Construct a dict representation of a MessageContextActionSkill model + message_context_action_skill_model = {} + 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 dict representation of a MessageContextSkills model message_context_skills_model = {} - message_context_skills_model['main skill'] = message_context_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + message_context_skills_model['main skill'] = message_context_dialog_skill_model + message_context_skills_model['actions skill'] = message_context_action_skill_model # Construct a dict representation of a MessageContext model message_context_model = {} @@ -823,7 +824,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"}' + 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}}}' responses.add( responses.POST, url, @@ -863,7 +864,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"}' + 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}}}' responses.add( responses.POST, url, @@ -908,7 +909,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"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}' + 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"}' responses.add( responses.POST, url, @@ -994,23 +995,24 @@ def test_message_stateless_all_params(self): message_input_options_spelling_model['suggestions'] = True message_input_options_spelling_model['auto_correct'] = True - # Construct a dict representation of a MessageInputOptionsStateless model - message_input_options_stateless_model = {} - message_input_options_stateless_model['restart'] = False - message_input_options_stateless_model['alternate_intents'] = False - message_input_options_stateless_model['spelling'] = message_input_options_spelling_model - message_input_options_stateless_model['debug'] = False - - # Construct a dict representation of a MessageInputStateless model - message_input_stateless_model = {} - message_input_stateless_model['message_type'] = 'text' - message_input_stateless_model['text'] = 'testString' - message_input_stateless_model['intents'] = [runtime_intent_model] - message_input_stateless_model['entities'] = [runtime_entity_model] - message_input_stateless_model['suggestion_id'] = 'testString' - message_input_stateless_model['attachments'] = [message_input_attachment_model] - message_input_stateless_model['analytics'] = request_analytics_model - message_input_stateless_model['options'] = message_input_options_stateless_model + # Construct a dict representation of a StatelessMessageInputOptions model + stateless_message_input_options_model = {} + 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 dict representation of a StatelessMessageInput model + stateless_message_input_model = {} + stateless_message_input_model['message_type'] = 'text' + stateless_message_input_model['text'] = 'testString' + stateless_message_input_model['intents'] = [runtime_intent_model] + stateless_message_input_model['entities'] = [runtime_entity_model] + stateless_message_input_model['suggestion_id'] = 'testString' + stateless_message_input_model['attachments'] = [message_input_attachment_model] + stateless_message_input_model['analytics'] = request_analytics_model + stateless_message_input_model['options'] = stateless_message_input_options_model # Construct a dict representation of a MessageContextGlobalSystem model message_context_global_system_model = {} @@ -1023,43 +1025,45 @@ def test_message_stateless_all_params(self): message_context_global_system_model['state'] = 'testString' message_context_global_system_model['skip_user_input'] = True - # Construct a dict representation of a MessageContextGlobalStateless model - message_context_global_stateless_model = {} - message_context_global_stateless_model['system'] = message_context_global_system_model - message_context_global_stateless_model['session_id'] = 'testString' + # Construct a dict representation of a StatelessMessageContextGlobal model + stateless_message_context_global_model = {} + stateless_message_context_global_model['system'] = message_context_global_system_model + stateless_message_context_global_model['session_id'] = 'testString' # Construct a dict representation of a MessageContextSkillSystem model message_context_skill_system_model = {} message_context_skill_system_model['state'] = 'testString' message_context_skill_system_model['foo'] = 'testString' - # Construct a dict representation of a MessageContextSkillDialog model - message_context_skill_dialog_model = {} - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_model - - # Construct a dict representation of a MessageContextSkillAction model - message_context_skill_action_model = {} - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} - - # Construct a dict representation of a MessageContextSkills model - message_context_skills_model = {} - message_context_skills_model['main skill'] = message_context_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model - - # Construct a dict representation of a MessageContextStateless model - message_context_stateless_model = {} - message_context_stateless_model['global'] = message_context_global_stateless_model - message_context_stateless_model['skills'] = message_context_skills_model - message_context_stateless_model['integrations'] = {'anyKey': 'anyValue'} + # Construct a dict representation of a MessageContextDialogSkill model + message_context_dialog_skill_model = {} + message_context_dialog_skill_model['user_defined'] = {'anyKey': 'anyValue'} + message_context_dialog_skill_model['system'] = message_context_skill_system_model + + # Construct a dict representation of a StatelessMessageContextSkillsActionsSkill model + stateless_message_context_skills_actions_skill_model = {} + 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 dict representation of a StatelessMessageContextSkills model + stateless_message_context_skills_model = {} + 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 dict representation of a StatelessMessageContext model + stateless_message_context_model = {} + 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'} # Set up parameter values assistant_id = 'testString' - input = message_input_stateless_model - context = message_context_stateless_model + input = stateless_message_input_model + context = stateless_message_context_model user_id = 'testString' # Invoke method @@ -1076,8 +1080,8 @@ def test_message_stateless_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['input'] == message_input_stateless_model - assert req_body['context'] == message_context_stateless_model + assert req_body['input'] == stateless_message_input_model + assert req_body['context'] == stateless_message_context_model assert req_body['user_id'] == 'testString' def test_message_stateless_all_params_with_retries(self): @@ -1096,7 +1100,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"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}' + 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"}' responses.add( responses.POST, url, @@ -1134,7 +1138,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"}}}, "integrations": {"anyKey": "anyValue"}}, "user_id": "user_id"}' + 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"}' responses.add( responses.POST, url, @@ -1295,7 +1299,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, "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": "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"}}' responses.add( responses.GET, url, @@ -1348,7 +1352,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, "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": "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"}}' responses.add( responses.GET, url, @@ -1386,7 +1390,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, "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": "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"}}' responses.add( responses.GET, url, @@ -1807,6 +1811,10 @@ def test_update_environment_all_params(self): status=200, ) + # Construct a dict representation of a BaseEnvironmentOrchestration model + base_environment_orchestration_model = {} + base_environment_orchestration_model['search_skill_fallback'] = True + # Construct a dict representation of a EnvironmentSkill model environment_skill_model = {} environment_skill_model['skill_id'] = 'testString' @@ -1820,6 +1828,7 @@ def test_update_environment_all_params(self): environment_id = 'testString' name = 'testString' description = 'testString' + orchestration = base_environment_orchestration_model session_timeout = 10 skill_references = [environment_skill_model] @@ -1829,6 +1838,7 @@ def test_update_environment_all_params(self): environment_id, name=name, description=description, + orchestration=orchestration, session_timeout=session_timeout, skill_references=skill_references, headers={}, @@ -1841,6 +1851,7 @@ def test_update_environment_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['name'] == 'testString' assert req_body['description'] == 'testString' + assert req_body['orchestration'] == base_environment_orchestration_model assert req_body['session_timeout'] == 10 assert req_body['skill_references'] == [environment_skill_model] @@ -4111,6 +4122,7 @@ def test_dialog_node_output_options_element_serialization(self): 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 @@ -4233,6 +4245,7 @@ def test_dialog_node_output_options_element_value_serialization(self): 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 @@ -4383,6 +4396,7 @@ def test_dialog_suggestion_serialization(self): 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 @@ -4506,6 +4520,7 @@ def test_dialog_suggestion_value_serialization(self): 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 @@ -4553,6 +4568,9 @@ def test_environment_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + base_environment_orchestration_model = {} # BaseEnvironmentOrchestration + base_environment_orchestration_model['search_skill_fallback'] = True + environment_skill_model = {} # EnvironmentSkill environment_skill_model['skill_id'] = 'testString' environment_skill_model['type'] = 'dialog' @@ -4564,6 +4582,7 @@ def test_environment_serialization(self): environment_model_json = {} environment_model_json['name'] = 'testString' environment_model_json['description'] = 'testString' + environment_model_json['orchestration'] = base_environment_orchestration_model environment_model_json['session_timeout'] = 10 environment_model_json['skill_references'] = [environment_skill_model] @@ -4595,6 +4614,9 @@ def test_environment_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + base_environment_orchestration_model = {} # BaseEnvironmentOrchestration + base_environment_orchestration_model['search_skill_fallback'] = True + environment_skill_model = {} # EnvironmentSkill environment_skill_model['skill_id'] = 'testString' environment_skill_model['type'] = 'dialog' @@ -4605,6 +4627,7 @@ def test_environment_collection_serialization(self): environment_model = {} # Environment environment_model['name'] = 'testString' environment_model['description'] = 'testString' + environment_model['orchestration'] = base_environment_orchestration_model environment_model['session_timeout'] = 10 environment_model['skill_references'] = [environment_skill_model] @@ -4815,20 +4838,21 @@ def test_log_serialization(self): 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 + 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' @@ -4847,29 +4871,29 @@ def test_log_serialization(self): message_context_skill_system_model['state'] = 'testString' message_context_skill_system_model['foo'] = 'testString' - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_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 - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + 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_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + 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_request_model = {} # MessageRequest - message_request_model['input'] = message_input_model - message_request_model['context'] = message_context_model - message_request_model['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' response_generic_channel_model = {} # ResponseGenericChannel response_generic_channel_model['channel'] = 'testString' @@ -4927,25 +4951,25 @@ def test_log_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = '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 + 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_response_model = {} # MessageResponse - message_response_model['output'] = message_output_model - message_response_model['context'] = message_context_model - message_response_model['user_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' # Construct a json representation of a Log model log_model_json = {} log_model_json['log_id'] = 'testString' - log_model_json['request'] = message_request_model - log_model_json['response'] = message_response_model + 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' @@ -5054,20 +5078,21 @@ def test_log_collection_serialization(self): 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 + 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' @@ -5086,29 +5111,29 @@ def test_log_collection_serialization(self): message_context_skill_system_model['state'] = 'testString' message_context_skill_system_model['foo'] = 'testString' - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_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 - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + 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_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + 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_request_model = {} # MessageRequest - message_request_model['input'] = message_input_model - message_request_model['context'] = message_context_model - message_request_model['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' response_generic_channel_model = {} # ResponseGenericChannel response_generic_channel_model['channel'] = 'testString' @@ -5166,24 +5191,24 @@ def test_log_collection_serialization(self): message_output_spelling_model['original_text'] = 'testString' message_output_spelling_model['suggested_text'] = '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 + 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_response_model = {} # MessageResponse - message_response_model['output'] = message_output_model - message_response_model['context'] = message_context_model - message_response_model['user_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' log_model = {} # Log log_model['log_id'] = 'testString' - log_model['request'] = message_request_model - log_model['response'] = message_response_model + 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' @@ -5251,21 +5276,108 @@ def test_log_pagination_serialization(self): assert log_pagination_model_json2 == log_pagination_model_json -class TestModel_MessageContext: +class TestModel_LogRequest: """ - Test Class for MessageContext + Test Class for LogRequest """ - def test_message_context_serialization(self): + def test_log_request_serialization(self): """ - Test serialization/deserialization for MessageContext + Test serialization/deserialization for LogRequest """ # 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 + + 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 + + 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' @@ -5280,339 +5392,294 @@ def test_message_context_serialization(self): message_context_skill_system_model['state'] = 'testString' message_context_skill_system_model['foo'] = 'testString' - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_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 - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + 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_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + 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'} + 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 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 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 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) + # 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 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_model == message_context_model2 + assert log_request_model == log_request_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 + log_request_model_json2 = log_request_model.to_dict() + assert log_request_model_json2 == log_request_model_json -class TestModel_MessageContextGlobal: +class TestModel_LogRequestInput: """ - Test Class for MessageContextGlobal + Test Class for LogRequestInput """ - def test_message_context_global_serialization(self): + def test_log_request_input_serialization(self): """ - Test serialization/deserialization for MessageContextGlobal + Test serialization/deserialization for LogRequestInput """ # 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) + 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 message_context_global_model == message_context_global_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 - message_context_global_model_json2 = message_context_global_model.to_dict() - assert message_context_global_model_json2 == message_context_global_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_MessageContextGlobalStateless: - """ - Test Class for MessageContextGlobalStateless - """ + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' - def test_message_context_global_stateless_serialization(self): - """ - Test serialization/deserialization for MessageContextGlobalStateless - """ + 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 dict forms of any model objects needed in order to build this model. + message_input_attachment_model = {} # MessageInputAttachment + message_input_attachment_model['url'] = 'testString' + message_input_attachment_model['media_type'] = '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 + request_analytics_model = {} # RequestAnalytics + request_analytics_model['browser'] = 'testString' + request_analytics_model['device'] = 'testString' + request_analytics_model['pageUrl'] = 'testString' - # Construct a json representation of a MessageContextGlobalStateless model - message_context_global_stateless_model_json = {} - message_context_global_stateless_model_json['system'] = message_context_global_system_model - message_context_global_stateless_model_json['session_id'] = 'testString' + message_input_options_spelling_model = {} # MessageInputOptionsSpelling + message_input_options_spelling_model['suggestions'] = True + message_input_options_spelling_model['auto_correct'] = True - # Construct a model instance of MessageContextGlobalStateless by calling from_dict on the json representation - message_context_global_stateless_model = MessageContextGlobalStateless.from_dict(message_context_global_stateless_model_json) - assert message_context_global_stateless_model != False + 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 model instance of MessageContextGlobalStateless by calling from_dict on the json representation - message_context_global_stateless_model_dict = MessageContextGlobalStateless.from_dict(message_context_global_stateless_model_json).__dict__ - message_context_global_stateless_model2 = MessageContextGlobalStateless(**message_context_global_stateless_model_dict) + # 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 + + # 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_context_global_stateless_model == message_context_global_stateless_model2 + assert log_request_input_model == log_request_input_model2 # Convert model instance back to dict and verify no loss of data - message_context_global_stateless_model_json2 = message_context_global_stateless_model.to_dict() - assert message_context_global_stateless_model_json2 == message_context_global_stateless_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_MessageContextGlobalSystem: +class TestModel_LogResponse: """ - Test Class for MessageContextGlobalSystem + Test Class for LogResponse """ - 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_MessageContextSkillAction: - """ - Test Class for MessageContextSkillAction - """ - - def test_message_context_skill_action_serialization(self): - """ - Test serialization/deserialization for MessageContextSkillAction - """ - - # 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 MessageContextSkillAction model - message_context_skill_action_model_json = {} - message_context_skill_action_model_json['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model_json['system'] = message_context_skill_system_model - message_context_skill_action_model_json['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model_json['skill_variables'] = {'anyKey': 'anyValue'} - - # Construct a model instance of MessageContextSkillAction by calling from_dict on the json representation - message_context_skill_action_model = MessageContextSkillAction.from_dict(message_context_skill_action_model_json) - assert message_context_skill_action_model != False - - # Construct a model instance of MessageContextSkillAction by calling from_dict on the json representation - message_context_skill_action_model_dict = MessageContextSkillAction.from_dict(message_context_skill_action_model_json).__dict__ - message_context_skill_action_model2 = MessageContextSkillAction(**message_context_skill_action_model_dict) - - # Verify the model instances are equivalent - assert message_context_skill_action_model == message_context_skill_action_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_skill_action_model_json2 = message_context_skill_action_model.to_dict() - assert message_context_skill_action_model_json2 == message_context_skill_action_model_json - - -class TestModel_MessageContextSkillDialog: - """ - Test Class for MessageContextSkillDialog - """ - - def test_message_context_skill_dialog_serialization(self): + def test_log_response_serialization(self): """ - Test serialization/deserialization for MessageContextSkillDialog + Test serialization/deserialization for LogResponse """ # 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 MessageContextSkillDialog model - message_context_skill_dialog_model_json = {} - message_context_skill_dialog_model_json['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model_json['system'] = message_context_skill_system_model - - # Construct a model instance of MessageContextSkillDialog by calling from_dict on the json representation - message_context_skill_dialog_model = MessageContextSkillDialog.from_dict(message_context_skill_dialog_model_json) - assert message_context_skill_dialog_model != False - - # Construct a model instance of MessageContextSkillDialog by calling from_dict on the json representation - message_context_skill_dialog_model_dict = MessageContextSkillDialog.from_dict(message_context_skill_dialog_model_json).__dict__ - message_context_skill_dialog_model2 = MessageContextSkillDialog(**message_context_skill_dialog_model_dict) - - # Verify the model instances are equivalent - assert message_context_skill_dialog_model == message_context_skill_dialog_model2 - - # Convert model instance back to dict and verify no loss of data - message_context_skill_dialog_model_json2 = message_context_skill_dialog_model.to_dict() - assert message_context_skill_dialog_model_json2 == message_context_skill_dialog_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 == expected_dict + 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] -class TestModel_MessageContextSkills: - """ - Test Class for MessageContextSkills - """ + runtime_intent_model = {} # RuntimeIntent + runtime_intent_model['intent'] = 'testString' + runtime_intent_model['confidence'] = 72.5 + runtime_intent_model['skill'] = 'testString' - def test_message_context_skills_serialization(self): - """ - Test serialization/deserialization for MessageContextSkills - """ + capture_group_model = {} # CaptureGroup + capture_group_model['group'] = 'testString' + capture_group_model['location'] = [38] - # Construct dict forms of any model objects needed in order to build this 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' - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + runtime_entity_alternative_model = {} # RuntimeEntityAlternative + runtime_entity_alternative_model['value'] = 'testString' + runtime_entity_alternative_model['confidence'] = 72.5 - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_model + runtime_entity_role_model = {} # RuntimeEntityRole + runtime_entity_role_model['type'] = 'date_from' - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + 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 MessageContextSkills model - message_context_skills_model_json = {} - message_context_skills_model_json['main skill'] = message_context_skill_dialog_model - message_context_skills_model_json['actions skill'] = message_context_skill_action_model + 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 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 + 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 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) + 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 message_context_skills_model == message_context_skills_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 - message_context_skills_model_json2 = message_context_skills_model.to_dict() - assert message_context_skills_model_json2 == message_context_skills_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_MessageContextStateless: - """ - Test Class for MessageContextStateless - """ + 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_message_context_stateless_serialization(self): - """ - Test serialization/deserialization for MessageContextStateless - """ + 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. + 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_context_global_system_model = {} # MessageContextGlobalSystem message_context_global_system_model['timezone'] = 'testString' @@ -5624,62 +5691,74 @@ def test_message_context_stateless_serialization(self): message_context_global_system_model['state'] = 'testString' message_context_global_system_model['skip_user_input'] = True - message_context_global_stateless_model = {} # MessageContextGlobalStateless - message_context_global_stateless_model['system'] = message_context_global_system_model - message_context_global_stateless_model['session_id'] = 'testString' + 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_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_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 - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + 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_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + 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 MessageContextStateless model - message_context_stateless_model_json = {} - message_context_stateless_model_json['global'] = message_context_global_stateless_model - message_context_stateless_model_json['skills'] = message_context_skills_model - message_context_stateless_model_json['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 MessageContextStateless by calling from_dict on the json representation - message_context_stateless_model = MessageContextStateless.from_dict(message_context_stateless_model_json) - assert message_context_stateless_model != False + # 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 MessageContextStateless by calling from_dict on the json representation - message_context_stateless_model_dict = MessageContextStateless.from_dict(message_context_stateless_model_json).__dict__ - message_context_stateless_model2 = MessageContextStateless(**message_context_stateless_model_dict) + # 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_context_stateless_model == message_context_stateless_model2 + assert log_response_model == log_response_model2 # Convert model instance back to dict and verify no loss of data - message_context_stateless_model_json2 = message_context_stateless_model.to_dict() - assert message_context_stateless_model_json2 == message_context_stateless_model_json + log_response_model_json2 = log_response_model.to_dict() + assert log_response_model_json2 == log_response_model_json -class TestModel_MessageInput: +class TestModel_LogResponseOutput: """ - Test Class for MessageInput + Test Class for LogResponseOutput """ - def test_message_input_serialization(self): + def test_log_response_output_serialization(self): """ - Test serialization/deserialization for MessageInput + Test serialization/deserialization for LogResponseOutput """ # 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 @@ -5735,233 +5814,425 @@ def test_message_input_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' + 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' - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True + dialog_node_visited_model = {} # DialogNodeVisited + dialog_node_visited_model['dialog_node'] = 'testString' + dialog_node_visited_model['title'] = 'testString' + dialog_node_visited_model['conditions'] = 'testString' - message_input_options_model = {} # MessageInputOptions - message_input_options_model['restart'] = False - message_input_options_model['alternate_intents'] = 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_message_source_model = {} # LogMessageSourceDialogNode + log_message_source_model['type'] = 'dialog_node' + log_message_source_model['dialog_node'] = '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 + 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 - # 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 + 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 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) + 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 message_input_model == message_input_model2 + assert log_response_output_model == log_response_output_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_response_output_model_json2 = log_response_output_model.to_dict() + assert log_response_output_model_json2 == log_response_output_model_json -class TestModel_MessageInputAttachment: +class TestModel_MessageContext: """ - Test Class for MessageInputAttachment + Test Class for MessageContext """ - def test_message_input_attachment_serialization(self): + def test_message_context_serialization(self): """ - Test serialization/deserialization for MessageInputAttachment + Test serialization/deserialization for MessageContext """ - # 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 + 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 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) + 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_input_attachment_model == message_input_attachment_model2 + assert message_context_model == message_context_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 + message_context_model_json2 = message_context_model.to_dict() + assert message_context_model_json2 == message_context_model_json -class TestModel_MessageInputOptions: +class TestModel_MessageContextActionSkill: """ - Test Class for MessageInputOptions + Test Class for MessageContextActionSkill """ - def test_message_input_options_serialization(self): + def test_message_context_action_skill_serialization(self): """ - Test serialization/deserialization for MessageInputOptions + Test serialization/deserialization for MessageContextActionSkill """ # 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 + 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 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['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 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 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 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 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) + # 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 message_input_options_model == message_input_options_model2 + assert message_context_action_skill_model == message_context_action_skill_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 + 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_MessageInputOptionsSpelling: +class TestModel_MessageContextDialogSkill: """ - Test Class for MessageInputOptionsSpelling + Test Class for MessageContextDialogSkill """ - def test_message_input_options_spelling_serialization(self): + def test_message_context_dialog_skill_serialization(self): """ - Test serialization/deserialization for MessageInputOptionsSpelling + Test serialization/deserialization for MessageContextDialogSkill """ - # 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 dict forms of any model objects needed in order to build this model. - # 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 + 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 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) + # 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_input_options_spelling_model == message_input_options_spelling_model2 + assert message_context_dialog_skill_model == message_context_dialog_skill_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 + 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_MessageInputOptionsStateless: +class TestModel_MessageContextGlobal: """ - Test Class for MessageInputOptionsStateless + Test Class for MessageContextGlobal """ - def test_message_input_options_stateless_serialization(self): + def test_message_context_global_serialization(self): """ - Test serialization/deserialization for MessageInputOptionsStateless + Test serialization/deserialization for MessageContextGlobal """ # 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 + 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 MessageInputOptionsStateless model - message_input_options_stateless_model_json = {} - message_input_options_stateless_model_json['restart'] = False - message_input_options_stateless_model_json['alternate_intents'] = False - message_input_options_stateless_model_json['spelling'] = message_input_options_spelling_model - message_input_options_stateless_model_json['debug'] = False + # 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 MessageInputOptionsStateless by calling from_dict on the json representation - message_input_options_stateless_model = MessageInputOptionsStateless.from_dict(message_input_options_stateless_model_json) - assert message_input_options_stateless_model != False + # 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 MessageInputOptionsStateless by calling from_dict on the json representation - message_input_options_stateless_model_dict = MessageInputOptionsStateless.from_dict(message_input_options_stateless_model_json).__dict__ - message_input_options_stateless_model2 = MessageInputOptionsStateless(**message_input_options_stateless_model_dict) + # 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_input_options_stateless_model == message_input_options_stateless_model2 + assert message_context_global_model == message_context_global_model2 # Convert model instance back to dict and verify no loss of data - message_input_options_stateless_model_json2 = message_input_options_stateless_model.to_dict() - assert message_input_options_stateless_model_json2 == message_input_options_stateless_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_MessageInputStateless: +class TestModel_MessageContextGlobalSystem: """ - Test Class for MessageInputStateless + Test Class for MessageContextGlobalSystem """ - def test_message_input_stateless_serialization(self): + def test_message_context_global_system_serialization(self): """ - Test serialization/deserialization for MessageInputStateless + Test serialization/deserialization for MessageContextGlobalSystem """ - # Construct dict forms of any model objects needed in order to build this 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 - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + # 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 - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + # 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) - 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 + # 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 == expected_dict + + +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' + + 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' @@ -6005,37 +6276,144 @@ def test_message_input_stateless_serialization(self): message_input_options_spelling_model['suggestions'] = True message_input_options_spelling_model['auto_correct'] = True - message_input_options_stateless_model = {} # MessageInputOptionsStateless - message_input_options_stateless_model['restart'] = False - message_input_options_stateless_model['alternate_intents'] = False - message_input_options_stateless_model['spelling'] = message_input_options_spelling_model - message_input_options_stateless_model['debug'] = False - - # Construct a json representation of a MessageInputStateless model - message_input_stateless_model_json = {} - message_input_stateless_model_json['message_type'] = 'text' - message_input_stateless_model_json['text'] = 'testString' - message_input_stateless_model_json['intents'] = [runtime_intent_model] - message_input_stateless_model_json['entities'] = [runtime_entity_model] - message_input_stateless_model_json['suggestion_id'] = 'testString' - message_input_stateless_model_json['attachments'] = [message_input_attachment_model] - message_input_stateless_model_json['analytics'] = request_analytics_model - message_input_stateless_model_json['options'] = message_input_options_stateless_model - - # Construct a model instance of MessageInputStateless by calling from_dict on the json representation - message_input_stateless_model = MessageInputStateless.from_dict(message_input_stateless_model_json) - assert message_input_stateless_model != False - - # Construct a model instance of MessageInputStateless by calling from_dict on the json representation - message_input_stateless_model_dict = MessageInputStateless.from_dict(message_input_stateless_model_json).__dict__ - message_input_stateless_model2 = MessageInputStateless(**message_input_stateless_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 + + # 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 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 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 message_input_model == message_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 + + +class TestModel_MessageInputAttachment: + """ + Test Class for MessageInputAttachment + """ + + def test_message_input_attachment_serialization(self): + """ + Test serialization/deserialization for MessageInputAttachment + """ + + # 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 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_stateless_model == message_input_stateless_model2 + 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_stateless_model_json2 = message_input_stateless_model.to_dict() - assert message_input_stateless_model_json2 == message_input_stateless_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_MessageOutput: @@ -6284,377 +6662,250 @@ def test_message_output_spelling_serialization(self): assert message_output_spelling_model_json2 == message_output_spelling_model_json -class TestModel_MessageRequest: +class TestModel_Pagination: """ - Test Class for MessageRequest + Test Class for Pagination """ - def test_message_request_serialization(self): + def test_pagination_serialization(self): """ - Test serialization/deserialization for MessageRequest + Test serialization/deserialization for Pagination """ - # Construct dict forms of any model objects needed in order to build this model. + # 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' - runtime_intent_model = {} # RuntimeIntent - runtime_intent_model['intent'] = 'testString' - runtime_intent_model['confidence'] = 72.5 - runtime_intent_model['skill'] = 'testString' + # 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 - capture_group_model = {} # CaptureGroup - capture_group_model['group'] = 'testString' - capture_group_model['location'] = [38] + # 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) - 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' + # Verify the model instances are equivalent + assert pagination_model == pagination_model2 - runtime_entity_alternative_model = {} # RuntimeEntityAlternative - runtime_entity_alternative_model['value'] = 'testString' - runtime_entity_alternative_model['confidence'] = 72.5 + # 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 - 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' +class TestModel_Release: + """ + Test Class for Release + """ - message_input_attachment_model = {} # MessageInputAttachment - message_input_attachment_model['url'] = 'testString' - message_input_attachment_model['media_type'] = 'testString' + def test_release_serialization(self): + """ + Test serialization/deserialization for Release + """ - request_analytics_model = {} # RequestAnalytics - request_analytics_model['browser'] = 'testString' - request_analytics_model['device'] = 'testString' - request_analytics_model['pageUrl'] = 'testString' + # Construct a json representation of a Release model + release_model_json = {} + release_model_json['description'] = 'testString' - message_input_options_spelling_model = {} # MessageInputOptionsSpelling - message_input_options_spelling_model['suggestions'] = True - message_input_options_spelling_model['auto_correct'] = True + # 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 - message_input_options_model = {} # MessageInputOptions - message_input_options_model['restart'] = False - message_input_options_model['alternate_intents'] = 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 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) - message_input_model = {} # MessageInput - message_input_model['message_type'] = 'text' - message_input_model['text'] = 'Hello' - 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 + # Verify the model instances are equivalent + assert release_model == release_model2 - 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['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 + # 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 - 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' +class TestModel_ReleaseCollection: + """ + Test Class for ReleaseCollection + """ - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_model + def test_release_collection_serialization(self): + """ + Test serialization/deserialization for ReleaseCollection + """ - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} + # Construct dict forms of any model objects needed in order to build this model. - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model + release_model = {} # Release + release_model['description'] = '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'} + 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 MessageRequest model - message_request_model_json = {} - message_request_model_json['input'] = message_input_model - message_request_model_json['context'] = message_context_model - message_request_model_json['user_id'] = '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 MessageRequest by calling from_dict on the json representation - message_request_model = MessageRequest.from_dict(message_request_model_json) - assert message_request_model != False + # 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 MessageRequest by calling from_dict on the json representation - message_request_model_dict = MessageRequest.from_dict(message_request_model_json).__dict__ - message_request_model2 = MessageRequest(**message_request_model_dict) + # 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 message_request_model == message_request_model2 + assert release_collection_model == release_collection_model2 # Convert model instance back to dict and verify no loss of data - message_request_model_json2 = message_request_model.to_dict() - assert message_request_model_json2 == message_request_model_json + release_collection_model_json2 = release_collection_model.to_dict() + assert release_collection_model_json2 == release_collection_model_json -class TestModel_MessageResponse: +class TestModel_ReleaseContent: """ - Test Class for MessageResponse + Test Class for ReleaseContent """ - def test_message_response_serialization(self): + def test_release_content_serialization(self): """ - Test serialization/deserialization for MessageResponse + Test serialization/deserialization for ReleaseContent """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a ReleaseContent model + release_content_model_json = {} - response_generic_channel_model = {} # ResponseGenericChannel - response_generic_channel_model['channel'] = 'testString' + # 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 - 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 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) - 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 release_content_model == release_content_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 + release_content_model_json2 = release_content_model.to_dict() + assert release_content_model_json2 == release_content_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_ReleaseSkill: + """ + Test Class for ReleaseSkill + """ - runtime_entity_role_model = {} # RuntimeEntityRole - runtime_entity_role_model['type'] = 'date_from' + def test_release_skill_serialization(self): + """ + Test serialization/deserialization for ReleaseSkill + """ - 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 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' - 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' + # 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 - log_message_source_model = {} # LogMessageSourceDialogNode - log_message_source_model['type'] = 'dialog_node' - log_message_source_model['dialog_node'] = 'testString' + # 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) - 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 + # Verify the model instances are equivalent + assert release_skill_model == release_skill_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 + release_skill_model_json2 = release_skill_model.to_dict() + assert release_skill_model_json2 == release_skill_model_json - 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] +class TestModel_RequestAnalytics: + """ + Test Class for RequestAnalytics + """ - 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' + def test_request_analytics_serialization(self): + """ + Test serialization/deserialization for RequestAnalytics + """ - 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 + # 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' - 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 RequestAnalytics by calling from_dict on the json representation + request_analytics_model = RequestAnalytics.from_dict(request_analytics_model_json) + assert request_analytics_model != False - message_context_global_model = {} # MessageContextGlobal - message_context_global_model['system'] = message_context_global_system_model + # 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) - message_context_skill_system_model = {} # MessageContextSkillSystem - message_context_skill_system_model['state'] = 'testString' - message_context_skill_system_model['foo'] = 'testString' + # Verify the model instances are equivalent + assert request_analytics_model == request_analytics_model2 - message_context_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_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 - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model +class TestModel_ResponseGenericChannel: + """ + Test Class for ResponseGenericChannel + """ - 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'} + def test_response_generic_channel_serialization(self): + """ + Test serialization/deserialization for ResponseGenericChannel + """ - # Construct a json representation of a MessageResponse model - message_response_model_json = {} - message_response_model_json['output'] = message_output_model - message_response_model_json['context'] = message_context_model - message_response_model_json['user_id'] = '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 MessageResponse by calling from_dict on the json representation - message_response_model = MessageResponse.from_dict(message_response_model_json) - assert message_response_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 MessageResponse by calling from_dict on the json representation - message_response_model_dict = MessageResponse.from_dict(message_response_model_json).__dict__ - message_response_model2 = MessageResponse(**message_response_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 message_response_model == message_response_model2 + assert response_generic_channel_model == response_generic_channel_model2 # Convert model instance back to dict and verify no loss of data - message_response_model_json2 = message_response_model.to_dict() - assert message_response_model_json2 == message_response_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_MessageResponseStateless: +class TestModel_RuntimeEntity: """ - Test Class for MessageResponseStateless + Test Class for RuntimeEntity """ - def test_message_response_stateless_serialization(self): + def test_runtime_entity_serialization(self): """ - Test serialization/deserialization for MessageResponseStateless + Test serialization/deserialization for RuntimeEntity """ # 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 - runtime_intent_model['skill'] = 'testString' - capture_group_model = {} # CaptureGroup capture_group_model['group'] = 'testString' capture_group_model['location'] = [38] @@ -6694,757 +6945,607 @@ def test_message_response_stateless_serialization(self): 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_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_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_stateless_model = {} # MessageContextGlobalStateless - message_context_global_stateless_model['system'] = message_context_global_system_model - message_context_global_stateless_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_skill_dialog_model = {} # MessageContextSkillDialog - message_context_skill_dialog_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_dialog_model['system'] = message_context_skill_system_model - - message_context_skill_action_model = {} # MessageContextSkillAction - message_context_skill_action_model['user_defined'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['system'] = message_context_skill_system_model - message_context_skill_action_model['action_variables'] = {'anyKey': 'anyValue'} - message_context_skill_action_model['skill_variables'] = {'anyKey': 'anyValue'} - - message_context_skills_model = {} # MessageContextSkills - message_context_skills_model['main skill'] = message_context_skill_dialog_model - message_context_skills_model['actions skill'] = message_context_skill_action_model - - message_context_stateless_model = {} # MessageContextStateless - message_context_stateless_model['global'] = message_context_global_stateless_model - message_context_stateless_model['skills'] = message_context_skills_model - message_context_stateless_model['integrations'] = {'anyKey': 'anyValue'} - - # Construct a json representation of a MessageResponseStateless model - message_response_stateless_model_json = {} - message_response_stateless_model_json['output'] = message_output_model - message_response_stateless_model_json['context'] = message_context_stateless_model - message_response_stateless_model_json['user_id'] = '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' - # Construct a model instance of MessageResponseStateless by calling from_dict on the json representation - message_response_stateless_model = MessageResponseStateless.from_dict(message_response_stateless_model_json) - assert message_response_stateless_model != False + # 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 MessageResponseStateless by calling from_dict on the json representation - message_response_stateless_model_dict = MessageResponseStateless.from_dict(message_response_stateless_model_json).__dict__ - message_response_stateless_model2 = MessageResponseStateless(**message_response_stateless_model_dict) + # 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 message_response_stateless_model == message_response_stateless_model2 + assert runtime_entity_model == runtime_entity_model2 # Convert model instance back to dict and verify no loss of data - message_response_stateless_model_json2 = message_response_stateless_model.to_dict() - assert message_response_stateless_model_json2 == message_response_stateless_model_json + runtime_entity_model_json2 = runtime_entity_model.to_dict() + assert runtime_entity_model_json2 == runtime_entity_model_json -class TestModel_Pagination: +class TestModel_RuntimeEntityAlternative: """ - Test Class for Pagination + Test Class for RuntimeEntityAlternative """ - def test_pagination_serialization(self): + def test_runtime_entity_alternative_serialization(self): """ - Test serialization/deserialization for Pagination + Test serialization/deserialization for RuntimeEntityAlternative """ - # 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 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 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 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 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 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 pagination_model == pagination_model2 + assert runtime_entity_alternative_model == runtime_entity_alternative_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 + runtime_entity_alternative_model_json2 = runtime_entity_alternative_model.to_dict() + assert runtime_entity_alternative_model_json2 == runtime_entity_alternative_model_json -class TestModel_Release: +class TestModel_RuntimeEntityInterpretation: """ - Test Class for Release + Test Class for RuntimeEntityInterpretation """ - def test_release_serialization(self): + def test_runtime_entity_interpretation_serialization(self): """ - Test serialization/deserialization for Release + Test serialization/deserialization for RuntimeEntityInterpretation """ - # Construct a json representation of a Release model - release_model_json = {} - release_model_json['description'] = 'testString' + # 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 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 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 - # 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) + # 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) # Verify the model instances are equivalent - assert release_model == release_model2 + assert runtime_entity_interpretation_model == runtime_entity_interpretation_model2 # 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 + runtime_entity_interpretation_model_json2 = runtime_entity_interpretation_model.to_dict() + assert runtime_entity_interpretation_model_json2 == runtime_entity_interpretation_model_json -class TestModel_ReleaseCollection: +class TestModel_RuntimeEntityRole: """ - Test Class for ReleaseCollection + Test Class for RuntimeEntityRole """ - def test_release_collection_serialization(self): + def test_runtime_entity_role_serialization(self): """ - Test serialization/deserialization for ReleaseCollection + Test serialization/deserialization for RuntimeEntityRole """ - # Construct dict forms of any model objects needed in order to build this model. - - release_model = {} # Release - release_model['description'] = 'testString' - - 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 json representation of a RuntimeEntityRole model + runtime_entity_role_model_json = {} + runtime_entity_role_model_json['type'] = 'date_from' - # 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 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 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 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 release_collection_model == release_collection_model2 + assert runtime_entity_role_model == runtime_entity_role_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 + runtime_entity_role_model_json2 = runtime_entity_role_model.to_dict() + assert runtime_entity_role_model_json2 == runtime_entity_role_model_json -class TestModel_ReleaseContent: +class TestModel_RuntimeIntent: """ - Test Class for ReleaseContent + Test Class for RuntimeIntent """ - def test_release_content_serialization(self): + def test_runtime_intent_serialization(self): """ - Test serialization/deserialization for ReleaseContent + Test serialization/deserialization for RuntimeIntent """ - # Construct a json representation of a ReleaseContent model - release_content_model_json = {} + # 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 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 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 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) + # 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) # Verify the model instances are equivalent - assert release_content_model == release_content_model2 + assert runtime_intent_model == runtime_intent_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 + runtime_intent_model_json2 = runtime_intent_model.to_dict() + assert runtime_intent_model_json2 == runtime_intent_model_json -class TestModel_ReleaseSkill: +class TestModel_SearchResult: """ - Test Class for ReleaseSkill + Test Class for SearchResult """ - def test_release_skill_serialization(self): + def test_search_result_serialization(self): """ - Test serialization/deserialization for ReleaseSkill + Test serialization/deserialization for SearchResult """ - # 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 dict forms of any model objects needed in order to build this model. - # 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 + search_result_metadata_model = {} # SearchResultMetadata + search_result_metadata_model['confidence'] = 72.5 + search_result_metadata_model['score'] = 72.5 - # 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) + 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] + + # 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 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 release_skill_model == release_skill_model2 + assert search_result_model == search_result_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 + search_result_model_json2 = search_result_model.to_dict() + assert search_result_model_json2 == search_result_model_json -class TestModel_RequestAnalytics: +class TestModel_SearchResultAnswer: """ - Test Class for RequestAnalytics + Test Class for SearchResultAnswer """ - def test_request_analytics_serialization(self): + def test_search_result_answer_serialization(self): """ - Test serialization/deserialization for RequestAnalytics + Test serialization/deserialization for SearchResultAnswer """ - # 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 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 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 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 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) + # 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 request_analytics_model == request_analytics_model2 + assert search_result_answer_model == search_result_answer_model2 # 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 + search_result_answer_model_json2 = search_result_answer_model.to_dict() + assert search_result_answer_model_json2 == search_result_answer_model_json -class TestModel_ResponseGenericChannel: +class TestModel_SearchResultHighlight: """ - Test Class for ResponseGenericChannel + Test Class for SearchResultHighlight """ - def test_response_generic_channel_serialization(self): + def test_search_result_highlight_serialization(self): """ - Test serialization/deserialization for ResponseGenericChannel + Test serialization/deserialization for SearchResultHighlight """ - # Construct a json representation of a ResponseGenericChannel model - response_generic_channel_model_json = {} - response_generic_channel_model_json['channel'] = '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'] - # 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 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 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 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 response_generic_channel_model == response_generic_channel_model2 + assert search_result_highlight_model == search_result_highlight_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 + 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 == {} -class TestModel_RuntimeEntity: + expected_dict = {'foo': ['testString']} + search_result_highlight_model.set_properties(expected_dict) + actual_dict = search_result_highlight_model.get_properties() + assert actual_dict == expected_dict + + +class TestModel_SearchResultMetadata: """ - Test Class for RuntimeEntity + Test Class for SearchResultMetadata """ - def test_runtime_entity_serialization(self): + def test_search_result_metadata_serialization(self): """ - Test serialization/deserialization for RuntimeEntity + Test serialization/deserialization for SearchResultMetadata """ - # 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] - - 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 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 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 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 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) + # 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 runtime_entity_model == runtime_entity_model2 + assert search_result_metadata_model == search_result_metadata_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 + search_result_metadata_model_json2 = search_result_metadata_model.to_dict() + assert search_result_metadata_model_json2 == search_result_metadata_model_json -class TestModel_RuntimeEntityAlternative: +class TestModel_SearchSettings: """ - Test Class for RuntimeEntityAlternative + Test Class for SearchSettings """ - def test_runtime_entity_alternative_serialization(self): + def test_search_settings_serialization(self): """ - Test serialization/deserialization for RuntimeEntityAlternative + Test serialization/deserialization for SearchSettings """ - # 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 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 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 runtime_entity_alternative_model == runtime_entity_alternative_model2 + # Construct dict forms of any model objects needed in order to build this model. - # 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 + 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 -class TestModel_RuntimeEntityInterpretation: - """ - Test Class for RuntimeEntityInterpretation - """ + search_settings_messages_model = {} # SearchSettingsMessages + search_settings_messages_model['success'] = 'testString' + search_settings_messages_model['error'] = 'testString' + search_settings_messages_model['no_result'] = 'testString' - def test_runtime_entity_interpretation_serialization(self): - """ - Test serialization/deserialization for RuntimeEntityInterpretation - """ + 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' - # 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 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 - # 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 + # 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 - # 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) + # 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) # Verify the model instances are equivalent - assert runtime_entity_interpretation_model == runtime_entity_interpretation_model2 + assert search_settings_model == search_settings_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 + search_settings_model_json2 = search_settings_model.to_dict() + assert search_settings_model_json2 == search_settings_model_json -class TestModel_RuntimeEntityRole: +class TestModel_SearchSettingsDiscovery: """ - Test Class for RuntimeEntityRole + Test Class for SearchSettingsDiscovery """ - def test_runtime_entity_role_serialization(self): + def test_search_settings_discovery_serialization(self): """ - Test serialization/deserialization for RuntimeEntityRole + Test serialization/deserialization for SearchSettingsDiscovery """ - # Construct a json representation of a RuntimeEntityRole model - runtime_entity_role_model_json = {} - runtime_entity_role_model_json['type'] = 'date_from' - - # 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 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_dict = RuntimeEntityRole.from_dict(runtime_entity_role_model_json).__dict__ - runtime_entity_role_model2 = RuntimeEntityRole(**runtime_entity_role_model_dict) + 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 runtime_entity_role_model == runtime_entity_role_model2 + assert search_settings_discovery_model == search_settings_discovery_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 + search_settings_discovery_model_json2 = search_settings_discovery_model.to_dict() + assert search_settings_discovery_model_json2 == search_settings_discovery_model_json -class TestModel_RuntimeIntent: +class TestModel_SearchSettingsDiscoveryAuthentication: """ - Test Class for RuntimeIntent + Test Class for SearchSettingsDiscoveryAuthentication """ - def test_runtime_intent_serialization(self): + def test_search_settings_discovery_authentication_serialization(self): """ - Test serialization/deserialization for RuntimeIntent + Test serialization/deserialization for SearchSettingsDiscoveryAuthentication """ - # 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 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 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 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 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 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 runtime_intent_model == runtime_intent_model2 + assert search_settings_discovery_authentication_model == search_settings_discovery_authentication_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 + 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_SearchResult: +class TestModel_SearchSettingsMessages: """ - Test Class for SearchResult + Test Class for SearchSettingsMessages """ - def test_search_result_serialization(self): + def test_search_settings_messages_serialization(self): """ - Test serialization/deserialization for SearchResult + Test serialization/deserialization for SearchSettingsMessages """ - # 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] + # 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 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 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 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) + # 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_result_model == search_result_model2 + assert search_settings_messages_model == search_settings_messages_model2 # 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 + search_settings_messages_model_json2 = search_settings_messages_model.to_dict() + assert search_settings_messages_model_json2 == search_settings_messages_model_json -class TestModel_SearchResultAnswer: +class TestModel_SearchSettingsSchemaMapping: """ - Test Class for SearchResultAnswer + Test Class for SearchSettingsSchemaMapping """ - def test_search_result_answer_serialization(self): + def test_search_settings_schema_mapping_serialization(self): """ - Test serialization/deserialization for SearchResultAnswer + Test serialization/deserialization for SearchSettingsSchemaMapping """ - # 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 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 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 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 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 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_result_answer_model == search_result_answer_model2 + assert search_settings_schema_mapping_model == search_settings_schema_mapping_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 + 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_SearchResultHighlight: +class TestModel_SearchSkillWarning: """ - Test Class for SearchResultHighlight + Test Class for SearchSkillWarning """ - def test_search_result_highlight_serialization(self): + def test_search_skill_warning_serialization(self): """ - Test serialization/deserialization for SearchResultHighlight + Test serialization/deserialization for SearchSkillWarning """ - # 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 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 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 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 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) + # 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_result_highlight_model == search_result_highlight_model2 + assert search_skill_warning_model == search_skill_warning_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 == expected_dict + search_skill_warning_model_json2 = search_skill_warning_model.to_dict() + assert search_skill_warning_model_json2 == search_skill_warning_model_json -class TestModel_SearchResultMetadata: +class TestModel_SessionResponse: """ - Test Class for SearchResultMetadata + Test Class for SessionResponse """ - def test_search_result_metadata_serialization(self): + def test_session_response_serialization(self): """ - Test serialization/deserialization for SearchResultMetadata + Test serialization/deserialization for SessionResponse """ - # 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 SessionResponse model + session_response_model_json = {} + session_response_model_json['session_id'] = 'testString' - # 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 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 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 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 search_result_metadata_model == search_result_metadata_model2 + assert session_response_model == session_response_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 + session_response_model_json2 = session_response_model.to_dict() + assert session_response_model_json2 == session_response_model_json -class TestModel_SearchSettings: +class TestModel_Skill: """ - Test Class for SearchSettings + Test Class for Skill """ - def test_search_settings_serialization(self): + def test_skill_serialization(self): """ - Test serialization/deserialization for SearchSettings + Test serialization/deserialization for Skill """ # Construct dict forms of any model objects needed in order to build this model. @@ -7474,270 +7575,10 @@ def test_search_settings_serialization(self): search_settings_schema_mapping_model['body'] = 'testString' search_settings_schema_mapping_model['title'] = 'testString' - # 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 - - # 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 - - # 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) - - # Verify the model instances are equivalent - assert search_settings_model == search_settings_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 - - -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_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_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_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 = {} # 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 # Construct a json representation of a Skill model skill_model_json = {} @@ -7938,6 +7779,812 @@ def test_skills_export_serialization(self): 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_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 + 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_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_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_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_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 + 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_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_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'} + + 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 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 + + # 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 @@ -8923,6 +9570,7 @@ def test_runtime_response_generic_runtime_response_type_option_serialization(sel 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 @@ -9156,6 +9804,7 @@ def test_runtime_response_generic_runtime_response_type_suggestion_serialization 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