fauna-api 1.0.773 → 1.0.780
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.
|
@@ -30,10 +30,13 @@ export declare function generateTextSync(authorization: Credentials | ApiKey, mo
|
|
|
30
30
|
export declare function generateVoice(authorization: Credentials | ApiKey, model: Voice, options?: Partial<{
|
|
31
31
|
content: Content[];
|
|
32
32
|
audio: AsyncIterable<Uint8Array>;
|
|
33
|
+
notes: AsyncIterable<string>;
|
|
33
34
|
tools: Tool[] | Tool;
|
|
34
35
|
maxTools: number;
|
|
35
36
|
voice: Partial<Demographic>;
|
|
36
37
|
memories: number;
|
|
38
|
+
brain: Text;
|
|
39
|
+
reasoning: string;
|
|
37
40
|
group: Group;
|
|
38
41
|
signal: AbortSignal;
|
|
39
42
|
}>): AsyncGenerator<VoiceEvent>;
|
package/dist/src/parrot/agent.js
CHANGED
|
@@ -78,7 +78,10 @@ export async function* generateText(authorization, model, options) {
|
|
|
78
78
|
export async function generateTextSync(authorization, model, options) {
|
|
79
79
|
return collectText(generateText(authorization, model, options));
|
|
80
80
|
}
|
|
81
|
-
// Realtime voice: PCM16 16 kHz in from `audio`, PCM16 24 kHz out as audio events.
|
|
81
|
+
// Realtime voice: PCM16 16 kHz in from `audio`, PCM16 24 kHz out as audio events. Each of
|
|
82
|
+
// `notes` tells the model something to act on now. An ElevenLabs voice thinks with `brain`
|
|
83
|
+
// (a text model, through Fauna) at `reasoning`, and needs one; OpenAI and xAI voices are their
|
|
84
|
+
// own brain.
|
|
82
85
|
export async function* generateVoice(authorization, model, options) {
|
|
83
86
|
yield* streamVoice(authorization, '/agent/voice', model, options);
|
|
84
87
|
}
|
|
@@ -54,7 +54,7 @@ export declare enum Speech {
|
|
|
54
54
|
}
|
|
55
55
|
export declare enum Transcription {
|
|
56
56
|
GPT_TRANSCRIBE = "gpt-transcribe",
|
|
57
|
-
|
|
57
|
+
GROK_VOICE_TRANSCRIBE_2_0 = "grok-voice-transcribe-2.0",
|
|
58
58
|
SCRIBE_V2 = "scribe_v2"
|
|
59
59
|
}
|
|
60
60
|
export declare enum Embedding {
|
|
@@ -245,17 +245,23 @@ export declare function generateTranscription(authorization: Credentials | ApiKe
|
|
|
245
245
|
export declare function generateVoice(authorization: Credentials | ApiKey, model: Voice, options?: Partial<{
|
|
246
246
|
content: Content[];
|
|
247
247
|
audio: AsyncIterable<Uint8Array>;
|
|
248
|
+
notes: AsyncIterable<string>;
|
|
248
249
|
tools: Tool[] | Tool;
|
|
249
250
|
maxTools: number;
|
|
250
251
|
voice: Partial<Demographic>;
|
|
252
|
+
brain: Text;
|
|
253
|
+
reasoning: string;
|
|
251
254
|
signal: AbortSignal;
|
|
252
255
|
group: Group;
|
|
253
256
|
}>): AsyncGenerator<VoiceEvent>;
|
|
254
257
|
export declare function generateVoiceSync(authorization: Credentials | ApiKey, model: Voice, options?: Partial<{
|
|
255
258
|
content: Content[];
|
|
256
259
|
audio: AsyncIterable<Uint8Array>;
|
|
260
|
+
notes: AsyncIterable<string>;
|
|
257
261
|
tools: Tool[] | Tool;
|
|
258
262
|
maxTools: number;
|
|
259
263
|
voice: Partial<Demographic>;
|
|
264
|
+
brain: Text;
|
|
265
|
+
reasoning: string;
|
|
260
266
|
group: Group;
|
|
261
267
|
}>): Promise<TextResponse>;
|
|
@@ -68,7 +68,7 @@ export var Transcription;
|
|
|
68
68
|
// OpenAI
|
|
69
69
|
Transcription["GPT_TRANSCRIBE"] = "gpt-transcribe";
|
|
70
70
|
// xAI
|
|
71
|
-
Transcription["
|
|
71
|
+
Transcription["GROK_VOICE_TRANSCRIBE_2_0"] = "grok-voice-transcribe-2.0";
|
|
72
72
|
// ElevenLabs
|
|
73
73
|
Transcription["SCRIBE_V2"] = "scribe_v2";
|
|
74
74
|
})(Transcription || (Transcription = {}));
|
|
@@ -176,7 +176,9 @@ export async function generateSpeech(authorization, model, options = {}) {
|
|
|
176
176
|
export async function generateTranscription(authorization, model, options = {}) {
|
|
177
177
|
return generateMedia(authorization, '/generative/transcription', model, options, 'application/octet-stream');
|
|
178
178
|
}
|
|
179
|
-
// Streaming Voice Generation
|
|
179
|
+
// Streaming Voice Generation. Each of `notes` tells the model something to act on now. An
|
|
180
|
+
// ElevenLabs voice thinks with `brain` (a text model, through Fauna) at `reasoning`, and needs
|
|
181
|
+
// one; OpenAI and xAI voices are their own brain.
|
|
180
182
|
export async function* generateVoice(authorization, model, options = {}) {
|
|
181
183
|
yield* streamVoice(authorization, '/generative/voice', model, options);
|
|
182
184
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Credentials, ApiKey } from "../authentification.js";
|
|
2
2
|
import type { Group } from "../groups.js";
|
|
3
3
|
import type { Demographic } from "../ant/persona.js";
|
|
4
|
-
import { type Content, type StreamEvent, type TextResponse, type Tool, type VoiceEvent } from "./generative.js";
|
|
4
|
+
import { type Content, type StreamEvent, type Text, type TextResponse, type Tool, type VoiceEvent } from "./generative.js";
|
|
5
5
|
/** A Parrot socket URL; `group` adds the Group header (shared memory, group billing). */
|
|
6
6
|
export declare function socketUrl(path: string, authorization: Credentials | ApiKey, group?: Group): string;
|
|
7
7
|
/** FILE parts become path or access code refs (uploading offline files first); no binaries go up. */
|
|
@@ -27,10 +27,13 @@ export declare function collectText(stream: AsyncGenerator<StreamEvent>): Promis
|
|
|
27
27
|
type VoiceOptions = Partial<{
|
|
28
28
|
content: Content[];
|
|
29
29
|
audio: AsyncIterable<Uint8Array>;
|
|
30
|
+
notes: AsyncIterable<string>;
|
|
30
31
|
tools: Tool[] | Tool;
|
|
31
32
|
maxTools: number;
|
|
32
33
|
voice: Partial<Demographic>;
|
|
33
34
|
memories: number;
|
|
35
|
+
brain: Text;
|
|
36
|
+
reasoning: string;
|
|
34
37
|
group: Group;
|
|
35
38
|
signal: AbortSignal;
|
|
36
39
|
}>;
|
|
@@ -393,6 +393,8 @@ export async function* streamVoice(authorization, path, model, options = {}) {
|
|
|
393
393
|
maxTools: options.maxTools,
|
|
394
394
|
voice: options.voice,
|
|
395
395
|
memories: options.memories,
|
|
396
|
+
brain: options.brain,
|
|
397
|
+
reasoning: options.reasoning,
|
|
396
398
|
}));
|
|
397
399
|
ws.send(JSON.stringify({ event: 'start' }));
|
|
398
400
|
if (options.audio) {
|
|
@@ -407,6 +409,18 @@ export async function* streamVoice(authorization, path, model, options = {}) {
|
|
|
407
409
|
catch { }
|
|
408
410
|
})();
|
|
409
411
|
}
|
|
412
|
+
if (options.notes) {
|
|
413
|
+
void (async () => {
|
|
414
|
+
try {
|
|
415
|
+
for await (const text of options.notes) {
|
|
416
|
+
if (ws.readyState !== WebSocket.OPEN)
|
|
417
|
+
break;
|
|
418
|
+
ws.send(JSON.stringify({ event: 'note', text }));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
catch { }
|
|
422
|
+
})();
|
|
423
|
+
}
|
|
410
424
|
yield* readEvents(ws, (msg, queue) => {
|
|
411
425
|
const data = msg.data;
|
|
412
426
|
if (typeof data !== 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fauna-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.780",
|
|
4
4
|
"description": "The Fauna SDK: accounts, Drive, groups, calendar, chats, payments and every Fauna app (Parrot, Marmot, Magpie, Cicada, Ant, Termite), plus React UI.",
|
|
5
5
|
"homepage": "https://docs.faunakit.com",
|
|
6
6
|
"repository": {
|