@docbrasil/api-systemmanager 1.1.79 → 1.1.81
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/api/admin/user.js +2 -2
- package/api/{ai.js → ai/index.js} +3 -0
- package/api/ai/sessions.js +153 -0
- package/dist/bundle.cjs +152 -2
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +134 -47
- package/docs/AISession.html +1370 -0
- package/docs/Admin.html +1 -1
- package/docs/AdminDocuments.html +1 -1
- package/docs/AdminForm.html +1 -1
- package/docs/AdminLists.html +1 -1
- package/docs/AdminMessage.html +1 -1
- package/docs/AdminNotification.html +1 -1
- package/docs/AdminPlugin.html +1 -1
- package/docs/AdminPolicy.html +1 -1
- package/docs/AdminProcesses.html +1 -1
- package/docs/AdminTask.html +1 -1
- package/docs/AdminUser.html +1 -1
- package/docs/Application.html +1 -1
- package/docs/Chart.html +1 -1
- package/docs/Dashboard.html +1 -1
- package/docs/Datasource.html +1 -1
- package/docs/Dispatch.html +1 -1
- package/docs/Documents.html +1 -1
- package/docs/External.html +1 -1
- package/docs/GeoLocation.html +1 -1
- package/docs/Help.html +1 -1
- package/docs/Kanban.html +1 -1
- package/docs/Login.html +1 -1
- package/docs/MyTasks.html +1 -1
- package/docs/MyndAI.html +5 -5
- package/docs/Notification.html +1 -1
- package/docs/Organization.html +1 -1
- package/docs/Page.html +1 -1
- package/docs/Process.html +1 -1
- package/docs/Register.html +1 -1
- package/docs/Report.html +1 -1
- package/docs/Session.html +1 -1
- package/docs/Settings.html +1 -1
- package/docs/Task.html +1 -1
- package/docs/TaskAvailable.html +1 -1
- package/docs/Updates.html +1 -1
- package/docs/User.html +1 -1
- package/docs/Users.html +1 -1
- package/docs/admin_doctypes.js.html +1 -1
- package/docs/admin_document.js.html +1 -1
- package/docs/admin_form.js.html +1 -1
- package/docs/admin_index.js.html +1 -1
- package/docs/admin_list.js.html +1 -1
- package/docs/admin_message.js.html +1 -1
- package/docs/admin_notification.js.html +1 -1
- package/docs/admin_organization.js.html +1 -1
- package/docs/admin_plugin.js.html +1 -1
- package/docs/admin_policy.js.html +1 -1
- package/docs/admin_processes.js.html +1 -1
- package/docs/admin_task.js.html +1 -1
- package/docs/admin_user.js.html +3 -3
- package/docs/{ai.js.html → ai_index.js.html} +6 -3
- package/docs/ai_sessions.js.html +270 -0
- package/docs/dispatch.js.html +1 -1
- package/docs/external.js.html +1 -1
- package/docs/general_geoLocation.js.html +1 -1
- package/docs/general_index.js.html +1 -1
- package/docs/index.html +1 -1
- package/docs/login.js.html +1 -1
- package/docs/session.js.html +1 -1
- package/docs/user_application.js.html +1 -1
- package/docs/user_dashboard.js.html +1 -1
- package/docs/user_datasource.js.html +1 -1
- package/docs/user_document.js.html +1 -1
- package/docs/user_help.js.html +1 -1
- package/docs/user_index.js.html +1 -1
- package/docs/user_kanban.js.html +1 -1
- package/docs/user_my_tasks.js.html +1 -1
- package/docs/user_notification.js.html +1 -1
- package/docs/user_organization.js.html +1 -1
- package/docs/user_page.js.html +1 -1
- package/docs/user_process.js.html +1 -1
- package/docs/user_register.js.html +1 -1
- package/docs/user_settings.js.html +1 -1
- package/docs/user_task.js.html +1 -1
- package/docs/user_task_available.js.html +1 -1
- package/docs/user_updates.js.html +1 -1
- package/docs/user_user.js.html +1 -1
- package/docs/utils_promises.js.html +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
<dt><a href="#AdminUser">AdminUser</a></dt>
|
|
38
38
|
<dd><p>Admin Class for user, permission admin</p>
|
|
39
39
|
</dd>
|
|
40
|
+
<dt><a href="#MyndAI">MyndAI</a></dt>
|
|
41
|
+
<dd><p>Class using AI</p>
|
|
42
|
+
</dd>
|
|
43
|
+
<dt><a href="#AISession">AISession</a></dt>
|
|
44
|
+
<dd><p>Class for AI Session management</p>
|
|
45
|
+
</dd>
|
|
40
46
|
<dt><a href="#GeoLocation">GeoLocation</a></dt>
|
|
41
47
|
<dd><p>General Class for user, permission organization</p>
|
|
42
48
|
</dd>
|
|
@@ -103,9 +109,6 @@
|
|
|
103
109
|
<dt><a href="#User">User</a></dt>
|
|
104
110
|
<dd><p>Class for user, permission user</p>
|
|
105
111
|
</dd>
|
|
106
|
-
<dt><a href="#MyndAI">MyndAI</a></dt>
|
|
107
|
-
<dd><p>Class using AI</p>
|
|
108
|
-
</dd>
|
|
109
112
|
<dt><a href="#Dispatch">Dispatch</a></dt>
|
|
110
113
|
<dd><p>Api dispatch manager</p>
|
|
111
114
|
</dd>
|
|
@@ -1757,6 +1760,134 @@ const params = { orgId: '5edd11c46b6ce9729c2c297c' };
|
|
|
1757
1760
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1758
1761
|
const users = await api.admin.user.getOrgUsers(params, session);
|
|
1759
1762
|
```
|
|
1763
|
+
<a name="MyndAI"></a>
|
|
1764
|
+
|
|
1765
|
+
## MyndAI
|
|
1766
|
+
Class using AI
|
|
1767
|
+
|
|
1768
|
+
**Kind**: global class
|
|
1769
|
+
<a name="MyndAI+explain"></a>
|
|
1770
|
+
|
|
1771
|
+
### myndAI.explain(params) ⇒ <code>Promise.<object></code> \| <code>boolean</code> \| <code>object</code> \| <code>string</code> \| <code>number</code>
|
|
1772
|
+
Create new document
|
|
1773
|
+
|
|
1774
|
+
**Kind**: instance method of [<code>MyndAI</code>](#MyndAI)
|
|
1775
|
+
**Returns**: <code>Promise.<object></code> - data<code>boolean</code> - data.success true|false for success<code>object</code> - data.result the result of the AI call<code>string</code> - data.result.response The actual text response according the prompt<code>number</code> - data.result.tokens The quantity of token used in this request
|
|
1776
|
+
**Access**: public
|
|
1777
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1778
|
+
|
|
1779
|
+
| Param | Type | Default | Description |
|
|
1780
|
+
| --- | --- | --- | --- |
|
|
1781
|
+
| params | <code>object</code> | | Object for add new document |
|
|
1782
|
+
| params.model | <code>string</code> | | The model to use for the explain |
|
|
1783
|
+
| params.context | <code>object</code> | | The context to apply to a prompt |
|
|
1784
|
+
| params.text | <code>string</code> | | The text to add to the prompt |
|
|
1785
|
+
| params.medias | <code>array.<object></code> | | Medias to add (PDF, Image, Video, Audio) |
|
|
1786
|
+
| params.medias.type | <code>string</code> | | can be base64 | document |
|
|
1787
|
+
| params.medias.mime | <code>string</code> | | the mime type of the media |
|
|
1788
|
+
| params.medias.base64 | <code>string</code> | | the base64 of the image (in the case the type is base64) |
|
|
1789
|
+
| params.medias.document | <code>string</code> | | the document path for the image (in the case the type is document) |
|
|
1790
|
+
| params.prompt | <code>string</code> | | The actual prompt with context and text to apply to |
|
|
1791
|
+
| params.json | <code>boolean</code> | <code>false</code> | If we return in json format or not |
|
|
1792
|
+
|
|
1793
|
+
**Example**
|
|
1794
|
+
```js
|
|
1795
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1796
|
+
const api = new API();
|
|
1797
|
+
const authorization = '...';
|
|
1798
|
+
const params = {
|
|
1799
|
+
model: 'model-name',
|
|
1800
|
+
context: { name: 'Some name' },
|
|
1801
|
+
text: 'Say hello to the world',
|
|
1802
|
+
medias: ['...'],
|
|
1803
|
+
prompt: 'Write a story about {{name}} with the following theme: {{text}}',
|
|
1804
|
+
};
|
|
1805
|
+
const retData = await api.ai.explain(params, authorization);
|
|
1806
|
+
```
|
|
1807
|
+
<a name="AISession"></a>
|
|
1808
|
+
|
|
1809
|
+
## AISession
|
|
1810
|
+
Class for AI Session management
|
|
1811
|
+
|
|
1812
|
+
**Kind**: global class
|
|
1813
|
+
|
|
1814
|
+
* [AISession](#AISession)
|
|
1815
|
+
* [.getByDocument(params, authorization)](#AISession+getByDocument) ⇒ <code>Promise.<object></code> \| <code>object</code> \| <code>object</code> \| <code>array.<object></code> \| <code>array.<object></code> \| <code>array.<object></code> \| <code>object</code>
|
|
1816
|
+
* [.updateData(params, authorization)](#AISession+updateData) ⇒ <code>Promise.<object></code> \| <code>array.<object></code> \| <code>object</code> \| <code>object</code>
|
|
1817
|
+
|
|
1818
|
+
<a name="AISession+getByDocument"></a>
|
|
1819
|
+
|
|
1820
|
+
### aiSession.getByDocument(params, authorization) ⇒ <code>Promise.<object></code> \| <code>object</code> \| <code>object</code> \| <code>array.<object></code> \| <code>array.<object></code> \| <code>array.<object></code> \| <code>object</code>
|
|
1821
|
+
Get full session data by document ID.
|
|
1822
|
+
Returns session, execution, activities, pages, triples and summary.
|
|
1823
|
+
|
|
1824
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1825
|
+
**Returns**: <code>Promise.<object></code> - data The full session data<code>object</code> - data.session The session object<code>object</code> - data.execution The latest execution or null<code>array.<object></code> - data.activities Activity log entries<code>array.<object></code> - data.pages Extracted page objects<code>array.<object></code> - data.triples Ontology triple objects<code>object</code> - data.summary Document summary or null
|
|
1826
|
+
**Access**: public
|
|
1827
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1828
|
+
|
|
1829
|
+
| Param | Type | Description |
|
|
1830
|
+
| --- | --- | --- |
|
|
1831
|
+
| params | <code>object</code> | Parameters |
|
|
1832
|
+
| params.documentId | <code>string</code> | The document ID to look up the session for |
|
|
1833
|
+
| authorization | <code>string</code> | Authorization token |
|
|
1834
|
+
|
|
1835
|
+
**Example**
|
|
1836
|
+
```js
|
|
1837
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1838
|
+
const api = new API();
|
|
1839
|
+
const authorization = '...';
|
|
1840
|
+
const params = { documentId: 'doc-123' };
|
|
1841
|
+
const retData = await api.ai.sessions.getByDocument(params, authorization);
|
|
1842
|
+
```
|
|
1843
|
+
<a name="AISession+updateData"></a>
|
|
1844
|
+
|
|
1845
|
+
### aiSession.updateData(params, authorization) ⇒ <code>Promise.<object></code> \| <code>array.<object></code> \| <code>object</code> \| <code>object</code>
|
|
1846
|
+
Update session document data (pages, triples, summary).
|
|
1847
|
+
Used by Scarface to push corrections or enrichments for a document.
|
|
1848
|
+
|
|
1849
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1850
|
+
**Returns**: <code>Promise.<object></code> - data The update results<code>array.<object></code> - data.pages Page update results [{pageNumber, updated}]<code>object</code> - data.triples Triple insert results {added: number}<code>object</code> - data.summary Applied summary updates
|
|
1851
|
+
**Access**: public
|
|
1852
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1853
|
+
|
|
1854
|
+
| Param | Type | Description |
|
|
1855
|
+
| --- | --- | --- |
|
|
1856
|
+
| params | <code>object</code> | Parameters |
|
|
1857
|
+
| params.documentId | <code>string</code> | The document ID |
|
|
1858
|
+
| [params.pages] | <code>array.<object></code> | Page updates |
|
|
1859
|
+
| params.pages.pageNumber | <code>number</code> | 1-based page number |
|
|
1860
|
+
| [params.pages.markdown] | <code>string</code> | Updated markdown text |
|
|
1861
|
+
| [params.pages.entities] | <code>array.<object></code> | Updated entities |
|
|
1862
|
+
| [params.triples] | <code>array.<object></code> | New triples to add |
|
|
1863
|
+
| params.triples.pageNumber | <code>number</code> | Source page number |
|
|
1864
|
+
| params.triples.subject | <code>string</code> | Subject entity text |
|
|
1865
|
+
| params.triples.predicate | <code>string</code> | Relationship predicate |
|
|
1866
|
+
| params.triples.object | <code>string</code> | Object entity text |
|
|
1867
|
+
| [params.summary] | <code>object</code> | Summary field updates |
|
|
1868
|
+
| [params.summary.documentName] | <code>string</code> | Document name |
|
|
1869
|
+
| [params.summary.entityCount] | <code>number</code> | Total entity count |
|
|
1870
|
+
| [params.summary.tripleCount] | <code>number</code> | Total triple count |
|
|
1871
|
+
| authorization | <code>string</code> | Authorization token |
|
|
1872
|
+
|
|
1873
|
+
**Example**
|
|
1874
|
+
```js
|
|
1875
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1876
|
+
const api = new API();
|
|
1877
|
+
const authorization = '...';
|
|
1878
|
+
const params = {
|
|
1879
|
+
documentId: 'doc-123',
|
|
1880
|
+
pages: [
|
|
1881
|
+
{ pageNumber: 1, markdown: '# Updated page content' }
|
|
1882
|
+
],
|
|
1883
|
+
summary: {
|
|
1884
|
+
documentName: 'Patient Report.pdf',
|
|
1885
|
+
entityCount: 42,
|
|
1886
|
+
tripleCount: 15
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
const retData = await api.ai.sessions.updateData(params, authorization);
|
|
1890
|
+
```
|
|
1760
1891
|
<a name="GeoLocation"></a>
|
|
1761
1892
|
|
|
1762
1893
|
## GeoLocation
|
|
@@ -5193,50 +5324,6 @@ const orgIds: ['616eccaaa9360a05293b10fe'];
|
|
|
5193
5324
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
5194
5325
|
const jwtToken = await api.user.getChartTags(orgIds, session);
|
|
5195
5326
|
```
|
|
5196
|
-
<a name="MyndAI"></a>
|
|
5197
|
-
|
|
5198
|
-
## MyndAI
|
|
5199
|
-
Class using AI
|
|
5200
|
-
|
|
5201
|
-
**Kind**: global class
|
|
5202
|
-
<a name="MyndAI+explain"></a>
|
|
5203
|
-
|
|
5204
|
-
### myndAI.explain(params) ⇒ <code>Promise.<object></code> \| <code>boolean</code> \| <code>object</code> \| <code>string</code> \| <code>number</code>
|
|
5205
|
-
Create new document
|
|
5206
|
-
|
|
5207
|
-
**Kind**: instance method of [<code>MyndAI</code>](#MyndAI)
|
|
5208
|
-
**Returns**: <code>Promise.<object></code> - data<code>boolean</code> - data.success true|false for success<code>object</code> - data.result the result of the AI call<code>string</code> - data.result.response The actual text response according the prompt<code>number</code> - data.result.tokens The quantity of token used in this request
|
|
5209
|
-
**Access**: public
|
|
5210
|
-
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
5211
|
-
|
|
5212
|
-
| Param | Type | Default | Description |
|
|
5213
|
-
| --- | --- | --- | --- |
|
|
5214
|
-
| params | <code>object</code> | | Object for add new document |
|
|
5215
|
-
| params.model | <code>string</code> | | The model to use for the explain |
|
|
5216
|
-
| params.context | <code>object</code> | | The context to apply to a prompt |
|
|
5217
|
-
| params.text | <code>string</code> | | The text to add to the prompt |
|
|
5218
|
-
| params.medias | <code>array.<object></code> | | Medias to add (PDF, Image, Video, Audio) |
|
|
5219
|
-
| params.medias.type | <code>string</code> | | can be base64 | document |
|
|
5220
|
-
| params.medias.mime | <code>string</code> | | the mime type of the media |
|
|
5221
|
-
| params.medias.base64 | <code>string</code> | | the base64 of the image (in the case the type is base64) |
|
|
5222
|
-
| params.medias.document | <code>string</code> | | the document path for the image (in the case the type is document) |
|
|
5223
|
-
| params.prompt | <code>string</code> | | The actual prompt with context and text to apply to |
|
|
5224
|
-
| params.json | <code>boolean</code> | <code>false</code> | If we return in json format or not |
|
|
5225
|
-
|
|
5226
|
-
**Example**
|
|
5227
|
-
```js
|
|
5228
|
-
const API = require('@docbrasil/api-systemmanager');
|
|
5229
|
-
const api = new API();
|
|
5230
|
-
const authorization = '...';
|
|
5231
|
-
const params = {
|
|
5232
|
-
model: 'model-name',
|
|
5233
|
-
context: { name: 'Some name' },
|
|
5234
|
-
text: 'Say hello to the world',
|
|
5235
|
-
medias: ['...'],
|
|
5236
|
-
prompt: 'Write a story about {{name}} with the following theme: {{text}}',
|
|
5237
|
-
};
|
|
5238
|
-
const retData = await api.ai.explain(params, authorization);
|
|
5239
|
-
```
|
|
5240
5327
|
<a name="Dispatch"></a>
|
|
5241
5328
|
|
|
5242
5329
|
## Dispatch
|