vorqard-ai-sdk 1.0.0 → 1.0.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 +228 -209
- package/package.json +11 -7
- package/src/api/sdkClient.js +36 -1
- package/src/components/ChatCards.js +2 -0
- package/src/components/ChatComponents.js +72 -14
- package/src/components/ChatStyles.js +125 -0
- package/src/components/UICards.js +239 -0
- package/src/components/VoiceInputPanel.js +201 -0
- package/src/components/cards/DoctorCards.js +54 -13
- package/src/components/cards/HospitalCards.js +112 -5
- package/src/components/cards/RadiusSelectionCard.js +56 -0
- package/src/components/cards/SlotSelectionCard.js +33 -9
- package/src/components/cards/SpecialtySelectionCard.js +62 -0
- package/src/hooks/useHealthChat.js +186 -25
- package/src/hooks/useRealtimeVoice.js +273 -0
- package/src/hooks/useVoiceChat.js +373 -0
- package/src/index.js +21 -3
- package/src/screens/AIHealthChatScreen.js +209 -118
- package/src/screens/AIVoiceAssistantScreen.js +669 -0
package/README.md
CHANGED
|
@@ -1,209 +1,228 @@
|
|
|
1
|
-
# VORQARD AI Health Assistant SDK
|
|
2
|
-
|
|
3
|
-
[](https://github.com/AbhivornGroupIn/VORQARD_SDK_AI)
|
|
4
|
-
|
|
5
|
-
The VORQARD AI SDK is a standalone React Native / Expo module that provides a conversational AI clinical health assistant and a structured medical report analyzer.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 🚀 Step-by-Step Integration Guide
|
|
10
|
-
|
|
11
|
-
Follow these steps to integrate the AI SDK into your React Native / Expo application (such as the Groupin App):
|
|
12
|
-
|
|
13
|
-
### Step 1: Copy the SDK Folder
|
|
14
|
-
Copy the `VORQARD_AI_SDK` directory into your project structure. A common setup is to place it side-by-side with your host application:
|
|
15
|
-
```text
|
|
16
|
-
/my-workspace
|
|
17
|
-
├── groupin-app/ (Your main mobile application directory)
|
|
18
|
-
└── VORQARD_AI_SDK/ (This SDK directory)
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Step 2: Install Peer Dependencies
|
|
22
|
-
The SDK relies on standard
|
|
23
|
-
|
|
24
|
-
Run the following command in your main application folder (`groupin-app/`):
|
|
25
|
-
```bash
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Step 3:
|
|
30
|
-
In your main application folder (`groupin-app/`), install the SDK package
|
|
31
|
-
```bash
|
|
32
|
-
npm install
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
import
|
|
43
|
-
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
###
|
|
103
|
-
* **Path:** `GET /patients/
|
|
104
|
-
* **Headers:** `Authorization: Bearer <userToken>`
|
|
105
|
-
* **Description:** Fetches
|
|
106
|
-
|
|
107
|
-
###
|
|
108
|
-
* **Path:** `
|
|
109
|
-
* **Headers:** `Authorization: Bearer <userToken>`
|
|
110
|
-
* **
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
* **
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
|
180
|
-
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
# VORQARD AI Health Assistant SDK
|
|
2
|
+
|
|
3
|
+
[](https://github.com/AbhivornGroupIn/VORQARD_SDK_AI)
|
|
4
|
+
|
|
5
|
+
The VORQARD AI SDK is a standalone React Native / Expo module that provides a conversational AI clinical health assistant and a structured medical report analyzer.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🚀 Step-by-Step Integration Guide
|
|
10
|
+
|
|
11
|
+
Follow these steps to integrate the AI SDK into your React Native / Expo application (such as the Groupin App):
|
|
12
|
+
|
|
13
|
+
### Step 1: Copy the SDK Folder
|
|
14
|
+
Copy the `VORQARD_AI_SDK` directory into your project structure. A common setup is to place it side-by-side with your host application:
|
|
15
|
+
```text
|
|
16
|
+
/my-workspace
|
|
17
|
+
├── groupin-app/ (Your main mobile application directory)
|
|
18
|
+
└── VORQARD_AI_SDK/ (This SDK directory)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Step 2: Install Peer Dependencies
|
|
22
|
+
The SDK relies on standard React Native libraries for image picking, safe area views, icons, and network requests.
|
|
23
|
+
|
|
24
|
+
Run the following command in your main application folder (`groupin-app/`):
|
|
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
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Step 3: Install the SDK
|
|
30
|
+
In your main application folder (`groupin-app/`), install the SDK package from npm by running:
|
|
31
|
+
```bash
|
|
32
|
+
npm install vorqard-ai-sdk
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 4: Render the AI Assistant Screen
|
|
36
|
+
Import `VorqardAIAssistant` and add it to any screen, layout, or modal in your navigation stack.
|
|
37
|
+
|
|
38
|
+
Here is a basic template:
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import { SafeAreaView, StyleSheet } from 'react-native';
|
|
43
|
+
import { VorqardAIAssistant } from 'vorqard-ai-sdk';
|
|
44
|
+
|
|
45
|
+
export default function AIExpertScreen({ navigation }) {
|
|
46
|
+
// Retrieve the patient's authenticated token and first name from your app's auth state
|
|
47
|
+
const userToken = "eyJhbGciOi..."; // Active patient JWT session token
|
|
48
|
+
const patientName = "Jagadish"; // Used for personalized greeting
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<SafeAreaView style={styles.container}>
|
|
52
|
+
<VorqardAIAssistant
|
|
53
|
+
backendUrl="https://app.vorqard.com/api" // VORQARD production API endpoint
|
|
54
|
+
userToken={userToken} // Authentication JWT
|
|
55
|
+
patientName={patientName} // Custom patient name
|
|
56
|
+
onClose={() => navigation.goBack()} // Callback when close/back button is pressed
|
|
57
|
+
aiLogo={require('./assets/AI_Icon.png')} // Optional: custom icon for AI replies
|
|
58
|
+
onTokenRefresh={async () => {
|
|
59
|
+
// Triggered automatically if the token expires (401 error)
|
|
60
|
+
const newToken = await fetchNewTokenFromYourBackend();
|
|
61
|
+
setVorqardToken(newToken);
|
|
62
|
+
return newToken; // The SDK will retry the failed request using this
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
</SafeAreaView>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
container: {
|
|
71
|
+
flex: 1,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🛠 Advanced / Decoupled Usage
|
|
79
|
+
|
|
80
|
+
If you want to render your own custom user interface and only use the state management and API integration layer of the SDK, you can import the initialization client and custom hooks directly:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
import { initSDKClient, getSDKClient, useHealthChat } from 'vorqard-ai-sdk';
|
|
84
|
+
|
|
85
|
+
// 1. Initialize the HTTP client configuration
|
|
86
|
+
initSDKClient('https://app.vorqard.com/api', 'JWT_TOKEN_HERE');
|
|
87
|
+
|
|
88
|
+
// 2. Consume the custom health chat state hook in your own component
|
|
89
|
+
const MyCustomChat = () => {
|
|
90
|
+
const { messages, sendMessage, loading } = useHealthChat('chat', 'Jagadish');
|
|
91
|
+
// messages contains: [{ id, role, content, ui_action, timestamp }]
|
|
92
|
+
// sendMessage is a function to send the next prompt
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🌐 Backend API Endpoints Reference
|
|
99
|
+
|
|
100
|
+
The SDK automatically communicates with the following backend routes. Ensure your API gateway/server allows the client's JWT token authorization on these endpoints:
|
|
101
|
+
|
|
102
|
+
### 1. Patient Dashboard Context
|
|
103
|
+
* **Path:** `GET /patients/dashboard/me`
|
|
104
|
+
* **Headers:** `Authorization: Bearer <userToken>`
|
|
105
|
+
* **Description:** Fetches core summary details of the logged-in patient (e.g. name, date of last visit) to personalize the greeting.
|
|
106
|
+
|
|
107
|
+
### 2. Patient Medical Records
|
|
108
|
+
* **Path:** `GET /patients/records/me`
|
|
109
|
+
* **Headers:** `Authorization: Bearer <userToken>`
|
|
110
|
+
* **Description:** Fetches past clinical records and consult history to provide relevant diagnostic context to the AI model.
|
|
111
|
+
|
|
112
|
+
### 3. AI Health Chat Engine
|
|
113
|
+
* **Path:** `POST /patients/ai/chat`
|
|
114
|
+
* **Headers:** `Authorization: Bearer <userToken>`
|
|
115
|
+
* **Request Body:**
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"message": "book appointment",
|
|
119
|
+
"history": [
|
|
120
|
+
{ "role": "user", "content": "hello" },
|
|
121
|
+
{ "role": "assistant", "content": "Hi there! How can I help you today?" }
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
* **Response Body:**
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"response": "Here is a list of hospital-associated doctors...",
|
|
129
|
+
"ui_action": {
|
|
130
|
+
"type": "selection",
|
|
131
|
+
"title": "Select Doctor",
|
|
132
|
+
"options": [
|
|
133
|
+
{ "id": "129", "label": "Dr. Veeha Reddy", "name": "Dr. Veeha Reddy" }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
* **Description:** The chat router interface. It passes user utterances and conversational history to return clinical AI responses and rich-action metadata.
|
|
139
|
+
|
|
140
|
+
### 4. AI Report Analyzer (Optional)
|
|
141
|
+
* **Path:** `POST /patients/ai/analyze-report`
|
|
142
|
+
* **Headers:** `Authorization: Bearer <userToken>`
|
|
143
|
+
* **Request Body:** `Multipart Form-Data` (keys: `file`)
|
|
144
|
+
* **Description:** Submits physical medical report images for OCR scanning and structured health scoring.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🤝 Integration Path Options
|
|
149
|
+
|
|
150
|
+
Groupin can choose one of two integration approaches based on their requirements:
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Option A: SDK Integration (Recommended — AI-powered)
|
|
155
|
+
Use the SDK component described in this README. The AI chat handles hospital search, doctor discovery, slot picking, and appointment booking — all through a single conversational interface.
|
|
156
|
+
|
|
157
|
+
**What Groupin needs to Do:**
|
|
158
|
+
- `backendUrl` — VORQARD API base URL (e.g., `https://app.vorqard.com/api`)
|
|
159
|
+
- `userToken` — Patient JWT token
|
|
160
|
+
|
|
161
|
+
> **Getting a Token for Testing & Production:**
|
|
162
|
+
> To retrieve a valid `userToken`, call the `/partner/groupin/sync-user` endpoint from your backend — it now returns an `access_token` directly in the response. Pass this token straight to the SDK `userToken` prop. No separate OTP login step is needed.
|
|
163
|
+
|
|
164
|
+
**Endpoints used internally by SDK (no manual calls needed):**
|
|
165
|
+
|
|
166
|
+
| Endpoint | Method | Purpose |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `/partner/groupin/sync-user` | POST | Register/sync user **→ returns `access_token` directly** |
|
|
169
|
+
| `/patients/ai/chat` | POST | Full AI booking + health chat |
|
|
170
|
+
| `/patients/ai/analyze-report` | POST | Medical report OCR analysis |
|
|
171
|
+
|
|
172
|
+
### Props Reference
|
|
173
|
+
|
|
174
|
+
| Prop | Type | Required | Description |
|
|
175
|
+
|---|---|---|---|
|
|
176
|
+
| `backendUrl` | string | Yes | VORQARD API base URL |
|
|
177
|
+
| `userToken` | string | Yes | JWT token from `sync-user` |
|
|
178
|
+
| `patientName` | string | No | First name for greeting (Default: `"there"`) |
|
|
179
|
+
| `onClose` | function | No | Called when user presses the back button |
|
|
180
|
+
| `aiLogo` | image | No | Custom AI avatar icon |
|
|
181
|
+
| `onAnalyzeReportPress` | function | No | Custom handler to override the default report analyzer screen |
|
|
182
|
+
| `onTokenRefresh` | function | No | Callback triggered on 401 errors. Return a promise that resolves to a new JWT token to automatically retry failed requests. |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### Option B: Direct Partner API (Custom UI — no SDK required)
|
|
187
|
+
If Groupin prefers to build their own UI and call VORQARD APIs directly from their backend server.
|
|
188
|
+
|
|
189
|
+
**Authentication:** All requests must include the partner API key in the header:
|
|
190
|
+
```
|
|
191
|
+
X-Api-Key: <provided_by_vorqard>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Backend URL:** `https://app.vorqard.com/api`
|
|
195
|
+
|
|
196
|
+
**Available Partner Endpoints:**
|
|
197
|
+
|
|
198
|
+
| Endpoint | Method | Purpose |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| `/partner/groupin/sync-user` | POST | Register/sync a Groupin user as a VORQARD patient |
|
|
201
|
+
| `/partner/groupin/hospitals` | GET | Fetch all available hospitals |
|
|
202
|
+
| `/partner/groupin/doctors` | GET | Fetch doctors (filter by specialty or hospital) |
|
|
203
|
+
| `/partner/groupin/book-appointment` | POST | Book an appointment directly |
|
|
204
|
+
|
|
205
|
+
**Example — Sync User Request Body:**
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"phone_number": "9876543210",
|
|
209
|
+
"user_name": "Ravi Kumar",
|
|
210
|
+
"email": "ravi@example.com",
|
|
211
|
+
"gender": "Male",
|
|
212
|
+
"date_of_birth": "1990-05-15",
|
|
213
|
+
"blood_group": "O+",
|
|
214
|
+
"location": "Hyderabad"
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Example — Book Appointment Request Body:**
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"vorqard_patient_id": 42,
|
|
222
|
+
"vorqard_doctor_id": 7,
|
|
223
|
+
"date": "2026-06-20",
|
|
224
|
+
"time_slot": "10:00"
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vorqard-ai-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Standalone React Native SDK for VORQARD AI Health Assistant and Report Analyzer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"url": "https://github.com/AbhivornGroupIn/VORQARD_SDK_AI/issues"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
+
"axios": "^1.0.0",
|
|
15
16
|
"react": ">=18.0.0",
|
|
16
17
|
"react-native": ">=0.70.0",
|
|
17
|
-
"axios": "^1.0.0",
|
|
18
|
-
"react-native-linear-gradient": "*",
|
|
19
18
|
"react-native-image-crop-picker": "*",
|
|
20
|
-
"react-native-
|
|
19
|
+
"react-native-linear-gradient": "*",
|
|
20
|
+
"react-native-safe-area-context": "*",
|
|
21
21
|
"react-native-vector-icons": "*",
|
|
22
|
-
"react-native-
|
|
22
|
+
"react-native-vision-camera": "*"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"vorqard",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"healthcare"
|
|
30
30
|
],
|
|
31
31
|
"author": "VORQARD Developer",
|
|
32
|
-
"license": "Abhivorn Technologies"
|
|
32
|
+
"license": "Abhivorn Technologies",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"expo-av": "^16.0.8",
|
|
35
|
+
"expo-file-system": "~18.0.0",
|
|
36
|
+
"react-native-live-audio-stream": "^1.1.1"
|
|
37
|
+
}
|
|
33
38
|
}
|
|
34
|
-
|
package/src/api/sdkClient.js
CHANGED
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
|
|
3
3
|
let client = null;
|
|
4
4
|
|
|
5
|
-
export const initSDKClient = (backendUrl, token) => {
|
|
5
|
+
export const initSDKClient = (backendUrl, token, onTokenRefresh = null) => {
|
|
6
6
|
client = axios.create({
|
|
7
7
|
baseURL: backendUrl,
|
|
8
8
|
headers: {
|
|
@@ -10,6 +10,41 @@ export const initSDKClient = (backendUrl, token) => {
|
|
|
10
10
|
...(token ? { Authorization: `Bearer ${token}` } : {})
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
|
|
14
|
+
if (onTokenRefresh) {
|
|
15
|
+
client.interceptors.response.use(
|
|
16
|
+
(response) => response,
|
|
17
|
+
async (error) => {
|
|
18
|
+
const originalRequest = error.config;
|
|
19
|
+
|
|
20
|
+
// If it's a 401 error and we haven't already retried this exact request
|
|
21
|
+
if (error.response?.status === 401 && !originalRequest._retry) {
|
|
22
|
+
originalRequest._retry = true;
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
// Ask the host app for a new token
|
|
26
|
+
const newToken = await onTokenRefresh();
|
|
27
|
+
|
|
28
|
+
if (newToken) {
|
|
29
|
+
// Update the default headers for future requests
|
|
30
|
+
client.defaults.headers.common['Authorization'] = `Bearer ${newToken}`;
|
|
31
|
+
|
|
32
|
+
// Update the headers of the failed request
|
|
33
|
+
originalRequest.headers['Authorization'] = `Bearer ${newToken}`;
|
|
34
|
+
|
|
35
|
+
// Retry the original request with the new token
|
|
36
|
+
return client(originalRequest);
|
|
37
|
+
}
|
|
38
|
+
} catch (refreshError) {
|
|
39
|
+
console.error('VORQARD AI SDK: Token refresh failed:', refreshError);
|
|
40
|
+
return Promise.reject(refreshError);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return Promise.reject(error);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
13
48
|
};
|
|
14
49
|
|
|
15
50
|
export const getSDKClient = () => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { DoctorTypeSelectionCard } from './cards/DoctorTypeSelectionCard';
|
|
2
|
+
export { SpecialtySelectionCard } from './cards/SpecialtySelectionCard';
|
|
3
|
+
export { RadiusSelectionCard } from './cards/RadiusSelectionCard';
|
|
2
4
|
export { HospitalSelectionList, HospitalProfileCard } from './cards/HospitalCards';
|
|
3
5
|
export { DoctorSelectionList, DoctorProfileCard } from './cards/DoctorCards';
|
|
4
6
|
export { SlotSelectionCard } from './cards/SlotSelectionCard';
|