@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 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
- ## Quick Start
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
- ### Option 2: Script Tag
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
- <sofia-sdk
51
- baseurl="your-base-url"
52
- wssurl="your-wss-url"
53
- apikey="your-api-key"
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
- ### Handling Generated Reports
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
- const sofiaComponent = document.querySelector('sofia-sdk');
65
-
66
- // Handle medical reports
67
- sofiaComponent.handleReport = (report) => {
68
- console.log('Medical report generated:', report);
69
- // Integrate with your medical records system
70
- saveToEHR(report);
71
- };
72
-
73
- // Control component visibility
74
- sofiaComponent.setIsOpen = (isOpen) => {
75
- console.log('Component status:', isOpen ? 'Open' : 'Closed');
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
- ## Required Configuration
86
+ ### SDK Configuration with Proxy
80
87
 
81
- All properties below are mandatory for proper SDK functionality:
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
- | Property | Type | Description |
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
- ### Getting Credentials
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
- Contact [support@omniloy.com](mailto:support@omniloy.com) to obtain:
96
- - **API Key**: Authentication credentials
97
- - **Base URL**: Your API endpoint
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
- ## Features
111
+ **Component not defined:**
101
112
 
102
- - **Real-time medical transcription**: Voice-to-text conversion optimized for medical terminology
103
- - **Intelligent report generation**: AI-powered clinical documentation
104
- - **HIPAA compliant**: Enterprise-grade security and privacy
105
- - **Framework agnostic**: Works with any web framework or vanilla JavaScript
106
- - **WebSocket streaming**: Real-time bidirectional communication
107
- - **Customizable schemas**: Define your own clinical data structures
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
- ## Technical Requirements
120
+ ## Next Steps
110
121
 
111
- - **HTTPS connection**: TLS required for audio functionalities
112
- - **Modern browser**: Chrome 88+, Firefox 78+, Safari 14+, Edge 88+
113
- - **WebSocket support**: For real-time features
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