vania-janet/multiturn-rag-retrieval-data huggingface dataset:
assistant = AssistantV2(
version = '2021-11-27',
authenticator = authenticator
)
assistant.set_service_url('{url}') replace with service instance URL
assistant_id = '{environment_id}' replace with environment ID

 Start conversation with empty message.
result = assistant.message_stateless(
assistant_id,
).get_result()

 Print responses from actions, if any. Supports only text responses.
if result['output']:
for response in result['output']:
if response['response_type'] == 'text':
print(response['text'])

Show more

// Example 1: Creates service object, sends initial message, and
// receives response.

const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

// Create Assistant service object.
const assistant = new AssistantV2({
version: '2021-11-27',
authenticator: new IamAuthenticator({
apikey: '{apikey}', // replace with API key
}),
url: '{url}', // replace with URL
});

const assistantId = '{environment_id}'; // replace with environment ID

// Start conversation with empty message
messageInput = {
messageType: 'text',
text: '',
};
sendMessage(messageInput);

// Send message to assistant.
function sendMessage(messageInput) {
assistant
.messageStateless({
assistantId,
input: messageInput,
})
.then(res => {
processResult(res.result);
})
.catch(err => {
console.log(err); // something went wrong
});
For more information on uploading or downloading example phrases, see [Adding more examples](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-understand-questionsunderstand-questions-adding-more-examples).







 Editing the fallback action 

The built-in Fallback action is automatically provided with each assistant and cannot be deleted. However, you can edit the Fallback action to modify the conversation your users have with the assistant when errors occur. For example, you might want to add steps or modify step conditions to provide more control over how specific error conditions are handled.

To edit the Fallback action, click Set by assistant in the list of actions, and then click Fallback.

Zoom

![Fallback built-in action](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/fallback-action.png)

Fallback built-in action

Whenever the Fallback action is triggered, the assistant also sets a value for the Fallback reason session variable. This value indicates what kind of situation led to the Fallback action being triggered. By default, this variable can have one of five values:



* Step validation failed: The customer repeatedly gave answers that were not valid for the expected customer response type.
* Agent requested: The customer directly asked to be connected to a live agent.
* No action matches: The customer repeatedly made requests or asked questions that the assistant did not understand.
* Danger word detected: The customer uses words or phrases that match the Connect to agent step in the Trigger word detected action.
* Profanity detected: The customer repeatedly used words or phrases that match the Show warning step in the Trigger word detected action.



For more information about the Trigger word detected action, see [Detecting trigger words](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-trigger-words).

The Fallback action defines five conditional steps, one for each possible value of the Fallback reason variable.
For most customer response types, the assistant is able to understand valid responses provided in a variety of formats. For example, for a time value, 2:15 PM and a quarter past two in the afternoon are both acceptable. But if the user provides a value that the assistant cannot interpret as matching the expected response type (for example, a response of purple when asked for a number), a validation error results.

When there is a validation error, the assistant asks the customer to try again. By default, the assistant allows three attempts to provide a valid response. After the third attempt, another invalid attempt triggers the Fallback action, which offers other options like connecting to a live agent. For more information about the Fallback action, see [Editing the fallback action](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-handle-errorsfallback-action).



 Customizing validation for a response 

When you edit a step that expects a customer response, you can customize how validation errors are handled.



1. Click Edit validation to see the validation options.
2. For all customer responses except free text, you can customize the following options:



* In the Response 1 field, specify the text of the message the assistant sends when the customer's response doesn't match the expected response type. For example, the default validation error message for a numeric value is I didn't catch that. Enter a number. You might want to customize this message to be more specific, such as Enter the number of people in your group.
* If you want to use several validation responses, click Add Response to add more validation messages. The number of validation responses you can enter depends upon the value in the If attempts exceed field.
* In the If attempts exceed field, click + or -, or directly edit the number, to change how many consecutive attempts the customer can make before the Fallback action is triggered. Or, if you enabled [response modes](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-action-response-modes), you can use the number of step validation attempts from the response mode that you are using.
Release notes for Watson Assistant 

Find out what's new in IBM Watson® Assistant.

Release notes describe the new features, changes, and bug fixes in each release of the product. For more information about changes in the web chat integration, see the [Web chat release notes](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-release-notes-chat).



 14 July 2023 

Multiple responses when customizing validation
: When you edit validation for a customer response, you can now include several validation responses. For more information, see [Customizing validation for a response](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-handle-errorscustomize-validation).

Fallback option for dynamic options
: The dynamic options response type now includes a fallback static choice, such as None of the above, if the options aren't what the customer wants. You can then add a step that is conditioned on this static option to provide further assistance. For more information, see [Dynamic options](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-dynamic-options).

Allow change of topic between actions and dialog
: If you are using actions and dialog, there is a new setting you can use to ensure that customers can change topics between an action and a dialog node. For more information, see [Allow change of topic between actions and dialog](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-change-topicchange-topic-action-to-dialog).

Use multilingual downloads for translation
: You can enable the download of language data files, in CSV format, so you can translate training examples and assistant responses into other languages and use in other assistants. For more information, see [Using multilingual downloads for translation](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-admin-language-supportadmin-language-support-multilingual).





 12 July 2023 

Algorithm version Beta provides improved intent detection and action matching for more languages
* [Creating an agent definition using the CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewcreate-agent-cli)
* [Verifying prerequisites for agent deployment using the CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewverify-agent-cli)
* [Deploying an agent using the CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewapply-agent-cli)
* [Verifying the agent deployment using the CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewd-agent-cli)
* [Creating an agent using the Schematics API](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewcreate-agent-api)
* [Next steps](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overviewagent-create-nextsteps)



[Displaying agents](https://cloud.ibm.com/docs/schematics?topic=schematics-display-agentb1-overviewdisplay-agentb1-overview)



* [Displaying the list of agents using UI](https://cloud.ibm.com/docs/schematics?topic=schematics-display-agentb1-overviewdisplay-agentb1-get-ui)
* [Displaying the list of agents using the CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-display-agentb1-overviewdisplay-agentb1-list-cli)
* [Displaying agent configuration using CLI](https://cloud.ibm.com/docs/schematics?topic=schematics-display-agentb1-overviewdisplay-agentb1-get-cli)
More commonly, though, an action requires multiple steps to fully understand the customer's request. For our I want to withdraw money example, we need more information:



* Which account should the money come from?
* What is the amount to withdraw?



Each of these follow-up questions represents a step in the action.



 Editing a step 

Within a step, you define the following things:



* A step title that describes what the step does. The step title is optional.
* Any conditions that determine whether the step is processed at run time. (By default, a step is always processed if the user input matches.)
* What the assistant says to the customer when the step is processed.
* Rules for how the customer can reply to what the assistant says (if any response is expected).
* What to do after the step finishes.



Zoom

![Action editor showing parts of a step](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/action-editor-step-parts.png)

Step

Let's edit step 1 to find out which account the customer wants to withdraw money from:



1. Click the Edit step title icon and enter the title Determine account.
2. In the Is taken field, use the default value of without conditions. This step is always required for any withdrawal.
3. In the Assistant says field, type Withdraw from which account?.
4. Click Define customer response.

Zoom

![Defining the customer response for a step](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/action-editor-define-response.png)

Define customer response

Because we are asking the user to select from a list of predefined choices, click Options. The Edit Response window opens.
5.
* For account_type, select 1. Withdraw from which account?.



![Action editor: message including variable references](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/action-editor-message-with-variables.png)
3. Because this is the last step in the action, you don't need to specify any customer response.



If you decide a step is no longer needed, you can delete it from the action. To delete a step, click the Delete![Delete step icon](https://cloud.ibm.com/docs-content/v1/content/icons/delete.svg) icon on the tile for the step.







 Testing the action 

We can now test the action to make sure it's working. Click Preview to open the Preview pane. (If the text from a previous test is still shown, click the Refresh![Preview refresh icon](https://cloud.ibm.com/docs-content/v1/content/icons/restart%5B%5D.svg) icon to restart the conversation.)

Start by typing I want to withdraw money. Try various permutations of your input to test how the assistant behaves:



* Try selecting both Savings and Checking. Confirm that if you select Checking, the assistant warns you about incurring a fee and asks if you want to continue, but if you select Savings, it proceeds without the warning.
* When you select Checking, try both responses when the assistant asks if you want to continue. Confirm that if you select No, the action ends.
* Try including additional information in your initial message. For example, try typing I want to withdraw $50 from my savings account. Confirm that the assistant does not ask you again to specify the information you already provided.



That's it! You built a simple action that includes multiple steps, collects information that it stores as action variables, and conditions its responses based on what your customer chooses.
* [What's the maximum time or maximum memory that my function can run?](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-faqmax-runtime)
* [What's the difference between an action and a web action?](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-faqdifference)
* [How can I see my action logs?](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-faqlogs_faq)
* [How does monitoring work?](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-faqmonitor_faq)







 Troubleshooting 

[Troubleshooting overview](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-troubleshootingtroubleshooting)



* [General ways to resolve issues](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-troubleshootinghelp-general)
* [Reviewing cloud issues and status](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-troubleshootinghelp-cloud-status)
* [Getting help](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-troubleshootinghelp-functions)





 General troubleshooting 

[Action is failing](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-ts_action_failsts_action_fails)

[Service configuration properties are incorrect](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-ts_propertyts_property)
[Learn more](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-assistant). 
 Completion Measures how often within a given time period users reach the end step of an action. [Learn more](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-analytics-action-completioncomplete-reasons). 
 Content The conversation logic and words that are used to respond to your customer. Content is required for every assistant. [Learn more](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-build-actions-overview). 
 Environment You can group your work in separate containers that are called environments. Each environment contains its own content, channels, and extensions. Environments also have their own IDs, URLs, and service credentials that can be referenced by external services. Each new assistant comes with two environments: the draft environment and the live environment. Your customers interact with assistants on the live environment and cannot interact with assistants on the draft environment. The separation of these two environments allows you to build and iterate on your content separately from what your customers see. You do not want customers to stumble upon an incomplete action that leads them to a dead end. For Enterprise plans, you can add up to three environments as a staging area to test your assistant before deployment. You can build content in the draft environment and test versions of your content in the extra environments. [Learn more](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overviewenvironments). 
 Escalation If your assistant is integrated with one of the supported service desk systems, you can build in logic that transfers, or escalates, the conversation to a human when necessary. [Learn more](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-human-agent). 
 Incompletion Reasons why an action is not completed by a user, including escalated to agent, started a new action, stuck on a step, or abandoned or ongoing.
See the [Watson Assistant release notes](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-watson-assistant-release-notes) for details about each algorithm version release.

Algorithm version choices are currently available for Arabic, Chinese (Simplified), Chinese (Traditional), Czech, Dutch, English, French, German, Japanese, Korean, Italian, Portuguese, and Spanish. The universal language model uses a default algorithm.



 Automatic retraining 

IBM Cloud

Watson Assistant was released as a service in July 2016. Since then, users have been creating and updating skills to meet their virtual assistant needs. Behind the scenes, Watson Assistant creates machine learning (ML) models to perform a variety of tasks on the user's behalf.

The primary ML models deal with action recognition, intent classification, and entity detection. For example, the model might detect what a user intends when saying I want to open a checking account, and what type of account the user is talking about.

These ML models rely on a sophisticated infrastructure. There are many intricate components that are responsible for analyzing what the user has said, breaking down the user's input, and processing it so the ML model can more easily predict what the user is asking.

Since Watson Assistant was first released, the product team has been making continuous updates to the algorithms that generate these sophisticated ML models. Older models have continued to function while running in the context of newer algorithms. Historically, the behavior of these existing ML model did not change unless the skill was updated, at which point the skill was retrained and a new model generated to replace the older one. This meant that many older models never benefited from improvements in our ML algorithms.

Watson Assistant uses continuous retraining. The Watson Assistant service continually monitors all ML models, and automatically retrains those models that have not been retrained in the previous 6 months. Watson Assistant retrains using the selected algorithm version. If the version you had selected is no longer supported, Watson Assistant retrains using the version labeled as Previous. This means that your assistant will automatically have the supported technologies applied. Assistants that have been modified during the previous 6 months will not be affected.
This documentation is for the classic Watson Assistant experience. To see the documentation for the new Watson Assistant, please go [here](https://cloud.ibm.com/docs/watson-assistant).



  Automatic retrain of old skills and workspaces 

Watson Assistant was released as a service in July 2016. Since then, users have been creating and updating skills to meet their virtual assistant needs. Behind the scenes, Watson Assistant creates machine learning (ML) models to perform a variety of tasks on the user's behalf.

The primary ML models deal with action recognition, intent classification, and entity detection. For example, the model might detect what a user intends when saying I want to open a checking account, and what type of account the user is talking about.

These ML models rely on a sophisticated infrastructure. There are many intricate components that are responsible for analyzing what the user has said, breaking down the user's input, and processing it so the ML model can more easily predict what the user is asking.

Since Watson Assistant was first released, the product team has been making continuous updates to the algorithms that generate these sophisticated ML models. Older models have continued to function while running in the context of newer algorithms. Historically, the behavior of these existing ML model did not change unless the skill was updated, at which point the skill was retrained and a new model generated to replace the older one. This meant that many older models never benefited from improvements in our ML algorithms.

Watson Assistant uses continuous retraining. The Watson Assistant service continually monitors all ML models, and automatically retrains those models that have not been retrained in the previous 6 months. Watson Assistant retrains using the selected algorithm version. If the version you had selected is no longer supported, Watson Assistant retrains using the version labeled as Previous. This means that your assistant will automatically have the supported technologies applied. Assistants that have been modified during the previous 6 months will not be affected. For more information, see [Algorithm version](https://cloud.ibm.com/docs/assistant?topic=assistant-algorithm-version).

In most cases, this retraining will be seamless from an end-user point of view. The same inputs will result in the same actions, intents, and entities being detected. In some cases, the retraining might cause changes in accuracy.
* [Worker nodes](https://cloud.ibm.com/docs/openshift?topic=openshift-costsnodes)
* [What is the difference between virtual and physical machines?](https://cloud.ibm.com/docs/openshift?topic=openshift-costsphysical-vs-virtual)
* [Compute licenses](https://cloud.ibm.com/docs/openshift?topic=openshift-costslicenses)
* [Public bandwidth](https://cloud.ibm.com/docs/openshift?topic=openshift-costsbandwidth)
* [Subnet IP addresses](https://cloud.ibm.com/docs/openshift?topic=openshift-costssubnet_ips)
* [Multizone load balancer](https://cloud.ibm.com/docs/openshift?topic=openshift-costsmzlb_pricing)
* [Default storage for images](https://cloud.ibm.com/docs/openshift?topic=openshift-costsstorage_images)
* [Storage for apps](https://cloud.ibm.com/docs/openshift?topic=openshift-costspersistent_storage)
* [IBM Cloud services](https://cloud.ibm.com/docs/openshift?topic=openshift-costsservices)
* [Operators and other third-party integrations](https://cloud.ibm.com/docs/openshift?topic=openshift-costsoperators_pricing)
* [VPC worker nodes](https://cloud.ibm.com/docs/openshift?topic=openshift-costscharges_vpc_gen2)



* [Estimating costs](https://cloud.ibm.com/docs/openshift?topic=openshift-costscosts-estimate)
Writing 



 Writing style 

Written content in an API definition, such as summary and description properties, MUST contain American English. Content SHOULD be written for client developers as the primary audience. A particular type of client, such as an interactive utility, a dashboard, or scheduled automation SHOULD NOT be assumed.

All content SHOULD use sentence-style capitalization.



 Programmatic and conceptual values 

When referring to a programmatic value such as a property name, boolean, or enumerated value, the value SHOULD be written precisely as in code, and surrounded by backticks to indicate inline code in [CommonMark](https://commonmark.org/help/). For example:



* "Specify the user_id property..."
* "Set debug to true..."
* "In the 2021-12-31 API version..."



When referring to the concept that the syntax of an API represents, use ordinary text, even if a programmatic value has the same name as the concept. For example:



* The password must be at least 12 characters in length.
* The user ID of an administrator...
* Use debug mode to see additional messages.









 Operations 



 Operation summaries 

The summary value for an operation SHOULD be parallel to the [operation ID](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-operationsoperation-ids), in sentence case, without punctuation, and with an indefinite article where appropriate. A summary SHOULD be as short as possible while remaining unique and unambiguous.

For example:



* For list_users, the summary would be List users
* For create_user, the summary would be Create a user
* For get_user, the summary would be Get a user



A summary MAY omit parts of the resource hierarchy as long as the resulting text remains clear. For example the get_farm_barn (GET /farms/{farm_id}/barns/{id}) operation could have the summary Get barn.

A summary MUST NOT contain CommonMark formatting.





 Operation descriptions 

The description value for an operation SHOULD be in full, grammatically correct sentences.