@fluxyte/sdk 0.4.0 → 0.4.1
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/README.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
The official TypeScript SDK for the Fluxyte Onboarding AI API: a context-aware,
|
|
4
4
|
documentation-grounded assistant designed for onboarding and setup flows (not generic chat).
|
|
5
5
|
|
|
6
|
+
## What's New In 0.4.0
|
|
7
|
+
|
|
8
|
+
- Voice chat API via `client.voiceChat(...)` for speech input.
|
|
9
|
+
- Optional synthesized audio reply output.
|
|
10
|
+
- React voice chat hook support for UI integration.
|
|
11
|
+
|
|
6
12
|
## Install
|
|
7
13
|
|
|
8
14
|
```bash
|
|
@@ -302,6 +308,24 @@ start({
|
|
|
302
308
|
});
|
|
303
309
|
```
|
|
304
310
|
|
|
311
|
+
```tsx
|
|
312
|
+
import { useVoiceChat } from "@fluxyte/sdk/react";
|
|
313
|
+
|
|
314
|
+
const { sendVoice, loading, data, error } = useVoiceChat();
|
|
315
|
+
|
|
316
|
+
const res = await sendVoice({
|
|
317
|
+
audioBase64: "BASE64_AUDIO",
|
|
318
|
+
mimeType: "audio/webm",
|
|
319
|
+
context: { product: "analytics", userTarget: "admin" },
|
|
320
|
+
synthesize: true,
|
|
321
|
+
voice: "alloy",
|
|
322
|
+
audioFormat: "mp3",
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
console.log(res.transcript);
|
|
326
|
+
console.log(res.reply);
|
|
327
|
+
```
|
|
328
|
+
|
|
305
329
|
## Multi-Target
|
|
306
330
|
|
|
307
331
|
Use `context.product` or `context.service` to isolate onboarding targets under one account (apps, APIs, and services).
|
|
@@ -10,6 +10,15 @@ export declare function useVoiceChat(): {
|
|
|
10
10
|
audioFormat?: components["schemas"]["VoiceAudioFormat"] | null;
|
|
11
11
|
replyAudioBase64?: string | null;
|
|
12
12
|
}>;
|
|
13
|
+
sendVoice: (payload: VoiceChatRequest) => Promise<{
|
|
14
|
+
answerId: string;
|
|
15
|
+
transcript: string;
|
|
16
|
+
reply: string;
|
|
17
|
+
confidence?: number | null;
|
|
18
|
+
sources?: components["schemas"]["EvidenceItem"][];
|
|
19
|
+
audioFormat?: components["schemas"]["VoiceAudioFormat"] | null;
|
|
20
|
+
replyAudioBase64?: string | null;
|
|
21
|
+
}>;
|
|
13
22
|
data: {
|
|
14
23
|
answerId: string;
|
|
15
24
|
transcript: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceChat.d.ts","sourceRoot":"","sources":["../../src/react/useVoiceChat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,KAAK,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAGlE,wBAAgB,YAAY;oBAOR,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"useVoiceChat.d.ts","sourceRoot":"","sources":["../../src/react/useVoiceChat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,KAAK,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAGlE,wBAAgB,YAAY;oBAOR,gBAAgB;;;;;kBAuB2kI,qBAAsB;sBAAuC,qBAAsB;;;yBAvB9qI,gBAAgB;;;;;kBAuB2kI,qBAAsB;sBAAuC,qBAAsB;;;;;;;;kBAAnF,qBAAsB;sBAAuC,qBAAsB;;;;;EADjsI"}
|
|
@@ -22,6 +22,9 @@ export function useVoiceChat() {
|
|
|
22
22
|
setLoading(false);
|
|
23
23
|
}
|
|
24
24
|
}, [client]);
|
|
25
|
-
|
|
25
|
+
// Keep `send` for consistency with other hooks and expose `sendVoice`
|
|
26
|
+
// as an explicit alias for voice-focused integrations.
|
|
27
|
+
const sendVoice = send;
|
|
28
|
+
return { send, sendVoice, data, loading, error };
|
|
26
29
|
}
|
|
27
30
|
//# sourceMappingURL=useVoiceChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceChat.js","sourceRoot":"","sources":["../../src/react/useVoiceChat.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAA2B,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,IAAI,GAAG,WAAW,CACtB,KAAK,EAAE,OAAyB,EAAE,EAAE;QAClC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,GAAY,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"useVoice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