Skip to content

Commit aa2fad9

Browse files
committed
update languages field
1 parent 4dfe56f commit aa2fad9

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

livekit-plugins/livekit-plugins-phonic/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Set the `PHONIC_API_KEY` environment variable, or pass `api_key` directly to `Re
8989
| `welcome_message` | `str` | Message the agent says when the conversation starts. Ignored when `generate_welcome_message` is True |
9090
| `generate_welcome_message` | `bool` | Auto-generate the welcome message (ignores `welcome_message`) |
9191
| `project` | `str` | Project name (default: `main`) |
92-
| `languages` | `list[str]` | ISO 639-1 language codes the agent should recognize and speak |
92+
| `default_language` | `str` | ISO 639-1 default language for recognition and speech |
93+
| `additional_languages` | `list[str]` | Further ISO 639-1 codes (must not repeat `default_language`) |
94+
| `multilingual_mode` | `"auto"` \| `"request"` | Per-utterance language detection vs. change on user request (recommended: `request`) |
9395
| `audio_speed` | `float` | Audio playback speed |
9496
| `phonic_tools` | `list[str]` | [Phonic Webhook tool](https://docs.phonic.co/docs/using-tools/tools_overview#webhook-tools) names available to the assistant |
9597
| `boosted_keywords` | `list[str]` | Keywords to boost in speech recognition |

livekit-plugins/livekit-plugins-phonic/livekit/plugins/phonic/realtime/realtime_model.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ class _RealtimeOptions:
5353
welcome_message: NotGivenOr[str | None]
5454
generate_welcome_message: NotGivenOr[bool | None]
5555
project: NotGivenOr[str | None]
56-
languages: NotGivenOr[list[str]]
56+
default_language: NotGivenOr[str]
57+
additional_languages: NotGivenOr[list[str]]
58+
multilingual_mode: NotGivenOr[Literal["auto", "request"]]
5759
audio_speed: NotGivenOr[float]
5860
phonic_tools: NotGivenOr[list[str]]
5961
boosted_keywords: NotGivenOr[list[str]]
@@ -100,7 +102,9 @@ def __init__(
100102
welcome_message: NotGivenOr[str | None] = NOT_GIVEN,
101103
generate_welcome_message: NotGivenOr[bool] = NOT_GIVEN,
102104
project: NotGivenOr[str | None] = NOT_GIVEN,
103-
languages: NotGivenOr[list[str]] = NOT_GIVEN,
105+
default_language: NotGivenOr[str] = NOT_GIVEN,
106+
additional_languages: NotGivenOr[list[str]] = NOT_GIVEN,
107+
multilingual_mode: NotGivenOr[Literal["auto", "request"]] = NOT_GIVEN,
104108
audio_speed: NotGivenOr[float] = NOT_GIVEN,
105109
phonic_tools: NotGivenOr[list[str]] = NOT_GIVEN,
106110
boosted_keywords: NotGivenOr[list[str]] = NOT_GIVEN,
@@ -123,7 +127,11 @@ def __init__(
123127
generate_welcome_message: When True, the welcome message is automatically generated
124128
and ``welcome_message`` is ignored.
125129
project: Project name to use for the conversation.
126-
languages: ISO 639-1 language codes the agent should recognize and speak.
130+
default_language: ISO 639-1 default language for recognition and speech.
131+
additional_languages: Further ISO 639-1 codes the agent may use (must not include
132+
``default_language``).
133+
multilingual_mode: ``\"auto\"`` to detect language per utterance, ``\"request\"`` to
134+
switch only when the user asks (recommended).
127135
audio_speed: Audio playback speed multiplier.
128136
phonic_tools: Phonic tool names available to the assistant.
129137
boosted_keywords: Keywords to boost in speech recognition.
@@ -159,7 +167,9 @@ def __init__(
159167
welcome_message=welcome_message,
160168
generate_welcome_message=generate_welcome_message,
161169
project=project,
162-
languages=languages,
170+
default_language=default_language,
171+
additional_languages=additional_languages,
172+
multilingual_mode=multilingual_mode,
163173
audio_speed=audio_speed,
164174
phonic_tools=phonic_tools,
165175
boosted_keywords=boosted_keywords,
@@ -491,7 +501,9 @@ async def _main_task(self) -> None:
491501
"voice_id": self._opts.voice,
492502
"input_format": "pcm_44100",
493503
"output_format": "pcm_44100",
494-
"recognized_languages": self._opts.languages,
504+
"default_language": self._opts.default_language,
505+
"additional_languages": self._opts.additional_languages,
506+
"multilingual_mode": self._opts.multilingual_mode,
495507
"audio_speed": self._opts.audio_speed,
496508
"tools": tools_payload if len(tools_payload) > 0 else NOT_GIVEN,
497509
"boosted_keywords": self._opts.boosted_keywords,

livekit-plugins/livekit-plugins-phonic/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"livekit-agents>=1.5.1",
2626
"websockets>=11.0",
2727
"aiohttp>=3.8.0",
28-
"phonic>=0.31.5"
28+
"phonic>=0.31.8"
2929
]
3030

3131
[project.urls]

0 commit comments

Comments
 (0)