phenoml 6.3.0 → 6.4.0
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agent/client/Client.d.ts +8 -1
- package/dist/cjs/api/resources/agent/client/Client.js +82 -1
- package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +31 -0
- package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.js +3 -0
- package/dist/cjs/api/resources/agent/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/agent/types/AgentChatStreamEvent.d.ts +36 -0
- package/dist/cjs/api/resources/agent/types/AgentChatStreamEvent.js +16 -0
- package/dist/cjs/api/resources/agent/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/agent/types/index.js +1 -0
- package/dist/cjs/api/resources/construe/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/construe/client/Client.js +6 -6
- package/dist/cjs/api/resources/fhir/client/Client.d.ts +49 -49
- package/dist/cjs/api/resources/fhir/client/Client.js +69 -69
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -10
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +25 -25
- package/dist/cjs/api/resources/fhirProvider/types/Provider.d.ts +1 -0
- package/dist/cjs/api/resources/fhirProvider/types/Provider.js +1 -0
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +10 -10
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +20 -20
- package/dist/cjs/core/fetcher/Fetcher.js +12 -6
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/core/stream/Stream.d.ts +47 -0
- package/dist/cjs/core/stream/Stream.js +175 -0
- package/dist/cjs/core/stream/index.d.ts +1 -0
- package/dist/cjs/core/stream/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agent/client/Client.d.mts +8 -1
- package/dist/esm/api/resources/agent/client/Client.mjs +82 -1
- package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +2 -0
- package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +31 -0
- package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.mjs +2 -0
- package/dist/esm/api/resources/agent/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/agent/types/AgentChatStreamEvent.d.mts +36 -0
- package/dist/esm/api/resources/agent/types/AgentChatStreamEvent.mjs +13 -0
- package/dist/esm/api/resources/agent/types/index.d.mts +1 -0
- package/dist/esm/api/resources/agent/types/index.mjs +1 -0
- package/dist/esm/api/resources/construe/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/construe/client/Client.mjs +6 -6
- package/dist/esm/api/resources/fhir/client/Client.d.mts +49 -49
- package/dist/esm/api/resources/fhir/client/Client.mjs +69 -69
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -10
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +25 -25
- package/dist/esm/api/resources/fhirProvider/types/Provider.d.mts +1 -0
- package/dist/esm/api/resources/fhirProvider/types/Provider.mjs +1 -0
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +10 -10
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +20 -20
- package/dist/esm/core/fetcher/Fetcher.mjs +12 -6
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/stream/Stream.d.mts +47 -0
- package/dist/esm/core/stream/Stream.mjs +170 -0
- package/dist/esm/core/stream/index.d.mts +1 -0
- package/dist/esm/core/stream/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +115 -42
|
@@ -13,7 +13,7 @@ export declare class Tools {
|
|
|
13
13
|
/**
|
|
14
14
|
* Lists all MCP server tools for a specific MCP server
|
|
15
15
|
*
|
|
16
|
-
* @param {string}
|
|
16
|
+
* @param {string} mcp_server_id - ID of the MCP server to list tools for
|
|
17
17
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -23,12 +23,12 @@ export declare class Tools {
|
|
|
23
23
|
* @example
|
|
24
24
|
* await client.tools.mcpServer.tools.list("mcp_server_id")
|
|
25
25
|
*/
|
|
26
|
-
list(
|
|
26
|
+
list(mcp_server_id: string, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<phenoml.tools.McpServerToolResponse>;
|
|
27
27
|
private __list;
|
|
28
28
|
/**
|
|
29
29
|
* Gets a MCP server tool by ID
|
|
30
30
|
*
|
|
31
|
-
* @param {string}
|
|
31
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to retrieve
|
|
32
32
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
33
|
*
|
|
34
34
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -38,12 +38,12 @@ export declare class Tools {
|
|
|
38
38
|
* @example
|
|
39
39
|
* await client.tools.mcpServer.tools.get("mcp_server_tool_id")
|
|
40
40
|
*/
|
|
41
|
-
get(
|
|
41
|
+
get(mcp_server_tool_id: string, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<phenoml.tools.McpServerToolResponse>;
|
|
42
42
|
private __get;
|
|
43
43
|
/**
|
|
44
44
|
* Deletes a MCP server tool by ID
|
|
45
45
|
*
|
|
46
|
-
* @param {string}
|
|
46
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to delete
|
|
47
47
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -53,12 +53,12 @@ export declare class Tools {
|
|
|
53
53
|
* @example
|
|
54
54
|
* await client.tools.mcpServer.tools.delete("mcp_server_tool_id")
|
|
55
55
|
*/
|
|
56
|
-
delete(
|
|
56
|
+
delete(mcp_server_tool_id: string, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<phenoml.tools.McpServerToolResponse>;
|
|
57
57
|
private __delete;
|
|
58
58
|
/**
|
|
59
59
|
* Calls a MCP server tool
|
|
60
60
|
*
|
|
61
|
-
* @param {string}
|
|
61
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to call
|
|
62
62
|
* @param {phenoml.tools.mcpServer.McpServerToolCallRequest} request
|
|
63
63
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
64
|
*
|
|
@@ -74,7 +74,7 @@ export declare class Tools {
|
|
|
74
74
|
* }
|
|
75
75
|
* })
|
|
76
76
|
*/
|
|
77
|
-
call(
|
|
77
|
+
call(mcp_server_tool_id: string, request: phenoml.tools.mcpServer.McpServerToolCallRequest, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<phenoml.tools.McpServerToolCallResponse>;
|
|
78
78
|
private __call;
|
|
79
79
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
80
80
|
}
|
|
@@ -56,7 +56,7 @@ class Tools {
|
|
|
56
56
|
/**
|
|
57
57
|
* Lists all MCP server tools for a specific MCP server
|
|
58
58
|
*
|
|
59
|
-
* @param {string}
|
|
59
|
+
* @param {string} mcp_server_id - ID of the MCP server to list tools for
|
|
60
60
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
61
|
*
|
|
62
62
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -66,15 +66,15 @@ class Tools {
|
|
|
66
66
|
* @example
|
|
67
67
|
* await client.tools.mcpServer.tools.list("mcp_server_id")
|
|
68
68
|
*/
|
|
69
|
-
list(
|
|
70
|
-
return core.HttpResponsePromise.fromPromise(this.__list(
|
|
69
|
+
list(mcp_server_id, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__list(mcp_server_id, requestOptions));
|
|
71
71
|
}
|
|
72
|
-
__list(
|
|
72
|
+
__list(mcp_server_id, requestOptions) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
75
75
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
76
76
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
77
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/${core.url.encodePathParam(
|
|
77
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/${core.url.encodePathParam(mcp_server_id)}/list`),
|
|
78
78
|
method: "GET",
|
|
79
79
|
headers: _headers,
|
|
80
80
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -123,7 +123,7 @@ class Tools {
|
|
|
123
123
|
/**
|
|
124
124
|
* Gets a MCP server tool by ID
|
|
125
125
|
*
|
|
126
|
-
* @param {string}
|
|
126
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to retrieve
|
|
127
127
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
128
|
*
|
|
129
129
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -133,15 +133,15 @@ class Tools {
|
|
|
133
133
|
* @example
|
|
134
134
|
* await client.tools.mcpServer.tools.get("mcp_server_tool_id")
|
|
135
135
|
*/
|
|
136
|
-
get(
|
|
137
|
-
return core.HttpResponsePromise.fromPromise(this.__get(
|
|
136
|
+
get(mcp_server_tool_id, requestOptions) {
|
|
137
|
+
return core.HttpResponsePromise.fromPromise(this.__get(mcp_server_tool_id, requestOptions));
|
|
138
138
|
}
|
|
139
|
-
__get(
|
|
139
|
+
__get(mcp_server_tool_id, requestOptions) {
|
|
140
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
141
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
142
142
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
143
143
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
144
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(
|
|
144
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(mcp_server_tool_id)}`),
|
|
145
145
|
method: "GET",
|
|
146
146
|
headers: _headers,
|
|
147
147
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -190,7 +190,7 @@ class Tools {
|
|
|
190
190
|
/**
|
|
191
191
|
* Deletes a MCP server tool by ID
|
|
192
192
|
*
|
|
193
|
-
* @param {string}
|
|
193
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to delete
|
|
194
194
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
195
|
*
|
|
196
196
|
* @throws {@link phenoml.tools.UnauthorizedError}
|
|
@@ -200,15 +200,15 @@ class Tools {
|
|
|
200
200
|
* @example
|
|
201
201
|
* await client.tools.mcpServer.tools.delete("mcp_server_tool_id")
|
|
202
202
|
*/
|
|
203
|
-
delete(
|
|
204
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
203
|
+
delete(mcp_server_tool_id, requestOptions) {
|
|
204
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(mcp_server_tool_id, requestOptions));
|
|
205
205
|
}
|
|
206
|
-
__delete(
|
|
206
|
+
__delete(mcp_server_tool_id, requestOptions) {
|
|
207
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
208
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
209
209
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
210
210
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
211
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(
|
|
211
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(mcp_server_tool_id)}`),
|
|
212
212
|
method: "DELETE",
|
|
213
213
|
headers: _headers,
|
|
214
214
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -257,7 +257,7 @@ class Tools {
|
|
|
257
257
|
/**
|
|
258
258
|
* Calls a MCP server tool
|
|
259
259
|
*
|
|
260
|
-
* @param {string}
|
|
260
|
+
* @param {string} mcp_server_tool_id - ID of the MCP server tool to call
|
|
261
261
|
* @param {phenoml.tools.mcpServer.McpServerToolCallRequest} request
|
|
262
262
|
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
263
263
|
*
|
|
@@ -273,15 +273,15 @@ class Tools {
|
|
|
273
273
|
* }
|
|
274
274
|
* })
|
|
275
275
|
*/
|
|
276
|
-
call(
|
|
277
|
-
return core.HttpResponsePromise.fromPromise(this.__call(
|
|
276
|
+
call(mcp_server_tool_id, request, requestOptions) {
|
|
277
|
+
return core.HttpResponsePromise.fromPromise(this.__call(mcp_server_tool_id, request, requestOptions));
|
|
278
278
|
}
|
|
279
|
-
__call(
|
|
279
|
+
__call(mcp_server_tool_id, request, requestOptions) {
|
|
280
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
281
281
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
282
282
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
283
283
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
284
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(
|
|
284
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(mcp_server_tool_id)}/call`),
|
|
285
285
|
method: "POST",
|
|
286
286
|
headers: _headers,
|
|
287
287
|
contentType: "application/json",
|
|
@@ -19,6 +19,7 @@ const getErrorResponseBody_js_1 = require("./getErrorResponseBody.js");
|
|
|
19
19
|
const getFetchFn_js_1 = require("./getFetchFn.js");
|
|
20
20
|
const getRequestBody_js_1 = require("./getRequestBody.js");
|
|
21
21
|
const getResponseBody_js_1 = require("./getResponseBody.js");
|
|
22
|
+
const Headers_js_1 = require("./Headers.js");
|
|
22
23
|
const makeRequest_js_1 = require("./makeRequest.js");
|
|
23
24
|
const RawResponse_js_1 = require("./RawResponse.js");
|
|
24
25
|
const requestWithRetries_js_1 = require("./requestWithRetries.js");
|
|
@@ -42,7 +43,7 @@ const SENSITIVE_HEADERS = new Set([
|
|
|
42
43
|
]);
|
|
43
44
|
function redactHeaders(headers) {
|
|
44
45
|
const filtered = {};
|
|
45
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
46
|
+
for (const [key, value] of headers instanceof Headers_js_1.Headers ? headers.entries() : Object.entries(headers)) {
|
|
46
47
|
if (SENSITIVE_HEADERS.has(key.toLowerCase())) {
|
|
47
48
|
filtered[key] = "[REDACTED]";
|
|
48
49
|
}
|
|
@@ -154,9 +155,14 @@ function redactUrl(url) {
|
|
|
154
155
|
function getHeaders(args) {
|
|
155
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
157
|
var _a;
|
|
157
|
-
const newHeaders =
|
|
158
|
+
const newHeaders = new Headers_js_1.Headers();
|
|
159
|
+
newHeaders.set("Accept", args.responseType === "json" || args.responseType == null
|
|
160
|
+
? "application/json"
|
|
161
|
+
: args.responseType === "text"
|
|
162
|
+
? "text/plain"
|
|
163
|
+
: "*/*");
|
|
158
164
|
if (args.body !== undefined && args.contentType != null) {
|
|
159
|
-
newHeaders
|
|
165
|
+
newHeaders.set("Content-Type", args.contentType);
|
|
160
166
|
}
|
|
161
167
|
if (args.headers == null) {
|
|
162
168
|
return newHeaders;
|
|
@@ -164,13 +170,13 @@ function getHeaders(args) {
|
|
|
164
170
|
for (const [key, value] of Object.entries(args.headers)) {
|
|
165
171
|
const result = yield EndpointSupplier_js_1.EndpointSupplier.get(value, { endpointMetadata: (_a = args.endpointMetadata) !== null && _a !== void 0 ? _a : {} });
|
|
166
172
|
if (typeof result === "string") {
|
|
167
|
-
newHeaders
|
|
173
|
+
newHeaders.set(key, result);
|
|
168
174
|
continue;
|
|
169
175
|
}
|
|
170
176
|
if (result == null) {
|
|
171
177
|
continue;
|
|
172
178
|
}
|
|
173
|
-
newHeaders
|
|
179
|
+
newHeaders.set(key, `${result}`);
|
|
174
180
|
}
|
|
175
181
|
return newHeaders;
|
|
176
182
|
});
|
|
@@ -206,7 +212,7 @@ function fetcherImpl(args) {
|
|
|
206
212
|
method: args.method,
|
|
207
213
|
url: redactUrl(url),
|
|
208
214
|
statusCode: response.status,
|
|
209
|
-
responseHeaders: redactHeaders(
|
|
215
|
+
responseHeaders: redactHeaders(response.headers),
|
|
210
216
|
};
|
|
211
217
|
logger.debug("HTTP request succeeded", metadata);
|
|
212
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half") => Promise<Response>;
|
|
1
|
+
export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half") => Promise<Response>;
|
package/dist/cjs/core/index.d.ts
CHANGED
package/dist/cjs/core/index.js
CHANGED
|
@@ -42,4 +42,5 @@ __exportStar(require("./base64.js"), exports);
|
|
|
42
42
|
__exportStar(require("./fetcher/index.js"), exports);
|
|
43
43
|
exports.logging = __importStar(require("./logging/index.js"));
|
|
44
44
|
__exportStar(require("./runtime/index.js"), exports);
|
|
45
|
+
__exportStar(require("./stream/index.js"), exports);
|
|
45
46
|
exports.url = __importStar(require("./url/index.js"));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare namespace Stream {
|
|
2
|
+
interface Args {
|
|
3
|
+
/**
|
|
4
|
+
* The HTTP response stream to read from.
|
|
5
|
+
*/
|
|
6
|
+
stream: ReadableStream;
|
|
7
|
+
/**
|
|
8
|
+
* The event shape to use for parsing the stream data.
|
|
9
|
+
*/
|
|
10
|
+
eventShape: JsonEvent | SseEvent;
|
|
11
|
+
/**
|
|
12
|
+
* An abort signal to stop the stream.
|
|
13
|
+
*/
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
interface JsonEvent {
|
|
17
|
+
type: "json";
|
|
18
|
+
messageTerminator: string;
|
|
19
|
+
}
|
|
20
|
+
interface SseEvent {
|
|
21
|
+
type: "sse";
|
|
22
|
+
streamTerminator?: string;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare class Stream<T> implements AsyncIterable<T> {
|
|
26
|
+
private stream;
|
|
27
|
+
private parse;
|
|
28
|
+
/**
|
|
29
|
+
* The prefix to use for each message. For example,
|
|
30
|
+
* for SSE, the prefix is "data: ".
|
|
31
|
+
*/
|
|
32
|
+
private prefix;
|
|
33
|
+
private messageTerminator;
|
|
34
|
+
private streamTerminator;
|
|
35
|
+
private controller;
|
|
36
|
+
private decoder;
|
|
37
|
+
constructor({ stream, parse, eventShape, signal }: Stream.Args & {
|
|
38
|
+
parse: (val: unknown) => Promise<T>;
|
|
39
|
+
});
|
|
40
|
+
private iterMessages;
|
|
41
|
+
[Symbol.asyncIterator](): AsyncIterator<T, void, unknown>;
|
|
42
|
+
private decodeChunk;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Browser polyfill for ReadableStream
|
|
46
|
+
*/
|
|
47
|
+
export declare function readableStreamAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
+
};
|
|
18
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
19
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
20
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
21
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
22
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
23
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
24
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
25
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
26
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
27
|
+
function fulfill(value) { resume("next", value); }
|
|
28
|
+
function reject(value) { resume("throw", value); }
|
|
29
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.Stream = void 0;
|
|
33
|
+
exports.readableStreamAsyncIterable = readableStreamAsyncIterable;
|
|
34
|
+
const index_js_1 = require("../runtime/index.js");
|
|
35
|
+
const DATA_PREFIX = "data:";
|
|
36
|
+
class Stream {
|
|
37
|
+
constructor({ stream, parse, eventShape, signal }) {
|
|
38
|
+
this.controller = new AbortController();
|
|
39
|
+
this.stream = stream;
|
|
40
|
+
this.parse = parse;
|
|
41
|
+
if (eventShape.type === "sse") {
|
|
42
|
+
this.prefix = DATA_PREFIX;
|
|
43
|
+
this.messageTerminator = "\n";
|
|
44
|
+
this.streamTerminator = eventShape.streamTerminator;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.messageTerminator = eventShape.messageTerminator;
|
|
48
|
+
}
|
|
49
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", () => this.controller.abort());
|
|
50
|
+
// Initialize shared TextDecoder
|
|
51
|
+
if (typeof TextDecoder !== "undefined") {
|
|
52
|
+
this.decoder = new TextDecoder("utf-8");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
iterMessages() {
|
|
56
|
+
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
57
|
+
var _a, e_1, _b, _c;
|
|
58
|
+
const signal = this.controller.signal;
|
|
59
|
+
const stream = readableStreamAsyncIterable(this.stream);
|
|
60
|
+
let buf = "";
|
|
61
|
+
let prefixSeen = false;
|
|
62
|
+
try {
|
|
63
|
+
for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield __await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) {
|
|
64
|
+
_c = stream_1_1.value;
|
|
65
|
+
_d = false;
|
|
66
|
+
const chunk = _c;
|
|
67
|
+
if (signal.aborted) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
buf += this.decodeChunk(chunk);
|
|
71
|
+
let terminatorIndex;
|
|
72
|
+
while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {
|
|
73
|
+
let line = buf.slice(0, terminatorIndex);
|
|
74
|
+
buf = buf.slice(terminatorIndex + this.messageTerminator.length);
|
|
75
|
+
if (!line.trim()) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (!prefixSeen && this.prefix != null) {
|
|
79
|
+
const prefixIndex = line.indexOf(this.prefix);
|
|
80
|
+
if (prefixIndex === -1) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
prefixSeen = true;
|
|
84
|
+
line = line.slice(prefixIndex + this.prefix.length);
|
|
85
|
+
}
|
|
86
|
+
if (this.streamTerminator != null && line.includes(this.streamTerminator)) {
|
|
87
|
+
return yield __await(void 0);
|
|
88
|
+
}
|
|
89
|
+
const message = yield __await(this.parse(JSON.parse(line)));
|
|
90
|
+
yield yield __await(message);
|
|
91
|
+
prefixSeen = false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
96
|
+
finally {
|
|
97
|
+
try {
|
|
98
|
+
if (!_d && !_a && (_b = stream_1.return)) yield __await(_b.call(stream_1));
|
|
99
|
+
}
|
|
100
|
+
finally { if (e_1) throw e_1.error; }
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
[Symbol.asyncIterator]() {
|
|
105
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
106
|
+
var _b, e_2, _c, _d;
|
|
107
|
+
try {
|
|
108
|
+
for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
|
|
109
|
+
_d = _g.value;
|
|
110
|
+
_e = false;
|
|
111
|
+
const message = _d;
|
|
112
|
+
yield yield __await(message);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
116
|
+
finally {
|
|
117
|
+
try {
|
|
118
|
+
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
119
|
+
}
|
|
120
|
+
finally { if (e_2) throw e_2.error; }
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
decodeChunk(chunk) {
|
|
125
|
+
let decoded = "";
|
|
126
|
+
// If TextDecoder is available, use the streaming decoder instance
|
|
127
|
+
if (this.decoder != null) {
|
|
128
|
+
decoded += this.decoder.decode(chunk, { stream: true });
|
|
129
|
+
}
|
|
130
|
+
// Buffer is present in Node.js environment
|
|
131
|
+
else if (index_js_1.RUNTIME.type === "node" && typeof chunk !== "undefined") {
|
|
132
|
+
decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
133
|
+
}
|
|
134
|
+
return decoded;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.Stream = Stream;
|
|
138
|
+
/**
|
|
139
|
+
* Browser polyfill for ReadableStream
|
|
140
|
+
*/
|
|
141
|
+
// biome-ignore lint/suspicious/noExplicitAny: allow explicit any
|
|
142
|
+
function readableStreamAsyncIterable(stream) {
|
|
143
|
+
if (stream[Symbol.asyncIterator]) {
|
|
144
|
+
return stream;
|
|
145
|
+
}
|
|
146
|
+
const reader = stream.getReader();
|
|
147
|
+
return {
|
|
148
|
+
next() {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
try {
|
|
151
|
+
const result = yield reader.read();
|
|
152
|
+
if (result === null || result === void 0 ? void 0 : result.done) {
|
|
153
|
+
reader.releaseLock();
|
|
154
|
+
} // release lock when stream becomes closed
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
reader.releaseLock(); // release lock when stream becomes errored
|
|
159
|
+
throw e;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
return() {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const cancelPromise = reader.cancel();
|
|
166
|
+
reader.releaseLock();
|
|
167
|
+
yield cancelPromise;
|
|
168
|
+
return { done: true, value: undefined };
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
[Symbol.asyncIterator]() {
|
|
172
|
+
return this;
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stream } from "./Stream.js";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "6.
|
|
1
|
+
export declare const SDK_VERSION = "6.4.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -16,8 +16,8 @@ export class phenomlClient {
|
|
|
16
16
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
|
|
17
17
|
"X-Fern-Language": "JavaScript",
|
|
18
18
|
"X-Fern-SDK-Name": "phenoml",
|
|
19
|
-
"X-Fern-SDK-Version": "6.
|
|
20
|
-
"User-Agent": "phenoml/
|
|
19
|
+
"X-Fern-SDK-Version": "6.4.0",
|
|
20
|
+
"User-Agent": "phenoml/6.4.0",
|
|
21
21
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
22
22
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
23
23
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -134,7 +134,7 @@ export declare class Agent {
|
|
|
134
134
|
patch(id: string, request: phenoml.agent.JsonPatch, requestOptions?: Agent.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentResponse>;
|
|
135
135
|
private __patch;
|
|
136
136
|
/**
|
|
137
|
-
* Send a message to an agent and receive a response
|
|
137
|
+
* Send a message to an agent and receive a JSON response.
|
|
138
138
|
*
|
|
139
139
|
* @param {phenoml.agent.AgentChatRequest} request
|
|
140
140
|
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -154,6 +154,13 @@ export declare class Agent {
|
|
|
154
154
|
*/
|
|
155
155
|
chat(request: phenoml.agent.AgentChatRequest, requestOptions?: Agent.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentChatResponse>;
|
|
156
156
|
private __chat;
|
|
157
|
+
/**
|
|
158
|
+
* Send a message to an agent and receive the response as a Server-Sent Events
|
|
159
|
+
* (SSE) stream. Events include message_start, content_delta, tool_use,
|
|
160
|
+
* tool_result, message_end, and error.
|
|
161
|
+
*/
|
|
162
|
+
streamChat(request: phenoml.agent.AgentStreamChatRequest, requestOptions?: Agent.RequestOptions): core.HttpResponsePromise<core.Stream<phenoml.agent.AgentChatStreamEvent>>;
|
|
163
|
+
private __streamChat;
|
|
157
164
|
/**
|
|
158
165
|
* Retrieves a list of chat messages for a given chat session
|
|
159
166
|
*
|
|
@@ -494,7 +494,7 @@ export class Agent {
|
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
/**
|
|
497
|
-
* Send a message to an agent and receive a response
|
|
497
|
+
* Send a message to an agent and receive a JSON response.
|
|
498
498
|
*
|
|
499
499
|
* @param {phenoml.agent.AgentChatRequest} request
|
|
500
500
|
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -576,6 +576,87 @@ export class Agent {
|
|
|
576
576
|
}
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
|
+
/**
|
|
580
|
+
* Send a message to an agent and receive the response as a Server-Sent Events
|
|
581
|
+
* (SSE) stream. Events include message_start, content_delta, tool_use,
|
|
582
|
+
* tool_result, message_end, and error.
|
|
583
|
+
*/
|
|
584
|
+
streamChat(request, requestOptions) {
|
|
585
|
+
return core.HttpResponsePromise.fromPromise(this.__streamChat(request, requestOptions));
|
|
586
|
+
}
|
|
587
|
+
__streamChat(request, requestOptions) {
|
|
588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
589
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
590
|
+
const { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
|
|
591
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
592
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
593
|
+
"X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf != null ? phenomlOnBehalfOf : undefined,
|
|
594
|
+
"X-Phenoml-Fhir-Provider": phenomlFhirProvider != null ? phenomlFhirProvider : undefined,
|
|
595
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
596
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
597
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/stream-chat"),
|
|
598
|
+
method: "POST",
|
|
599
|
+
headers: _headers,
|
|
600
|
+
contentType: "application/json",
|
|
601
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
602
|
+
requestType: "json",
|
|
603
|
+
body: _body,
|
|
604
|
+
responseType: "sse",
|
|
605
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
606
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
607
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
608
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
609
|
+
logging: this._options.logging,
|
|
610
|
+
});
|
|
611
|
+
if (_response.ok) {
|
|
612
|
+
return {
|
|
613
|
+
data: new core.Stream({
|
|
614
|
+
stream: _response.body,
|
|
615
|
+
parse: (data) => data,
|
|
616
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
617
|
+
eventShape: {
|
|
618
|
+
type: "sse",
|
|
619
|
+
streamTerminator: "[DONE]",
|
|
620
|
+
},
|
|
621
|
+
}),
|
|
622
|
+
rawResponse: _response.rawResponse,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
if (_response.error.reason === "status-code") {
|
|
626
|
+
switch (_response.error.statusCode) {
|
|
627
|
+
case 400:
|
|
628
|
+
throw new phenoml.agent.BadRequestError(_response.error.body, _response.rawResponse);
|
|
629
|
+
case 401:
|
|
630
|
+
throw new phenoml.agent.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
631
|
+
case 403:
|
|
632
|
+
throw new phenoml.agent.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
633
|
+
case 500:
|
|
634
|
+
throw new phenoml.agent.InternalServerError(_response.error.body, _response.rawResponse);
|
|
635
|
+
default:
|
|
636
|
+
throw new errors.phenomlError({
|
|
637
|
+
statusCode: _response.error.statusCode,
|
|
638
|
+
body: _response.error.body,
|
|
639
|
+
rawResponse: _response.rawResponse,
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
switch (_response.error.reason) {
|
|
644
|
+
case "non-json":
|
|
645
|
+
throw new errors.phenomlError({
|
|
646
|
+
statusCode: _response.error.statusCode,
|
|
647
|
+
body: _response.error.rawBody,
|
|
648
|
+
rawResponse: _response.rawResponse,
|
|
649
|
+
});
|
|
650
|
+
case "timeout":
|
|
651
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /agent/stream-chat.");
|
|
652
|
+
case "unknown":
|
|
653
|
+
throw new errors.phenomlError({
|
|
654
|
+
message: _response.error.errorMessage,
|
|
655
|
+
rawResponse: _response.rawResponse,
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
}
|
|
579
660
|
/**
|
|
580
661
|
* Retrieves a list of chat messages for a given chat session
|
|
581
662
|
*
|
|
@@ -26,4 +26,6 @@ export interface AgentChatRequest {
|
|
|
26
26
|
session_id?: string;
|
|
27
27
|
/** The ID of the agent to chat with */
|
|
28
28
|
agent_id: string;
|
|
29
|
+
/** Enable enhanced reasoning capabilities, will increase latency but will also improve response quality and reliability. */
|
|
30
|
+
enhanced_reasoning?: boolean;
|
|
29
31
|
}
|