Skip to content

Commit b0fc5cb

Browse files
committed
feat: make provider objects generic
1 parent 27398b6 commit b0fc5cb

1 file changed

Lines changed: 6 additions & 150 deletions

File tree

src/lib/types/AgentLiveSchema.ts

Lines changed: 6 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,4 @@
1-
type AudioEncoding =
2-
| "linear16"
3-
| "flac"
4-
| "mulaw"
5-
| "amr-nb"
6-
| "amr-wb"
7-
| "Opus"
8-
| "speex"
9-
| "g729"
10-
| string;
11-
12-
type ListenModel =
13-
| "nova-3"
14-
| "nova-3-general"
15-
| "nova-3-medical"
16-
| "nova-2"
17-
| "nova-2-meeting"
18-
| "nova-2-phonecall"
19-
| "nova-2-voicemail"
20-
| "nova-2-finance"
21-
| "nova-2-conversational"
22-
| "nova-2-video"
23-
| "nova-2-medical"
24-
| "nova-2-drivethru"
25-
| "nova-2-automotive"
26-
| "nova-2-atc"
27-
| "nova"
28-
| "nova-phonecall"
29-
| "enhanced"
30-
| "enhanced-meeting"
31-
| "enhanced-phonecall"
32-
| "enhanced-finance"
33-
| "base"
34-
| "base-meeting"
35-
| "base-phonecall"
36-
| "base-voicemail"
37-
| "base-finance"
38-
| "base-conversational"
39-
| "base-video"
40-
| "whisper-tiny"
41-
| "whisper"
42-
| "whisper-small"
43-
| "whisper-medium"
44-
| "whisper-large"
45-
| string;
46-
47-
type SpeakModel =
48-
| "aura-asteria-en"
49-
| "aura-luna-en"
50-
| "aura-stella-en"
51-
| "aura-athena-en"
52-
| "aura-hera-en"
53-
| "aura-orion-en"
54-
| "aura-arcas-en"
55-
| "aura-perseus-en"
56-
| "aura-angus-en"
57-
| "aura-orpheus-en"
58-
| "aura-helios-en"
59-
| "aura-zeus-en"
60-
| "aura-2-amalthea-en"
61-
| "aura-2-andromeda-en"
62-
| "aura-2-apollo-en"
63-
| "aura-2-arcas-en"
64-
| "aura-2-aries-en"
65-
| "aura-2-asteria-en"
66-
| "aura-2-athena-en"
67-
| "aura-2-atlas-en"
68-
| "aura-2-aurora-en"
69-
| "aura-2-callista-en"
70-
| "aura-2-cordelia-en"
71-
| "aura-2-cora-en"
72-
| "aura-2-cressida-en"
73-
| "aura-2-delia-en"
74-
| "aura-2-draco-en"
75-
| "aura-2-electra-en"
76-
| "aura-2-harmonia-en"
77-
| "aura-2-helena-en"
78-
| "aura-2-hera-en"
79-
| "aura-2-hermes-en"
80-
| "aura-2-hyperion-en"
81-
| "aura-2-iris-en"
82-
| "aura-2-janus-en"
83-
| "aura-2-juno-en"
84-
| "aura-2-jupiter-en"
85-
| "aura-2-luna-en"
86-
| "aura-2-mars-en"
87-
| "aura-2-minerva-en"
88-
| "aura-2-neptune-en"
89-
| "aura-2-odysseus-en"
90-
| "aura-2-ophelia-en"
91-
| "aura-2-orion-en"
92-
| "aura-2-orpheus-en"
93-
| "aura-2-pandora-en"
94-
| "aura-2-phoebe-en"
95-
| "aura-2-pluto-en"
96-
| "aura-2-saturn-en"
97-
| "aura-2-selene-en"
98-
| "aura-2-thalia-en"
99-
| "aura-2-theia-en"
100-
| "aura-2-vesta-en"
101-
| "aura-2-zeus-en"
102-
| string;
1+
type Provider = { type: string } & Record<string, unknown>;
1032

1043
/**
1054
* @see https://developers.deepgram.com/reference/voicebot-api-phase-preview#settingsconfiguration
@@ -115,7 +14,7 @@ interface AgentLiveSchema extends Record<string, unknown> {
11514
/**
11615
* @default "linear16"
11716
*/
118-
encoding: AudioEncoding;
17+
encoding: string;
11918
/**
12019
* @default 16000
12120
*/
@@ -141,46 +40,10 @@ interface AgentLiveSchema extends Record<string, unknown> {
14140
*/
14241
language?: string;
14342
listen?: {
144-
provider: {
145-
type: "deepgram";
146-
/**
147-
* @see https://developers.deepgram.com/docs/model
148-
*/
149-
model: ListenModel;
150-
/**
151-
* Only available for Nova 3.
152-
* @see https://developers.deepgram.com/docs/keyterm
153-
*/
154-
keyterms?: string[];
155-
};
43+
provider: Provider;
15644
};
15745
speak?: {
158-
provider: {
159-
type: "deepgram" | "eleven_labs" | "cartesia" | "open_ai" | string;
160-
/**
161-
* Deepgram OR OpenAI model to use.
162-
*/
163-
model?: SpeakModel;
164-
/**
165-
* Eleven Labs OR Cartesia model to use.
166-
*/
167-
model_id?: string;
168-
/**
169-
* Cartesia voice configuration.
170-
*/
171-
voice?: {
172-
mode: string;
173-
id: string;
174-
};
175-
/**
176-
* Optional Cartesia language.
177-
*/
178-
language?: string;
179-
/**
180-
* Optional Eleven Labs voice.
181-
*/
182-
language_code?: string;
183-
};
46+
provider: Provider;
18447
endpoint?: {
18548
url: string;
18649
headers?: Record<string, string>;
@@ -190,14 +53,7 @@ interface AgentLiveSchema extends Record<string, unknown> {
19053
* @see https://developers.deepgram.com/reference/voicebot-api-phase-preview#supported-llm-providers-and-models
19154
*/
19255
think?: {
193-
provider: {
194-
type: "deepgram" | "open_ai" | "anthropic" | "x_ai" | string;
195-
model: string;
196-
/**
197-
* 0-2 for OpenAI, 0-1 for Anthropic.
198-
*/
199-
temperature?: number;
200-
};
56+
provider: Provider;
20157
/**
20258
* Optional ONLY if LLM provider is OpenAI or Anthropic.
20359
*/
@@ -224,4 +80,4 @@ interface AgentLiveSchema extends Record<string, unknown> {
22480
};
22581
}
22682

227-
export type { AgentLiveSchema, SpeakModel };
83+
export type { AgentLiveSchema };

0 commit comments

Comments
 (0)