@agentica/core 0.34.2 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Agentica.d.ts +9 -10
- package/lib/Agentica.js.map +1 -1
- package/lib/MicroAgentica.d.ts +9 -10
- package/lib/MicroAgentica.js.map +1 -1
- package/lib/constants/AgenticaDefaultPrompt.d.ts +1 -2
- package/lib/constants/AgenticaDefaultPrompt.js.map +1 -1
- package/lib/context/AgenticaContext.d.ts +6 -7
- package/lib/context/AgenticaOperation.d.ts +5 -5
- package/lib/context/AgenticaOperationCollection.d.ts +5 -6
- package/lib/context/AgenticaOperationSelection.d.ts +2 -3
- package/lib/context/MicroAgenticaContext.d.ts +5 -6
- package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/context/internal/AgenticaOperationComposer.spec.js +41 -9
- package/lib/context/internal/AgenticaOperationComposer.spec.js.map +1 -1
- package/lib/context/internal/__IChatInitialApplication.d.ts +1 -1
- package/lib/context/internal/isAgenticaContext.js.map +1 -1
- package/lib/events/AgenticaCallEvent.d.ts +2 -3
- package/lib/events/AgenticaCancelEvent.d.ts +2 -3
- package/lib/events/AgenticaDescribeEvent.d.ts +3 -4
- package/lib/events/AgenticaEvent.d.ts +10 -11
- package/lib/events/AgenticaExecuteEvent.d.ts +5 -5
- package/lib/events/AgenticaJsonParseErrorEvent.d.ts +2 -3
- package/lib/events/AgenticaSelectEvent.d.ts +3 -4
- package/lib/events/AgenticaValidateEvent.d.ts +2 -3
- package/lib/events/MicroAgenticaEvent.d.ts +8 -9
- package/lib/factory/events.d.ts +22 -22
- package/lib/factory/events.js.map +1 -1
- package/lib/factory/histories.js.map +1 -1
- package/lib/factory/operations.d.ts +3 -4
- package/lib/factory/operations.js.map +1 -1
- package/lib/functional/assertHttpController.d.ts +6 -10
- package/lib/functional/assertHttpController.js +775 -91
- package/lib/functional/assertHttpController.js.map +1 -1
- package/lib/functional/assertHttpLlmApplication.d.ts +4 -8
- package/lib/functional/assertHttpLlmApplication.js +775 -91
- package/lib/functional/assertHttpLlmApplication.js.map +1 -1
- package/lib/functional/assertMcpController.d.ts +5 -6
- package/lib/functional/assertMcpController.js +201 -32
- package/lib/functional/assertMcpController.js.map +1 -1
- package/lib/functional/validateHttpController.d.ts +6 -10
- package/lib/functional/validateHttpController.js +636 -89
- package/lib/functional/validateHttpController.js.map +1 -1
- package/lib/functional/validateHttpLlmApplication.d.ts +4 -8
- package/lib/functional/validateHttpLlmApplication.js +636 -89
- package/lib/functional/validateHttpLlmApplication.js.map +1 -1
- package/lib/functional/validateMcpController.d.ts +5 -6
- package/lib/functional/validateMcpController.js +366 -61
- package/lib/functional/validateMcpController.js.map +1 -1
- package/lib/histories/AgenticaCancelHistory.d.ts +2 -3
- package/lib/histories/AgenticaDescribeHistory.d.ts +2 -3
- package/lib/histories/AgenticaExecuteHistory.d.ts +5 -5
- package/lib/histories/AgenticaHistory.d.ts +7 -8
- package/lib/histories/AgenticaSelectHistory.d.ts +2 -3
- package/lib/histories/MicroAgenticaHistory.d.ts +5 -6
- package/lib/index.mjs +3964 -849
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/call.d.ts +1 -2
- package/lib/orchestrate/call.js.map +1 -1
- package/lib/orchestrate/cancel.d.ts +1 -2
- package/lib/orchestrate/cancel.js +4 -4
- package/lib/orchestrate/cancel.js.map +1 -1
- package/lib/orchestrate/describe.d.ts +1 -2
- package/lib/orchestrate/describe.js.map +1 -1
- package/lib/orchestrate/execute.d.ts +1 -2
- package/lib/orchestrate/execute.js.map +1 -1
- package/lib/orchestrate/initialize.d.ts +1 -2
- package/lib/orchestrate/initialize.js +262 -83
- package/lib/orchestrate/initialize.js.map +1 -1
- package/lib/orchestrate/internal/cancelFunctionFromContext.js.map +1 -1
- package/lib/orchestrate/internal/selectFunctionFromContext.js.map +1 -1
- package/lib/orchestrate/select.d.ts +1 -2
- package/lib/orchestrate/select.js +4 -4
- package/lib/orchestrate/select.js.map +1 -1
- package/lib/structures/IAgenticaConfig.d.ts +3 -4
- package/lib/structures/IAgenticaController.d.ts +11 -14
- package/lib/structures/IAgenticaExecutor.d.ts +6 -7
- package/lib/structures/IAgenticaProps.d.ts +3 -8
- package/lib/structures/IAgenticaSystemPrompt.d.ts +9 -10
- package/lib/structures/IMicroAgenticaConfig.d.ts +3 -4
- package/lib/structures/IMicroAgenticaExecutor.d.ts +3 -4
- package/lib/structures/IMicroAgenticaProps.d.ts +3 -8
- package/lib/structures/IMicroAgenticaSystemPrompt.d.ts +6 -7
- package/lib/transformers/transformHistory.js.map +1 -1
- package/lib/utils/ChatGptCompletionStreamingUtil.spec.js +2 -2
- package/lib/utils/ChatGptCompletionStreamingUtil.spec.js.map +1 -1
- package/lib/utils/request.d.ts +2 -3
- package/lib/utils/request.js.map +1 -1
- package/package.json +8 -8
- package/src/Agentica.ts +24 -26
- package/src/MicroAgentica.ts +27 -29
- package/src/constants/AgenticaDefaultPrompt.ts +2 -4
- package/src/context/AgenticaContext.ts +6 -7
- package/src/context/AgenticaOperation.ts +14 -14
- package/src/context/AgenticaOperationCollection.ts +5 -8
- package/src/context/AgenticaOperationSelection.ts +2 -4
- package/src/context/MicroAgenticaContext.ts +5 -6
- package/src/context/internal/AgenticaOperationComposer.spec.ts +50 -18
- package/src/context/internal/AgenticaOperationComposer.ts +21 -23
- package/src/context/internal/__IChatInitialApplication.ts +1 -1
- package/src/context/internal/isAgenticaContext.ts +4 -6
- package/src/events/AgenticaCallEvent.ts +2 -5
- package/src/events/AgenticaCancelEvent.ts +2 -6
- package/src/events/AgenticaDescribeEvent.ts +3 -7
- package/src/events/AgenticaEvent.ts +17 -19
- package/src/events/AgenticaEvent.type.ts +1 -1
- package/src/events/AgenticaExecuteEvent.ts +12 -12
- package/src/events/AgenticaJsonParseErrorEvent.ts +2 -4
- package/src/events/AgenticaSelectEvent.ts +3 -7
- package/src/events/AgenticaValidateEvent.ts +2 -5
- package/src/events/MicroAgenticaEvent.ts +13 -15
- package/src/factory/events.ts +24 -24
- package/src/factory/histories.ts +15 -17
- package/src/factory/operations.ts +3 -5
- package/src/functional/assertHttpController.ts +7 -15
- package/src/functional/assertHttpLlmApplication.ts +4 -13
- package/src/functional/assertMcpController.ts +6 -8
- package/src/functional/validateHttpController.ts +7 -15
- package/src/functional/validateHttpLlmApplication.ts +4 -13
- package/src/functional/validateMcpController.ts +6 -11
- package/src/histories/AgenticaCancelHistory.ts +2 -6
- package/src/histories/AgenticaDescribeHistory.ts +2 -6
- package/src/histories/AgenticaExecuteHistory.ts +7 -9
- package/src/histories/AgenticaHistory.ts +11 -13
- package/src/histories/AgenticaSelectHistory.ts +2 -6
- package/src/histories/MicroAgenticaHistory.ts +7 -9
- package/src/orchestrate/call.ts +55 -56
- package/src/orchestrate/cancel.ts +11 -12
- package/src/orchestrate/describe.ts +4 -5
- package/src/orchestrate/execute.ts +3 -5
- package/src/orchestrate/initialize.ts +4 -5
- package/src/orchestrate/internal/cancelFunctionFromContext.ts +4 -6
- package/src/orchestrate/internal/selectFunctionFromContext.ts +5 -9
- package/src/orchestrate/select.ts +11 -12
- package/src/structures/IAgenticaConfig.ts +4 -6
- package/src/structures/IAgenticaController.ts +11 -14
- package/src/structures/IAgenticaExecutor.ts +9 -11
- package/src/structures/IAgenticaProps.ts +3 -10
- package/src/structures/IAgenticaSystemPrompt.ts +9 -11
- package/src/structures/IMicroAgenticaConfig.ts +3 -5
- package/src/structures/IMicroAgenticaExecutor.ts +4 -6
- package/src/structures/IMicroAgenticaProps.ts +3 -10
- package/src/structures/IMicroAgenticaSystemPrompt.ts +6 -8
- package/src/transformers/transformHistory.ts +19 -21
- package/src/utils/ChatGptCompletionStreamingUtil.spec.ts +4 -5
- package/src/utils/request.ts +2 -3
|
@@ -54,11 +54,11 @@ const events_1 = require("../factory/events");
|
|
|
54
54
|
const histories_1 = require("../factory/histories");
|
|
55
55
|
const ChatGptCompletionStreamingUtil_1 = require("../utils/ChatGptCompletionStreamingUtil");
|
|
56
56
|
const FUNCTION = {
|
|
57
|
-
|
|
58
|
-
options: {
|
|
57
|
+
config: {
|
|
59
58
|
reference: true,
|
|
60
59
|
strict: false,
|
|
61
|
-
separate: null
|
|
60
|
+
separate: null,
|
|
61
|
+
validate: null
|
|
62
62
|
},
|
|
63
63
|
functions: [
|
|
64
64
|
{
|
|
@@ -70,8 +70,8 @@ const FUNCTION = {
|
|
|
70
70
|
required: [],
|
|
71
71
|
additionalProperties: false,
|
|
72
72
|
$defs: {
|
|
73
|
-
|
|
74
|
-
description: "LLM function calling schema from HTTP (OpenAPI) operation.\n\n`IHttpLlmFunction` is a data structure representing a function converted from\nthe {@link OpenApi.IOperation OpenAPI operation}, used for the LLM (Large\nLanguage Model) function calling. It's a typical RPC (Remote Procedure Call)\nstructure containing the function {@link name}, {@link parameters}, and\n{@link output return type}.\n\nIf you provide this `IHttpLlmFunction` data to the LLM provider like\n\"OpenAI\", the \"OpenAI\" will compose a function arguments by analyzing\nconversations with the user. With the LLM composed arguments, you can execute\nthe function through {@link LlmFetcher.execute} and get the result.\n\nFor reference, different between `IHttpLlmFunction` and its origin source\n{@link OpenApi.IOperation} is, `IHttpLlmFunction` has converted every type\nschema information from {@link OpenApi.IJsonSchema} to {@link
|
|
73
|
+
IHttpLlmFunction: {
|
|
74
|
+
description: "LLM function calling schema from HTTP (OpenAPI) operation.\n\n`IHttpLlmFunction` is a data structure representing a function converted from\nthe {@link OpenApi.IOperation OpenAPI operation}, used for the LLM (Large\nLanguage Model) function calling. It's a typical RPC (Remote Procedure Call)\nstructure containing the function {@link name}, {@link parameters}, and\n{@link output return type}.\n\nIf you provide this `IHttpLlmFunction` data to the LLM provider like\n\"OpenAI\", the \"OpenAI\" will compose a function arguments by analyzing\nconversations with the user. With the LLM composed arguments, you can execute\nthe function through {@link LlmFetcher.execute} and get the result.\n\nFor reference, different between `IHttpLlmFunction` and its origin source\n{@link OpenApi.IOperation} is, `IHttpLlmFunction` has converted every type\nschema information from {@link OpenApi.IJsonSchema} to {@link ILlmSchema}.\n\nAdditionally, the properties' rule is:\n\n- `pathParameters`: Path parameters of {@link OpenApi.IOperation.parameters}\n- `query`: Query parameter of {@link IHttpMigrateRoute.query}\n- `body`: Body parameter of {@link IHttpMigrateRoute.body}\n\n```typescript\n{\n ...pathParameters,\n query,\n body,\n}\n```",
|
|
75
75
|
type: "object",
|
|
76
76
|
properties: {
|
|
77
77
|
method: {
|
|
@@ -90,54 +90,55 @@ const FUNCTION = {
|
|
|
90
90
|
type: "string"
|
|
91
91
|
},
|
|
92
92
|
name: {
|
|
93
|
-
description: "Representative name of the function.\n\nThe `name` is a representative name identifying the function in the\n{@link IHttpLlmApplication}. The `name` value is just composed by joining\nthe {@link IHttpMigrateRoute.accessor} by underscore `_` character.\n\nHere is the composition rule of the {@link IHttpMigrateRoute.accessor}:\n\n> The `accessor` is composed with the following rules. At first, namespaces\n> are composed by static directory names in the {@link path}. Parametric\n> symbols represented by `:param` or `{param}` cannot be a part of the\n> namespace.\n\n> Instead, they would be a part of the function name. The function name is\n> composed with the {@link method HTTP method} and parametric symbols like\n> `getByParam` or `postByParam`. If there are multiple path parameters, they\n> would be concatenated by `And` like `getByParam1AndParam2`.\n\n> For reference, if the {@link operation}'s {@link method} is `delete`, the\n> function name would be replaced to `erase` instead of `delete`. It is the\n> reason why the `delete` is a reserved keyword in many programming\n> languages.\n\n> - Example 1\n\n>
|
|
94
|
-
type: "string"
|
|
93
|
+
description: "Representative name of the function.\n\nThe `name` is a representative name identifying the function in the\n{@link IHttpLlmApplication}. The `name` value is just composed by joining\nthe {@link IHttpMigrateRoute.accessor} by underscore `_` character.\n\nHere is the composition rule of the {@link IHttpMigrateRoute.accessor}:\n\n> The `accessor` is composed with the following rules. At first, namespaces\n> are composed by static directory names in the {@link path}. Parametric\n> symbols represented by `:param` or `{param}` cannot be a part of the\n> namespace.\n\n> Instead, they would be a part of the function name. The function name is\n> composed with the {@link method HTTP method} and parametric symbols like\n> `getByParam` or `postByParam`. If there are multiple path parameters, they\n> would be concatenated by `And` like `getByParam1AndParam2`.\n\n> For reference, if the {@link operation}'s {@link method} is `delete`, the\n> function name would be replaced to `erase` instead of `delete`. It is the\n> reason why the `delete` is a reserved keyword in many programming\n> languages.\n\n> - Example 1\n\n> - Path: `POST /shopping/sellers/sales`\n> - Accessor: `shopping.sellers.sales.post`\n> - Example 2\n\n> - Endpoint: `GET\n> /shoppings/sellers/sales/:saleId/reviews/:reviewId/comments/:id`\n> - Accessor:\n> `shoppings.sellers.sales.reviews.getBySaleIdAndReviewIdAndCommentId`",
|
|
94
|
+
type: "string",
|
|
95
|
+
maxLength: 64
|
|
95
96
|
},
|
|
96
97
|
parameters: {
|
|
97
|
-
description: "List of parameter types.\n\nIf you've configured {@link IHttpLlmApplication.
|
|
98
|
-
$ref: "#/$defs/
|
|
98
|
+
description: "List of parameter types.\n\nIf you've configured {@link IHttpLlmApplication.IConfig.keyword} as `true`,\nnumber of {@link IHttpLlmFunction.parameters} are always 1 and the first\nparameter's type is always {@link ILlmSchema.IObject}. The properties'\nrule is:\n\n- `pathParameters`: Path parameters of {@link IHttpMigrateRoute.parameters}\n- `query`: Query parameter of {@link IHttpMigrateRoute.query}\n- `body`: Body parameter of {@link IHttpMigrateRoute.body}\n\n```typescript\n{\n ...pathParameters,\n query,\n body,\n}\n```\n\nOtherwise, the parameters would be multiple, and the sequence of the\nparameters are following below rules:\n\n```typescript\n[\n ...pathParameters,\n ...(query ? [query] : []),\n ...(body ? [body] : []),\n];\n```",
|
|
99
|
+
$ref: "#/$defs/ILlmSchema.IParameters"
|
|
99
100
|
},
|
|
100
101
|
separated: {
|
|
101
|
-
description: "Collection of separated parameters.\n\nFilled only when {@link IHttpLlmApplication.
|
|
102
|
-
$ref: "#/$defs/IHttpLlmFunction.
|
|
102
|
+
description: "Collection of separated parameters.\n\nFilled only when {@link IHttpLlmApplication.IConfig.separate} is configured.",
|
|
103
|
+
$ref: "#/$defs/IHttpLlmFunction.ISeparated"
|
|
103
104
|
},
|
|
104
105
|
output: {
|
|
105
106
|
description: "Expected return type.\n\nIf the target operation returns nothing (`void`), the `output` would be\n`undefined`.",
|
|
106
107
|
anyOf: [
|
|
107
108
|
{
|
|
108
|
-
$ref: "#/$defs/
|
|
109
|
+
$ref: "#/$defs/ILlmSchema.IBoolean"
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
|
-
$ref: "#/$defs/
|
|
112
|
+
$ref: "#/$defs/ILlmSchema.INumber"
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
$ref: "#/$defs/
|
|
115
|
+
$ref: "#/$defs/ILlmSchema.IInteger"
|
|
115
116
|
},
|
|
116
117
|
{
|
|
117
|
-
$ref: "#/$defs/
|
|
118
|
+
$ref: "#/$defs/ILlmSchema.IString"
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
|
-
$ref: "#/$defs/
|
|
121
|
+
$ref: "#/$defs/ILlmSchema.IArray"
|
|
121
122
|
},
|
|
122
123
|
{
|
|
123
|
-
$ref: "#/$defs/
|
|
124
|
+
$ref: "#/$defs/ILlmSchema.IObject"
|
|
124
125
|
},
|
|
125
126
|
{
|
|
126
|
-
$ref: "#/$defs/
|
|
127
|
+
$ref: "#/$defs/ILlmSchema.IReference"
|
|
127
128
|
},
|
|
128
129
|
{
|
|
129
|
-
$ref: "#/$defs/
|
|
130
|
+
$ref: "#/$defs/ILlmSchema.IAnyOf"
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
|
-
$ref: "#/$defs/
|
|
133
|
+
$ref: "#/$defs/ILlmSchema.IUnknown"
|
|
133
134
|
},
|
|
134
135
|
{
|
|
135
|
-
$ref: "#/$defs/
|
|
136
|
+
$ref: "#/$defs/ILlmSchema.INull"
|
|
136
137
|
}
|
|
137
138
|
]
|
|
138
139
|
},
|
|
139
140
|
description: {
|
|
140
|
-
description: "Description of the function.\n\n`IHttpLlmFunction.description` is composed using the following rules:\n\n1. Starts with the {@link OpenApi.IOperation.summary} paragraph\n2. The next paragraphs are filled with the\n {@link OpenApi.IOperation.description}. If the first\n
|
|
141
|
+
description: "Description of the function.\n\n`IHttpLlmFunction.description` is composed using the following rules:\n\n1. Starts with the {@link OpenApi.IOperation.summary} paragraph\n2. The next paragraphs are filled with the\n {@link OpenApi.IOperation.description}. If the first paragraph of\n {@link OpenApi.IOperation.description} matches the\n {@link OpenApi.IOperation.summary}, it is not duplicated\n3. Parameter descriptions are added with `@param` tags\n4. {@link OpenApi.IOperation.security Security requirements} are added with\n `@security` tags\n5. Tag names are added with `@tag` tags\n6. If {@link OpenApi.IOperation.deprecated}, a `@deprecated` tag is added\n\nFor reference, the `description` is a critical property for teaching the\npurpose of the function to LLMs (Large Language Models). LLMs use this\ndescription to determine which function to call.\n\nAlso, when the LLM converses with users, the `description` explains the\nfunction to the user. Therefore, the `description` property has the highest\npriority and should be carefully considered.",
|
|
141
142
|
type: "string"
|
|
142
143
|
},
|
|
143
144
|
deprecated: {
|
|
@@ -159,13 +160,13 @@ const FUNCTION = {
|
|
|
159
160
|
"parameters"
|
|
160
161
|
]
|
|
161
162
|
},
|
|
162
|
-
"
|
|
163
|
-
description: "Type for function parameters.\n\n`
|
|
163
|
+
"ILlmSchema.IParameters": {
|
|
164
|
+
description: "Type for function parameters.\n\n`ILlmSchema.IParameters` defines a function's parameters as a keyword\nobject type, where each property represents a named parameter.\n\nIt can also be used for structured output metadata to define the expected\nformat of LLM responses.",
|
|
164
165
|
type: "object",
|
|
165
166
|
properties: {
|
|
166
167
|
$defs: {
|
|
167
|
-
description: "Collection of the named types.",
|
|
168
|
-
$ref: "#/$defs/
|
|
168
|
+
description: "Collection of the named types.\n\nThis record would be filled when {@link IConfig.reference} is `true`, or\nrecursive type comes.",
|
|
169
|
+
$ref: "#/$defs/RecordstringILlmSchema"
|
|
169
170
|
},
|
|
170
171
|
additionalProperties: {
|
|
171
172
|
description: "Additional properties information.\n\nThe `additionalProperties` defines the type schema for additional\nproperties that are not listed in the {@link properties}.\n\nBy the way, it is not allowed at the parameters level.",
|
|
@@ -183,7 +184,7 @@ const FUNCTION = {
|
|
|
183
184
|
},
|
|
184
185
|
properties: {
|
|
185
186
|
description: "Properties of the object.\n\nThe `properties` means a list of key-value pairs of the object's regular\nproperties. The key is the name of the regular property, and the value is\nthe type schema info.",
|
|
186
|
-
$ref: "#/$defs/
|
|
187
|
+
$ref: "#/$defs/RecordstringILlmSchema"
|
|
187
188
|
},
|
|
188
189
|
required: {
|
|
189
190
|
description: "List of required property keys.\n\nThe `required` contains a list of property keys from {@link properties}\nthat must be provided. Properties not listed in `required` are optional,\nwhile those listed must be filled.\n\nBelow is an example of {@link properties} and `required`:\n\n```typescript\ninterface SomeObject {\n id: string;\n email: string;\n name?: string;\n}\n```\n\nAs you can see, `id` and `email` {@link properties} are {@link required},\nso they are listed in the `required` array.\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" },\n \"name\": { \"type\": \"string\" }\n },\n \"required\": [\"id\", \"email\"]\n}\n```",
|
|
@@ -210,6 +211,14 @@ const FUNCTION = {
|
|
|
210
211
|
examples: {
|
|
211
212
|
description: "List of example values as key-value pairs.",
|
|
212
213
|
$ref: "#/$defs/Recordstringany"
|
|
214
|
+
},
|
|
215
|
+
readOnly: {
|
|
216
|
+
description: "Whether the property is read-only.",
|
|
217
|
+
type: "boolean"
|
|
218
|
+
},
|
|
219
|
+
writeOnly: {
|
|
220
|
+
description: "Whether the property is write-only.",
|
|
221
|
+
type: "boolean"
|
|
213
222
|
}
|
|
214
223
|
},
|
|
215
224
|
required: [
|
|
@@ -220,51 +229,51 @@ const FUNCTION = {
|
|
|
220
229
|
"required"
|
|
221
230
|
]
|
|
222
231
|
},
|
|
223
|
-
|
|
232
|
+
RecordstringILlmSchema: {
|
|
224
233
|
description: "Construct a type with a set of properties K of type T",
|
|
225
234
|
type: "object",
|
|
226
235
|
properties: {},
|
|
227
236
|
required: [],
|
|
228
237
|
additionalProperties: {
|
|
229
|
-
$ref: "#/$defs/
|
|
238
|
+
$ref: "#/$defs/ILlmSchema"
|
|
230
239
|
}
|
|
231
240
|
},
|
|
232
|
-
|
|
233
|
-
description: "Type schema info for
|
|
241
|
+
ILlmSchema: {
|
|
242
|
+
description: "Type schema info for LLM (Large Language Model) function calling.\n\n## Overview\n\n`ILlmSchema` is a type schema info for LLM function calling, designed to be\ncompatible with multiple LLM providers while following the JSON schema\nspecification.\n\n## Specification\n\n`ILlmSchema` basically follows the JSON schema definition of the OpenAPI v3.1\nspecification; {@link OpenApiV3_1.IJsonSchema}.\n\nHowever, it deviates from the standard JSON schema specification and omits\nmany features to ensure compatibility across different LLM providers and\ntheir function calling requirements.\n\n## Differences from OpenAPI v3.1\n\nHere is the list of how `ILlmSchema` is different with the OpenAPI v3.1 JSON\nschema:\n\n- Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n- Resolve nullable property:\n {@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 ILlmSchema.IAnyOf}\n- Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link ILlmSchema.IObject}\n- Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to\n {@link ILlmSchema.IReference}\n\n## Differences from OpenApi.IJsonSchema\n\nCompared to {@link OpenApi.IJsonSchema}, the emended JSON schema\nspecification:\n\n- {@link ILlmSchema.IAnyOf} instead of {@link OpenApi.IJsonSchema.IOneOf}\n- {@link ILlmSchema.IParameters.$defs} instead of\n {@link OpenApi.IJsonSchema.IComponents.schemas}\n- Do not support {@link OpenApi.IJsonSchema.ITuple} type\n- {@link ILlmSchema.properties} and {@link ILlmSchema.required} are always\n defined\n\n## Strict Mode\n\nWhen {@link ILlmSchema.IConfig.strict} mode is enabled, the schema\ntransformation follows OpenAI's structured output requirements:\n\n- Every {@link ILlmSchema.IObject.additionalProperties} is forced to `false`\n- Every property in {@link ILlmSchema.IObject.properties} becomes\n {@link ILlmSchema.IObject.required}\n- All constraint properties are removed from the schema and moved to\n {@link IJsonSchemaAttribute.description} in a JSDoc-like format:\n\n - Numeric constraints: `minimum`, `maximum`, `exclusiveMinimum`,\n `exclusiveMaximum`, `multipleOf`\n - String constraints: `minLength`, `maxLength`, `pattern`, `format`,\n `contentMediaType`\n - Array constraints: `minItems`, `maxItems`, `uniqueItems`\n - Example: `@minimum 0`, `@maximum 100`, `@format uuid`",
|
|
234
243
|
anyOf: [
|
|
235
244
|
{
|
|
236
|
-
$ref: "#/$defs/
|
|
245
|
+
$ref: "#/$defs/ILlmSchema.IBoolean"
|
|
237
246
|
},
|
|
238
247
|
{
|
|
239
|
-
$ref: "#/$defs/
|
|
248
|
+
$ref: "#/$defs/ILlmSchema.IInteger"
|
|
240
249
|
},
|
|
241
250
|
{
|
|
242
|
-
$ref: "#/$defs/
|
|
251
|
+
$ref: "#/$defs/ILlmSchema.INumber"
|
|
243
252
|
},
|
|
244
253
|
{
|
|
245
|
-
$ref: "#/$defs/
|
|
254
|
+
$ref: "#/$defs/ILlmSchema.IString"
|
|
246
255
|
},
|
|
247
256
|
{
|
|
248
|
-
$ref: "#/$defs/
|
|
257
|
+
$ref: "#/$defs/ILlmSchema.IArray"
|
|
249
258
|
},
|
|
250
259
|
{
|
|
251
|
-
$ref: "#/$defs/
|
|
260
|
+
$ref: "#/$defs/ILlmSchema.IObject"
|
|
252
261
|
},
|
|
253
262
|
{
|
|
254
|
-
$ref: "#/$defs/
|
|
263
|
+
$ref: "#/$defs/ILlmSchema.IReference"
|
|
255
264
|
},
|
|
256
265
|
{
|
|
257
|
-
$ref: "#/$defs/
|
|
266
|
+
$ref: "#/$defs/ILlmSchema.IAnyOf"
|
|
258
267
|
},
|
|
259
268
|
{
|
|
260
|
-
$ref: "#/$defs/
|
|
269
|
+
$ref: "#/$defs/ILlmSchema.INull"
|
|
261
270
|
},
|
|
262
271
|
{
|
|
263
|
-
$ref: "#/$defs/
|
|
272
|
+
$ref: "#/$defs/ILlmSchema.IUnknown"
|
|
264
273
|
}
|
|
265
274
|
]
|
|
266
275
|
},
|
|
267
|
-
"
|
|
276
|
+
"ILlmSchema.IBoolean": {
|
|
268
277
|
description: "Boolean type info.",
|
|
269
278
|
type: "object",
|
|
270
279
|
properties: {
|
|
@@ -275,6 +284,10 @@ const FUNCTION = {
|
|
|
275
284
|
type: "boolean"
|
|
276
285
|
}
|
|
277
286
|
},
|
|
287
|
+
"default": {
|
|
288
|
+
description: "Default value.",
|
|
289
|
+
type: "boolean"
|
|
290
|
+
},
|
|
278
291
|
type: {
|
|
279
292
|
description: "Discriminator value of the type.",
|
|
280
293
|
type: "string",
|
|
@@ -300,6 +313,14 @@ const FUNCTION = {
|
|
|
300
313
|
examples: {
|
|
301
314
|
description: "List of example values as key-value pairs.",
|
|
302
315
|
$ref: "#/$defs/Recordstringany"
|
|
316
|
+
},
|
|
317
|
+
readOnly: {
|
|
318
|
+
description: "Whether the property is read-only.",
|
|
319
|
+
type: "boolean"
|
|
320
|
+
},
|
|
321
|
+
writeOnly: {
|
|
322
|
+
description: "Whether the property is write-only.",
|
|
323
|
+
type: "boolean"
|
|
303
324
|
}
|
|
304
325
|
},
|
|
305
326
|
required: [
|
|
@@ -313,7 +334,7 @@ const FUNCTION = {
|
|
|
313
334
|
required: [],
|
|
314
335
|
additionalProperties: {}
|
|
315
336
|
},
|
|
316
|
-
"
|
|
337
|
+
"ILlmSchema.IInteger": {
|
|
317
338
|
description: "Integer type info.",
|
|
318
339
|
type: "object",
|
|
319
340
|
properties: {
|
|
@@ -324,6 +345,31 @@ const FUNCTION = {
|
|
|
324
345
|
type: "number"
|
|
325
346
|
}
|
|
326
347
|
},
|
|
348
|
+
"default": {
|
|
349
|
+
description: "Default value.",
|
|
350
|
+
type: "integer"
|
|
351
|
+
},
|
|
352
|
+
minimum: {
|
|
353
|
+
description: "Minimum value restriction.",
|
|
354
|
+
type: "integer"
|
|
355
|
+
},
|
|
356
|
+
maximum: {
|
|
357
|
+
description: "Maximum value restriction.",
|
|
358
|
+
type: "integer"
|
|
359
|
+
},
|
|
360
|
+
exclusiveMinimum: {
|
|
361
|
+
description: "Exclusive minimum value restriction.",
|
|
362
|
+
type: "integer"
|
|
363
|
+
},
|
|
364
|
+
exclusiveMaximum: {
|
|
365
|
+
description: "Exclusive maximum value restriction.",
|
|
366
|
+
type: "integer"
|
|
367
|
+
},
|
|
368
|
+
multipleOf: {
|
|
369
|
+
description: "Multiple of value restriction.",
|
|
370
|
+
type: "integer",
|
|
371
|
+
exclusiveMinimum: 0
|
|
372
|
+
},
|
|
327
373
|
type: {
|
|
328
374
|
description: "Discriminator value of the type.",
|
|
329
375
|
type: "string",
|
|
@@ -349,13 +395,21 @@ const FUNCTION = {
|
|
|
349
395
|
examples: {
|
|
350
396
|
description: "List of example values as key-value pairs.",
|
|
351
397
|
$ref: "#/$defs/Recordstringany"
|
|
398
|
+
},
|
|
399
|
+
readOnly: {
|
|
400
|
+
description: "Whether the property is read-only.",
|
|
401
|
+
type: "boolean"
|
|
402
|
+
},
|
|
403
|
+
writeOnly: {
|
|
404
|
+
description: "Whether the property is write-only.",
|
|
405
|
+
type: "boolean"
|
|
352
406
|
}
|
|
353
407
|
},
|
|
354
408
|
required: [
|
|
355
409
|
"type"
|
|
356
410
|
]
|
|
357
411
|
},
|
|
358
|
-
"
|
|
412
|
+
"ILlmSchema.INumber": {
|
|
359
413
|
description: "Number (double) type info.",
|
|
360
414
|
type: "object",
|
|
361
415
|
properties: {
|
|
@@ -366,6 +420,31 @@ const FUNCTION = {
|
|
|
366
420
|
type: "number"
|
|
367
421
|
}
|
|
368
422
|
},
|
|
423
|
+
"default": {
|
|
424
|
+
description: "Default value.",
|
|
425
|
+
type: "number"
|
|
426
|
+
},
|
|
427
|
+
minimum: {
|
|
428
|
+
description: "Minimum value restriction.",
|
|
429
|
+
type: "number"
|
|
430
|
+
},
|
|
431
|
+
maximum: {
|
|
432
|
+
description: "Maximum value restriction.",
|
|
433
|
+
type: "number"
|
|
434
|
+
},
|
|
435
|
+
exclusiveMinimum: {
|
|
436
|
+
description: "Exclusive minimum value restriction.",
|
|
437
|
+
type: "number"
|
|
438
|
+
},
|
|
439
|
+
exclusiveMaximum: {
|
|
440
|
+
description: "Exclusive maximum value restriction.",
|
|
441
|
+
type: "number"
|
|
442
|
+
},
|
|
443
|
+
multipleOf: {
|
|
444
|
+
description: "Multiple of value restriction.",
|
|
445
|
+
type: "number",
|
|
446
|
+
exclusiveMinimum: 0
|
|
447
|
+
},
|
|
369
448
|
type: {
|
|
370
449
|
description: "Discriminator value of the type.",
|
|
371
450
|
type: "string",
|
|
@@ -391,13 +470,21 @@ const FUNCTION = {
|
|
|
391
470
|
examples: {
|
|
392
471
|
description: "List of example values as key-value pairs.",
|
|
393
472
|
$ref: "#/$defs/Recordstringany"
|
|
473
|
+
},
|
|
474
|
+
readOnly: {
|
|
475
|
+
description: "Whether the property is read-only.",
|
|
476
|
+
type: "boolean"
|
|
477
|
+
},
|
|
478
|
+
writeOnly: {
|
|
479
|
+
description: "Whether the property is write-only.",
|
|
480
|
+
type: "boolean"
|
|
394
481
|
}
|
|
395
482
|
},
|
|
396
483
|
required: [
|
|
397
484
|
"type"
|
|
398
485
|
]
|
|
399
486
|
},
|
|
400
|
-
"
|
|
487
|
+
"ILlmSchema.IString": {
|
|
401
488
|
description: "String type info.",
|
|
402
489
|
type: "object",
|
|
403
490
|
properties: {
|
|
@@ -412,6 +499,28 @@ const FUNCTION = {
|
|
|
412
499
|
description: "Default value.",
|
|
413
500
|
type: "string"
|
|
414
501
|
},
|
|
502
|
+
format: {
|
|
503
|
+
description: "Format restriction.",
|
|
504
|
+
type: "string"
|
|
505
|
+
},
|
|
506
|
+
pattern: {
|
|
507
|
+
description: "Pattern restriction.",
|
|
508
|
+
type: "string"
|
|
509
|
+
},
|
|
510
|
+
contentMediaType: {
|
|
511
|
+
description: "Content media type restriction.",
|
|
512
|
+
type: "string"
|
|
513
|
+
},
|
|
514
|
+
minLength: {
|
|
515
|
+
description: "Minimum length restriction.",
|
|
516
|
+
type: "integer",
|
|
517
|
+
minimum: 0
|
|
518
|
+
},
|
|
519
|
+
maxLength: {
|
|
520
|
+
description: "Maximum length restriction.",
|
|
521
|
+
type: "integer",
|
|
522
|
+
minimum: 0
|
|
523
|
+
},
|
|
415
524
|
type: {
|
|
416
525
|
description: "Discriminator value of the type.",
|
|
417
526
|
type: "string",
|
|
@@ -437,19 +546,41 @@ const FUNCTION = {
|
|
|
437
546
|
examples: {
|
|
438
547
|
description: "List of example values as key-value pairs.",
|
|
439
548
|
$ref: "#/$defs/Recordstringany"
|
|
549
|
+
},
|
|
550
|
+
readOnly: {
|
|
551
|
+
description: "Whether the property is read-only.",
|
|
552
|
+
type: "boolean"
|
|
553
|
+
},
|
|
554
|
+
writeOnly: {
|
|
555
|
+
description: "Whether the property is write-only.",
|
|
556
|
+
type: "boolean"
|
|
440
557
|
}
|
|
441
558
|
},
|
|
442
559
|
required: [
|
|
443
560
|
"type"
|
|
444
561
|
]
|
|
445
562
|
},
|
|
446
|
-
"
|
|
563
|
+
"ILlmSchema.IArray": {
|
|
447
564
|
description: "Array type info.",
|
|
448
565
|
type: "object",
|
|
449
566
|
properties: {
|
|
450
567
|
items: {
|
|
451
568
|
description: "Items type info.\n\nThe `items` means the type of the array elements. In other words, it is\nthe type schema info of the `T` in the TypeScript array type `Array<T>`.",
|
|
452
|
-
$ref: "#/$defs/
|
|
569
|
+
$ref: "#/$defs/ILlmSchema"
|
|
570
|
+
},
|
|
571
|
+
uniqueItems: {
|
|
572
|
+
description: "Unique items restriction.\n\nIf this property value is `true`, target array must have unique items.",
|
|
573
|
+
type: "boolean"
|
|
574
|
+
},
|
|
575
|
+
minItems: {
|
|
576
|
+
description: "Minimum items restriction.\n\nRestriction of minimum number of items in the array.",
|
|
577
|
+
type: "integer",
|
|
578
|
+
minimum: 0
|
|
579
|
+
},
|
|
580
|
+
maxItems: {
|
|
581
|
+
description: "Maximum items restriction.\n\nRestriction of maximum number of items in the array.",
|
|
582
|
+
type: "integer",
|
|
583
|
+
minimum: 0
|
|
453
584
|
},
|
|
454
585
|
type: {
|
|
455
586
|
description: "Discriminator value of the type.",
|
|
@@ -476,6 +607,14 @@ const FUNCTION = {
|
|
|
476
607
|
examples: {
|
|
477
608
|
description: "List of example values as key-value pairs.",
|
|
478
609
|
$ref: "#/$defs/Recordstringany"
|
|
610
|
+
},
|
|
611
|
+
readOnly: {
|
|
612
|
+
description: "Whether the property is read-only.",
|
|
613
|
+
type: "boolean"
|
|
614
|
+
},
|
|
615
|
+
writeOnly: {
|
|
616
|
+
description: "Whether the property is write-only.",
|
|
617
|
+
type: "boolean"
|
|
479
618
|
}
|
|
480
619
|
},
|
|
481
620
|
required: [
|
|
@@ -483,49 +622,49 @@ const FUNCTION = {
|
|
|
483
622
|
"type"
|
|
484
623
|
]
|
|
485
624
|
},
|
|
486
|
-
"
|
|
625
|
+
"ILlmSchema.IObject": {
|
|
487
626
|
description: "Object type info.",
|
|
488
627
|
type: "object",
|
|
489
628
|
properties: {
|
|
490
629
|
properties: {
|
|
491
630
|
description: "Properties of the object.\n\nThe `properties` means a list of key-value pairs of the object's regular\nproperties. The key is the name of the regular property, and the value is\nthe type schema info.",
|
|
492
|
-
$ref: "#/$defs/
|
|
631
|
+
$ref: "#/$defs/RecordstringILlmSchema"
|
|
493
632
|
},
|
|
494
633
|
additionalProperties: {
|
|
495
|
-
description: "Additional properties
|
|
634
|
+
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\nIf the value is `true`, it means that the additional properties are not\nrestricted. They can be any type. Otherwise, if the value is\n{@link ILlmSchema} type, it means that the additional properties must\nfollow the type schema info.\n\n- `true`: `Record<string, any>`\n- `ILlmSchema`: `Record<string, T>`\n\nNote: When {@link IConfig.strict} mode is enabled, this property is always\nfixed to `false`, meaning no additional properties are allowed.",
|
|
496
635
|
anyOf: [
|
|
497
636
|
{
|
|
498
637
|
type: "boolean"
|
|
499
638
|
},
|
|
500
639
|
{
|
|
501
|
-
$ref: "#/$defs/
|
|
640
|
+
$ref: "#/$defs/ILlmSchema.IBoolean"
|
|
502
641
|
},
|
|
503
642
|
{
|
|
504
|
-
$ref: "#/$defs/
|
|
643
|
+
$ref: "#/$defs/ILlmSchema.INumber"
|
|
505
644
|
},
|
|
506
645
|
{
|
|
507
|
-
$ref: "#/$defs/
|
|
646
|
+
$ref: "#/$defs/ILlmSchema.IInteger"
|
|
508
647
|
},
|
|
509
648
|
{
|
|
510
|
-
$ref: "#/$defs/
|
|
649
|
+
$ref: "#/$defs/ILlmSchema.IString"
|
|
511
650
|
},
|
|
512
651
|
{
|
|
513
|
-
$ref: "#/$defs/
|
|
652
|
+
$ref: "#/$defs/ILlmSchema.IArray"
|
|
514
653
|
},
|
|
515
654
|
{
|
|
516
|
-
$ref: "#/$defs/
|
|
655
|
+
$ref: "#/$defs/ILlmSchema.IObject"
|
|
517
656
|
},
|
|
518
657
|
{
|
|
519
|
-
$ref: "#/$defs/
|
|
658
|
+
$ref: "#/$defs/ILlmSchema.IReference"
|
|
520
659
|
},
|
|
521
660
|
{
|
|
522
|
-
$ref: "#/$defs/
|
|
661
|
+
$ref: "#/$defs/ILlmSchema.IAnyOf"
|
|
523
662
|
},
|
|
524
663
|
{
|
|
525
|
-
$ref: "#/$defs/
|
|
664
|
+
$ref: "#/$defs/ILlmSchema.IUnknown"
|
|
526
665
|
},
|
|
527
666
|
{
|
|
528
|
-
$ref: "#/$defs/
|
|
667
|
+
$ref: "#/$defs/ILlmSchema.INull"
|
|
529
668
|
}
|
|
530
669
|
]
|
|
531
670
|
},
|
|
@@ -561,6 +700,14 @@ const FUNCTION = {
|
|
|
561
700
|
examples: {
|
|
562
701
|
description: "List of example values as key-value pairs.",
|
|
563
702
|
$ref: "#/$defs/Recordstringany"
|
|
703
|
+
},
|
|
704
|
+
readOnly: {
|
|
705
|
+
description: "Whether the property is read-only.",
|
|
706
|
+
type: "boolean"
|
|
707
|
+
},
|
|
708
|
+
writeOnly: {
|
|
709
|
+
description: "Whether the property is write-only.",
|
|
710
|
+
type: "boolean"
|
|
564
711
|
}
|
|
565
712
|
},
|
|
566
713
|
required: [
|
|
@@ -569,12 +716,12 @@ const FUNCTION = {
|
|
|
569
716
|
"type"
|
|
570
717
|
]
|
|
571
718
|
},
|
|
572
|
-
"
|
|
573
|
-
description: "Reference type directing to named schema.",
|
|
719
|
+
"ILlmSchema.IReference": {
|
|
720
|
+
description: "Reference type directing to named schema.\n\nIf {@link IConfig.strict} mode is enabled, its other properties like\n{@link description} would be disabled. Instead, the description would be\nplaced in the parent type. For example, if this reference type is used as a\nproperty of an object, the description would be placed in the object\nplace.",
|
|
574
721
|
type: "object",
|
|
575
722
|
properties: {
|
|
576
723
|
$ref: {
|
|
577
|
-
description: "Reference to the named schema.\n\nThe `$ref` is a reference to a named schema. The format follows the JSON\nPointer specification. In OpenAPI, the `$ref` starts with `#/$defs/`\nwhich indicates the type is stored in the\n{@link
|
|
724
|
+
description: "Reference to the named schema.\n\nThe `$ref` is a reference to a named schema. The format follows the JSON\nPointer specification. In OpenAPI, the `$ref` starts with `#/$defs/`\nwhich indicates the type is stored in the\n{@link ILlmSchema.IParameters.$defs} object.\n\n- `#/$defs/SomeObject`\n- `#/$defs/AnotherObject`",
|
|
578
725
|
type: "string"
|
|
579
726
|
},
|
|
580
727
|
title: {
|
|
@@ -595,14 +742,22 @@ const FUNCTION = {
|
|
|
595
742
|
examples: {
|
|
596
743
|
description: "List of example values as key-value pairs.",
|
|
597
744
|
$ref: "#/$defs/Recordstringany"
|
|
745
|
+
},
|
|
746
|
+
readOnly: {
|
|
747
|
+
description: "Whether the property is read-only.",
|
|
748
|
+
type: "boolean"
|
|
749
|
+
},
|
|
750
|
+
writeOnly: {
|
|
751
|
+
description: "Whether the property is write-only.",
|
|
752
|
+
type: "boolean"
|
|
598
753
|
}
|
|
599
754
|
},
|
|
600
755
|
required: [
|
|
601
756
|
"$ref"
|
|
602
757
|
]
|
|
603
758
|
},
|
|
604
|
-
"
|
|
605
|
-
description: "Union type.\n\n`IAnyOf` represents a union type in TypeScript (`A | B | C`).\n\nFor reference, even if your Swagger (or OpenAPI) document defines `
|
|
759
|
+
"ILlmSchema.IAnyOf": {
|
|
760
|
+
description: "Union type.\n\n`IAnyOf` represents a union type in TypeScript (`A | B | C`).\n\nFor reference, even if your Swagger (or OpenAPI) document defines `oneOf`\ninstead of `anyOf`, {@link ILlmSchema} forcibly converts it to the\n`anyOf`-based {@link ILlmSchema.IAnyOf} type.",
|
|
606
761
|
type: "object",
|
|
607
762
|
properties: {
|
|
608
763
|
anyOf: {
|
|
@@ -611,38 +766,38 @@ const FUNCTION = {
|
|
|
611
766
|
items: {
|
|
612
767
|
anyOf: [
|
|
613
768
|
{
|
|
614
|
-
$ref: "#/$defs/
|
|
769
|
+
$ref: "#/$defs/ILlmSchema.IBoolean"
|
|
615
770
|
},
|
|
616
771
|
{
|
|
617
|
-
$ref: "#/$defs/
|
|
772
|
+
$ref: "#/$defs/ILlmSchema.INumber"
|
|
618
773
|
},
|
|
619
774
|
{
|
|
620
|
-
$ref: "#/$defs/
|
|
775
|
+
$ref: "#/$defs/ILlmSchema.IInteger"
|
|
621
776
|
},
|
|
622
777
|
{
|
|
623
|
-
$ref: "#/$defs/
|
|
778
|
+
$ref: "#/$defs/ILlmSchema.IString"
|
|
624
779
|
},
|
|
625
780
|
{
|
|
626
|
-
$ref: "#/$defs/
|
|
781
|
+
$ref: "#/$defs/ILlmSchema.IArray"
|
|
627
782
|
},
|
|
628
783
|
{
|
|
629
|
-
$ref: "#/$defs/
|
|
784
|
+
$ref: "#/$defs/ILlmSchema.IObject"
|
|
630
785
|
},
|
|
631
786
|
{
|
|
632
|
-
$ref: "#/$defs/
|
|
787
|
+
$ref: "#/$defs/ILlmSchema.IReference"
|
|
633
788
|
},
|
|
634
789
|
{
|
|
635
|
-
$ref: "#/$defs/
|
|
790
|
+
$ref: "#/$defs/ILlmSchema.IUnknown"
|
|
636
791
|
},
|
|
637
792
|
{
|
|
638
|
-
$ref: "#/$defs/
|
|
793
|
+
$ref: "#/$defs/ILlmSchema.INull"
|
|
639
794
|
}
|
|
640
795
|
]
|
|
641
796
|
}
|
|
642
797
|
},
|
|
643
798
|
"x-discriminator": {
|
|
644
|
-
description: "Discriminator info of the union type.",
|
|
645
|
-
$ref: "#/$defs/
|
|
799
|
+
description: "Discriminator info of the union type.\n\nThis discriminator is used to determine which type in the union should be\nused based on the value of a specific property.",
|
|
800
|
+
$ref: "#/$defs/ILlmSchema.IAnyOf.IDiscriminator"
|
|
646
801
|
},
|
|
647
802
|
title: {
|
|
648
803
|
description: "Title of the schema.",
|
|
@@ -662,13 +817,21 @@ const FUNCTION = {
|
|
|
662
817
|
examples: {
|
|
663
818
|
description: "List of example values as key-value pairs.",
|
|
664
819
|
$ref: "#/$defs/Recordstringany"
|
|
820
|
+
},
|
|
821
|
+
readOnly: {
|
|
822
|
+
description: "Whether the property is read-only.",
|
|
823
|
+
type: "boolean"
|
|
824
|
+
},
|
|
825
|
+
writeOnly: {
|
|
826
|
+
description: "Whether the property is write-only.",
|
|
827
|
+
type: "boolean"
|
|
665
828
|
}
|
|
666
829
|
},
|
|
667
830
|
required: [
|
|
668
831
|
"anyOf"
|
|
669
832
|
]
|
|
670
833
|
},
|
|
671
|
-
"
|
|
834
|
+
"ILlmSchema.IUnknown": {
|
|
672
835
|
description: "Unknown, the `any` type.",
|
|
673
836
|
type: "object",
|
|
674
837
|
properties: {
|
|
@@ -690,11 +853,19 @@ const FUNCTION = {
|
|
|
690
853
|
examples: {
|
|
691
854
|
description: "List of example values as key-value pairs.",
|
|
692
855
|
$ref: "#/$defs/Recordstringany"
|
|
856
|
+
},
|
|
857
|
+
readOnly: {
|
|
858
|
+
description: "Whether the property is read-only.",
|
|
859
|
+
type: "boolean"
|
|
860
|
+
},
|
|
861
|
+
writeOnly: {
|
|
862
|
+
description: "Whether the property is write-only.",
|
|
863
|
+
type: "boolean"
|
|
693
864
|
}
|
|
694
865
|
},
|
|
695
866
|
required: []
|
|
696
867
|
},
|
|
697
|
-
"
|
|
868
|
+
"ILlmSchema.INull": {
|
|
698
869
|
description: "Null type.",
|
|
699
870
|
type: "object",
|
|
700
871
|
properties: {
|
|
@@ -723,13 +894,21 @@ const FUNCTION = {
|
|
|
723
894
|
examples: {
|
|
724
895
|
description: "List of example values as key-value pairs.",
|
|
725
896
|
$ref: "#/$defs/Recordstringany"
|
|
897
|
+
},
|
|
898
|
+
readOnly: {
|
|
899
|
+
description: "Whether the property is read-only.",
|
|
900
|
+
type: "boolean"
|
|
901
|
+
},
|
|
902
|
+
writeOnly: {
|
|
903
|
+
description: "Whether the property is write-only.",
|
|
904
|
+
type: "boolean"
|
|
726
905
|
}
|
|
727
906
|
},
|
|
728
907
|
required: [
|
|
729
908
|
"type"
|
|
730
909
|
]
|
|
731
910
|
},
|
|
732
|
-
"
|
|
911
|
+
"ILlmSchema.IAnyOf.IDiscriminator": {
|
|
733
912
|
description: "Discriminator info of the union type.",
|
|
734
913
|
type: "object",
|
|
735
914
|
properties: {
|
|
@@ -755,13 +934,13 @@ const FUNCTION = {
|
|
|
755
934
|
type: "string"
|
|
756
935
|
}
|
|
757
936
|
},
|
|
758
|
-
"IHttpLlmFunction.
|
|
937
|
+
"IHttpLlmFunction.ISeparated": {
|
|
759
938
|
description: "Collection of separated parameters.",
|
|
760
939
|
type: "object",
|
|
761
940
|
properties: {
|
|
762
941
|
llm: {
|
|
763
942
|
description: "Parameters that would be composed by the LLM.\n\nEven though no property exists in the LLM side, the `llm` property would\nhave at least empty object type.",
|
|
764
|
-
$ref: "#/$defs/
|
|
943
|
+
$ref: "#/$defs/ILlmSchema.IParameters"
|
|
765
944
|
},
|
|
766
945
|
human: {
|
|
767
946
|
description: "Parameters that would be composed by the human.",
|
|
@@ -770,7 +949,7 @@ const FUNCTION = {
|
|
|
770
949
|
type: "null"
|
|
771
950
|
},
|
|
772
951
|
{
|
|
773
|
-
$ref: "#/$defs/
|
|
952
|
+
$ref: "#/$defs/ILlmSchema.IParameters"
|
|
774
953
|
}
|
|
775
954
|
]
|
|
776
955
|
}
|
|
@@ -785,7 +964,7 @@ const FUNCTION = {
|
|
|
785
964
|
output: {
|
|
786
965
|
type: "array",
|
|
787
966
|
items: {
|
|
788
|
-
$ref: "#/$defs/
|
|
967
|
+
$ref: "#/$defs/IHttpLlmFunction"
|
|
789
968
|
}
|
|
790
969
|
},
|
|
791
970
|
description: "Get list of API functions.\n\nIf user seems like to request some function calling except this one,\ncall this `getApiFunctions()` to get the list of candidate API functions\nprovided from this application.\n\nAlso, user just wants to list up every remote API functions that can be\ncalled from the backend server, utilize this function too.",
|