@applica-software-guru/persona-sdk 0.1.107 → 0.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +89 -1
- package/package.json +1 -1
- package/src/agents/types.ts +89 -1
- package/src/index.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare interface Agent {
|
|
|
22
22
|
initialMessageMode?: "processed" | "static";
|
|
23
23
|
knowledge?: KnowledgeConfiguration;
|
|
24
24
|
wakeup?: WakeupConfiguration;
|
|
25
|
+
backchannel?: BackchannelConfiguration;
|
|
26
|
+
thinkingFiller?: ThinkingFillerConfiguration;
|
|
25
27
|
telegram?: TelegramConfiguration;
|
|
26
28
|
whatsapp?: WhatsAppConfiguration;
|
|
27
29
|
collaboration?: CollaborationConfiguration;
|
|
@@ -56,6 +58,8 @@ export declare interface AgentCreateRequest {
|
|
|
56
58
|
initialMessageMode?: "processed" | "static";
|
|
57
59
|
knowledge?: KnowledgeConfiguration;
|
|
58
60
|
wakeup?: WakeupConfiguration;
|
|
61
|
+
backchannel?: BackchannelConfiguration;
|
|
62
|
+
thinkingFiller?: ThinkingFillerConfiguration;
|
|
59
63
|
telegram?: TelegramConfiguration;
|
|
60
64
|
whatsapp?: WhatsAppConfiguration;
|
|
61
65
|
collaboration?: CollaborationConfiguration;
|
|
@@ -165,6 +169,44 @@ export declare interface AuthorizeResponse {
|
|
|
165
169
|
redirectUrl?: string;
|
|
166
170
|
}
|
|
167
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Riempitivi vocali emessi mentre l'utente sta ancora parlando.
|
|
174
|
+
*
|
|
175
|
+
* Due modalità con compromessi diversi:
|
|
176
|
+
* - `static`: una parola scelta a caso dalla lista. Le clip sono
|
|
177
|
+
* pre-sintetizzate e in cache, quindi la latenza aggiunta è zero.
|
|
178
|
+
* - `llm`: un modello veloce genera la frase seguendo `instructions`. Più
|
|
179
|
+
* pertinente, ma la prima volta che produce un testo nuovo si paga LLM più
|
|
180
|
+
* TTS; se non è pronto in tempo si ripiega su una parola della lista.
|
|
181
|
+
*
|
|
182
|
+
* Richiede un synthesizer con sintesi one-shot (gcloud o elevenlabs).
|
|
183
|
+
*/
|
|
184
|
+
export declare interface BackchannelConfiguration {
|
|
185
|
+
enabled?: boolean;
|
|
186
|
+
mode?: BackchannelMode;
|
|
187
|
+
/** Lista per `static`, e fallback per `llm` quando il modello tarda. */
|
|
188
|
+
words?: string[];
|
|
189
|
+
/** Solo `llm`: cosa deve generare il modello. */
|
|
190
|
+
instructions?: string;
|
|
191
|
+
/** Tetto sulle parole generate, per non parlare sopra l'utente. */
|
|
192
|
+
maxGeneratedWords?: number;
|
|
193
|
+
/** Parlato continuo richiesto prima di intervenire. */
|
|
194
|
+
minSpeechSeconds?: number;
|
|
195
|
+
maxPerUserTurn?: number;
|
|
196
|
+
partialFreshnessSeconds?: number;
|
|
197
|
+
agentSilenceSeconds?: number;
|
|
198
|
+
throttleSeconds?: number;
|
|
199
|
+
/**
|
|
200
|
+
* Modello usato dalla modalità `llm`. Va scelto piccolo e veloce: sta nel
|
|
201
|
+
* percorso critico di un riempitivo che deve arrivare entro un secondo.
|
|
202
|
+
*/
|
|
203
|
+
model?: ModelConfiguration;
|
|
204
|
+
llmTimeoutSeconds?: number;
|
|
205
|
+
prewarm?: boolean;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export declare type BackchannelMode = 'static' | 'llm';
|
|
209
|
+
|
|
168
210
|
export declare class BearerTokenAuthenticationProvider implements AuthenticationProvider {
|
|
169
211
|
private readonly token;
|
|
170
212
|
constructor(token: string);
|
|
@@ -246,6 +288,8 @@ export declare interface Collaborator {
|
|
|
246
288
|
scope?: string;
|
|
247
289
|
}
|
|
248
290
|
|
|
291
|
+
export declare type CommitStrategy = 'vad' | 'manual';
|
|
292
|
+
|
|
249
293
|
export declare interface CommittedUsage {
|
|
250
294
|
id?: string;
|
|
251
295
|
committedAt?: string;
|
|
@@ -1240,6 +1284,12 @@ export declare interface SynthesizerConfiguration {
|
|
|
1240
1284
|
stability?: number;
|
|
1241
1285
|
style?: number;
|
|
1242
1286
|
voiceInstructions?: string;
|
|
1287
|
+
/**
|
|
1288
|
+
* Solo ElevenLabs, 0-4. Valori alti riducono la latenza ma dal 4 il
|
|
1289
|
+
* normalizzatore del testo viene disattivato e numeri e date vengono
|
|
1290
|
+
* pronunciati male.
|
|
1291
|
+
*/
|
|
1292
|
+
optimizeStreamingLatency?: number;
|
|
1243
1293
|
}
|
|
1244
1294
|
|
|
1245
1295
|
export declare type SynthesizerName = 'gcloud' | 'elevenlabs' | 'gtts' | 'openai';
|
|
@@ -1257,6 +1307,31 @@ export declare interface TelegramConfiguration {
|
|
|
1257
1307
|
enabledUsers?: string[];
|
|
1258
1308
|
}
|
|
1259
1309
|
|
|
1310
|
+
/**
|
|
1311
|
+
* Riempitivo emesso quando l'agente è occupato e muto.
|
|
1312
|
+
*
|
|
1313
|
+
* Copre due momenti che per l'utente sono lo stesso silenzio: la chiamata di uno
|
|
1314
|
+
* strumento e la fase di ragionamento del modello. Non scatta se l'agente ha già
|
|
1315
|
+
* detto qualcosa prima di occuparsi.
|
|
1316
|
+
*/
|
|
1317
|
+
export declare interface ThinkingFillerConfiguration {
|
|
1318
|
+
enabled?: boolean;
|
|
1319
|
+
/** `sound` è il tono breve, `words` una frase parlata scelta a caso. */
|
|
1320
|
+
mode?: ThinkingFillerMode;
|
|
1321
|
+
words?: string[];
|
|
1322
|
+
/** Attesa prima di emettere: le attese rapide non producono niente. */
|
|
1323
|
+
delaySeconds?: number;
|
|
1324
|
+
/** Distanza minima tra due riempitivi, condivisa col backchannel. */
|
|
1325
|
+
throttleSeconds?: number;
|
|
1326
|
+
/**
|
|
1327
|
+
* Se emettere il riempitivo anche mentre il modello ragiona. Disattivo per
|
|
1328
|
+
* default: con modelli che ragionano a ogni turno può diventare invadente.
|
|
1329
|
+
*/
|
|
1330
|
+
onReasoning?: boolean;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
export declare type ThinkingFillerMode = 'sound' | 'words';
|
|
1334
|
+
|
|
1260
1335
|
export declare interface Tool {
|
|
1261
1336
|
type?: ToolType;
|
|
1262
1337
|
name?: string;
|
|
@@ -1297,9 +1372,22 @@ export declare interface TranscriberConfiguration {
|
|
|
1297
1372
|
transcriberName?: TranscriberName;
|
|
1298
1373
|
languageCode?: LanguageCode;
|
|
1299
1374
|
sampleRateHertz?: number;
|
|
1375
|
+
/**
|
|
1376
|
+
* Secondi di silenzio dopo i quali il turno dell'utente è considerato
|
|
1377
|
+
* concluso: è il parametro con più impatto sulla latenza percepita, perché
|
|
1378
|
+
* l'agente non inizia a elaborare prima che scada. Valori bassi rendono la
|
|
1379
|
+
* conversazione reattiva ma spezzano le pause di pensiero in due turni.
|
|
1380
|
+
*/
|
|
1381
|
+
silenceDurationThreshold?: number;
|
|
1382
|
+
/** Solo ElevenLabs Scribe. */
|
|
1383
|
+
modelId?: string;
|
|
1384
|
+
commitStrategy?: CommitStrategy;
|
|
1385
|
+
keyterms?: string[];
|
|
1386
|
+
secondaryLanguages?: string[];
|
|
1387
|
+
filterBackgroundAudio?: boolean;
|
|
1300
1388
|
}
|
|
1301
1389
|
|
|
1302
|
-
export declare type TranscriberName = 'gcloud' | 'deepgram' | 'vosk';
|
|
1390
|
+
export declare type TranscriberName = 'gcloud' | 'deepgram' | 'elevenlabs' | 'vosk';
|
|
1303
1391
|
|
|
1304
1392
|
export declare interface TransferAction {
|
|
1305
1393
|
request?: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@applica-software-guru/persona-sdk",
|
|
3
3
|
"description": "Official TypeScript SDK for the Persona API — manage agents, sessions, projects, knowledge bases, workflows, triggers and more.",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.108",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
package/src/agents/types.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type LanguageCode = 'en-US' | 'it-IT' | 'es-ES' | 'fr-FR' | 'de-DE' | 'pt
|
|
|
7
7
|
|
|
8
8
|
export type SynthesizerName = 'gcloud' | 'elevenlabs' | 'gtts' | 'openai';
|
|
9
9
|
|
|
10
|
-
export type TranscriberName = 'gcloud' | 'deepgram' | 'vosk';
|
|
10
|
+
export type TranscriberName = 'gcloud' | 'deepgram' | 'elevenlabs' | 'vosk';
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
export type ToolType = 'remote' | 'local';
|
|
@@ -93,13 +93,34 @@ export interface SynthesizerConfiguration {
|
|
|
93
93
|
stability?: number;
|
|
94
94
|
style?: number;
|
|
95
95
|
voiceInstructions?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Solo ElevenLabs, 0-4. Valori alti riducono la latenza ma dal 4 il
|
|
98
|
+
* normalizzatore del testo viene disattivato e numeri e date vengono
|
|
99
|
+
* pronunciati male.
|
|
100
|
+
*/
|
|
101
|
+
optimizeStreamingLatency?: number;
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
export type CommitStrategy = 'vad' | 'manual';
|
|
105
|
+
|
|
98
106
|
export interface TranscriberConfiguration {
|
|
99
107
|
enabled?: boolean;
|
|
100
108
|
transcriberName?: TranscriberName;
|
|
101
109
|
languageCode?: LanguageCode;
|
|
102
110
|
sampleRateHertz?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Secondi di silenzio dopo i quali il turno dell'utente è considerato
|
|
113
|
+
* concluso: è il parametro con più impatto sulla latenza percepita, perché
|
|
114
|
+
* l'agente non inizia a elaborare prima che scada. Valori bassi rendono la
|
|
115
|
+
* conversazione reattiva ma spezzano le pause di pensiero in due turni.
|
|
116
|
+
*/
|
|
117
|
+
silenceDurationThreshold?: number;
|
|
118
|
+
/** Solo ElevenLabs Scribe. */
|
|
119
|
+
modelId?: string;
|
|
120
|
+
commitStrategy?: CommitStrategy;
|
|
121
|
+
keyterms?: string[];
|
|
122
|
+
secondaryLanguages?: string[];
|
|
123
|
+
filterBackgroundAudio?: boolean;
|
|
103
124
|
}
|
|
104
125
|
|
|
105
126
|
export interface KnowledgeConfiguration {
|
|
@@ -149,6 +170,69 @@ export interface WakeupConfiguration {
|
|
|
149
170
|
sleepDelaySeconds?: number;
|
|
150
171
|
}
|
|
151
172
|
|
|
173
|
+
export type ThinkingFillerMode = 'sound' | 'words';
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Riempitivo emesso quando l'agente è occupato e muto.
|
|
177
|
+
*
|
|
178
|
+
* Copre due momenti che per l'utente sono lo stesso silenzio: la chiamata di uno
|
|
179
|
+
* strumento e la fase di ragionamento del modello. Non scatta se l'agente ha già
|
|
180
|
+
* detto qualcosa prima di occuparsi.
|
|
181
|
+
*/
|
|
182
|
+
export interface ThinkingFillerConfiguration {
|
|
183
|
+
enabled?: boolean;
|
|
184
|
+
/** `sound` è il tono breve, `words` una frase parlata scelta a caso. */
|
|
185
|
+
mode?: ThinkingFillerMode;
|
|
186
|
+
words?: string[];
|
|
187
|
+
/** Attesa prima di emettere: le attese rapide non producono niente. */
|
|
188
|
+
delaySeconds?: number;
|
|
189
|
+
/** Distanza minima tra due riempitivi, condivisa col backchannel. */
|
|
190
|
+
throttleSeconds?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Se emettere il riempitivo anche mentre il modello ragiona. Disattivo per
|
|
193
|
+
* default: con modelli che ragionano a ogni turno può diventare invadente.
|
|
194
|
+
*/
|
|
195
|
+
onReasoning?: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export type BackchannelMode = 'static' | 'llm';
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Riempitivi vocali emessi mentre l'utente sta ancora parlando.
|
|
202
|
+
*
|
|
203
|
+
* Due modalità con compromessi diversi:
|
|
204
|
+
* - `static`: una parola scelta a caso dalla lista. Le clip sono
|
|
205
|
+
* pre-sintetizzate e in cache, quindi la latenza aggiunta è zero.
|
|
206
|
+
* - `llm`: un modello veloce genera la frase seguendo `instructions`. Più
|
|
207
|
+
* pertinente, ma la prima volta che produce un testo nuovo si paga LLM più
|
|
208
|
+
* TTS; se non è pronto in tempo si ripiega su una parola della lista.
|
|
209
|
+
*
|
|
210
|
+
* Richiede un synthesizer con sintesi one-shot (gcloud o elevenlabs).
|
|
211
|
+
*/
|
|
212
|
+
export interface BackchannelConfiguration {
|
|
213
|
+
enabled?: boolean;
|
|
214
|
+
mode?: BackchannelMode;
|
|
215
|
+
/** Lista per `static`, e fallback per `llm` quando il modello tarda. */
|
|
216
|
+
words?: string[];
|
|
217
|
+
/** Solo `llm`: cosa deve generare il modello. */
|
|
218
|
+
instructions?: string;
|
|
219
|
+
/** Tetto sulle parole generate, per non parlare sopra l'utente. */
|
|
220
|
+
maxGeneratedWords?: number;
|
|
221
|
+
/** Parlato continuo richiesto prima di intervenire. */
|
|
222
|
+
minSpeechSeconds?: number;
|
|
223
|
+
maxPerUserTurn?: number;
|
|
224
|
+
partialFreshnessSeconds?: number;
|
|
225
|
+
agentSilenceSeconds?: number;
|
|
226
|
+
throttleSeconds?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Modello usato dalla modalità `llm`. Va scelto piccolo e veloce: sta nel
|
|
229
|
+
* percorso critico di un riempitivo che deve arrivare entro un secondo.
|
|
230
|
+
*/
|
|
231
|
+
model?: ModelConfiguration;
|
|
232
|
+
llmTimeoutSeconds?: number;
|
|
233
|
+
prewarm?: boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
152
236
|
export interface TelegramConfiguration {
|
|
153
237
|
enabled?: boolean;
|
|
154
238
|
botToken?: string;
|
|
@@ -286,6 +370,8 @@ export interface Agent {
|
|
|
286
370
|
initialMessageMode?: "processed" | "static";
|
|
287
371
|
knowledge?: KnowledgeConfiguration;
|
|
288
372
|
wakeup?: WakeupConfiguration;
|
|
373
|
+
backchannel?: BackchannelConfiguration;
|
|
374
|
+
thinkingFiller?: ThinkingFillerConfiguration;
|
|
289
375
|
telegram?: TelegramConfiguration;
|
|
290
376
|
whatsapp?: WhatsAppConfiguration;
|
|
291
377
|
collaboration?: CollaborationConfiguration;
|
|
@@ -317,6 +403,8 @@ export interface AgentCreateRequest {
|
|
|
317
403
|
initialMessageMode?: "processed" | "static";
|
|
318
404
|
knowledge?: KnowledgeConfiguration;
|
|
319
405
|
wakeup?: WakeupConfiguration;
|
|
406
|
+
backchannel?: BackchannelConfiguration;
|
|
407
|
+
thinkingFiller?: ThinkingFillerConfiguration;
|
|
320
408
|
telegram?: TelegramConfiguration;
|
|
321
409
|
whatsapp?: WhatsAppConfiguration;
|
|
322
410
|
collaboration?: CollaborationConfiguration;
|
package/src/index.ts
CHANGED