@guideai/react-native 0.7.0 → 0.9.0
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 +20 -1
- package/dist/GuideAIChat-BFu10t6D.cjs +2794 -0
- package/dist/GuideAIChat-BFu10t6D.cjs.map +1 -0
- package/dist/GuideAIChat-BQQ8lUKs.js +2795 -0
- package/dist/GuideAIChat-BQQ8lUKs.js.map +1 -0
- package/dist/GuideAIChat-Ba6n1ePs.js +2795 -0
- package/dist/GuideAIChat-Ba6n1ePs.js.map +1 -0
- package/dist/GuideAIChat-CNmEo5bZ.cjs +2794 -0
- package/dist/GuideAIChat-CNmEo5bZ.cjs.map +1 -0
- package/dist/GuideAIChat-SU0CVNby.js +2795 -0
- package/dist/GuideAIChat-SU0CVNby.js.map +1 -0
- package/dist/GuideAIChat-W8KQ4Y6i.cjs +2794 -0
- package/dist/GuideAIChat-W8KQ4Y6i.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +91 -6
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +2 -2
- package/dist/ui.d.ts +11 -5
- package/dist/ui.mjs +3 -3
- package/dist/useConversations-C-OmzdeA.js +4300 -0
- package/dist/useConversations-C-OmzdeA.js.map +1 -0
- package/dist/useConversations-CJEaVqch.cjs +4290 -0
- package/dist/useConversations-CJEaVqch.cjs.map +1 -0
- package/dist/useConversations-Chn_GKOz.cjs +4299 -0
- package/dist/useConversations-Chn_GKOz.cjs.map +1 -0
- package/dist/useConversations-Ckyqbxqi.cjs +4299 -0
- package/dist/useConversations-Ckyqbxqi.cjs.map +1 -0
- package/dist/useConversations-DzhYCIiY.js +4300 -0
- package/dist/useConversations-DzhYCIiY.js.map +1 -0
- package/dist/useConversations-SbhtYN_R.js +4291 -0
- package/dist/useConversations-SbhtYN_R.js.map +1 -0
- package/dist/voice.cjs +2835 -19
- package/dist/voice.cjs.map +1 -1
- package/dist/voice.d.ts +12 -6
- package/dist/voice.mjs +2836 -20
- package/dist/voice.mjs.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -8,10 +8,29 @@ npm install @guideai/react-native
|
|
|
8
8
|
npx expo install expo-audio expo-file-system
|
|
9
9
|
# pictures on the whiteboard:
|
|
10
10
|
npx expo install react-native-svg
|
|
11
|
+
# live voice that flows like a phone call (recommended):
|
|
12
|
+
npx expo install react-native-audio-api
|
|
11
13
|
```
|
|
12
14
|
|
|
13
15
|
React ≥ 18 and React Native ≥ 0.73. No native module of its own: voice uses expo-audio and expo-file-system, which Expo apps already ship, so it works in a dev build and over OTA updates.
|
|
14
16
|
|
|
17
|
+
**Live voice that flows.** Pass react-native-audio-api in and live voice streams both ways, as on the web: it hears you finish in a fraction of a second, starts speaking while the answer is still being written, says something while it thinks, you can talk over it, and "yes" or "no" answers an action waiting for approval. Without it, each turn is recorded, uploaded once you go quiet, and the finished answer read aloud.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import * as AudioAPI from 'react-native-audio-api';
|
|
21
|
+
|
|
22
|
+
GuideAI.configure({ apiKey: 'pk_live_…', origin: 'https://app.example.com', storage: AsyncStorage, audio: AudioAPI });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
It is a native module: add its config plugin to app.json, then make a new development build (not Expo Go; an OTA update cannot add it).
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
["react-native-audio-api", {
|
|
29
|
+
"iosMicrophonePermission": "Talk to the assistant.",
|
|
30
|
+
"androidPermissions": ["android.permission.RECORD_AUDIO", "android.permission.MODIFY_AUDIO_SETTINGS"]
|
|
31
|
+
}]
|
|
32
|
+
```
|
|
33
|
+
|
|
15
34
|
## The quickest way: our chat, with voice
|
|
16
35
|
|
|
17
36
|
```tsx
|
|
@@ -147,7 +166,7 @@ function Tutor() {
|
|
|
147
166
|
|
|
148
167
|
`<GuideAILiveVoice>` and `<GuideAILanguagePicker>` are our UI for the call and the language: pass `theme` for your colours and `labels` for your words. Or draw your own from the hook fields.
|
|
149
168
|
|
|
150
|
-
`suggestions` appear when the agent's Blueprint has the **Suggest follow-ups** node, `whiteboard` when it has **Explain on a whiteboard**, and `images` when it has **Draw images**. The whiteboard reads each step aloud when `speech` is configured. A board shows complex things the way a teacher would: drawn by the pen from a line drawing found on the web, or as the real photo, with labels on their parts (an arrow, a ring or a box). Nothing on a board is ever generated.
|
|
169
|
+
`suggestions` appear when the agent's Blueprint has the **Suggest follow-ups** node, `whiteboard` when it has **Explain on a whiteboard**, and `images` when it has **Draw images**. The whiteboard reads each step aloud when `speech` is configured. A board shows complex things the way a teacher would: drawn by the pen from a line drawing found on the web, or as the real photo, with labels on their parts (an arrow, a ring or a box). Nothing on a board is ever generated. With **Animate** on in that node, a board about how something works shows it moving: a payment travelling along an arrow, gears turning, a balance counting up.
|
|
151
170
|
|
|
152
171
|
## Or a floating button
|
|
153
172
|
|