vorqard-ai-sdk 1.0.1 → 1.0.3
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 +1 -1
- package/package.json +3 -2
- package/src/index.js +2 -0
- package/src/screens/AIHealthChatScreen.js +12 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ The SDK relies on standard React Native libraries for image picking, safe area v
|
|
|
23
23
|
|
|
24
24
|
Run the following command in your main application folder (`groupin-app/`):
|
|
25
25
|
```bash
|
|
26
|
-
npm install axios react-native-linear-gradient react-native-image-crop-picker react-native-vision-camera react-native-vector-icons react-native-safe-area-context
|
|
26
|
+
npm install axios react-native-linear-gradient react-native-image-crop-picker react-native-vision-camera react-native-vector-icons react-native-safe-area-context react-native-webrtc expo-av
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Step 3: Install the SDK
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vorqard-ai-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Standalone React Native SDK for VORQARD AI Health Assistant and Report Analyzer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"react-native-linear-gradient": "*",
|
|
20
20
|
"react-native-safe-area-context": "*",
|
|
21
21
|
"react-native-vector-icons": "*",
|
|
22
|
-
"react-native-vision-camera": "*"
|
|
22
|
+
"react-native-vision-camera": "*",
|
|
23
|
+
"react-native-webrtc": "*"
|
|
23
24
|
},
|
|
24
25
|
"keywords": [
|
|
25
26
|
"vorqard",
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export const VorqardAIAssistant = ({
|
|
|
13
13
|
voiceBackendUrl,
|
|
14
14
|
userToken,
|
|
15
15
|
patientName = 'there',
|
|
16
|
+
initialPrompt,
|
|
16
17
|
userLocation,
|
|
17
18
|
onClose,
|
|
18
19
|
aiLogo,
|
|
@@ -33,6 +34,7 @@ export const VorqardAIAssistant = ({
|
|
|
33
34
|
<AIHealthChatScreen
|
|
34
35
|
voiceBackendUrl={voiceBackendUrl}
|
|
35
36
|
patientName={patientName}
|
|
37
|
+
initialPrompt={initialPrompt}
|
|
36
38
|
userLocation={userLocation}
|
|
37
39
|
onClose={onClose}
|
|
38
40
|
aiLogo={aiLogo}
|
|
@@ -78,6 +78,7 @@ const AI_ACTIONS = [
|
|
|
78
78
|
export const AIHealthChatScreen = ({
|
|
79
79
|
voiceBackendUrl,
|
|
80
80
|
patientName = 'there',
|
|
81
|
+
initialPrompt,
|
|
81
82
|
userLocation,
|
|
82
83
|
onClose,
|
|
83
84
|
aiLogo,
|
|
@@ -107,11 +108,21 @@ export const AIHealthChatScreen = ({
|
|
|
107
108
|
|
|
108
109
|
const [chatMode, setChatMode] = useState(false); // false = hub view, true = chat view
|
|
109
110
|
const [isVoiceMode, setIsVoiceMode] = useState(false); // true = live voice input panel active
|
|
111
|
+
const [hasSentInitial, setHasSentInitial] = useState(false);
|
|
110
112
|
|
|
111
113
|
useEffect(() => {
|
|
112
114
|
loadChatContext();
|
|
113
115
|
if (messages.length > 0) setChatMode(true);
|
|
114
|
-
|
|
116
|
+
|
|
117
|
+
// Auto-trigger an initial prompt if passed down
|
|
118
|
+
if (initialPrompt && !hasSentInitial) {
|
|
119
|
+
setHasSentInitial(true);
|
|
120
|
+
setChatMode(true);
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
sendMessage(initialPrompt);
|
|
123
|
+
}, 300);
|
|
124
|
+
}
|
|
125
|
+
}, [initialPrompt]);
|
|
115
126
|
|
|
116
127
|
// When user sends a message, switch to chat mode
|
|
117
128
|
const handleSend = (text) => {
|