@agentica/core 0.16.8 → 0.16.9
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/lib/context/AgenticaOperation.d.ts +4 -2
- package/lib/context/internal/AgenticaOperationComposer.d.ts +0 -9
- package/lib/context/internal/AgenticaOperationComposer.js +105 -35
- package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/context/internal/AgenticaOperationComposer.spec.d.ts +1 -0
- package/lib/context/internal/AgenticaOperationComposer.spec.js +266 -0
- package/lib/context/internal/AgenticaOperationComposer.spec.js.map +1 -0
- package/lib/functional/assertHttpLlmApplication.js +31 -31
- package/lib/functional/assertMcpLlmApplication.d.ts +15 -0
- package/lib/functional/assertMcpLlmApplication.js +59 -0
- package/lib/functional/assertMcpLlmApplication.js.map +1 -0
- package/lib/functional/validateHttpLlmApplication.js +27 -27
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +406 -204
- package/lib/index.mjs.map +1 -1
- package/lib/json/IAgenticaOperationJson.d.ts +1 -1
- package/lib/orchestrate/call.js +204 -94
- package/lib/orchestrate/call.js.map +1 -1
- package/lib/orchestrate/initialize.js +60 -60
- package/lib/structures/IAgenticaController.d.ts +9 -2
- package/lib/structures/mcp/IMcpLlmApplication.d.ts +15 -0
- package/lib/structures/mcp/IMcpLlmApplication.js +3 -0
- package/lib/structures/mcp/IMcpLlmApplication.js.map +1 -0
- package/lib/structures/mcp/IMcpLlmFunction.d.ts +17 -0
- package/lib/structures/mcp/IMcpLlmFunction.js +3 -0
- package/lib/structures/mcp/IMcpLlmFunction.js.map +1 -0
- package/lib/structures/mcp/IMcpLlmTransportProps.d.ts +11 -0
- package/lib/structures/mcp/IMcpLlmTransportProps.js +3 -0
- package/lib/structures/mcp/IMcpLlmTransportProps.js.map +1 -0
- package/lib/structures/mcp/index.d.ts +3 -0
- package/lib/structures/mcp/index.js +20 -0
- package/lib/structures/mcp/index.js.map +1 -0
- package/package.json +11 -6
- package/src/context/AgenticaOperation.ts +9 -2
- package/src/context/internal/AgenticaOperationComposer.spec.ts +314 -0
- package/src/context/internal/AgenticaOperationComposer.ts +119 -49
- package/src/functional/assertMcpLlmApplication.ts +48 -0
- package/src/index.ts +6 -2
- package/src/json/IAgenticaOperationJson.ts +1 -1
- package/src/orchestrate/call.ts +237 -135
- package/src/structures/IAgenticaController.ts +12 -2
- package/src/structures/mcp/IMcpLlmApplication.ts +17 -0
- package/src/structures/mcp/IMcpLlmFunction.ts +19 -0
- package/src/structures/mcp/IMcpLlmTransportProps.ts +13 -0
- package/src/structures/mcp/index.ts +3 -0
package/lib/index.mjs
CHANGED
|
@@ -10,6 +10,14 @@ import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard
|
|
|
10
10
|
|
|
11
11
|
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
12
12
|
|
|
13
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
14
|
+
|
|
15
|
+
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
16
|
+
|
|
17
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
18
|
+
|
|
19
|
+
import { ListToolsResultSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
20
|
+
|
|
13
21
|
class AgenticaTokenUsage {
|
|
14
22
|
constructor(props) {
|
|
15
23
|
if (props === undefined) {
|
|
@@ -116,33 +124,13 @@ function __map_take(dict, key, generator) {
|
|
|
116
124
|
|
|
117
125
|
function compose(props) {
|
|
118
126
|
const unique = props.controllers.length === 1 || (() => {
|
|
119
|
-
const names = props.controllers.map((
|
|
127
|
+
const names = props.controllers.map((controllers => controllers.application.functions.map((func => func.name)))).flat();
|
|
120
128
|
return new Set(names).size === names.length;
|
|
121
129
|
})();
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
function: func,
|
|
127
|
-
name: naming(func.name, ci),
|
|
128
|
-
toJSON: () => ({
|
|
129
|
-
protocol: "http",
|
|
130
|
-
controller: controller.name,
|
|
131
|
-
function: func.name,
|
|
132
|
-
name: naming(func.name, ci)
|
|
133
|
-
})
|
|
134
|
-
}))) : controller.application.functions.map((func => ({
|
|
135
|
-
protocol: "class",
|
|
136
|
-
controller,
|
|
137
|
-
function: func,
|
|
138
|
-
name: naming(func.name, ci),
|
|
139
|
-
toJSON: () => ({
|
|
140
|
-
protocol: "class",
|
|
141
|
-
controller: controller.name,
|
|
142
|
-
function: func.name,
|
|
143
|
-
name: naming(func.name, ci)
|
|
144
|
-
})
|
|
145
|
-
}))))).flat();
|
|
130
|
+
const array = getOperations({
|
|
131
|
+
controllers: props.controllers,
|
|
132
|
+
naming: (func, controllerIndex) => unique ? func : `_${controllerIndex}_${func}`
|
|
133
|
+
});
|
|
146
134
|
const capacity = props.config?.capacity;
|
|
147
135
|
const divided = capacity !== undefined && array.length > capacity ? divide({
|
|
148
136
|
array,
|
|
@@ -162,7 +150,97 @@ function compose(props) {
|
|
|
162
150
|
};
|
|
163
151
|
}
|
|
164
152
|
|
|
153
|
+
function getOperations(props) {
|
|
154
|
+
return props.controllers.flatMap(((controller, idx) => {
|
|
155
|
+
switch (controller.protocol) {
|
|
156
|
+
case "http":
|
|
157
|
+
{
|
|
158
|
+
return toHttpOperations({
|
|
159
|
+
controller,
|
|
160
|
+
index: idx,
|
|
161
|
+
naming: props.naming
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
case "class":
|
|
166
|
+
{
|
|
167
|
+
return toClassOperations({
|
|
168
|
+
controller,
|
|
169
|
+
index: idx,
|
|
170
|
+
naming: props.naming
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
case "mcp":
|
|
175
|
+
{
|
|
176
|
+
return toMcpOperations({
|
|
177
|
+
controller,
|
|
178
|
+
index: idx,
|
|
179
|
+
naming: props.naming
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
default:
|
|
184
|
+
throw new Error(`Unsupported protocol: ${controller.protocol}`);
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function toHttpOperations(props) {
|
|
190
|
+
return props.controller.application.functions.map((func => ({
|
|
191
|
+
protocol: "http",
|
|
192
|
+
controller: props.controller,
|
|
193
|
+
function: func,
|
|
194
|
+
name: props.naming(func.name, props.index),
|
|
195
|
+
toJSON: () => ({
|
|
196
|
+
protocol: "http",
|
|
197
|
+
controller: props.controller.name,
|
|
198
|
+
function: func.name,
|
|
199
|
+
name: props.naming(func.name, props.index)
|
|
200
|
+
})
|
|
201
|
+
})));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function toClassOperations(props) {
|
|
205
|
+
return props.controller.application.functions.map((func => ({
|
|
206
|
+
protocol: "class",
|
|
207
|
+
controller: props.controller,
|
|
208
|
+
function: func,
|
|
209
|
+
name: props.naming(func.name, props.index),
|
|
210
|
+
toJSON: () => ({
|
|
211
|
+
protocol: "class",
|
|
212
|
+
controller: props.controller.name,
|
|
213
|
+
function: func.name,
|
|
214
|
+
name: props.naming(func.name, props.index)
|
|
215
|
+
})
|
|
216
|
+
})));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function toMcpOperations(props) {
|
|
220
|
+
return props.controller.application.functions.map((func => ({
|
|
221
|
+
protocol: "mcp",
|
|
222
|
+
controller: props.controller,
|
|
223
|
+
function: func,
|
|
224
|
+
name: props.naming(func.name, props.index),
|
|
225
|
+
toJSON: () => ({
|
|
226
|
+
protocol: "mcp",
|
|
227
|
+
controller: props.controller.name,
|
|
228
|
+
function: func.name,
|
|
229
|
+
name: props.naming(func.name, props.index)
|
|
230
|
+
})
|
|
231
|
+
})));
|
|
232
|
+
}
|
|
233
|
+
|
|
165
234
|
function divide(props) {
|
|
235
|
+
if (props.capacity <= 0) {
|
|
236
|
+
throw new Error("Capacity must be a positive integer");
|
|
237
|
+
}
|
|
238
|
+
if (Number.isNaN(props.capacity)) {
|
|
239
|
+
throw new TypeError("Capacity must be a positive integer");
|
|
240
|
+
}
|
|
241
|
+
if (props.capacity === Infinity) {
|
|
242
|
+
throw new Error("Capacity must be a positive integer");
|
|
243
|
+
}
|
|
166
244
|
const size = Math.ceil(props.array.length / props.capacity);
|
|
167
245
|
const capacity = Math.ceil(props.array.length / size);
|
|
168
246
|
const replica = props.array.slice();
|
|
@@ -1180,7 +1258,7 @@ async function call(ctx, operations) {
|
|
|
1180
1258
|
function: {
|
|
1181
1259
|
name: s.name,
|
|
1182
1260
|
description: s.function.description,
|
|
1183
|
-
parameters: s.function.separated !== undefined ? s.function.separated.llm ?? {
|
|
1261
|
+
parameters: "separated" in s.function && s.function.separated !== undefined ? s.function.separated.llm ?? {
|
|
1184
1262
|
type: "object",
|
|
1185
1263
|
properties: {},
|
|
1186
1264
|
required: [],
|
|
@@ -1260,85 +1338,148 @@ async function call(ctx, operations) {
|
|
|
1260
1338
|
}
|
|
1261
1339
|
|
|
1262
1340
|
async function propagate(ctx, call, retry) {
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
operation: call.operation,
|
|
1269
|
-
result: check
|
|
1270
|
-
})).catch((() => {}));
|
|
1271
|
-
if (retry++ < (ctx.config?.retry ?? AgenticaConstant.RETRY)) {
|
|
1272
|
-
const trial = await correct(ctx, call, retry, check.errors);
|
|
1273
|
-
if (trial !== null) {
|
|
1274
|
-
return trial;
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
try {
|
|
1279
|
-
const response = await executeHttpOperation(call.operation, call.arguments);
|
|
1280
|
-
const success = ((response.status === 400 || response.status === 404 || response.status === 422) && retry++ < (ctx.config?.retry ?? AgenticaConstant.RETRY) && typeof response.body) === false;
|
|
1281
|
-
return (success === false ? await correct(ctx, call, retry, response.body) : null) ?? createExecuteHistory({
|
|
1341
|
+
switch (call.operation.protocol) {
|
|
1342
|
+
case "http":
|
|
1343
|
+
{
|
|
1344
|
+
return propagateHttp({
|
|
1345
|
+
ctx,
|
|
1282
1346
|
operation: call.operation,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
value: response
|
|
1286
|
-
});
|
|
1287
|
-
} catch (error) {
|
|
1288
|
-
return createExecuteHistory({
|
|
1289
|
-
operation: call.operation,
|
|
1290
|
-
id: call.id,
|
|
1291
|
-
arguments: call.arguments,
|
|
1292
|
-
value: {
|
|
1293
|
-
status: 500,
|
|
1294
|
-
headers: {},
|
|
1295
|
-
body: error instanceof Error ? {
|
|
1296
|
-
...error,
|
|
1297
|
-
name: error.name,
|
|
1298
|
-
message: error.message
|
|
1299
|
-
} : error
|
|
1300
|
-
}
|
|
1347
|
+
call,
|
|
1348
|
+
retry
|
|
1301
1349
|
});
|
|
1302
1350
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
operation: call.operation,
|
|
1309
|
-
result: check
|
|
1310
|
-
})).catch((() => {}));
|
|
1311
|
-
return (retry++ < (ctx.config?.retry ?? AgenticaConstant.RETRY) ? await correct(ctx, call, retry, check.errors) : null) ?? createExecuteHistory({
|
|
1312
|
-
id: call.id,
|
|
1351
|
+
|
|
1352
|
+
case "class":
|
|
1353
|
+
{
|
|
1354
|
+
return propagateClass({
|
|
1355
|
+
ctx,
|
|
1313
1356
|
operation: call.operation,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
name: "TypeGuardError",
|
|
1317
|
-
message: "Invalid arguments.",
|
|
1318
|
-
errors: check.errors
|
|
1319
|
-
}
|
|
1357
|
+
call,
|
|
1358
|
+
retry
|
|
1320
1359
|
});
|
|
1321
1360
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1361
|
+
|
|
1362
|
+
case "mcp":
|
|
1363
|
+
{
|
|
1364
|
+
return propagateMcp({
|
|
1365
|
+
ctx,
|
|
1326
1366
|
operation: call.operation,
|
|
1327
|
-
|
|
1328
|
-
|
|
1367
|
+
call,
|
|
1368
|
+
retry
|
|
1329
1369
|
});
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
default:
|
|
1373
|
+
{
|
|
1374
|
+
call.operation;
|
|
1375
|
+
throw new Error("Unsupported protocol");
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
async function propagateHttp(props) {
|
|
1381
|
+
const check = props.operation.function.validate(props.call.arguments);
|
|
1382
|
+
if (check.success === false) {
|
|
1383
|
+
props.ctx.dispatch(createValidateEvent({
|
|
1384
|
+
id: props.call.id,
|
|
1385
|
+
operation: props.operation,
|
|
1386
|
+
result: check
|
|
1387
|
+
})).catch((() => {}));
|
|
1388
|
+
if (props.retry++ < (props.ctx.config?.retry ?? AgenticaConstant.RETRY)) {
|
|
1389
|
+
const trial = await correct(props.ctx, props.call, props.retry, check.errors);
|
|
1390
|
+
if (trial !== null) {
|
|
1391
|
+
return trial;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
try {
|
|
1396
|
+
const response = await executeHttpOperation(props.operation, props.call.arguments);
|
|
1397
|
+
const success = ((response.status === 400 || response.status === 404 || response.status === 422) && props.retry++ < (props.ctx.config?.retry ?? AgenticaConstant.RETRY) && typeof response.body) === false;
|
|
1398
|
+
return (success === false ? await correct(props.ctx, props.call, props.retry, response.body) : null) ?? createExecuteHistory({
|
|
1399
|
+
operation: props.call.operation,
|
|
1400
|
+
id: props.call.id,
|
|
1401
|
+
arguments: props.call.arguments,
|
|
1402
|
+
value: response
|
|
1403
|
+
});
|
|
1404
|
+
} catch (error) {
|
|
1405
|
+
return createExecuteHistory({
|
|
1406
|
+
operation: props.call.operation,
|
|
1407
|
+
id: props.call.id,
|
|
1408
|
+
arguments: props.call.arguments,
|
|
1409
|
+
value: {
|
|
1410
|
+
status: 500,
|
|
1411
|
+
headers: {},
|
|
1412
|
+
body: error instanceof Error ? {
|
|
1336
1413
|
...error,
|
|
1337
1414
|
name: error.name,
|
|
1338
1415
|
message: error.message
|
|
1339
1416
|
} : error
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
async function propagateClass(props) {
|
|
1423
|
+
const check = props.operation.function.validate(props.call.arguments);
|
|
1424
|
+
if (check.success === false) {
|
|
1425
|
+
props.ctx.dispatch(createValidateEvent({
|
|
1426
|
+
id: props.call.id,
|
|
1427
|
+
operation: props.call.operation,
|
|
1428
|
+
result: check
|
|
1429
|
+
})).catch((() => {}));
|
|
1430
|
+
return (props.retry++ < (props.ctx.config?.retry ?? AgenticaConstant.RETRY) ? await correct(props.ctx, props.call, props.retry, check.errors) : null) ?? createExecuteHistory({
|
|
1431
|
+
id: props.call.id,
|
|
1432
|
+
operation: props.call.operation,
|
|
1433
|
+
arguments: props.call.arguments,
|
|
1434
|
+
value: {
|
|
1435
|
+
name: "TypeGuardError",
|
|
1436
|
+
message: "Invalid arguments.",
|
|
1437
|
+
errors: check.errors
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
try {
|
|
1442
|
+
const value = await executeClassOperation(props.operation, props.call.arguments);
|
|
1443
|
+
return createExecuteHistory({
|
|
1444
|
+
id: props.call.id,
|
|
1445
|
+
operation: props.call.operation,
|
|
1446
|
+
arguments: props.call.arguments,
|
|
1447
|
+
value
|
|
1448
|
+
});
|
|
1449
|
+
} catch (error) {
|
|
1450
|
+
return createExecuteHistory({
|
|
1451
|
+
id: props.call.id,
|
|
1452
|
+
operation: props.call.operation,
|
|
1453
|
+
arguments: props.call.arguments,
|
|
1454
|
+
value: error instanceof Error ? {
|
|
1455
|
+
...error,
|
|
1456
|
+
name: error.name,
|
|
1457
|
+
message: error.message
|
|
1458
|
+
} : error
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
async function propagateMcp(props) {
|
|
1464
|
+
try {
|
|
1465
|
+
const value = await executeMcpOperation(props.operation, props.call.arguments);
|
|
1466
|
+
return createExecuteHistory({
|
|
1467
|
+
id: props.call.id,
|
|
1468
|
+
operation: props.call.operation,
|
|
1469
|
+
arguments: props.call.arguments,
|
|
1470
|
+
value
|
|
1471
|
+
});
|
|
1472
|
+
} catch (error) {
|
|
1473
|
+
return createExecuteHistory({
|
|
1474
|
+
id: props.call.id,
|
|
1475
|
+
operation: props.call.operation,
|
|
1476
|
+
arguments: props.call.arguments,
|
|
1477
|
+
value: error instanceof Error ? {
|
|
1478
|
+
...error,
|
|
1479
|
+
name: error.name,
|
|
1480
|
+
message: error.message
|
|
1481
|
+
} : error
|
|
1482
|
+
});
|
|
1342
1483
|
}
|
|
1343
1484
|
}
|
|
1344
1485
|
|
|
@@ -1369,6 +1510,36 @@ async function executeClassOperation(operation, operationArguments) {
|
|
|
1369
1510
|
return execute[operation.function.name](operationArguments);
|
|
1370
1511
|
}
|
|
1371
1512
|
|
|
1513
|
+
async function executeMcpOperation(operation, operationArguments) {
|
|
1514
|
+
const {Client} = await import("@modelcontextprotocol/sdk/client/index.js");
|
|
1515
|
+
const {SSEClientTransport} = await import("@modelcontextprotocol/sdk/client/sse.js");
|
|
1516
|
+
const {StdioClientTransport} = await import("@modelcontextprotocol/sdk/client/stdio.js");
|
|
1517
|
+
const client = new Client({
|
|
1518
|
+
name: operation.name,
|
|
1519
|
+
version: "1.0.0"
|
|
1520
|
+
});
|
|
1521
|
+
const transport = (() => {
|
|
1522
|
+
switch (operation.controller.application.transport.type) {
|
|
1523
|
+
case "sse":
|
|
1524
|
+
return new SSEClientTransport(operation.controller.application.transport.url);
|
|
1525
|
+
|
|
1526
|
+
case "stdio":
|
|
1527
|
+
return new StdioClientTransport(operation.controller.application.transport);
|
|
1528
|
+
|
|
1529
|
+
default:
|
|
1530
|
+
operation.controller.application.transport;
|
|
1531
|
+
throw new Error("Unsupported transport type");
|
|
1532
|
+
}
|
|
1533
|
+
})();
|
|
1534
|
+
await client.connect(transport);
|
|
1535
|
+
const result = await client.callTool({
|
|
1536
|
+
method: operation.function.name,
|
|
1537
|
+
name: operation.function.name,
|
|
1538
|
+
arguments: operationArguments
|
|
1539
|
+
});
|
|
1540
|
+
return result.content;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1372
1543
|
async function correct(ctx, call, retry, error) {
|
|
1373
1544
|
const completionStream = await ctx.request("call", {
|
|
1374
1545
|
messages: [ {
|
|
@@ -1403,7 +1574,7 @@ async function correct(ctx, call, retry, error) {
|
|
|
1403
1574
|
function: {
|
|
1404
1575
|
name: call.operation.name,
|
|
1405
1576
|
description: call.operation.function.description,
|
|
1406
|
-
parameters: call.operation.function.separated !== undefined ? call.operation.function.separated?.llm ?? {
|
|
1577
|
+
parameters: "separated" in call.operation.function && call.operation.function.separated !== undefined ? call.operation.function.separated?.llm ?? {
|
|
1407
1578
|
$defs: {},
|
|
1408
1579
|
type: "object",
|
|
1409
1580
|
properties: {},
|
|
@@ -1965,6 +2136,8 @@ const FUNCTION = {
|
|
|
1965
2136
|
title: "Type schema info of the ChatGPT",
|
|
1966
2137
|
description: 'Type schema info of the ChatGPT.\n\n`IChatGptSchema` is a type schema info of the ChatGPT function calling.\n\n`IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\nspeciifcation; {@link OpenApiV3_1.IJsonSchema}.\n\nHowever, the `IChatGptSchema` does not follow the entire specification of\nthe OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\nlist of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n\n- Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n- Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n- Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n- Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n- Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n- Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n- Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n- When {@link IChatGptSchema.IConfig.strict} mode\n - Every object properties must be required\n - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n\nIf compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n\n- {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n- {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n- {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n- {@link IChatGptSchema.additionalProperties} is fixed to `false`\n- No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n- When {@link IChatGptSchema.IConfig.strict} mode\n - Every object properties must be required\n - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n\nFor reference, if you\'ve composed the `IChatGptSchema` type with the\n{@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\nonly the recursived named types would be archived into the\n{@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n{@link IChatGptSchema.IReference} type.\n\nAlso, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\nfills the {@link IChatGptSchema.__IAttribute.description} property with\nthe comment text like `"@format uuid"`.\n\n- {@link OpenApi.IJsonSchema.INumber.minimum}\n- {@link OpenApi.IJsonSchema.INumber.maximum}\n- {@link OpenApi.IJsonSchema.INumber.multipleOf}\n- {@link OpenApi.IJsonSchema.IString.minLength}\n- {@link OpenApi.IJsonSchema.IString.maxLength}\n- {@link OpenApi.IJsonSchema.IString.format}\n- {@link OpenApi.IJsonSchema.IString.pattern}\n- {@link OpenApi.IJsonSchema.IString.contentMediaType}\n- {@link OpenApi.IJsonSchema.IString.default}\n- {@link OpenApi.IJsonSchema.IArray.minItems}\n- {@link OpenApi.IJsonSchema.IArray.maxItems}\n- {@link OpenApi.IJsonSchema.IArray.unique}\n\nAdditionally, OpenAI cannot define the `description` property to the\n{@link IChatGptSchema.IReference} type, and even does not understand\nthe capsulization to the {@link IChatGptSchema.IAnyOf} type.\nTherefore, the `description` is written to the parent object type,\nnot the reference type.\n\n```json\n{\n "type": "object",\n "description": "### Description of {@link something} property.\\n\\n> Hello?",\n "properties": {\n "something": {\n "$ref": "#/$defs/SomeObject"\n }\n }\n}\n```',
|
|
1967
2138
|
anyOf: [ {
|
|
2139
|
+
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2140
|
+
}, {
|
|
1968
2141
|
type: "object",
|
|
1969
2142
|
properties: {
|
|
1970
2143
|
enum: {
|
|
@@ -2150,8 +2323,6 @@ const FUNCTION = {
|
|
|
2150
2323
|
description: 'Description of the current {@link IChatGptSchema.IString} type:\n\n> String type info.\n\n------------------------------\n\nDescription of the parent {@link IChatGptSchema} type:\n\n> Type schema info of the ChatGPT.\n> \n> `IChatGptSchema` is a type schema info of the ChatGPT function calling.\n> \n> `IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\n> speciifcation; {@link OpenApiV3_1.IJsonSchema}.\n> \n> However, the `IChatGptSchema` does not follow the entire specification of\n> the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n> list of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n> \n> - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n> - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n> - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n> - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n> \n> - {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n> - {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n> - {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n> - {@link IChatGptSchema.additionalProperties} is fixed to `false`\n> - No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> For reference, if you\'ve composed the `IChatGptSchema` type with the\n> {@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\n> only the recursived named types would be archived into the\n> {@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n> {@link IChatGptSchema.IReference} type.\n> \n> Also, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\n> fills the {@link IChatGptSchema.__IAttribute.description} property with\n> the comment text like `"@format uuid"`.\n> \n> - {@link OpenApi.IJsonSchema.INumber.minimum}\n> - {@link OpenApi.IJsonSchema.INumber.maximum}\n> - {@link OpenApi.IJsonSchema.INumber.multipleOf}\n> - {@link OpenApi.IJsonSchema.IString.minLength}\n> - {@link OpenApi.IJsonSchema.IString.maxLength}\n> - {@link OpenApi.IJsonSchema.IString.format}\n> - {@link OpenApi.IJsonSchema.IString.pattern}\n> - {@link OpenApi.IJsonSchema.IString.contentMediaType}\n> - {@link OpenApi.IJsonSchema.IString.default}\n> - {@link OpenApi.IJsonSchema.IArray.minItems}\n> - {@link OpenApi.IJsonSchema.IArray.maxItems}\n> - {@link OpenApi.IJsonSchema.IArray.unique}\n> \n> Additionally, OpenAI cannot define the `description` property to the\n> {@link IChatGptSchema.IReference} type, and even does not understand\n> the capsulization to the {@link IChatGptSchema.IAnyOf} type.\n> Therefore, the `description` is written to the parent object type,\n> not the reference type.\n> \n> ```json\n> {\n> "type": "object",\n> "description": "### Description of {@link something} property.\\n\\n> Hello?",\n> "properties": {\n> "something": {\n> "$ref": "#/$defs/SomeObject"\n> }\n> }\n> }\n> ```'
|
|
2151
2324
|
}, {
|
|
2152
2325
|
$ref: "#/$defs/IChatGptSchema.IArray"
|
|
2153
|
-
}, {
|
|
2154
|
-
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2155
2326
|
}, {
|
|
2156
2327
|
type: "object",
|
|
2157
2328
|
properties: {
|
|
@@ -2263,49 +2434,6 @@ const FUNCTION = {
|
|
|
2263
2434
|
description: 'Description of the current {@link IChatGptSchema.IUnknown} type:\n\n> Unknown, the `any` type.\n\n------------------------------\n\nDescription of the parent {@link IChatGptSchema} type:\n\n> Type schema info of the ChatGPT.\n> \n> `IChatGptSchema` is a type schema info of the ChatGPT function calling.\n> \n> `IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\n> speciifcation; {@link OpenApiV3_1.IJsonSchema}.\n> \n> However, the `IChatGptSchema` does not follow the entire specification of\n> the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n> list of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n> \n> - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n> - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n> - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n> - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n> \n> - {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n> - {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n> - {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n> - {@link IChatGptSchema.additionalProperties} is fixed to `false`\n> - No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> For reference, if you\'ve composed the `IChatGptSchema` type with the\n> {@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\n> only the recursived named types would be archived into the\n> {@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n> {@link IChatGptSchema.IReference} type.\n> \n> Also, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\n> fills the {@link IChatGptSchema.__IAttribute.description} property with\n> the comment text like `"@format uuid"`.\n> \n> - {@link OpenApi.IJsonSchema.INumber.minimum}\n> - {@link OpenApi.IJsonSchema.INumber.maximum}\n> - {@link OpenApi.IJsonSchema.INumber.multipleOf}\n> - {@link OpenApi.IJsonSchema.IString.minLength}\n> - {@link OpenApi.IJsonSchema.IString.maxLength}\n> - {@link OpenApi.IJsonSchema.IString.format}\n> - {@link OpenApi.IJsonSchema.IString.pattern}\n> - {@link OpenApi.IJsonSchema.IString.contentMediaType}\n> - {@link OpenApi.IJsonSchema.IString.default}\n> - {@link OpenApi.IJsonSchema.IArray.minItems}\n> - {@link OpenApi.IJsonSchema.IArray.maxItems}\n> - {@link OpenApi.IJsonSchema.IArray.unique}\n> \n> Additionally, OpenAI cannot define the `description` property to the\n> {@link IChatGptSchema.IReference} type, and even does not understand\n> the capsulization to the {@link IChatGptSchema.IAnyOf} type.\n> Therefore, the `description` is written to the parent object type,\n> not the reference type.\n> \n> ```json\n> {\n> "type": "object",\n> "description": "### Description of {@link something} property.\\n\\n> Hello?",\n> "properties": {\n> "something": {\n> "$ref": "#/$defs/SomeObject"\n> }\n> }\n> }\n> ```'
|
|
2264
2435
|
} ]
|
|
2265
2436
|
},
|
|
2266
|
-
"IChatGptSchema.IArray": {
|
|
2267
|
-
description: "Array type info.\n\n### Description of {@link items} property:\n\n> Items type info.\n> \n> The `items` means the type of the array elements. In other words, it is\n> the type schema info of the `T` in the TypeScript array type `Array<T>`.",
|
|
2268
|
-
type: "object",
|
|
2269
|
-
properties: {
|
|
2270
|
-
items: {
|
|
2271
|
-
title: "Items type info",
|
|
2272
|
-
$ref: "#/$defs/IChatGptSchema"
|
|
2273
|
-
},
|
|
2274
|
-
type: {
|
|
2275
|
-
title: "Discriminator value of the type",
|
|
2276
|
-
description: "Discriminator value of the type.",
|
|
2277
|
-
type: "string",
|
|
2278
|
-
enum: [ "array" ]
|
|
2279
|
-
},
|
|
2280
|
-
title: {
|
|
2281
|
-
title: "Title of the schema",
|
|
2282
|
-
description: "Title of the schema.",
|
|
2283
|
-
type: "string"
|
|
2284
|
-
},
|
|
2285
|
-
description: {
|
|
2286
|
-
title: "Detailed description of the schema",
|
|
2287
|
-
description: "Detailed description of the schema.",
|
|
2288
|
-
type: "string"
|
|
2289
|
-
},
|
|
2290
|
-
deprecated: {
|
|
2291
|
-
title: "Whether the type is deprecated or not",
|
|
2292
|
-
description: "Whether the type is deprecated or not.",
|
|
2293
|
-
type: "boolean"
|
|
2294
|
-
},
|
|
2295
|
-
example: {
|
|
2296
|
-
title: "Example value",
|
|
2297
|
-
description: "Example value."
|
|
2298
|
-
},
|
|
2299
|
-
examples: {
|
|
2300
|
-
description: "List of example values as key-value pairs.\n\n------------------------------\n\nDescription of the current {@link Recordstringany} type:\n\n> Construct a type with a set of properties K of type T",
|
|
2301
|
-
type: "object",
|
|
2302
|
-
properties: {},
|
|
2303
|
-
required: [],
|
|
2304
|
-
additionalProperties: {}
|
|
2305
|
-
}
|
|
2306
|
-
},
|
|
2307
|
-
required: [ "items", "type" ]
|
|
2308
|
-
},
|
|
2309
2437
|
"IChatGptSchema.IObject": {
|
|
2310
2438
|
description: "Object type info.\n\n### Description of {@link properties} property:\n\n> Properties of the object.\n> \n> The `properties` means a list of key-value pairs of the object's\n> regular properties. The key is the name of the regular property,\n> and the value is the type schema info.",
|
|
2311
2439
|
type: "object",
|
|
@@ -2319,6 +2447,8 @@ const FUNCTION = {
|
|
|
2319
2447
|
description: "Additional properties' info.\n\nThe `additionalProperties` means the type schema info of the additional\nproperties that are not listed in the {@link properties}.\n\nBy the way, if you've configured {@link IChatGptSchema.IConfig.strict} as `true`,\nChatGPT function calling does not support such dynamic key typed properties, so\nthe `additionalProperties` becomes always `false`.",
|
|
2320
2448
|
anyOf: [ {
|
|
2321
2449
|
type: "boolean"
|
|
2450
|
+
}, {
|
|
2451
|
+
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2322
2452
|
}, {
|
|
2323
2453
|
type: "object",
|
|
2324
2454
|
properties: {
|
|
@@ -2505,8 +2635,6 @@ const FUNCTION = {
|
|
|
2505
2635
|
description: 'Description of the current {@link IChatGptSchema.IBoolean} type:\n\n> Boolean type info.\n\n------------------------------\n\nDescription of the parent {@link IChatGptSchema} type:\n\n> Type schema info of the ChatGPT.\n> \n> `IChatGptSchema` is a type schema info of the ChatGPT function calling.\n> \n> `IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\n> speciifcation; {@link OpenApiV3_1.IJsonSchema}.\n> \n> However, the `IChatGptSchema` does not follow the entire specification of\n> the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n> list of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n> \n> - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n> - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n> - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n> - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n> \n> - {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n> - {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n> - {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n> - {@link IChatGptSchema.additionalProperties} is fixed to `false`\n> - No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> For reference, if you\'ve composed the `IChatGptSchema` type with the\n> {@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\n> only the recursived named types would be archived into the\n> {@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n> {@link IChatGptSchema.IReference} type.\n> \n> Also, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\n> fills the {@link IChatGptSchema.__IAttribute.description} property with\n> the comment text like `"@format uuid"`.\n> \n> - {@link OpenApi.IJsonSchema.INumber.minimum}\n> - {@link OpenApi.IJsonSchema.INumber.maximum}\n> - {@link OpenApi.IJsonSchema.INumber.multipleOf}\n> - {@link OpenApi.IJsonSchema.IString.minLength}\n> - {@link OpenApi.IJsonSchema.IString.maxLength}\n> - {@link OpenApi.IJsonSchema.IString.format}\n> - {@link OpenApi.IJsonSchema.IString.pattern}\n> - {@link OpenApi.IJsonSchema.IString.contentMediaType}\n> - {@link OpenApi.IJsonSchema.IString.default}\n> - {@link OpenApi.IJsonSchema.IArray.minItems}\n> - {@link OpenApi.IJsonSchema.IArray.maxItems}\n> - {@link OpenApi.IJsonSchema.IArray.unique}\n> \n> Additionally, OpenAI cannot define the `description` property to the\n> {@link IChatGptSchema.IReference} type, and even does not understand\n> the capsulization to the {@link IChatGptSchema.IAnyOf} type.\n> Therefore, the `description` is written to the parent object type,\n> not the reference type.\n> \n> ```json\n> {\n> "type": "object",\n> "description": "### Description of {@link something} property.\\n\\n> Hello?",\n> "properties": {\n> "something": {\n> "$ref": "#/$defs/SomeObject"\n> }\n> }\n> }\n> ```'
|
|
2506
2636
|
}, {
|
|
2507
2637
|
$ref: "#/$defs/IChatGptSchema.IArray"
|
|
2508
|
-
}, {
|
|
2509
|
-
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2510
2638
|
}, {
|
|
2511
2639
|
type: "object",
|
|
2512
2640
|
properties: {
|
|
@@ -2661,6 +2789,49 @@ const FUNCTION = {
|
|
|
2661
2789
|
},
|
|
2662
2790
|
required: [ "properties", "required", "type" ]
|
|
2663
2791
|
},
|
|
2792
|
+
"IChatGptSchema.IArray": {
|
|
2793
|
+
description: "Array type info.\n\n### Description of {@link items} property:\n\n> Items type info.\n> \n> The `items` means the type of the array elements. In other words, it is\n> the type schema info of the `T` in the TypeScript array type `Array<T>`.",
|
|
2794
|
+
type: "object",
|
|
2795
|
+
properties: {
|
|
2796
|
+
items: {
|
|
2797
|
+
title: "Items type info",
|
|
2798
|
+
$ref: "#/$defs/IChatGptSchema"
|
|
2799
|
+
},
|
|
2800
|
+
type: {
|
|
2801
|
+
title: "Discriminator value of the type",
|
|
2802
|
+
description: "Discriminator value of the type.",
|
|
2803
|
+
type: "string",
|
|
2804
|
+
enum: [ "array" ]
|
|
2805
|
+
},
|
|
2806
|
+
title: {
|
|
2807
|
+
title: "Title of the schema",
|
|
2808
|
+
description: "Title of the schema.",
|
|
2809
|
+
type: "string"
|
|
2810
|
+
},
|
|
2811
|
+
description: {
|
|
2812
|
+
title: "Detailed description of the schema",
|
|
2813
|
+
description: "Detailed description of the schema.",
|
|
2814
|
+
type: "string"
|
|
2815
|
+
},
|
|
2816
|
+
deprecated: {
|
|
2817
|
+
title: "Whether the type is deprecated or not",
|
|
2818
|
+
description: "Whether the type is deprecated or not.",
|
|
2819
|
+
type: "boolean"
|
|
2820
|
+
},
|
|
2821
|
+
example: {
|
|
2822
|
+
title: "Example value",
|
|
2823
|
+
description: "Example value."
|
|
2824
|
+
},
|
|
2825
|
+
examples: {
|
|
2826
|
+
description: "List of example values as key-value pairs.\n\n------------------------------\n\nDescription of the current {@link Recordstringany} type:\n\n> Construct a type with a set of properties K of type T",
|
|
2827
|
+
type: "object",
|
|
2828
|
+
properties: {},
|
|
2829
|
+
required: [],
|
|
2830
|
+
additionalProperties: {}
|
|
2831
|
+
}
|
|
2832
|
+
},
|
|
2833
|
+
required: [ "items", "type" ]
|
|
2834
|
+
},
|
|
2664
2835
|
"IChatGptSchema.IAnyOf": {
|
|
2665
2836
|
description: "Union type.\n\nIOneOf` represents an union type of the TypeScript (`A | B | C`).\n\nFor reference, even though your Swagger (or OpenAPI) document has\ndefined `anyOf` instead of the `oneOf`, {@link IChatGptSchema} forcibly\nconverts it to `oneOf` type.",
|
|
2666
2837
|
type: "object",
|
|
@@ -2671,6 +2842,8 @@ const FUNCTION = {
|
|
|
2671
2842
|
type: "array",
|
|
2672
2843
|
items: {
|
|
2673
2844
|
anyOf: [ {
|
|
2845
|
+
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2846
|
+
}, {
|
|
2674
2847
|
type: "object",
|
|
2675
2848
|
properties: {
|
|
2676
2849
|
enum: {
|
|
@@ -2856,8 +3029,6 @@ const FUNCTION = {
|
|
|
2856
3029
|
description: 'Description of the current {@link IChatGptSchema.IBoolean} type:\n\n> Boolean type info.\n\n------------------------------\n\nDescription of the parent {@link IChatGptSchema} type:\n\n> Type schema info of the ChatGPT.\n> \n> `IChatGptSchema` is a type schema info of the ChatGPT function calling.\n> \n> `IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\n> speciifcation; {@link OpenApiV3_1.IJsonSchema}.\n> \n> However, the `IChatGptSchema` does not follow the entire specification of\n> the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n> list of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n> \n> - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n> - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n> - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n> - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n> \n> - {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n> - {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n> - {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n> - {@link IChatGptSchema.additionalProperties} is fixed to `false`\n> - No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> For reference, if you\'ve composed the `IChatGptSchema` type with the\n> {@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\n> only the recursived named types would be archived into the\n> {@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n> {@link IChatGptSchema.IReference} type.\n> \n> Also, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\n> fills the {@link IChatGptSchema.__IAttribute.description} property with\n> the comment text like `"@format uuid"`.\n> \n> - {@link OpenApi.IJsonSchema.INumber.minimum}\n> - {@link OpenApi.IJsonSchema.INumber.maximum}\n> - {@link OpenApi.IJsonSchema.INumber.multipleOf}\n> - {@link OpenApi.IJsonSchema.IString.minLength}\n> - {@link OpenApi.IJsonSchema.IString.maxLength}\n> - {@link OpenApi.IJsonSchema.IString.format}\n> - {@link OpenApi.IJsonSchema.IString.pattern}\n> - {@link OpenApi.IJsonSchema.IString.contentMediaType}\n> - {@link OpenApi.IJsonSchema.IString.default}\n> - {@link OpenApi.IJsonSchema.IArray.minItems}\n> - {@link OpenApi.IJsonSchema.IArray.maxItems}\n> - {@link OpenApi.IJsonSchema.IArray.unique}\n> \n> Additionally, OpenAI cannot define the `description` property to the\n> {@link IChatGptSchema.IReference} type, and even does not understand\n> the capsulization to the {@link IChatGptSchema.IAnyOf} type.\n> Therefore, the `description` is written to the parent object type,\n> not the reference type.\n> \n> ```json\n> {\n> "type": "object",\n> "description": "### Description of {@link something} property.\\n\\n> Hello?",\n> "properties": {\n> "something": {\n> "$ref": "#/$defs/SomeObject"\n> }\n> }\n> }\n> ```'
|
|
2857
3030
|
}, {
|
|
2858
3031
|
$ref: "#/$defs/IChatGptSchema.IArray"
|
|
2859
|
-
}, {
|
|
2860
|
-
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
2861
3032
|
}, {
|
|
2862
3033
|
type: "object",
|
|
2863
3034
|
properties: {
|
|
@@ -3221,6 +3392,8 @@ const FUNCTION = {
|
|
|
3221
3392
|
title: "Expected return type",
|
|
3222
3393
|
description: "Expected return type.\n\nIf the target operation returns nothing (`void`), the `output`\nwould be `undefined`.",
|
|
3223
3394
|
anyOf: [ {
|
|
3395
|
+
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
3396
|
+
}, {
|
|
3224
3397
|
type: "object",
|
|
3225
3398
|
properties: {
|
|
3226
3399
|
enum: {
|
|
@@ -3406,8 +3579,6 @@ const FUNCTION = {
|
|
|
3406
3579
|
description: 'Description of the current {@link IChatGptSchema.IBoolean} type:\n\n> Boolean type info.\n\n------------------------------\n\nDescription of the parent {@link IChatGptSchema} type:\n\n> Type schema info of the ChatGPT.\n> \n> `IChatGptSchema` is a type schema info of the ChatGPT function calling.\n> \n> `IChatGptSchema` basically follows the JSON schema definition of the OpenAPI v3.1\n> speciifcation; {@link OpenApiV3_1.IJsonSchema}.\n> \n> However, the `IChatGptSchema` does not follow the entire specification of\n> the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n> list of how `IChatGptSchema` is different with the OpenAPI v3.1 JSON schema.\n> \n> - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n> - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n> - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n> - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IOneOf} to {@link IChatGptSchema.IAnOf}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n> - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IChatGptSchema.IReference}\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n> \n> - {@link IChatGptSchema.IAnyOf} instead of the {@link OpenApi.IJsonSchema.IOneOf}\n> - {@link IChatGptSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.IComponents.schemas}\n> - {@link IChatGptSchema.IString.enum} instead of the {@link OpenApi.IJsonSchema.IConstant}\n> - {@link IChatGptSchema.additionalProperties} is fixed to `false`\n> - No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n> - When {@link IChatGptSchema.IConfig.strict} mode\n> - Every object properties must be required\n> - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n> \n> For reference, if you\'ve composed the `IChatGptSchema` type with the\n> {@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\n> only the recursived named types would be archived into the\n> {@link IChatGptSchema.IParameters.$defs}, and the others would be ecaped from the\n> {@link IChatGptSchema.IReference} type.\n> \n> Also, OpenAI has banned below constraint properties. Instead, `IChatGptSchema`\n> fills the {@link IChatGptSchema.__IAttribute.description} property with\n> the comment text like `"@format uuid"`.\n> \n> - {@link OpenApi.IJsonSchema.INumber.minimum}\n> - {@link OpenApi.IJsonSchema.INumber.maximum}\n> - {@link OpenApi.IJsonSchema.INumber.multipleOf}\n> - {@link OpenApi.IJsonSchema.IString.minLength}\n> - {@link OpenApi.IJsonSchema.IString.maxLength}\n> - {@link OpenApi.IJsonSchema.IString.format}\n> - {@link OpenApi.IJsonSchema.IString.pattern}\n> - {@link OpenApi.IJsonSchema.IString.contentMediaType}\n> - {@link OpenApi.IJsonSchema.IString.default}\n> - {@link OpenApi.IJsonSchema.IArray.minItems}\n> - {@link OpenApi.IJsonSchema.IArray.maxItems}\n> - {@link OpenApi.IJsonSchema.IArray.unique}\n> \n> Additionally, OpenAI cannot define the `description` property to the\n> {@link IChatGptSchema.IReference} type, and even does not understand\n> the capsulization to the {@link IChatGptSchema.IAnyOf} type.\n> Therefore, the `description` is written to the parent object type,\n> not the reference type.\n> \n> ```json\n> {\n> "type": "object",\n> "description": "### Description of {@link something} property.\\n\\n> Hello?",\n> "properties": {\n> "something": {\n> "$ref": "#/$defs/SomeObject"\n> }\n> }\n> }\n> ```'
|
|
3407
3580
|
}, {
|
|
3408
3581
|
$ref: "#/$defs/IChatGptSchema.IArray"
|
|
3409
|
-
}, {
|
|
3410
|
-
$ref: "#/$defs/IChatGptSchema.IObject"
|
|
3411
3582
|
}, {
|
|
3412
3583
|
type: "object",
|
|
3413
3584
|
properties: {
|
|
@@ -4465,14 +4636,14 @@ function assertHttpLlmApplication(props) {
|
|
|
4465
4636
|
if (undefined === value) return true;
|
|
4466
4637
|
return "object" === typeof value && null !== value && _iu13(value);
|
|
4467
4638
|
}));
|
|
4468
|
-
const _io79 = input => (undefined === input.
|
|
4639
|
+
const _io79 = input => (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io75(input.examples)) && (undefined === input.name || "string" === typeof input.name) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu3(input.schema));
|
|
4469
4640
|
const _io80 = input => "string" === typeof input.$ref && RegExp(/^#\/components\/headers\/(.*)/).test(input.$ref) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
4470
4641
|
const _io81 = input => Object.keys(input).every((key => {
|
|
4471
4642
|
const value = input[key];
|
|
4472
4643
|
if (undefined === value) return true;
|
|
4473
4644
|
return "object" === typeof value && null !== value && _io82(value);
|
|
4474
4645
|
}));
|
|
4475
|
-
const _io82 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
4646
|
+
const _io82 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu3(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io75(input.examples));
|
|
4476
4647
|
const _io83 = input => Object.keys(input).every((key => {
|
|
4477
4648
|
const value = input[key];
|
|
4478
4649
|
if (undefined === value) return true;
|
|
@@ -4536,7 +4707,7 @@ function assertHttpLlmApplication(props) {
|
|
|
4536
4707
|
if (undefined === value) return true;
|
|
4537
4708
|
return "object" === typeof value && null !== value && false === Array.isArray(value) && _iu5(value);
|
|
4538
4709
|
}));
|
|
4539
|
-
const _io114 = input => Array.isArray(input.type) && input.type.every((elem => "string" === elem || "number" === elem || "boolean" === elem || "object" === elem || "integer" === elem || "array" === elem || "null" === elem)) && (null === input["default"] || undefined === input["default"] || Array.isArray(input["default"])) && (undefined === input["enum"] || Array.isArray(input["enum"])) && ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.
|
|
4710
|
+
const _io114 = input => Array.isArray(input.type) && input.type.every((elem => "string" === elem || "number" === elem || "boolean" === elem || "object" === elem || "integer" === elem || "array" === elem || "null" === elem)) && (null === input["default"] || undefined === input["default"] || Array.isArray(input["default"])) && (undefined === input["enum"] || Array.isArray(input["enum"])) && ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 0x10000000000000000)) && (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 0x10000000000000000)) && (null !== input.items && (undefined === input.items || (Array.isArray(input.items) && input.items.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem))) || "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && _iu5(input.items)))) && (undefined === input.prefixItems || Array.isArray(input.prefixItems) && input.prefixItems.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (undefined === input.uniqueItems || "boolean" === typeof input.uniqueItems) && (null !== input.additionalItems && (undefined === input.additionalItems || "boolean" === typeof input.additionalItems || "object" === typeof input.additionalItems && null !== input.additionalItems && false === Array.isArray(input.additionalItems) && _iu5(input.additionalItems))) && (undefined === input.minItems || "number" === typeof input.minItems && (Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 0x10000000000000000)) && (undefined === input.maxItems || "number" === typeof input.maxItems && (Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 0x10000000000000000)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || "boolean" === typeof input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && false === Array.isArray(input.additionalProperties) && _iu5(input.additionalProperties))) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io113(input.properties)) && (undefined === input.required || Array.isArray(input.required) && input.required.every((elem => "string" === typeof elem))) && (undefined === input.maxProperties || "number" === typeof input.maxProperties) && (undefined === input.minProperties || "number" === typeof input.minProperties) && (Array.isArray(input.oneOf) && input.oneOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (undefined === input.discriminator || "object" === typeof input.discriminator && null !== input.discriminator && _io127(input.discriminator)) && (Array.isArray(input.anyOf) && input.anyOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (Array.isArray(input.allOf) && input.allOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && "string" === typeof input.$ref;
|
|
4540
4711
|
const _io115 = input => ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
4541
4712
|
const _io116 = input => (undefined === input.nullable || "boolean" === typeof input.nullable) && (null === input["default"] || undefined === input["default"] || "boolean" === typeof input["default"]) && (undefined === input["enum"] || Array.isArray(input["enum"]) && input["enum"].every((elem => null === elem || "boolean" === typeof elem))) && "boolean" === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples))));
|
|
4542
4713
|
const _io117 = input => (undefined === input.nullable || "boolean" === typeof input.nullable) && (null === input["default"] || undefined === input["default"] || "number" === typeof input["default"] && (Math.floor(input["default"]) === input["default"] && -0x8000000000000000 <= input["default"] && input["default"] <= 0x8000000000000000)) && (undefined === input["enum"] || Array.isArray(input["enum"]) && input["enum"].every((elem => null === elem || "number" === typeof elem))) && (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -0x8000000000000000 <= input.minimum && input.minimum <= 0x8000000000000000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -0x8000000000000000 <= input.maximum && input.maximum <= 0x8000000000000000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum && (Math.floor(input.exclusiveMinimum) === input.exclusiveMinimum && -0x8000000000000000 <= input.exclusiveMinimum && input.exclusiveMinimum <= 0x8000000000000000) || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum && (Math.floor(input.exclusiveMaximum) === input.exclusiveMaximum && -0x8000000000000000 <= input.exclusiveMaximum && input.exclusiveMaximum <= 0x8000000000000000) || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 0x10000000000000000 && 0 < input.multipleOf)) && "integer" === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples))));
|
|
@@ -4558,7 +4729,7 @@ function assertHttpLlmApplication(props) {
|
|
|
4558
4729
|
return "object" === typeof value && null !== value && false === Array.isArray(value) && _io131(value);
|
|
4559
4730
|
}));
|
|
4560
4731
|
const _io131 = input => (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every((elem => "object" === typeof elem && null !== elem && _iu6(elem)))) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io106(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.get || "object" === typeof input.get && null !== input.get && false === Array.isArray(input.get) && _io138(input.get)) && (undefined === input.post || "object" === typeof input.post && null !== input.post && false === Array.isArray(input.post) && _io138(input.post)) && (undefined === input.patch || "object" === typeof input.patch && null !== input.patch && false === Array.isArray(input.patch) && _io138(input.patch)) && (undefined === input.put || "object" === typeof input.put && null !== input.put && false === Array.isArray(input.put) && _io138(input.put)) && (undefined === input["delete"] || "object" === typeof input["delete"] && null !== input["delete"] && false === Array.isArray(input["delete"]) && _io138(input["delete"])) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io138(input.options)) && (undefined === input.head || "object" === typeof input.head && null !== input.head && false === Array.isArray(input.head) && _io138(input.head)) && (undefined === input.trace || "object" === typeof input.trace && null !== input.trace && false === Array.isArray(input.trace) && _io138(input.trace));
|
|
4561
|
-
const _io132 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
4732
|
+
const _io132 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu5(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io133(input.examples));
|
|
4562
4733
|
const _io133 = input => Object.keys(input).every((key => {
|
|
4563
4734
|
const value = input[key];
|
|
4564
4735
|
if (undefined === value) return true;
|
|
@@ -4588,7 +4759,7 @@ function assertHttpLlmApplication(props) {
|
|
|
4588
4759
|
if (undefined === value) return true;
|
|
4589
4760
|
return "object" === typeof value && null !== value && _iu20(value);
|
|
4590
4761
|
}));
|
|
4591
|
-
const _io146 = input => (undefined === input.
|
|
4762
|
+
const _io146 = input => (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io133(input.examples)) && (undefined === input.name || "string" === typeof input.name) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu5(input.schema));
|
|
4592
4763
|
const _io147 = input => "string" === typeof input.$ref && RegExp(/^#\/components\/responses\/(.*)/).test(input.$ref) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
4593
4764
|
const _io148 = input => Object.keys(input).every((key => {
|
|
4594
4765
|
const value = input[key];
|
|
@@ -4687,7 +4858,7 @@ function assertHttpLlmApplication(props) {
|
|
|
4687
4858
|
}));
|
|
4688
4859
|
const _io199 = input => (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io167(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.get || "object" === typeof input.get && null !== input.get && false === Array.isArray(input.get) && _io200(input.get)) && (undefined === input.post || "object" === typeof input.post && null !== input.post && false === Array.isArray(input.post) && _io200(input.post)) && (undefined === input.patch || "object" === typeof input.patch && null !== input.patch && false === Array.isArray(input.patch) && _io200(input.patch)) && (undefined === input.put || "object" === typeof input.put && null !== input.put && false === Array.isArray(input.put) && _io200(input.put)) && (undefined === input["delete"] || "object" === typeof input["delete"] && null !== input["delete"] && false === Array.isArray(input["delete"]) && _io200(input["delete"])) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io200(input.options)) && (undefined === input.head || "object" === typeof input.head && null !== input.head && false === Array.isArray(input.head) && _io200(input.head)) && (undefined === input.trace || "object" === typeof input.trace && null !== input.trace && false === Array.isArray(input.trace) && _io200(input.trace));
|
|
4689
4860
|
const _io200 = input => (undefined === input.operationId || "string" === typeof input.operationId) && (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every((elem => "object" === typeof elem && null !== elem && _io201(elem)))) && (undefined === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && false === Array.isArray(input.requestBody) && _io204(input.requestBody)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && _io207(input.responses)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io167(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.security || Array.isArray(input.security) && input.security.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io39(elem)))) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every((elem => "string" === typeof elem))) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input["x-samchon-human"] || "boolean" === typeof input["x-samchon-human"]) && (undefined === input["x-samchon-accessor"] || Array.isArray(input["x-samchon-accessor"]) && input["x-samchon-accessor"].every((elem => "string" === typeof elem))) && (undefined === input["x-samchon-controller"] || "string" === typeof input["x-samchon-controller"]);
|
|
4690
|
-
const _io201 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
4861
|
+
const _io201 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu7(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io202(input.examples));
|
|
4691
4862
|
const _io202 = input => Object.keys(input).every((key => {
|
|
4692
4863
|
const value = input[key];
|
|
4693
4864
|
if (undefined === value) return true;
|
|
@@ -8320,12 +8491,7 @@ function assertHttpLlmApplication(props) {
|
|
|
8320
8491
|
value
|
|
8321
8492
|
}, _errorFactory);
|
|
8322
8493
|
}));
|
|
8323
|
-
const _ao79 = (input, _path, _exceptionable = true) => (undefined === input.
|
|
8324
|
-
method: "typia.assert",
|
|
8325
|
-
path: _path + ".name",
|
|
8326
|
-
expected: "(string | undefined)",
|
|
8327
|
-
value: input.name
|
|
8328
|
-
}, _errorFactory)) && (undefined === input.required || "boolean" === typeof input.required || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
8494
|
+
const _ao79 = (input, _path, _exceptionable = true) => (undefined === input.required || "boolean" === typeof input.required || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
8329
8495
|
method: "typia.assert",
|
|
8330
8496
|
path: _path + ".required",
|
|
8331
8497
|
expected: "(boolean | undefined)",
|
|
@@ -8345,6 +8511,11 @@ function assertHttpLlmApplication(props) {
|
|
|
8345
8511
|
path: _path + ".examples",
|
|
8346
8512
|
expected: "(Record<string, IExample | IReference<`#/components/examples/${string}`>> | undefined)",
|
|
8347
8513
|
value: input.examples
|
|
8514
|
+
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
8515
|
+
method: "typia.assert",
|
|
8516
|
+
path: _path + ".name",
|
|
8517
|
+
expected: "(string | undefined)",
|
|
8518
|
+
value: input.name
|
|
8348
8519
|
}, _errorFactory)) && (("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
8349
8520
|
method: "typia.assert",
|
|
8350
8521
|
path: _path + ".schema",
|
|
@@ -8412,7 +8583,7 @@ function assertHttpLlmApplication(props) {
|
|
|
8412
8583
|
path: _path + ".name",
|
|
8413
8584
|
expected: "(string | undefined)",
|
|
8414
8585
|
value: input.name
|
|
8415
|
-
}, _errorFactory)) && ("
|
|
8586
|
+
}, _errorFactory)) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
8416
8587
|
method: "typia.assert",
|
|
8417
8588
|
path: _path + '["in"]',
|
|
8418
8589
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
@@ -9551,16 +9722,6 @@ function assertHttpLlmApplication(props) {
|
|
|
9551
9722
|
path: _path + ".maximum",
|
|
9552
9723
|
expected: "(number | undefined)",
|
|
9553
9724
|
value: input.maximum
|
|
9554
|
-
}, _errorFactory)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9555
|
-
method: "typia.assert",
|
|
9556
|
-
path: _path + ".exclusiveMinimum",
|
|
9557
|
-
expected: "(boolean | number | undefined)",
|
|
9558
|
-
value: input.exclusiveMinimum
|
|
9559
|
-
}, _errorFactory)) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9560
|
-
method: "typia.assert",
|
|
9561
|
-
path: _path + ".exclusiveMaximum",
|
|
9562
|
-
expected: "(boolean | number | undefined)",
|
|
9563
|
-
value: input.exclusiveMaximum
|
|
9564
9725
|
}, _errorFactory)) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9565
9726
|
method: "typia.assert",
|
|
9566
9727
|
path: _path + ".multipleOf",
|
|
@@ -9571,6 +9732,16 @@ function assertHttpLlmApplication(props) {
|
|
|
9571
9732
|
path: _path + ".multipleOf",
|
|
9572
9733
|
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
9573
9734
|
value: input.multipleOf
|
|
9735
|
+
}, _errorFactory)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9736
|
+
method: "typia.assert",
|
|
9737
|
+
path: _path + ".exclusiveMinimum",
|
|
9738
|
+
expected: "(boolean | number | undefined)",
|
|
9739
|
+
value: input.exclusiveMinimum
|
|
9740
|
+
}, _errorFactory)) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9741
|
+
method: "typia.assert",
|
|
9742
|
+
path: _path + ".exclusiveMaximum",
|
|
9743
|
+
expected: "(boolean | number | undefined)",
|
|
9744
|
+
value: input.exclusiveMaximum
|
|
9574
9745
|
}, _errorFactory)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 0x10000000000000000 || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
9575
9746
|
method: "typia.assert",
|
|
9576
9747
|
path: _path + ".maxLength",
|
|
@@ -10928,7 +11099,7 @@ function assertHttpLlmApplication(props) {
|
|
|
10928
11099
|
path: _path + ".name",
|
|
10929
11100
|
expected: "(string | undefined)",
|
|
10930
11101
|
value: input.name
|
|
10931
|
-
}, _errorFactory)) && ("
|
|
11102
|
+
}, _errorFactory)) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
10932
11103
|
method: "typia.assert",
|
|
10933
11104
|
path: _path + '["in"]',
|
|
10934
11105
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
@@ -11368,12 +11539,7 @@ function assertHttpLlmApplication(props) {
|
|
|
11368
11539
|
value
|
|
11369
11540
|
}, _errorFactory);
|
|
11370
11541
|
}));
|
|
11371
|
-
const _ao146 = (input, _path, _exceptionable = true) => (undefined === input.
|
|
11372
|
-
method: "typia.assert",
|
|
11373
|
-
path: _path + ".name",
|
|
11374
|
-
expected: "(string | undefined)",
|
|
11375
|
-
value: input.name
|
|
11376
|
-
}, _errorFactory)) && (undefined === input.required || "boolean" === typeof input.required || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
11542
|
+
const _ao146 = (input, _path, _exceptionable = true) => (undefined === input.required || "boolean" === typeof input.required || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
11377
11543
|
method: "typia.assert",
|
|
11378
11544
|
path: _path + ".required",
|
|
11379
11545
|
expected: "(boolean | undefined)",
|
|
@@ -11393,6 +11559,11 @@ function assertHttpLlmApplication(props) {
|
|
|
11393
11559
|
path: _path + ".examples",
|
|
11394
11560
|
expected: "(Record<string, IExample | IReference<`#/components/examples/${string}`>>.o1 | undefined)",
|
|
11395
11561
|
value: input.examples
|
|
11562
|
+
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
11563
|
+
method: "typia.assert",
|
|
11564
|
+
path: _path + ".name",
|
|
11565
|
+
expected: "(string | undefined)",
|
|
11566
|
+
value: input.name
|
|
11396
11567
|
}, _errorFactory)) && (("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
11397
11568
|
method: "typia.assert",
|
|
11398
11569
|
path: _path + ".schema",
|
|
@@ -13272,7 +13443,7 @@ function assertHttpLlmApplication(props) {
|
|
|
13272
13443
|
path: _path + ".name",
|
|
13273
13444
|
expected: "(string | undefined)",
|
|
13274
13445
|
value: input.name
|
|
13275
|
-
}, _errorFactory)) && ("
|
|
13446
|
+
}, _errorFactory)) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
13276
13447
|
method: "typia.assert",
|
|
13277
13448
|
path: _path + '["in"]',
|
|
13278
13449
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
@@ -13685,6 +13856,37 @@ function assertHttpLlmApplication(props) {
|
|
|
13685
13856
|
});
|
|
13686
13857
|
}
|
|
13687
13858
|
|
|
13859
|
+
async function assertMcpLlmApplication(props) {
|
|
13860
|
+
const client = new Client({
|
|
13861
|
+
name: "get_tool_list",
|
|
13862
|
+
version: "1.0.0"
|
|
13863
|
+
});
|
|
13864
|
+
const transport = (() => {
|
|
13865
|
+
switch (props.type) {
|
|
13866
|
+
case "sse":
|
|
13867
|
+
return new SSEClientTransport(props.url);
|
|
13868
|
+
|
|
13869
|
+
case "stdio":
|
|
13870
|
+
return new StdioClientTransport(props);
|
|
13871
|
+
|
|
13872
|
+
default:
|
|
13873
|
+
throw new Error("Invalid transport type");
|
|
13874
|
+
}
|
|
13875
|
+
})();
|
|
13876
|
+
await client.connect(transport);
|
|
13877
|
+
const toolList = await client.request({
|
|
13878
|
+
method: "tools/list"
|
|
13879
|
+
}, ListToolsResultSchema);
|
|
13880
|
+
return {
|
|
13881
|
+
functions: toolList.tools.map((tool => ({
|
|
13882
|
+
name: tool.name,
|
|
13883
|
+
description: tool.description,
|
|
13884
|
+
parameters: tool.inputSchema
|
|
13885
|
+
}))),
|
|
13886
|
+
transport: props
|
|
13887
|
+
};
|
|
13888
|
+
}
|
|
13889
|
+
|
|
13688
13890
|
function validateHttpLlmApplication(props) {
|
|
13689
13891
|
const inspect = (() => {
|
|
13690
13892
|
const _io0 = input => null !== input.swagger && undefined !== input.swagger && ("2.0" === input.swagger || "string" === typeof input.swagger && RegExp(/^2\.0\.[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input.swagger)) && (undefined === input.info || "object" === typeof input.info && null !== input.info && _io1(input.info)) && (undefined === input.host || "string" === typeof input.host) && (undefined === input.basePath || "string" === typeof input.basePath) && (undefined === input.consumes || Array.isArray(input.consumes) && input.consumes.every((elem => "string" === typeof elem))) && (undefined === input.produces || Array.isArray(input.produces) && input.produces.every((elem => "string" === typeof elem))) && (undefined === input.definitions || "object" === typeof input.definitions && null !== input.definitions && false === Array.isArray(input.definitions) && _io4(input.definitions)) && (undefined === input.parameters || "object" === typeof input.parameters && null !== input.parameters && false === Array.isArray(input.parameters) && _io16(input.parameters)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && _io29(input.responses)) && (undefined === input.securityDefinitions || "object" === typeof input.securityDefinitions && null !== input.securityDefinitions && false === Array.isArray(input.securityDefinitions) && _io31(input.securityDefinitions)) && (undefined === input.security || Array.isArray(input.security) && input.security.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io39(elem)))) && (undefined === input.paths || "object" === typeof input.paths && null !== input.paths && false === Array.isArray(input.paths) && _io40(input.paths)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every((elem => "object" === typeof elem && null !== elem && _io47(elem))));
|
|
@@ -13826,14 +14028,14 @@ function validateHttpLlmApplication(props) {
|
|
|
13826
14028
|
if (undefined === value) return true;
|
|
13827
14029
|
return "object" === typeof value && null !== value && _iu13(value);
|
|
13828
14030
|
}));
|
|
13829
|
-
const _io79 = input => (undefined === input.
|
|
14031
|
+
const _io79 = input => (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io75(input.examples)) && (undefined === input.name || "string" === typeof input.name) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu3(input.schema));
|
|
13830
14032
|
const _io80 = input => "string" === typeof input.$ref && RegExp(/^#\/components\/headers\/(.*)/).test(input.$ref) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
13831
14033
|
const _io81 = input => Object.keys(input).every((key => {
|
|
13832
14034
|
const value = input[key];
|
|
13833
14035
|
if (undefined === value) return true;
|
|
13834
14036
|
return "object" === typeof value && null !== value && _io82(value);
|
|
13835
14037
|
}));
|
|
13836
|
-
const _io82 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
14038
|
+
const _io82 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu3(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io75(input.examples));
|
|
13837
14039
|
const _io83 = input => Object.keys(input).every((key => {
|
|
13838
14040
|
const value = input[key];
|
|
13839
14041
|
if (undefined === value) return true;
|
|
@@ -13897,7 +14099,7 @@ function validateHttpLlmApplication(props) {
|
|
|
13897
14099
|
if (undefined === value) return true;
|
|
13898
14100
|
return "object" === typeof value && null !== value && false === Array.isArray(value) && _iu5(value);
|
|
13899
14101
|
}));
|
|
13900
|
-
const _io114 = input => Array.isArray(input.type) && input.type.every((elem => "string" === elem || "number" === elem || "boolean" === elem || "object" === elem || "integer" === elem || "array" === elem || "null" === elem)) && (null === input["default"] || undefined === input["default"] || Array.isArray(input["default"])) && (undefined === input["enum"] || Array.isArray(input["enum"])) && ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.
|
|
14102
|
+
const _io114 = input => Array.isArray(input.type) && input.type.every((elem => "string" === elem || "number" === elem || "boolean" === elem || "object" === elem || "integer" === elem || "array" === elem || "null" === elem)) && (null === input["default"] || undefined === input["default"] || Array.isArray(input["default"])) && (undefined === input["enum"] || Array.isArray(input["enum"])) && ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 0x10000000000000000)) && (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 0x10000000000000000)) && (null !== input.items && (undefined === input.items || (Array.isArray(input.items) && input.items.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem))) || "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && _iu5(input.items)))) && (undefined === input.prefixItems || Array.isArray(input.prefixItems) && input.prefixItems.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (undefined === input.uniqueItems || "boolean" === typeof input.uniqueItems) && (null !== input.additionalItems && (undefined === input.additionalItems || "boolean" === typeof input.additionalItems || "object" === typeof input.additionalItems && null !== input.additionalItems && false === Array.isArray(input.additionalItems) && _iu5(input.additionalItems))) && (undefined === input.minItems || "number" === typeof input.minItems && (Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 0x10000000000000000)) && (undefined === input.maxItems || "number" === typeof input.maxItems && (Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 0x10000000000000000)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || "boolean" === typeof input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && false === Array.isArray(input.additionalProperties) && _iu5(input.additionalProperties))) && (undefined === input.properties || "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io113(input.properties)) && (undefined === input.required || Array.isArray(input.required) && input.required.every((elem => "string" === typeof elem))) && (undefined === input.maxProperties || "number" === typeof input.maxProperties) && (undefined === input.minProperties || "number" === typeof input.minProperties) && (Array.isArray(input.oneOf) && input.oneOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (undefined === input.discriminator || "object" === typeof input.discriminator && null !== input.discriminator && _io127(input.discriminator)) && (Array.isArray(input.anyOf) && input.anyOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && (Array.isArray(input.allOf) && input.allOf.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _iu5(elem)))) && "string" === typeof input.$ref;
|
|
13901
14103
|
const _io115 = input => ("string" === typeof input["const"] || "number" === typeof input["const"] || "boolean" === typeof input["const"]) && (undefined === input.nullable || "boolean" === typeof input.nullable) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
13902
14104
|
const _io116 = input => (undefined === input.nullable || "boolean" === typeof input.nullable) && (null === input["default"] || undefined === input["default"] || "boolean" === typeof input["default"]) && (undefined === input["enum"] || Array.isArray(input["enum"]) && input["enum"].every((elem => null === elem || "boolean" === typeof elem))) && "boolean" === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples))));
|
|
13903
14105
|
const _io117 = input => (undefined === input.nullable || "boolean" === typeof input.nullable) && (null === input["default"] || undefined === input["default"] || "number" === typeof input["default"] && (Math.floor(input["default"]) === input["default"] && -0x8000000000000000 <= input["default"] && input["default"] <= 0x8000000000000000)) && (undefined === input["enum"] || Array.isArray(input["enum"]) && input["enum"].every((elem => null === elem || "number" === typeof elem))) && (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -0x8000000000000000 <= input.minimum && input.minimum <= 0x8000000000000000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -0x8000000000000000 <= input.maximum && input.maximum <= 0x8000000000000000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum && (Math.floor(input.exclusiveMinimum) === input.exclusiveMinimum && -0x8000000000000000 <= input.exclusiveMinimum && input.exclusiveMinimum <= 0x8000000000000000) || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum && (Math.floor(input.exclusiveMaximum) === input.exclusiveMaximum && -0x8000000000000000 <= input.exclusiveMaximum && input.exclusiveMaximum <= 0x8000000000000000) || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 0x10000000000000000 && 0 < input.multipleOf)) && "integer" === input.type && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples))));
|
|
@@ -13919,7 +14121,7 @@ function validateHttpLlmApplication(props) {
|
|
|
13919
14121
|
return "object" === typeof value && null !== value && false === Array.isArray(value) && _io131(value);
|
|
13920
14122
|
}));
|
|
13921
14123
|
const _io131 = input => (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every((elem => "object" === typeof elem && null !== elem && _iu6(elem)))) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io106(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.get || "object" === typeof input.get && null !== input.get && false === Array.isArray(input.get) && _io138(input.get)) && (undefined === input.post || "object" === typeof input.post && null !== input.post && false === Array.isArray(input.post) && _io138(input.post)) && (undefined === input.patch || "object" === typeof input.patch && null !== input.patch && false === Array.isArray(input.patch) && _io138(input.patch)) && (undefined === input.put || "object" === typeof input.put && null !== input.put && false === Array.isArray(input.put) && _io138(input.put)) && (undefined === input["delete"] || "object" === typeof input["delete"] && null !== input["delete"] && false === Array.isArray(input["delete"]) && _io138(input["delete"])) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io138(input.options)) && (undefined === input.head || "object" === typeof input.head && null !== input.head && false === Array.isArray(input.head) && _io138(input.head)) && (undefined === input.trace || "object" === typeof input.trace && null !== input.trace && false === Array.isArray(input.trace) && _io138(input.trace));
|
|
13922
|
-
const _io132 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
14124
|
+
const _io132 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu5(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io133(input.examples));
|
|
13923
14125
|
const _io133 = input => Object.keys(input).every((key => {
|
|
13924
14126
|
const value = input[key];
|
|
13925
14127
|
if (undefined === value) return true;
|
|
@@ -13949,7 +14151,7 @@ function validateHttpLlmApplication(props) {
|
|
|
13949
14151
|
if (undefined === value) return true;
|
|
13950
14152
|
return "object" === typeof value && null !== value && _iu20(value);
|
|
13951
14153
|
}));
|
|
13952
|
-
const _io146 = input => (undefined === input.
|
|
14154
|
+
const _io146 = input => (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io133(input.examples)) && (undefined === input.name || "string" === typeof input.name) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu5(input.schema));
|
|
13953
14155
|
const _io147 = input => "string" === typeof input.$ref && RegExp(/^#\/components\/responses\/(.*)/).test(input.$ref) && (null !== input.examples && (undefined === input.examples || (Array.isArray(input.examples) || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io58(input.examples)))) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && true;
|
|
13954
14156
|
const _io148 = input => Object.keys(input).every((key => {
|
|
13955
14157
|
const value = input[key];
|
|
@@ -14048,7 +14250,7 @@ function validateHttpLlmApplication(props) {
|
|
|
14048
14250
|
}));
|
|
14049
14251
|
const _io199 = input => (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io167(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.get || "object" === typeof input.get && null !== input.get && false === Array.isArray(input.get) && _io200(input.get)) && (undefined === input.post || "object" === typeof input.post && null !== input.post && false === Array.isArray(input.post) && _io200(input.post)) && (undefined === input.patch || "object" === typeof input.patch && null !== input.patch && false === Array.isArray(input.patch) && _io200(input.patch)) && (undefined === input.put || "object" === typeof input.put && null !== input.put && false === Array.isArray(input.put) && _io200(input.put)) && (undefined === input["delete"] || "object" === typeof input["delete"] && null !== input["delete"] && false === Array.isArray(input["delete"]) && _io200(input["delete"])) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io200(input.options)) && (undefined === input.head || "object" === typeof input.head && null !== input.head && false === Array.isArray(input.head) && _io200(input.head)) && (undefined === input.trace || "object" === typeof input.trace && null !== input.trace && false === Array.isArray(input.trace) && _io200(input.trace));
|
|
14050
14252
|
const _io200 = input => (undefined === input.operationId || "string" === typeof input.operationId) && (undefined === input.parameters || Array.isArray(input.parameters) && input.parameters.every((elem => "object" === typeof elem && null !== elem && _io201(elem)))) && (undefined === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && false === Array.isArray(input.requestBody) && _io204(input.requestBody)) && (undefined === input.responses || "object" === typeof input.responses && null !== input.responses && false === Array.isArray(input.responses) && _io207(input.responses)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every((elem => "object" === typeof elem && null !== elem && _io167(elem)))) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.security || Array.isArray(input.security) && input.security.every((elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io39(elem)))) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every((elem => "string" === typeof elem))) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input["x-samchon-human"] || "boolean" === typeof input["x-samchon-human"]) && (undefined === input["x-samchon-accessor"] || Array.isArray(input["x-samchon-accessor"]) && input["x-samchon-accessor"].every((elem => "string" === typeof elem))) && (undefined === input["x-samchon-controller"] || "string" === typeof input["x-samchon-controller"]);
|
|
14051
|
-
const _io201 = input => (undefined === input.name || "string" === typeof input.name) && ("
|
|
14253
|
+
const _io201 = input => (undefined === input.name || "string" === typeof input.name) && ("path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && _iu7(input.schema)) && (undefined === input.required || "boolean" === typeof input.required) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && _io202(input.examples));
|
|
14052
14254
|
const _io202 = input => Object.keys(input).every((key => {
|
|
14053
14255
|
const value = input[key];
|
|
14054
14256
|
if (undefined === value) return true;
|
|
@@ -17005,11 +17207,7 @@ function validateHttpLlmApplication(props) {
|
|
|
17005
17207
|
value
|
|
17006
17208
|
});
|
|
17007
17209
|
})).every((flag => flag)) ].every((flag => flag));
|
|
17008
|
-
const _vo79 = (input, _path, _exceptionable = true) => [ undefined === input.
|
|
17009
|
-
path: _path + ".name",
|
|
17010
|
-
expected: "(string | undefined)",
|
|
17011
|
-
value: input.name
|
|
17012
|
-
}), undefined === input.required || "boolean" === typeof input.required || _report(_exceptionable, {
|
|
17210
|
+
const _vo79 = (input, _path, _exceptionable = true) => [ undefined === input.required || "boolean" === typeof input.required || _report(_exceptionable, {
|
|
17013
17211
|
path: _path + ".required",
|
|
17014
17212
|
expected: "(boolean | undefined)",
|
|
17015
17213
|
value: input.required
|
|
@@ -17025,6 +17223,10 @@ function validateHttpLlmApplication(props) {
|
|
|
17025
17223
|
path: _path + ".examples",
|
|
17026
17224
|
expected: "(Record<string, IExample | IReference<`#/components/examples/${string}`>> | undefined)",
|
|
17027
17225
|
value: input.examples
|
|
17226
|
+
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
17227
|
+
path: _path + ".name",
|
|
17228
|
+
expected: "(string | undefined)",
|
|
17229
|
+
value: input.name
|
|
17028
17230
|
}), ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || _report(_exceptionable, {
|
|
17029
17231
|
path: _path + ".schema",
|
|
17030
17232
|
expected: "(OpenApiV3.IJsonSchema.IAllOf | OpenApiV3.IJsonSchema.IAnyOf | OpenApiV3.IJsonSchema.IArray | OpenApiV3.IJsonSchema.IBoolean | OpenApiV3.IJsonSchema.IInteger | OpenApiV3.IJsonSchema.INullOnly | OpenApiV3.IJsonSchema.INumber | OpenApiV3.IJsonSchema.IObject | OpenApiV3.IJsonSchema.IOneOf | OpenApiV3.IJsonSchema.IReference<string> | OpenApiV3.IJsonSchema.IString | OpenApiV3.IJsonSchema.IUnknown)",
|
|
@@ -17080,7 +17282,7 @@ function validateHttpLlmApplication(props) {
|
|
|
17080
17282
|
path: _path + ".name",
|
|
17081
17283
|
expected: "(string | undefined)",
|
|
17082
17284
|
value: input.name
|
|
17083
|
-
}), "
|
|
17285
|
+
}), "path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || _report(_exceptionable, {
|
|
17084
17286
|
path: _path + '["in"]',
|
|
17085
17287
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
17086
17288
|
value: input["in"]
|
|
@@ -18004,14 +18206,6 @@ function validateHttpLlmApplication(props) {
|
|
|
18004
18206
|
path: _path + ".maximum",
|
|
18005
18207
|
expected: "(number | undefined)",
|
|
18006
18208
|
value: input.maximum
|
|
18007
|
-
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
18008
|
-
path: _path + ".exclusiveMinimum",
|
|
18009
|
-
expected: "(boolean | number | undefined)",
|
|
18010
|
-
value: input.exclusiveMinimum
|
|
18011
|
-
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
18012
|
-
path: _path + ".exclusiveMaximum",
|
|
18013
|
-
expected: "(boolean | number | undefined)",
|
|
18014
|
-
value: input.exclusiveMaximum
|
|
18015
18209
|
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || _report(_exceptionable, {
|
|
18016
18210
|
path: _path + ".multipleOf",
|
|
18017
18211
|
expected: "number & ExclusiveMinimum<0>",
|
|
@@ -18020,6 +18214,14 @@ function validateHttpLlmApplication(props) {
|
|
|
18020
18214
|
path: _path + ".multipleOf",
|
|
18021
18215
|
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
18022
18216
|
value: input.multipleOf
|
|
18217
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
18218
|
+
path: _path + ".exclusiveMinimum",
|
|
18219
|
+
expected: "(boolean | number | undefined)",
|
|
18220
|
+
value: input.exclusiveMinimum
|
|
18221
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
18222
|
+
path: _path + ".exclusiveMaximum",
|
|
18223
|
+
expected: "(boolean | number | undefined)",
|
|
18224
|
+
value: input.exclusiveMaximum
|
|
18023
18225
|
}), undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 0x10000000000000000 || _report(_exceptionable, {
|
|
18024
18226
|
path: _path + ".maxLength",
|
|
18025
18227
|
expected: 'number & Type<"uint64">',
|
|
@@ -19110,7 +19312,7 @@ function validateHttpLlmApplication(props) {
|
|
|
19110
19312
|
path: _path + ".name",
|
|
19111
19313
|
expected: "(string | undefined)",
|
|
19112
19314
|
value: input.name
|
|
19113
|
-
}), "
|
|
19315
|
+
}), "path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || _report(_exceptionable, {
|
|
19114
19316
|
path: _path + '["in"]',
|
|
19115
19317
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
19116
19318
|
value: input["in"]
|
|
@@ -19468,11 +19670,7 @@ function validateHttpLlmApplication(props) {
|
|
|
19468
19670
|
value
|
|
19469
19671
|
});
|
|
19470
19672
|
})).every((flag => flag)) ].every((flag => flag));
|
|
19471
|
-
const _vo146 = (input, _path, _exceptionable = true) => [ undefined === input.
|
|
19472
|
-
path: _path + ".name",
|
|
19473
|
-
expected: "(string | undefined)",
|
|
19474
|
-
value: input.name
|
|
19475
|
-
}), undefined === input.required || "boolean" === typeof input.required || _report(_exceptionable, {
|
|
19673
|
+
const _vo146 = (input, _path, _exceptionable = true) => [ undefined === input.required || "boolean" === typeof input.required || _report(_exceptionable, {
|
|
19476
19674
|
path: _path + ".required",
|
|
19477
19675
|
expected: "(boolean | undefined)",
|
|
19478
19676
|
value: input.required
|
|
@@ -19488,6 +19686,10 @@ function validateHttpLlmApplication(props) {
|
|
|
19488
19686
|
path: _path + ".examples",
|
|
19489
19687
|
expected: "(Record<string, IExample | IReference<`#/components/examples/${string}`>>.o1 | undefined)",
|
|
19490
19688
|
value: input.examples
|
|
19689
|
+
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
19690
|
+
path: _path + ".name",
|
|
19691
|
+
expected: "(string | undefined)",
|
|
19692
|
+
value: input.name
|
|
19491
19693
|
}), ("object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) || _report(_exceptionable, {
|
|
19492
19694
|
path: _path + ".schema",
|
|
19493
19695
|
expected: "(OpenApiV3_1.IJsonSchema.IAllOf | OpenApiV3_1.IJsonSchema.IAnyOf | OpenApiV3_1.IJsonSchema.IArray | OpenApiV3_1.IJsonSchema.IBoolean | OpenApiV3_1.IJsonSchema.IConstant | OpenApiV3_1.IJsonSchema.IInteger | OpenApiV3_1.IJsonSchema.IMixed | OpenApiV3_1.IJsonSchema.INull | OpenApiV3_1.IJsonSchema.INumber | OpenApiV3_1.IJsonSchema.IObject | OpenApiV3_1.IJsonSchema.IOneOf | OpenApiV3_1.IJsonSchema.IRecursiveReference | OpenApiV3_1.IJsonSchema.IReference<string> | OpenApiV3_1.IJsonSchema.IString | OpenApiV3_1.IJsonSchema.IUnknown)",
|
|
@@ -21011,7 +21213,7 @@ function validateHttpLlmApplication(props) {
|
|
|
21011
21213
|
path: _path + ".name",
|
|
21012
21214
|
expected: "(string | undefined)",
|
|
21013
21215
|
value: input.name
|
|
21014
|
-
}), "
|
|
21216
|
+
}), "path" === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || _report(_exceptionable, {
|
|
21015
21217
|
path: _path + '["in"]',
|
|
21016
21218
|
expected: '("cookie" | "header" | "path" | "query")',
|
|
21017
21219
|
value: input["in"]
|
|
@@ -21541,5 +21743,5 @@ var index = Object.freeze({
|
|
|
21541
21743
|
StreamUtil
|
|
21542
21744
|
});
|
|
21543
21745
|
|
|
21544
|
-
export { Agentica, AgenticaTokenUsage, MicroAgentica, assertHttpLlmApplication, index$2 as factory, index$1 as orchestrate, index as utils, validateHttpLlmApplication };
|
|
21746
|
+
export { Agentica, AgenticaTokenUsage, MicroAgentica, assertHttpLlmApplication, assertMcpLlmApplication, index$2 as factory, index$1 as orchestrate, index as utils, validateHttpLlmApplication };
|
|
21545
21747
|
//# sourceMappingURL=index.mjs.map
|