Tool messages in different languages
# support
s
Is there any way to make my tool start and end messages be in whatever language the model is speaking in? It appears to be hardcoded to whatever I put in the box.
a
HeySal Thank you for creating the ticket! A member of our team will reach out to you shortly.
v
You can continue this conversation by mentioning me in the message.
@Sal Yes, you can localize the start and end messages for your tool to match the language the model is speaking in. To achieve this, you would typically need to implement a localization system within your tool that can detect the language context and select the appropriate messages accordingly. If your tool currently doesn't support dynamic localization, you might need to update it to include this feature. This could involve setting up a database or a dictionary of messages in different languages and adding logic to your tool to choose the right message based on the user's language preference or the detected language. If you need assistance with implementing this feature or have any specific questions about how to set it up, please let me know, and I'll be happy to help!
s
@Sal Yes, it is already available, and I am having difficulty recalling how it was accomplished. Please allow me some time to respond to you regarding this matter.
Saw this message you posted on a different thread. Can I set multiple “request-start” messages for a tool? If so, will the model just pick the one that is in the correct language? Will try some out tomorrow.
s
@Sal It is necessary to utilize the contents property of tool messages and incorporate the message within the contents. If the user's language contents are available, they will be selected; otherwise, the initial message will be translated into the user's language. Below is an example of the request start message type. Please inform me if you require any further assistance.
Copy code
json
{
  "type": "request-start",
  "contents": [
    {
      "type": "string",
      "language": "en",
      "text": "Heyoo what's up, ... how's going?"
    }
  ]
}
https://cdn.discordapp.com/attachments/1334536427567976488/1335135813608149005/Screenshot_2025-02-01_at_11.58.48_AM.png?ex=679f119f&is=679dc01f&hm=d3913d1dfbf16457aff1f897b84a2d8ac3ad6206bd43d1b7a79f35ce3480d9f3&
s
@Shubham Bajaj Ok so I have these "messages" set on my tool:
Copy code
"messages": [
    {
      "type": "request-start",
      "contents": [
        {
          "text": "Let me check on that for you.",
          "type": "text",
          "language": "en"
        }
      ]
    },
    {
      "type": "request-start",
      "contents": [
        {
          "text": "Por favor, espere mientras lo reviso por usted.",
          "type": "text",
          "language": "es"
        }
      ]
    }
  ],
However when running on callid "b3271bc5-d6c2-4a62-a615-07fb0d937c7f", im getting this transcript:
Copy code
AI
This is Rosa. How can I help you?

User
Hola, ¿puedo reservar una cita para el próximo viernes a las siete de la noche?

AI
Let me check on that for you.

AI
Lo siento. No tengo disponibilidad a las siete PM el viernes siete de febrero. Pero podría acomodarte a las tres pm ese mismo día.
Can you explain where I can broadcast the "user's language contents"
s
@Sal 🔵 19:06:03:446 Say Request undefined But en Active So Speaking 29. (requested: "undefined", new: "Let me check on that for you.") As you can see the model detected the current active language as english, which resulted into using
Let me check on that for you.
can you try out 2-3 calls to validate the feature working for you? Lastly can you explain what do you mean by
where I can broadcast the "user's language contents"
?
u
Hello. Can you tell me how do I modify the tool message contents array as you describe? I am using VAPI interface at the moment which does not give you this possibility.
n
Was this resolved? We set different contents for different languages and are using a multi-lingual transcription model. But it is always picking the english tool message