ibm_watson.assistant_v2 module¶
The IBM Watson™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users. The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.
-
class
AssistantV2
(version: str, authenticator: Optional[ibm_cloud_sdk_core.authenticators.authenticator.Authenticator] = None, service_name: str = 'assistant')[source]¶ Bases:
ibm_cloud_sdk_core.base_service.BaseService
The Assistant V2 service.
-
DEFAULT_SERVICE_URL
= 'https://api.us-south.assistant.watson.cloud.ibm.com'¶
-
DEFAULT_SERVICE_NAME
= 'assistant'¶
-
create_session
(assistant_id: str, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Create a session.
Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).
- Parameters
assistant_id (str) – Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the assistant settings and click API Details. For information about creating assistants, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). Note: Currently, the v2 API does not support creating assistants.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SessionResponse object
-
delete_session
(assistant_id: str, session_id: str, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Delete session.
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)).
- Parameters
assistant_id (str) – Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the assistant settings and click API Details. For information about creating assistants, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). Note: Currently, the v2 API does not support creating assistants.
session_id (str) – Unique identifier of the session.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
-
message
(assistant_id: str, session_id: str, *, input: Optional[ibm_watson.assistant_v2.MessageInput] = None, context: Optional[ibm_watson.assistant_v2.MessageContext] = None, user_id: Optional[str] = None, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Send user input to assistant (stateful).
Send user input to an assistant and receive a response, with conversation state (including context data) stored by Watson Assistant for the duration of the session.
- Parameters
assistant_id (str) – Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the assistant settings and click API Details. For information about creating assistants, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). Note: Currently, the v2 API does not support creating assistants.
session_id (str) – Unique identifier of the session.
input (MessageInput) – (optional) An input object that includes the input text.
context (MessageContext) – (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.
user_id (str) – (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.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a MessageResponse object
-
message_stateless
(assistant_id: str, *, input: Optional[ibm_watson.assistant_v2.MessageInputStateless] = None, context: Optional[ibm_watson.assistant_v2.MessageContextStateless] = None, user_id: Optional[str] = None, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Send user input to assistant (stateless).
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
- Parameters
assistant_id (str) – Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the assistant settings and click API Details. For information about creating assistants, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). Note: Currently, the v2 API does not support creating assistants.
input (MessageInputStateless) – (optional) An input object that includes the input text.
context (MessageContextStateless) – (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 not stored by the assistant. To maintain session state, include the context from the previous response. Note: The total size of the context data for a stateless session cannot exceed 250KB.
user_id (str) – (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 in a message request, the value specified at the root is used.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a MessageResponseStateless object
-
bulk_classify
(skill_id: str, *, input: Optional[List[ibm_watson.assistant_v2.BulkClassifyUtterance]] = None, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Identify intents and entities in multiple user utterances.
Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions. This method is available only with Enterprise with Data Isolation plans.
- Parameters
skill_id (str) – Unique identifier of the skill. To find the skill ID in the Watson Assistant user interface, open the skill settings and click API Details.
input (List[BulkClassifyUtterance]) – (optional) An array of input utterances to classify.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a BulkClassifyResponse object
-
list_logs
(assistant_id: str, *, sort: Optional[str] = None, filter: Optional[str] = None, page_limit: Optional[int] = None, cursor: Optional[str] = None, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ List log events for an assistant.
List the events from the log of an assistant. This method requires Manager access, and is available only with Enterprise plans.
- Parameters
assistant_id (str) – Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the assistant settings and click API Details. For information about creating assistants, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). Note: Currently, the v2 API does not support creating assistants.
sort (str) – (optional) How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (-).
filter (str) – (optional) A cacheable parameter that limits the results to those matching the specified filter. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
page_limit (int) – (optional) The number of records to return in each page of results.
cursor (str) – (optional) A token identifying the page of results to retrieve.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a LogCollection object
-
delete_user_data
(customer_id: str, **kwargs) → ibm_cloud_sdk_core.detailed_response.DetailedResponse[source]¶ Delete labeled data.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID. You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see [Information security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security). Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see [Labeling and deleting data in Watson Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
-
-
class
AgentAvailabilityMessage
(*, message: Optional[str] = None)[source]¶ Bases:
object
AgentAvailabilityMessage.
- Attr str message
(optional) The text of the message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.AgentAvailabilityMessage[source]¶ Initialize a AgentAvailabilityMessage object from a json dictionary.
-
class
BulkClassifyOutput
(*, input: Optional[ibm_watson.assistant_v2.BulkClassifyUtterance] = None, entities: Optional[List[ibm_watson.assistant_v2.RuntimeEntity]] = None, intents: Optional[List[ibm_watson.assistant_v2.RuntimeIntent]] = None)[source]¶ Bases:
object
BulkClassifyOutput.
- Attr BulkClassifyUtterance input
(optional) The user input utterance to classify.
- Attr List[RuntimeEntity] entities
(optional) An array of entities identified in the utterance.
- Attr List[RuntimeIntent] intents
(optional) An array of intents recognized in the utterance.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.BulkClassifyOutput[source]¶ Initialize a BulkClassifyOutput object from a json dictionary.
-
class
BulkClassifyResponse
(*, output: Optional[List[ibm_watson.assistant_v2.BulkClassifyOutput]] = None)[source]¶ Bases:
object
BulkClassifyResponse.
- Attr List[BulkClassifyOutput] output
(optional) An array of objects that contain classification information for the submitted input utterances.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.BulkClassifyResponse[source]¶ Initialize a BulkClassifyResponse object from a json dictionary.
-
class
BulkClassifyUtterance
(text: str)[source]¶ Bases:
object
The user input utterance to classify.
- Attr str text
The text of the input utterance.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.BulkClassifyUtterance[source]¶ Initialize a BulkClassifyUtterance object from a json dictionary.
-
class
CaptureGroup
(group: str, *, location: Optional[List[int]] = None)[source]¶ Bases:
object
CaptureGroup.
- Attr str group
A recognized capture group for the entity.
- Attr List[int] location
(optional) Zero-based character offsets that indicate where the entity value begins and ends in the input text.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.CaptureGroup[source]¶ Initialize a CaptureGroup object from a json dictionary.
-
class
ChannelTransferInfo
(target: ibm_watson.assistant_v2.ChannelTransferTarget)[source]¶ Bases:
object
Information used by an integration to transfer the conversation to a different channel.
- Attr ChannelTransferTarget target
An object specifying target channels available for the transfer. Each property of this object represents an available transfer target. Currently, the only supported property is chat, representing the web chat integration.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.ChannelTransferInfo[source]¶ Initialize a ChannelTransferInfo object from a json dictionary.
-
class
ChannelTransferTarget
(*, chat: Optional[ibm_watson.assistant_v2.ChannelTransferTargetChat] = None)[source]¶ Bases:
object
An object specifying target channels available for the transfer. Each property of this object represents an available transfer target. Currently, the only supported property is chat, representing the web chat integration.
- Attr ChannelTransferTargetChat chat
(optional) Information for transferring to the web chat integration.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.ChannelTransferTarget[source]¶ Initialize a ChannelTransferTarget object from a json dictionary.
-
class
ChannelTransferTargetChat
(*, url: Optional[str] = None)[source]¶ Bases:
object
Information for transferring to the web chat integration.
- Attr str url
(optional) The URL of the target web chat.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.ChannelTransferTargetChat[source]¶ Initialize a ChannelTransferTargetChat object from a json dictionary.
-
class
DialogLogMessage
(level: str, message: str, code: str, *, source: Optional[ibm_watson.assistant_v2.LogMessageSource] = None)[source]¶ Bases:
object
Dialog log message details.
- Attr str level
The severity of the log message.
- Attr str message
The text of the log message.
- Attr str code
A code that indicates the category to which the error message belongs.
- Attr LogMessageSource source
(optional) An object that identifies the dialog element that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogLogMessage[source]¶ Initialize a DialogLogMessage object from a json dictionary.
-
class
DialogNodeAction
(name: str, result_variable: str, *, type: Optional[str] = None, parameters: Optional[dict] = None, credentials: Optional[str] = None)[source]¶ Bases:
object
DialogNodeAction.
- Attr str name
The name of the action.
- Attr str type
(optional) The type of action to invoke.
- Attr dict parameters
(optional) A map of key/value pairs to be provided to the action.
- Attr str result_variable
The location in the dialog context where the result of the action is stored.
- Attr str credentials
(optional) The name of the context variable that the client application will use to pass in credentials for the action.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogNodeAction[source]¶ Initialize a DialogNodeAction object from a json dictionary.
-
class
DialogNodeOutputConnectToAgentTransferInfo
(*, target: Optional[dict] = None)[source]¶ Bases:
object
Routing or other contextual information to be used by target service desk systems.
- Attr dict target
(optional)
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogNodeOutputConnectToAgentTransferInfo[source]¶ Initialize a DialogNodeOutputConnectToAgentTransferInfo object from a json dictionary.
-
class
DialogNodeOutputOptionsElement
(label: str, value: ibm_watson.assistant_v2.DialogNodeOutputOptionsElementValue)[source]¶ Bases:
object
DialogNodeOutputOptionsElement.
- Attr str label
The user-facing label for the option.
- Attr DialogNodeOutputOptionsElementValue value
An object defining the message input to be sent to the assistant if the user selects the corresponding option.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogNodeOutputOptionsElement[source]¶ Initialize a DialogNodeOutputOptionsElement object from a json dictionary.
-
class
DialogNodeOutputOptionsElementValue
(*, input: Optional[ibm_watson.assistant_v2.MessageInput] = None)[source]¶ Bases:
object
An object defining the message input to be sent to the assistant if the user selects the corresponding option.
- Attr MessageInput input
(optional) An input object that includes the input text.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogNodeOutputOptionsElementValue[source]¶ Initialize a DialogNodeOutputOptionsElementValue object from a json dictionary.
-
class
DialogNodesVisited
(*, dialog_node: Optional[str] = None, title: Optional[str] = None, conditions: Optional[str] = None)[source]¶ Bases:
object
DialogNodesVisited.
- Attr str dialog_node
(optional) A dialog node that was triggered during processing of the input message.
- Attr str title
(optional) The title of the dialog node.
- Attr str conditions
(optional) The conditions that trigger the dialog node.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogNodesVisited[source]¶ Initialize a DialogNodesVisited object from a json dictionary.
-
class
DialogSuggestion
(label: str, value: ibm_watson.assistant_v2.DialogSuggestionValue, *, output: Optional[dict] = None)[source]¶ Bases:
object
DialogSuggestion.
- Attr str label
The user-facing label for the suggestion. This label is taken from the title or user_label property of the corresponding dialog node, depending on the disambiguation options.
- Attr DialogSuggestionValue value
An object defining the message input to be sent to the assistant if the user selects the corresponding disambiguation option.
- Attr dict output
(optional) The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogSuggestion[source]¶ Initialize a DialogSuggestion object from a json dictionary.
-
class
DialogSuggestionValue
(*, input: Optional[ibm_watson.assistant_v2.MessageInput] = None)[source]¶ Bases:
object
An object defining the message input to be sent to the assistant if the user selects the corresponding disambiguation option.
- Attr MessageInput input
(optional) An input object that includes the input text.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.DialogSuggestionValue[source]¶ Initialize a DialogSuggestionValue object from a json dictionary.
-
class
Log
(log_id: str, request: ibm_watson.assistant_v2.MessageRequest, response: ibm_watson.assistant_v2.MessageResponse, assistant_id: str, session_id: str, skill_id: str, snapshot: str, request_timestamp: str, response_timestamp: str, language: str, *, customer_id: Optional[str] = None)[source]¶ Bases:
object
Log.
- Attr str log_id
A unique identifier for the logged event.
- Attr MessageRequest request
A stateful message request formatted for the Watson Assistant service.
- Attr MessageResponse response
A response from the Watson Assistant service.
- Attr str assistant_id
Unique identifier of the assistant.
- Attr str session_id
The ID of the session the message was part of.
- Attr str skill_id
The unique identifier of the skill that responded to the message.
- Attr str snapshot
The name of the snapshot (dialog skill version) that responded to the message (for example, draft).
- Attr str request_timestamp
The timestamp for receipt of the message.
- Attr str response_timestamp
The timestamp for the system response to the message.
- Attr str language
The language of the assistant to which the message request was made.
- Attr str customer_id
(optional) The customer ID specified for the message, if any.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.Log[source]¶ Initialize a Log object from a json dictionary.
-
class
LogCollection
(logs: List[ibm_watson.assistant_v2.Log], pagination: ibm_watson.assistant_v2.LogPagination)[source]¶ Bases:
object
LogCollection.
- Attr List[Log] logs
An array of objects describing log events.
- Attr LogPagination pagination
The pagination data for the returned objects.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogCollection[source]¶ Initialize a LogCollection object from a json dictionary.
-
class
LogMessageSource
[source]¶ Bases:
object
An object that identifies the dialog element that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogMessageSource[source]¶ Initialize a LogMessageSource object from a json dictionary.
-
classmethod
-
class
LogPagination
(*, next_url: Optional[str] = None, matched: Optional[int] = None, next_cursor: Optional[str] = None)[source]¶ Bases:
object
The pagination data for the returned objects.
- Attr str next_url
(optional) The URL that will return the next page of results, if any.
- Attr int matched
(optional) Reserved for future use.
- Attr str next_cursor
(optional) A token identifying the next page of results.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogPagination[source]¶ Initialize a LogPagination object from a json dictionary.
-
class
MessageContext
(*, global_: Optional[ibm_watson.assistant_v2.MessageContextGlobal] = None, skills: Optional[dict] = None)[source]¶ Bases:
object
MessageContext.
- Attr MessageContextGlobal globalglobal_
(optional) Session context data that is shared by all skills used by the Assistant.
- Attr dict skills
(optional) Information specific to particular skills used by the assistant. Note: Currently, only a single child property is supported, containing variables that apply to the dialog skill used by the assistant.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContext[source]¶ Initialize a MessageContext object from a json dictionary.
-
class
MessageContextGlobal
(*, system: Optional[ibm_watson.assistant_v2.MessageContextGlobalSystem] = None, session_id: Optional[str] = None)[source]¶ Bases:
object
Session context data that is shared by all skills used by the Assistant.
- Attr MessageContextGlobalSystem system
(optional) Built-in system properties that apply to all skills used by the assistant.
- Attr str session_id
(optional) The session ID.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextGlobal[source]¶ Initialize a MessageContextGlobal object from a json dictionary.
-
class
MessageContextGlobalStateless
(*, system: Optional[ibm_watson.assistant_v2.MessageContextGlobalSystem] = None, session_id: Optional[str] = None)[source]¶ Bases:
object
Session context data that is shared by all skills used by the Assistant.
- Attr MessageContextGlobalSystem system
(optional) Built-in system properties that apply to all skills used by the assistant.
- Attr str session_id
(optional) The unique identifier of the session.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextGlobalStateless[source]¶ Initialize a MessageContextGlobalStateless object from a json dictionary.
-
class
MessageContextGlobalSystem
(*, timezone: Optional[str] = None, user_id: Optional[str] = None, turn_count: Optional[int] = None, locale: Optional[str] = None, reference_time: Optional[str] = None)[source]¶ Bases:
object
Built-in system properties that apply to all skills used by the assistant.
- Attr str timezone
(optional) The user time zone. The assistant uses the time zone to correctly resolve relative time references.
- Attr 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.
- Attr 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).
- Attr 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.
- Attr 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, 2019-06-26T12:00:00Z for noon on 26 June 2019. This property is included only if the new system entities are enabled for the skill.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextGlobalSystem[source]¶ Initialize a MessageContextGlobalSystem object from a json dictionary.
-
class
LocaleEnum
(value)[source]¶ -
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
MessageContextSkill
(*, user_defined: Optional[dict] = None, system: Optional[ibm_watson.assistant_v2.MessageContextSkillSystem] = None)[source]¶ Bases:
object
Contains information specific to a particular skill used by the Assistant. The property name must be the same as the name of the skill (for example, main skill).
- Attr dict user_defined
(optional) Arbitrary variables that can be read and written by a particular skill.
- Attr MessageContextSkillSystem system
(optional) System context data used by the skill.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextSkill[source]¶ Initialize a MessageContextSkill object from a json dictionary.
-
class
MessageContextSkillSystem
(*, state: Optional[str] = None, **kwargs)[source]¶ Bases:
object
System context data used by the skill.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextSkillSystem[source]¶ Initialize a MessageContextSkillSystem object from a json dictionary.
-
class
MessageContextStateless
(*, global_: Optional[ibm_watson.assistant_v2.MessageContextGlobalStateless] = None, skills: Optional[dict] = None)[source]¶ Bases:
object
MessageContextStateless.
- Attr MessageContextGlobalStateless globalglobal_
(optional) Session context data that is shared by all skills used by the Assistant.
- Attr dict skills
(optional) Information specific to particular skills used by the assistant. Note: Currently, only a single child property is supported, containing variables that apply to the dialog skill used by the assistant.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageContextStateless[source]¶ Initialize a MessageContextStateless object from a json dictionary.
-
class
MessageInput
(*, message_type: Optional[str] = None, text: Optional[str] = None, intents: Optional[List[ibm_watson.assistant_v2.RuntimeIntent]] = None, entities: Optional[List[ibm_watson.assistant_v2.RuntimeEntity]] = None, suggestion_id: Optional[str] = None, options: Optional[ibm_watson.assistant_v2.MessageInputOptions] = None)[source]¶ Bases:
object
An input object that includes the input text.
- Attr str message_type
(optional) The type of user input. Currently, only text input is supported.
- Attr str text
(optional) The text of the user input. This string cannot contain carriage return, newline, or tab characters.
- Attr 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.
- Attr 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.
- Attr str suggestion_id
(optional) For internal use only.
- Attr MessageInputOptions options
(optional) Optional properties that control how the assistant responds.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageInput[source]¶ Initialize a MessageInput object from a json dictionary.
-
class
MessageInputOptions
(*, restart: Optional[bool] = None, alternate_intents: Optional[bool] = None, spelling: Optional[ibm_watson.assistant_v2.MessageInputOptionsSpelling] = None, debug: Optional[bool] = None, return_context: Optional[bool] = None, export: Optional[bool] = None)[source]¶ Bases:
object
Optional properties that control how the assistant responds.
- Attr 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.
- Attr bool alternate_intents
(optional) Whether to return more than one intent. Set to true to return all matching intents.
- Attr MessageInputOptionsSpelling spelling
(optional) Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- Attr bool debug
(optional) Whether to return additional diagnostic information. Set to true to return additional information in the output.debug property. If you also specify **return_context**=`true`, the returned skill context includes the system.state property.
- Attr bool return_context
(optional) Whether to return session context with the response. If you specify true, the response includes the context property. If you also specify **debug**=`true`, the returned skill context includes the system.state property.
- Attr bool export
(optional) Whether to return session context, including full conversation state. If you specify true, the response includes the context property, and the skill context includes the system.state property. Note: If export**=`true`, the context is returned regardless of the value of **return_context.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageInputOptions[source]¶ Initialize a MessageInputOptions object from a json dictionary.
-
class
MessageInputOptionsSpelling
(*, suggestions: Optional[bool] = None, auto_correct: Optional[bool] = None)[source]¶ Bases:
object
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- Attr bool suggestions
(optional) Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is true, any spelling corrections are automatically applied to the user input. If auto_correct is false, any suggested corrections are returned in the output.spelling property. This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
- Attr bool auto_correct
(optional) Whether to use autocorrection when processing the input. If this property is true, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageInputOptionsSpelling[source]¶ Initialize a MessageInputOptionsSpelling object from a json dictionary.
-
class
MessageInputOptionsStateless
(*, restart: Optional[bool] = None, alternate_intents: Optional[bool] = None, spelling: Optional[ibm_watson.assistant_v2.MessageInputOptionsSpelling] = None, debug: Optional[bool] = None)[source]¶ Bases:
object
Optional properties that control how the assistant responds.
- Attr 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.
- Attr bool alternate_intents
(optional) Whether to return more than one intent. Set to true to return all matching intents.
- Attr MessageInputOptionsSpelling spelling
(optional) Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- Attr bool debug
(optional) Whether to return additional diagnostic information. Set to true to return additional information in the output.debug property.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageInputOptionsStateless[source]¶ Initialize a MessageInputOptionsStateless object from a json dictionary.
-
class
MessageInputStateless
(*, message_type: Optional[str] = None, text: Optional[str] = None, intents: Optional[List[ibm_watson.assistant_v2.RuntimeIntent]] = None, entities: Optional[List[ibm_watson.assistant_v2.RuntimeEntity]] = None, suggestion_id: Optional[str] = None, options: Optional[ibm_watson.assistant_v2.MessageInputOptionsStateless] = None)[source]¶ Bases:
object
An input object that includes the input text.
- Attr str message_type
(optional) The type of user input. Currently, only text input is supported.
- Attr str text
(optional) The text of the user input. This string cannot contain carriage return, newline, or tab characters.
- Attr 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.
- Attr 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.
- Attr str suggestion_id
(optional) For internal use only.
- Attr MessageInputOptionsStateless options
(optional) Optional properties that control how the assistant responds.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageInputStateless[source]¶ Initialize a MessageInputStateless object from a json dictionary.
-
class
MessageOutput
(*, generic: Optional[List[ibm_watson.assistant_v2.RuntimeResponseGeneric]] = None, intents: Optional[List[ibm_watson.assistant_v2.RuntimeIntent]] = None, entities: Optional[List[ibm_watson.assistant_v2.RuntimeEntity]] = None, actions: Optional[List[ibm_watson.assistant_v2.DialogNodeAction]] = None, debug: Optional[ibm_watson.assistant_v2.MessageOutputDebug] = None, user_defined: Optional[dict] = None, spelling: Optional[ibm_watson.assistant_v2.MessageOutputSpelling] = None)[source]¶ Bases:
object
Assistant output to be rendered or processed by the client.
- Attr List[RuntimeResponseGeneric] generic
(optional) Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- Attr List[RuntimeIntent] intents
(optional) An array of intents recognized in the user input, sorted in descending order of confidence.
- Attr List[RuntimeEntity] entities
(optional) An array of entities identified in the user input.
- Attr List[DialogNodeAction] actions
(optional) An array of objects describing any actions requested by the dialog node.
- Attr MessageOutputDebug debug
(optional) Additional detailed information about a message response and how it was generated.
- Attr 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.
- Attr MessageOutputSpelling spelling
(optional) Properties describing any spelling corrections in the user input that was received.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageOutput[source]¶ Initialize a MessageOutput object from a json dictionary.
-
class
MessageOutputDebug
(*, nodes_visited: Optional[List[ibm_watson.assistant_v2.DialogNodesVisited]] = None, log_messages: Optional[List[ibm_watson.assistant_v2.DialogLogMessage]] = None, branch_exited: Optional[bool] = None, branch_exited_reason: Optional[str] = None)[source]¶ Bases:
object
Additional detailed information about a message response and how it was generated.
- Attr List[DialogNodesVisited] nodes_visited
(optional) An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message.
- Attr List[DialogLogMessage] log_messages
(optional) An array of up to 50 messages logged with the request.
- Attr bool branch_exited
(optional) Assistant sets this to true when this message response concludes or interrupts a dialog.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageOutputDebug[source]¶ Initialize a MessageOutputDebug object from a json dictionary.
-
class
MessageOutputSpelling
(*, text: Optional[str] = None, original_text: Optional[str] = None, suggested_text: Optional[str] = None)[source]¶ Bases:
object
Properties describing any spelling corrections in the user input that was received.
- Attr 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.
- Attr str original_text
(optional) The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageOutputSpelling[source]¶ Initialize a MessageOutputSpelling object from a json dictionary.
-
class
MessageRequest
(*, input: Optional[ibm_watson.assistant_v2.MessageInput] = None, context: Optional[ibm_watson.assistant_v2.MessageContext] = None, user_id: Optional[str] = None)[source]¶ Bases:
object
A stateful message request formatted for the Watson Assistant service.
- Attr MessageInput input
(optional) An input object that includes the input text.
- Attr 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.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageRequest[source]¶ Initialize a MessageRequest object from a json dictionary.
-
class
MessageResponse
(output: ibm_watson.assistant_v2.MessageOutput, user_id: str, *, context: Optional[ibm_watson.assistant_v2.MessageContext] = None)[source]¶ Bases:
object
A response from the Watson Assistant service.
- Attr MessageOutput output
Assistant output to be rendered or processed by the client.
- Attr 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.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageResponse[source]¶ Initialize a MessageResponse object from a json dictionary.
-
class
MessageResponseStateless
(output: ibm_watson.assistant_v2.MessageOutput, context: ibm_watson.assistant_v2.MessageContextStateless, *, user_id: Optional[str] = None)[source]¶ Bases:
object
A stateless response from the Watson Assistant service.
- Attr MessageOutput output
Assistant output to be rendered or processed by the client.
- Attr 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.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.MessageResponseStateless[source]¶ Initialize a MessageResponseStateless object from a json dictionary.
-
class
ResponseGenericChannel
(*, channel: Optional[str] = None)[source]¶ Bases:
object
ResponseGenericChannel.
- Attr str channel
(optional) A channel for which the response is intended.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.ResponseGenericChannel[source]¶ Initialize a ResponseGenericChannel object from a json dictionary.
-
class
RuntimeEntity
(entity: str, location: List[int], value: str, *, confidence: Optional[float] = None, metadata: Optional[dict] = None, groups: Optional[List[ibm_watson.assistant_v2.CaptureGroup]] = None, interpretation: Optional[ibm_watson.assistant_v2.RuntimeEntityInterpretation] = None, alternatives: Optional[List[ibm_watson.assistant_v2.RuntimeEntityAlternative]] = None, role: Optional[ibm_watson.assistant_v2.RuntimeEntityRole] = None)[source]¶ Bases:
object
The entity value that was recognized in the user input.
- Attr str entity
An entity detected in the input.
- Attr List[int] location
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
- Attr str value
The term in the input text that was recognized as an entity value.
- Attr float confidence
(optional) A decimal percentage that represents Watson’s confidence in the recognized entity.
- Attr dict metadata
(optional) Any metadata for the entity.
- Attr List[CaptureGroup] groups
(optional) The recognized capture groups for the entity, as defined by the entity pattern.
- Attr 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).
- Attr 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.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeEntity[source]¶ Initialize a RuntimeEntity object from a json dictionary.
-
class
RuntimeEntityAlternative
(*, value: Optional[str] = None, confidence: Optional[float] = None)[source]¶ Bases:
object
An alternative value for the recognized entity.
- Attr str value
(optional) The entity value that was recognized in the user input.
- Attr float confidence
(optional) A decimal percentage that represents Watson’s confidence in the recognized entity.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeEntityAlternative[source]¶ Initialize a RuntimeEntityAlternative object from a json dictionary.
-
class
RuntimeEntityInterpretation
(*, 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)[source]¶ Bases:
object
RuntimeEntityInterpretation.
- Attr str calendar_type
(optional) The calendar used to represent a recognized date (for example, Gregorian).
- Attr 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).
- Attr 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.
- Attr str granularity
(optional) The precision or duration of a time range specified by a recognized @sys-time or @sys-date entity.
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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.).
- Attr str specific_day_of_week
(optional) A recognized mention of a specific day of the week as a lowercase string (for example, monday).
- Attr float specific_month
(optional) A recognized mention of a specific month, represented numerically (for example, 7 for July).
- Attr float specific_quarter
(optional) A recognized mention of a specific quarter, represented numerically (for example, 3 for the third quarter).
- Attr float specific_year
(optional) A recognized mention of a specific year (for example, 2016).
- Attr float numeric_value
(optional) A recognized numeric value, represented as an integer or double.
- Attr str subtype
(optional) The type of numeric value recognized in the user input (integer or rational).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr 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).
- Attr float specific_hour
(optional) A recognized specific hour mentioned as part of a time value (for example, 10 for 10:15 AM.).
- Attr float specific_minute
(optional) A recognized specific minute mentioned as part of a time value (for example, 15 for 10:15 AM.).
- Attr float specific_second
(optional) A recognized specific second mentioned as part of a time value (for example, 30 for 10:15:30 AM.).
- Attr str timezone
(optional) A recognized time zone mentioned as part of a time value (for example, EST).
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeEntityInterpretation[source]¶ Initialize a RuntimeEntityInterpretation object from a json dictionary.
-
class
GranularityEnum
(value)[source]¶ -
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
(*, type: Optional[str] = None)[source]¶ Bases:
object
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.
- Attr str type
(optional) The relationship of the entity to the range.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeEntityRole[source]¶ Initialize a RuntimeEntityRole object from a json dictionary.
-
class
RuntimeIntent
(intent: str, confidence: float)[source]¶ Bases:
object
An intent identified in the user input.
- Attr str intent
The name of the recognized intent.
- Attr float confidence
A decimal percentage that represents Watson’s confidence in the intent.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeIntent[source]¶ Initialize a RuntimeIntent object from a json dictionary.
-
class
RuntimeResponseGeneric
[source]¶ Bases:
object
RuntimeResponseGeneric.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGeneric[source]¶ Initialize a RuntimeResponseGeneric object from a json dictionary.
-
classmethod
-
class
SearchResult
(id: str, result_metadata: ibm_watson.assistant_v2.SearchResultMetadata, *, body: Optional[str] = None, title: Optional[str] = None, url: Optional[str] = None, highlight: Optional[ibm_watson.assistant_v2.SearchResultHighlight] = None)[source]¶ Bases:
object
SearchResult.
- Attr 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.
- Attr SearchResultMetadata result_metadata
An object containing search result metadata from the Discovery service.
- Attr 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.
- Attr 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.
- Attr str url
(optional) The URL of the original data object in its native data source.
- Attr SearchResultHighlight highlight
(optional) An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.SearchResult[source]¶ Initialize a SearchResult object from a json dictionary.
-
class
SearchResultHighlight
(*, body: Optional[List[str]] = None, title: Optional[List[str]] = None, url: Optional[List[str]] = None, **kwargs)[source]¶ Bases:
object
An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags.
- Attr List[str] body
(optional) An array of strings containing segments taken from body text in the search results, with query-matching substrings highlighted.
- Attr List[str] title
(optional) An array of strings containing segments taken from title text in the search results, with query-matching substrings highlighted.
- Attr List[str] url
(optional) An array of strings containing segments taken from URLs in the search results, with query-matching substrings highlighted.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.SearchResultHighlight[source]¶ Initialize a SearchResultHighlight object from a json dictionary.
-
class
SearchResultMetadata
(*, confidence: Optional[float] = None, score: Optional[float] = None)[source]¶ Bases:
object
An object containing search result metadata from the Discovery service.
- Attr float confidence
(optional) The confidence score for the given result, as returned by the Discovery service.
- Attr 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.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.SearchResultMetadata[source]¶ Initialize a SearchResultMetadata object from a json dictionary.
-
class
SessionResponse
(session_id: str)[source]¶ Bases:
object
SessionResponse.
- Attr str session_id
The session ID.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.SessionResponse[source]¶ Initialize a SessionResponse object from a json dictionary.
-
class
LogMessageSourceAction
(type: str, action: str)[source]¶ Bases:
ibm_watson.assistant_v2.LogMessageSource
An object that identifies the dialog element that generated the error message.
- Attr str type
A string that indicates the type of dialog element that generated the error message.
- Attr str action
The unique identifier of the action that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogMessageSourceAction[source]¶ Initialize a LogMessageSourceAction object from a json dictionary.
-
class
LogMessageSourceDialogNode
(type: str, dialog_node: str)[source]¶ Bases:
ibm_watson.assistant_v2.LogMessageSource
An object that identifies the dialog element that generated the error message.
- Attr str type
A string that indicates the type of dialog element that generated the error message.
- Attr str dialog_node
The unique identifier of the dialog node that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogMessageSourceDialogNode[source]¶ Initialize a LogMessageSourceDialogNode object from a json dictionary.
-
class
LogMessageSourceHandler
(type: str, action: str, handler: str, *, step: Optional[str] = None)[source]¶ Bases:
ibm_watson.assistant_v2.LogMessageSource
An object that identifies the dialog element that generated the error message.
- Attr str type
A string that indicates the type of dialog element that generated the error message.
- Attr str action
The unique identifier of the action that generated the error message.
- Attr str step
(optional) The unique identifier of the step that generated the error message.
- Attr str handler
The unique identifier of the handler that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogMessageSourceHandler[source]¶ Initialize a LogMessageSourceHandler object from a json dictionary.
-
class
LogMessageSourceStep
(type: str, action: str, step: str)[source]¶ Bases:
ibm_watson.assistant_v2.LogMessageSource
An object that identifies the dialog element that generated the error message.
- Attr str type
A string that indicates the type of dialog element that generated the error message.
- Attr str action
The unique identifier of the action that generated the error message.
- Attr str step
The unique identifier of the step that generated the error message.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.LogMessageSourceStep[source]¶ Initialize a LogMessageSourceStep object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer
(response_type: str, message_to_user: str, transfer_info: ibm_watson.assistant_v2.ChannelTransferInfo, *, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str message_to_user
The message to display to the user when initiating a channel transfer.
- Attr ChannelTransferInfo transfer_info
Information used by an integration to transfer the conversation to a different channel.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeChannelTransfer[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeChannelTransfer object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeConnectToAgent
(response_type: str, *, message_to_human_agent: Optional[str] = None, agent_available: Optional[ibm_watson.assistant_v2.AgentAvailabilityMessage] = None, agent_unavailable: Optional[ibm_watson.assistant_v2.AgentAvailabilityMessage] = None, transfer_info: Optional[ibm_watson.assistant_v2.DialogNodeOutputConnectToAgentTransferInfo] = None, topic: Optional[str] = None, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str message_to_human_agent
(optional) A message to be sent to the human agent who will be taking over the conversation.
- Attr AgentAvailabilityMessage agent_available
(optional) An optional message to be displayed to the user to indicate that the conversation will be transferred to the next available agent.
- Attr AgentAvailabilityMessage agent_unavailable
(optional) An optional message to be displayed to the user to indicate that no online agent is available to take over the conversation.
- Attr DialogNodeOutputConnectToAgentTransferInfo transfer_info
(optional) Routing or other contextual information to be used by target service desk systems.
- Attr str topic
(optional) A label identifying the topic of the conversation, derived from the title property of the relevant node or the topic property of the dialog node response.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeConnectToAgent[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeConnectToAgent object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeImage
(response_type: str, source: str, *, title: Optional[str] = None, description: Optional[str] = None, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeImage.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str source
The URL of the image.
- Attr str title
(optional) The title to show before the response.
- Attr str description
(optional) The description to show with the the response.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeImage[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeImage object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeOption
(response_type: str, title: str, options: List[ibm_watson.assistant_v2.DialogNodeOutputOptionsElement], *, description: Optional[str] = None, preference: Optional[str] = None, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeOption.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str title
The title or introductory text to show before the response.
- Attr str description
(optional) The description to show with the the response.
- Attr str preference
(optional) The preferred type of control to display.
- Attr List[DialogNodeOutputOptionsElement] options
An array of objects describing the options from which the user can choose.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeOption[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeOption object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypePause
(response_type: str, time: int, *, typing: Optional[bool] = None, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypePause.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr int time
How long to pause, in milliseconds.
- Attr bool typing
(optional) Whether to send a “user is typing” event during the pause.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypePause[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypePause object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeSearch
(response_type: str, header: str, primary_results: List[ibm_watson.assistant_v2.SearchResult], additional_results: List[ibm_watson.assistant_v2.SearchResult], *, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeSearch.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str header
The title or introductory text to show before the response. This text is defined in the search skill configuration.
- Attr List[SearchResult] primary_results
An array of objects that contains the search results to be displayed in the initial response to the user.
- Attr List[SearchResult] additional_results
An array of objects that contains additional search results that can be displayed to the user upon request.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeSearch[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeSearch object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeSuggestion
(response_type: str, title: str, suggestions: List[ibm_watson.assistant_v2.DialogSuggestion], *, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeSuggestion.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str title
The title or introductory text to show before the response.
- Attr List[DialogSuggestion] suggestions
An array of objects describing the possible matching dialog nodes from which the user can choose.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeSuggestion[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeSuggestion object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeText
(response_type: str, text: str, *, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeText.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr str text
The text of the response.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeText[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeText object from a json dictionary.
-
class
RuntimeResponseGenericRuntimeResponseTypeUserDefined
(response_type: str, user_defined: dict, *, channels: Optional[List[ibm_watson.assistant_v2.ResponseGenericChannel]] = None)[source]¶ Bases:
ibm_watson.assistant_v2.RuntimeResponseGeneric
RuntimeResponseGenericRuntimeResponseTypeUserDefined.
- Attr str response_type
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
- Attr dict user_defined
An object containing any properties for the user-defined response type.
- Attr List[ResponseGenericChannel] channels
(optional) An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
-
classmethod
from_dict
(_dict: Dict) → ibm_watson.assistant_v2.RuntimeResponseGenericRuntimeResponseTypeUserDefined[source]¶ Initialize a RuntimeResponseGenericRuntimeResponseTypeUserDefined object from a json dictionary.