Discussions
How Can I Configure the Session to Immediately Start in Japanese Without an Extra Language Selection Step?
Hello everyone,
I’m working with the Streaming API v2 to implement real-time chat using HeyGen’s interactive avatar. Currently, our user experience follows a cumbersome flow: after clicking "Chat now," users must then go through an additional language selection step ("Start new chat") before the session begins. I would like to simplify this so that when the user clicks "Chat now," the session immediately starts in Japanese.
Here’s what I’ve done so far:
In the session creation request payload, I have set the following parameters:
"language": "ja"
"sttLanguage": "ja"
A knowledge base prompt in Japanese: "あなたは親切なアシスタントです。日本語で丁寧に話してください。"
My current payload looks like this:
json
{
"version": "v2",
"avatarName": "Wayne_20240711",
"quality": "high",
"language": "ja",
"sttLanguage": "ja",
"voice": {
"rate": 1.0
},
"knowledgeBase": "あなたは親切なアシスタントです。日本語で丁寧に話してください。",
"disableIdleTimeout": true
}
In addition, I’ve set the iframe URL and WebSocket query parameters to include lang=ja and stt_language=ja.
Despite these settings, once the session starts, the UI still requires the user to manually select the language before beginning the chat, and the session doesn’t immediately start in Japanese.
My Questions:
Is it theoretically possible to have the session initialize entirely in Japanese (i.e., so that when a user clicks “Chat now,” the chat begins immediately in Japanese without any further language selection)?
Assuming it is possible, do I need to explicitly set a Japanese-compatible voiceId in the voice object (obtained from the List Voices v2 endpoint) in addition to the current parameters?
Are there any other recommended settings or best practices to ensure that the session loads in Japanese immediately, thereby eliminating the extra language selection step in the UI?
Any insights or suggestions would be greatly appreciated. Thank you in advance for your help!
Environment:
Using Streaming API v2 in a React/Next.js project.
Currently using the default avatar, with plans to move to custom avatars in production.
The goal is to have the chat session start immediately in Japanese when "Chat now" is clicked.
Looking forward to your advice.