File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed
plugins/openai/src/realtime Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,26 @@ export interface Tool {
9191 } ;
9292}
9393
94- export type TurnDetectionType = {
95- type : 'server_vad' ;
96- threshold ?: number ; // 0.0 to 1.0, default: 0.5
97- prefix_padding_ms ?: number ; // default: 300
98- silence_duration_ms ?: number ; // default: 200
99- create_response ?: boolean ; // default: true
100- interrupt_response ?: boolean ; // default: true
101- } ;
94+ export type TurnDetectionType =
95+ | {
96+ type : 'semantic_vad' ;
97+ eagerness ?: 'auto' | 'low' | 'medium' | 'high' ; // default: auto
98+ create_response ?: boolean ; // default: true
99+ interrupt_response ?: boolean ; // default: true
100+ }
101+ | {
102+ type : 'server_vad' ;
103+ threshold ?: number ; // 0.0 to 1.0, default: 0.5
104+ prefix_padding_ms ?: number ; // default: 300
105+ silence_duration_ms ?: number ; // default: 200
106+ create_response ?: boolean ; // default: true
107+ interrupt_response ?: boolean ; // default: true
108+ } ;
102109
103110export type InputAudioTranscription = {
104111 model : InputTranscriptionModel ;
112+ language ?: string ;
113+ prompt ?: string ;
105114} ;
106115
107116export interface InputTextContent {
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import {
2222import { Mutex } from '@livekit/mutex' ;
2323import type { AudioResampler } from '@livekit/rtc-node' ;
2424import { AudioFrame , combineAudioFrames } from '@livekit/rtc-node' ;
25- import type { GenerationCreatedEvent } from 'agents/dist/llm/realtime.js' ;
2625import { type MessageEvent , WebSocket } from 'ws' ;
2726import * as api_proto from './api_proto.js' ;
2827
@@ -1011,7 +1010,7 @@ export class RealtimeSession extends llm.RealtimeSession {
10111010 messageStream : this . currentGeneration . messageChannel . stream ( ) ,
10121011 functionStream : this . currentGeneration . functionChannel . stream ( ) ,
10131012 userInitiated : false ,
1014- } as GenerationCreatedEvent ;
1013+ } as llm . GenerationCreatedEvent ;
10151014
10161015 const clientEventId = event . response . metadata ?. client_event_id ;
10171016 if ( clientEventId ) {
@@ -1414,7 +1413,7 @@ export class RealtimeSession extends llm.RealtimeSession {
14141413 messageStream : this . currentGeneration . messageChannel . stream ( ) ,
14151414 functionStream : this . currentGeneration . functionChannel . stream ( ) ,
14161415 userInitiated : false ,
1417- } as GenerationCreatedEvent ;
1416+ } as llm . GenerationCreatedEvent ;
14181417
14191418 const handle = this . responseCreatedFutures [ responseId ] ;
14201419 if ( handle ) {
You can’t perform that action at this time.
0 commit comments