Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/honest-chicken-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents-plugin-phonic': patch
---

Add minWordsToInterrupt option to Phonic plugin
1 change: 1 addition & 0 deletions examples/src/phonic_realtime_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default defineAgent({
llm: new phonic.realtime.RealtimeModel({
voice: 'sabrina',
audioSpeed: 1.2,
minWordsToInterrupt: 3,
}),
});

Expand Down
1 change: 1 addition & 0 deletions plugins/phonic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Set the `PHONIC_API_KEY` environment variable, or pass `apiKey` directly to `Rea
| `audioSpeed` | `number` | Audio playback speed |
| `phonicTools` | `string[]` | [Phonic Webhook tool](https://docs.phonic.co/docs/using-tools/tools_overview#webhook-tools) names available to the assistant |
| `boostedKeywords` | `string[]` | Keywords to boost in speech recognition |
| `minWordsToInterrupt` | `number` | Minimum number of user words required to interrupt the assistant |
| `generateNoInputPokeText` | `boolean` | Auto-generate poke text when user is silent |
| `noInputPokeSec` | `number` | Seconds of silence before sending poke message |
| `noInputPokeText` | `string` | Poke message text (ignored when `generateNoInputPokeText` is true) |
Expand Down
2 changes: 1 addition & 1 deletion plugins/phonic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"phonic": "^0.31.8"
"phonic": "^0.31.10"
},
"peerDependencies": {
"@livekit/agents": "workspace:*",
Expand Down
9 changes: 9 additions & 0 deletions plugins/phonic/src/realtime/realtime_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface RealtimeModelOptions {
audioSpeed?: number;
phonicTools?: string[];
boostedKeywords?: string[];
minWordsToInterrupt?: number;
generateNoInputPokeText?: boolean;
noInputPokeSec?: number;
noInputPokeText?: string;
Expand Down Expand Up @@ -116,6 +117,10 @@ export class RealtimeModel extends llm.RealtimeModel {
* Keywords to boost in speech recognition
*/
boostedKeywords?: string[];
/**
* Minimum number of user words required to interrupt the assistant
*/
minWordsToInterrupt?: number;
/**
* Auto-generate poke text when user is silent
*/
Expand Down Expand Up @@ -181,6 +186,7 @@ export class RealtimeModel extends llm.RealtimeModel {
audioSpeed: options.audioSpeed,
phonicTools: options.phonicTools,
boostedKeywords: options.boostedKeywords,
minWordsToInterrupt: options.minWordsToInterrupt,
generateNoInputPokeText: options.generateNoInputPokeText,
noInputPokeSec: options.noInputPokeSec,
noInputPokeText: options.noInputPokeText,
Expand Down Expand Up @@ -502,6 +508,9 @@ export class RealtimeSession extends llm.RealtimeSession {
audio_speed: this.options.audioSpeed,
tools: [...(this.options.phonicTools ?? []), ...this.toolDefinitions],
boosted_keywords: this.options.boostedKeywords,
...(this.options.minWordsToInterrupt !== undefined && {
min_words_to_interrupt: this.options.minWordsToInterrupt,
}),
generate_no_input_poke_text: this.options.generateNoInputPokeText,
no_input_poke_sec: this.options.noInputPokeSec,
no_input_poke_text: this.options.noInputPokeText,
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading