@docbrasil/api-systemmanager 1.1.81 → 1.1.83
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/ai/index.js +2 -2
- package/api/ai/sessions.js +98 -5
- package/api/dispatch.js +24 -0
- package/dist/bundle.cjs +139 -7
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +91 -0
- package/docs/AISession.html +731 -1
- package/docs/Dispatch.html +271 -0
- package/docs/MyndAI.html +1 -1
- package/docs/ai_index.js.html +2 -2
- package/docs/ai_sessions.js.html +98 -5
- package/docs/dispatch.js.html +24 -0
- package/index.js +15 -0
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -1814,6 +1814,8 @@ Class for AI Session management
|
|
|
1814
1814
|
* [AISession](#AISession)
|
|
1815
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
1816
|
* [.updateData(params, authorization)](#AISession+updateData) ⇒ <code>Promise.<object></code> \| <code>array.<object></code> \| <code>object</code> \| <code>object</code>
|
|
1817
|
+
* [.create(params, authorization)](#AISession+create) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1818
|
+
* [.execute(params, authorization)](#AISession+execute) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1817
1819
|
|
|
1818
1820
|
<a name="AISession+getByDocument"></a>
|
|
1819
1821
|
|
|
@@ -1888,6 +1890,72 @@ const params = {
|
|
|
1888
1890
|
};
|
|
1889
1891
|
const retData = await api.ai.sessions.updateData(params, authorization);
|
|
1890
1892
|
```
|
|
1893
|
+
<a name="AISession+create"></a>
|
|
1894
|
+
|
|
1895
|
+
### aiSession.create(params, authorization) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1896
|
+
Create a new agent session.
|
|
1897
|
+
Use this to create a session with full metadata before triggering execution.
|
|
1898
|
+
|
|
1899
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1900
|
+
**Returns**: <code>Promise.<object></code> - data The created session<code>string</code> - data.sessionId The session ID<code>string</code> - data.status The session status
|
|
1901
|
+
**Access**: public
|
|
1902
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1903
|
+
|
|
1904
|
+
| Param | Type | Description |
|
|
1905
|
+
| --- | --- | --- |
|
|
1906
|
+
| params | <code>object</code> | Parameters |
|
|
1907
|
+
| params.agentType | <code>string</code> | The agent type (e.g., 'doc-rlm-ingest') |
|
|
1908
|
+
| [params.config] | <code>object</code> | Agent configuration options |
|
|
1909
|
+
| [params.metadata] | <code>object</code> | Session metadata (documentId, pipelineVariant, analysisMode, etc.) |
|
|
1910
|
+
| authorization | <code>string</code> | Authorization token |
|
|
1911
|
+
|
|
1912
|
+
**Example**
|
|
1913
|
+
```js
|
|
1914
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1915
|
+
const api = new API();
|
|
1916
|
+
const authorization = '...';
|
|
1917
|
+
const params = {
|
|
1918
|
+
agentType: 'doc-rlm-ingest',
|
|
1919
|
+
metadata: {
|
|
1920
|
+
documentId: 'doc-123',
|
|
1921
|
+
documentName: 'Patient Report.pdf',
|
|
1922
|
+
pipelineVariant: 'A',
|
|
1923
|
+
analysisMode: 'full'
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
const retData = await api.ai.sessions.create(params, authorization);
|
|
1927
|
+
```
|
|
1928
|
+
<a name="AISession+execute"></a>
|
|
1929
|
+
|
|
1930
|
+
### aiSession.execute(params, authorization) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1931
|
+
Start execution on an existing agent session.
|
|
1932
|
+
|
|
1933
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1934
|
+
**Returns**: <code>Promise.<object></code> - data The execution data<code>string</code> - data.executionId The execution ID<code>string</code> - data.status The execution status
|
|
1935
|
+
**Access**: public
|
|
1936
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1937
|
+
|
|
1938
|
+
| Param | Type | Description |
|
|
1939
|
+
| --- | --- | --- |
|
|
1940
|
+
| params | <code>object</code> | Parameters |
|
|
1941
|
+
| params.sessionId | <code>string</code> | The session ID to execute |
|
|
1942
|
+
| [params.input] | <code>object</code> | Execution input (documentId, options, etc.) |
|
|
1943
|
+
| authorization | <code>string</code> | Authorization token |
|
|
1944
|
+
|
|
1945
|
+
**Example**
|
|
1946
|
+
```js
|
|
1947
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1948
|
+
const api = new API();
|
|
1949
|
+
const authorization = '...';
|
|
1950
|
+
const params = {
|
|
1951
|
+
sessionId: 'session-abc-123',
|
|
1952
|
+
input: {
|
|
1953
|
+
documentId: 'doc-123',
|
|
1954
|
+
options: { pipelineVariant: 'A', analysisMode: 'full' }
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
const retData = await api.ai.sessions.execute(params, authorization);
|
|
1958
|
+
```
|
|
1891
1959
|
<a name="GeoLocation"></a>
|
|
1892
1960
|
|
|
1893
1961
|
## GeoLocation
|
|
@@ -5335,6 +5403,8 @@ Api dispatch manager
|
|
|
5335
5403
|
* [.errorOffline()](#Dispatch+errorOffline)
|
|
5336
5404
|
* [.getContext(url, [session])](#Dispatch+getContext) ⇒ <code>Promise.<object></code>
|
|
5337
5405
|
* [.getClient()](#Dispatch+getClient) ⇒ <code>AxiosInstance</code>
|
|
5406
|
+
* [.setAkamaiBaseUrl(url)](#Dispatch+setAkamaiBaseUrl)
|
|
5407
|
+
* [.getAkamaiClient()](#Dispatch+getAkamaiClient) ⇒ <code>AxiosInstance</code>
|
|
5338
5408
|
|
|
5339
5409
|
<a name="Dispatch+errorOffline"></a>
|
|
5340
5410
|
|
|
@@ -5364,6 +5434,27 @@ Get the Axios client.
|
|
|
5364
5434
|
**Kind**: instance method of [<code>Dispatch</code>](#Dispatch)
|
|
5365
5435
|
**Returns**: <code>AxiosInstance</code> - The Axios client.
|
|
5366
5436
|
**Access**: public
|
|
5437
|
+
<a name="Dispatch+setAkamaiBaseUrl"></a>
|
|
5438
|
+
|
|
5439
|
+
### dispatch.setAkamaiBaseUrl(url)
|
|
5440
|
+
Create a dedicated Axios client for Akamai routes.
|
|
5441
|
+
|
|
5442
|
+
**Kind**: instance method of [<code>Dispatch</code>](#Dispatch)
|
|
5443
|
+
**Access**: public
|
|
5444
|
+
|
|
5445
|
+
| Param | Type | Description |
|
|
5446
|
+
| --- | --- | --- |
|
|
5447
|
+
| url | <code>string</code> | The Akamai base URL (e.g., http://localhost:9008 in DEV). |
|
|
5448
|
+
|
|
5449
|
+
<a name="Dispatch+getAkamaiClient"></a>
|
|
5450
|
+
|
|
5451
|
+
### dispatch.getAkamaiClient() ⇒ <code>AxiosInstance</code>
|
|
5452
|
+
Get the Akamai Axios client. Falls back to the default client
|
|
5453
|
+
for backward compatibility (e.g., PROD where NGiNX proxies all routes).
|
|
5454
|
+
|
|
5455
|
+
**Kind**: instance method of [<code>Dispatch</code>](#Dispatch)
|
|
5456
|
+
**Returns**: <code>AxiosInstance</code> - The Akamai client or default client.
|
|
5457
|
+
**Access**: public
|
|
5367
5458
|
<a name="External"></a>
|
|
5368
5459
|
|
|
5369
5460
|
## External
|