Tutorial: Multi-language support
AI Agents can already support multi-language communication with users, as they are based on large language models (LLMs), and those models are usually trained in multiple languages. However, depending on the task you want to run with your agent, you might need to add further instructions to the agent so that it can better support multi-language communication.
Before your begin
Before you start, you must comply with some requirements:
-
Follow the steps in the Empower agent tutorial to configure your agents.
-
Set up your IBM watsonx Orchestrate ADK environment, where you build agents and tools. It also provides a convenient interface for managing credentials, sending requests, and handling responses from the service’s APIs. See the Installing the watsonx Orchestrate ADK and Installing the watsonx Orchestrate Developer Edition.
Configuring multi-language support
Follow the steps to configure the multi-language support in your agent.
-
Open the
service_now_agent.yaml
file with a text editor, such as Visual Studio Code. -
In the
instructions
section, add the two following lines:
-
Save the YAML file.
-
Open the
customer_care_agent.yaml
file and apply the previous steps. It is necessary as the Customer Care agent is the supervisor of the ServiceNow agent.
By adding these two lines of instructions to your agents, you can ensure that the agent expects to be engaged in multiple languages and can adapt more accurately. You can even use these same instructions, or something similar to them, with any agent you build to help ensure that your agent can adapt to being engaged in multiple languages.
Importing your agents
Now that you finished editing instructions of the two agents, you must reimport them to update these agents in the IBM watsonx Orchestrate ADK. You can follow the steps that are described in the Empower agent tutorial, but that procedure also reimports the tools, which can take a long time. To import only the agents directly, you can follow the steps:
-
Open the terminal that you commonly use.
-
Navigate to the folder where your agents are saved.
-
Write the command
orchestrate agents import -f agent_file_name.yaml
. -
Replace
agent_file_name
expression with your agent file name. For this tutorial, you can run the following commands:orchestrate agents import -f customer_care_agent.yaml
orchestrate agents import -f service_now_agent.yaml
-
Run the command.
You can see in the terminal a message that confirms the agents were successfully imported.
Note: If you do not navigate to the agent files folder, you must run the command with the folder path, for example:
orchestrate agents import -f home/documents/agents/agentFile.yaml
.
Testing your agent
Now, you can test your multilanguage agents in the chat by using other languages.