@omniloy/sofia-sdk 0.0.9 → 0.0.11
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 +84 -73
- package/dist/legacy/webcomponents.es.js +734 -235
- package/dist/legacy/webcomponents.umd.js +734 -235
- package/dist/tailor/webcomponents.es.js +747 -233
- package/dist/tailor/webcomponents.umd.js +747 -233
- package/dist/webcomponents.es.js +742 -231
- package/dist/webcomponents.umd.js +742 -231
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -13,104 +13,115 @@ AI-powered medical assistant web component for healthcare applications.
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
+
### Option 1: NPM/Yarn (Recommended)
|
|
17
|
+
|
|
16
18
|
```bash
|
|
17
19
|
npm install @omniloy/sofia-sdk
|
|
18
20
|
```
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @omniloy/sofia-sdk
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Import in your project:
|
|
21
27
|
|
|
22
|
-
### Option 1: ES Modules (Recommended)
|
|
23
28
|
```javascript
|
|
29
|
+
// In your main file (main.js, app.js, index.js, etc.)
|
|
24
30
|
import '@omniloy/sofia-sdk';
|
|
25
|
-
|
|
26
|
-
<sofia-sdk
|
|
27
|
-
baseurl="your-base-url"
|
|
28
|
-
wssurl="your-wss-url"
|
|
29
|
-
apikey="your-api-key"
|
|
30
|
-
userid="dr-garcia-123"
|
|
31
|
-
patientid="patient-456"
|
|
32
|
-
toolsargs='{
|
|
33
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
34
|
-
"title": "Medical Consultation",
|
|
35
|
-
"type": "object",
|
|
36
|
-
"properties": {
|
|
37
|
-
"chief_complaint": {"type": "string", "description": "Primary reason for visit"},
|
|
38
|
-
"diagnosis": {"type": "string", "description": "Medical diagnosis"},
|
|
39
|
-
"treatment_plan": {"type": "string", "description": "Recommended treatment"}
|
|
40
|
-
},
|
|
41
|
-
"required": ["chief_complaint", "diagnosis"]
|
|
42
|
-
}'>
|
|
43
|
-
</sofia-sdk>
|
|
44
31
|
```
|
|
45
32
|
|
|
46
|
-
|
|
33
|
+
Once imported, the `<sofia-sdk>` component becomes available globally.
|
|
34
|
+
|
|
35
|
+
### Option 2: CDN
|
|
36
|
+
|
|
37
|
+
Latest version:
|
|
38
|
+
|
|
47
39
|
```html
|
|
48
40
|
<script src="https://unpkg.com/@omniloy/sofia-sdk@latest/dist/webcomponents.umd.js"></script>
|
|
41
|
+
```
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
userid="dr-garcia-123"
|
|
55
|
-
patientid="patient-456"
|
|
56
|
-
toolsargs='{"$schema": "http://json-schema.org/draft-07/schema#", "title": "Medical Consultation", "type": "object", "properties": {"diagnosis": {"type": "string"}}, "required": ["diagnosis"]}'
|
|
57
|
-
templateid='1234'
|
|
58
|
-
>
|
|
59
|
-
</sofia-sdk>
|
|
43
|
+
Specific version:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<script src="https://unpkg.com/@omniloy/sofia-sdk@1.0.0/dist/webcomponents.umd.js"></script>
|
|
60
47
|
```
|
|
61
48
|
|
|
62
|
-
###
|
|
49
|
+
### Option 3: Manual Build
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<script src="/dist/webcomponents.umd.js"></script>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Installation Verification
|
|
56
|
+
|
|
57
|
+
Browser verification:
|
|
58
|
+
|
|
63
59
|
```javascript
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
console.log(customElements.get('sofia-sdk'));
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Should return the component definition rather than `undefined`.
|
|
64
|
+
|
|
65
|
+
HTML verification:
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<sofia-sdk></sofia-sdk>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Successful installation displays a message about missing required properties.
|
|
72
|
+
|
|
73
|
+
## Environment Requirements
|
|
74
|
+
|
|
75
|
+
### HTTPS Protocol
|
|
76
|
+
|
|
77
|
+
SofIA SDK requires HTTPS for audio and microphone functionality. Local development uses `https://localhost` or `local-ssl-proxy`.
|
|
78
|
+
|
|
79
|
+
### Content Security Policy
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
connect-src 'self' https://*.omniloy.com wss://*.omniloy.com;
|
|
83
|
+
script-src 'self' 'unsafe-inline' https://unpkg.com;
|
|
77
84
|
```
|
|
78
85
|
|
|
79
|
-
|
|
86
|
+
### SDK Configuration with Proxy
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
```html
|
|
89
|
+
<sofia-sdk
|
|
90
|
+
baseurl="base-url"
|
|
91
|
+
apikey="your-api-key"
|
|
92
|
+
wssurl="wss://WSS_URL"
|
|
93
|
+
userid="doctor-123"
|
|
94
|
+
patientid="patient-456"
|
|
95
|
+
template='{"$schema": "http://json-schema.org/draft-07/schema#", "title": "Medical Consultation", "type": "object", "properties": {"diagnosis": {"type": "string"}}, "required": ["diagnosis"]}'
|
|
96
|
+
templateid='1234'
|
|
97
|
+
></sofia-sdk>
|
|
98
|
+
```
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
|----------|------|-------------|
|
|
85
|
-
| **baseurl** | `string` | SofIA REST API endpoint (HTTPS required) |
|
|
86
|
-
| **wssurl** | `string` | WebSocket URL for real-time streaming (WSS required) |
|
|
87
|
-
| **apikey** | `string` | Authentication key provided by Omniloy |
|
|
88
|
-
| **userid** | `string` | Unique identifier of the healthcare professional |
|
|
89
|
-
| **patientid** | `string` | Unique identifier of the patient for the session |
|
|
90
|
-
| **toolsargs** | `string` | JSON Schema Draft-07 defining clinical data structure - mandatory if isonlychat is not "true" |
|
|
91
|
-
| **templateid** | `string` | The current template Id - mandatory if isonlychat is not "true" |
|
|
100
|
+
## Troubleshooting
|
|
92
101
|
|
|
93
|
-
|
|
102
|
+
**Component doesn't load:**
|
|
103
|
+
- Verify the import is in the main file
|
|
104
|
+
- Confirm no errors in browser console
|
|
105
|
+
- Check network connectivity for CDN usage
|
|
94
106
|
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
- **WebSocket URL**: Real-time connection endpoint
|
|
107
|
+
**CORS errors:**
|
|
108
|
+
- Ensure application uses HTTPS
|
|
109
|
+
- Verify `baseurl` and `wssurl` URLs are correct
|
|
99
110
|
|
|
100
|
-
|
|
111
|
+
**Component not defined:**
|
|
101
112
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
```javascript
|
|
114
|
+
// Wait for component definition
|
|
115
|
+
customElements.whenDefined('sofia-sdk').then(() => {
|
|
116
|
+
console.log('SofIA SDK is ready');
|
|
117
|
+
});
|
|
118
|
+
```
|
|
108
119
|
|
|
109
|
-
##
|
|
120
|
+
## Next Steps
|
|
110
121
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
1. **[Required Properties](https://omniloy.mintlify.app/en/sdk/installation)**: Configure mandatory parameters
|
|
123
|
+
2. **[Optional Properties](https://omniloy.mintlify.app/en/sdk/installation)**: Customize behavior
|
|
124
|
+
3. **[Clinical Data Schemas](https://omniloy.mintlify.app/en/sdk/installation)**: Define data structure to generate
|
|
114
125
|
|
|
115
126
|
## License
|
|
116
127
|
|