@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.
Files changed (145) hide show
  1. package/lib/Agentica.d.ts +9 -10
  2. package/lib/Agentica.js.map +1 -1
  3. package/lib/MicroAgentica.d.ts +9 -10
  4. package/lib/MicroAgentica.js.map +1 -1
  5. package/lib/constants/AgenticaDefaultPrompt.d.ts +1 -2
  6. package/lib/constants/AgenticaDefaultPrompt.js.map +1 -1
  7. package/lib/context/AgenticaContext.d.ts +6 -7
  8. package/lib/context/AgenticaOperation.d.ts +5 -5
  9. package/lib/context/AgenticaOperationCollection.d.ts +5 -6
  10. package/lib/context/AgenticaOperationSelection.d.ts +2 -3
  11. package/lib/context/MicroAgenticaContext.d.ts +5 -6
  12. package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
  13. package/lib/context/internal/AgenticaOperationComposer.spec.js +41 -9
  14. package/lib/context/internal/AgenticaOperationComposer.spec.js.map +1 -1
  15. package/lib/context/internal/__IChatInitialApplication.d.ts +1 -1
  16. package/lib/context/internal/isAgenticaContext.js.map +1 -1
  17. package/lib/events/AgenticaCallEvent.d.ts +2 -3
  18. package/lib/events/AgenticaCancelEvent.d.ts +2 -3
  19. package/lib/events/AgenticaDescribeEvent.d.ts +3 -4
  20. package/lib/events/AgenticaEvent.d.ts +10 -11
  21. package/lib/events/AgenticaExecuteEvent.d.ts +5 -5
  22. package/lib/events/AgenticaJsonParseErrorEvent.d.ts +2 -3
  23. package/lib/events/AgenticaSelectEvent.d.ts +3 -4
  24. package/lib/events/AgenticaValidateEvent.d.ts +2 -3
  25. package/lib/events/MicroAgenticaEvent.d.ts +8 -9
  26. package/lib/factory/events.d.ts +22 -22
  27. package/lib/factory/events.js.map +1 -1
  28. package/lib/factory/histories.js.map +1 -1
  29. package/lib/factory/operations.d.ts +3 -4
  30. package/lib/factory/operations.js.map +1 -1
  31. package/lib/functional/assertHttpController.d.ts +6 -10
  32. package/lib/functional/assertHttpController.js +775 -91
  33. package/lib/functional/assertHttpController.js.map +1 -1
  34. package/lib/functional/assertHttpLlmApplication.d.ts +4 -8
  35. package/lib/functional/assertHttpLlmApplication.js +775 -91
  36. package/lib/functional/assertHttpLlmApplication.js.map +1 -1
  37. package/lib/functional/assertMcpController.d.ts +5 -6
  38. package/lib/functional/assertMcpController.js +201 -32
  39. package/lib/functional/assertMcpController.js.map +1 -1
  40. package/lib/functional/validateHttpController.d.ts +6 -10
  41. package/lib/functional/validateHttpController.js +636 -89
  42. package/lib/functional/validateHttpController.js.map +1 -1
  43. package/lib/functional/validateHttpLlmApplication.d.ts +4 -8
  44. package/lib/functional/validateHttpLlmApplication.js +636 -89
  45. package/lib/functional/validateHttpLlmApplication.js.map +1 -1
  46. package/lib/functional/validateMcpController.d.ts +5 -6
  47. package/lib/functional/validateMcpController.js +366 -61
  48. package/lib/functional/validateMcpController.js.map +1 -1
  49. package/lib/histories/AgenticaCancelHistory.d.ts +2 -3
  50. package/lib/histories/AgenticaDescribeHistory.d.ts +2 -3
  51. package/lib/histories/AgenticaExecuteHistory.d.ts +5 -5
  52. package/lib/histories/AgenticaHistory.d.ts +7 -8
  53. package/lib/histories/AgenticaSelectHistory.d.ts +2 -3
  54. package/lib/histories/MicroAgenticaHistory.d.ts +5 -6
  55. package/lib/index.mjs +3964 -849
  56. package/lib/index.mjs.map +1 -1
  57. package/lib/orchestrate/call.d.ts +1 -2
  58. package/lib/orchestrate/call.js.map +1 -1
  59. package/lib/orchestrate/cancel.d.ts +1 -2
  60. package/lib/orchestrate/cancel.js +4 -4
  61. package/lib/orchestrate/cancel.js.map +1 -1
  62. package/lib/orchestrate/describe.d.ts +1 -2
  63. package/lib/orchestrate/describe.js.map +1 -1
  64. package/lib/orchestrate/execute.d.ts +1 -2
  65. package/lib/orchestrate/execute.js.map +1 -1
  66. package/lib/orchestrate/initialize.d.ts +1 -2
  67. package/lib/orchestrate/initialize.js +262 -83
  68. package/lib/orchestrate/initialize.js.map +1 -1
  69. package/lib/orchestrate/internal/cancelFunctionFromContext.js.map +1 -1
  70. package/lib/orchestrate/internal/selectFunctionFromContext.js.map +1 -1
  71. package/lib/orchestrate/select.d.ts +1 -2
  72. package/lib/orchestrate/select.js +4 -4
  73. package/lib/orchestrate/select.js.map +1 -1
  74. package/lib/structures/IAgenticaConfig.d.ts +3 -4
  75. package/lib/structures/IAgenticaController.d.ts +11 -14
  76. package/lib/structures/IAgenticaExecutor.d.ts +6 -7
  77. package/lib/structures/IAgenticaProps.d.ts +3 -8
  78. package/lib/structures/IAgenticaSystemPrompt.d.ts +9 -10
  79. package/lib/structures/IMicroAgenticaConfig.d.ts +3 -4
  80. package/lib/structures/IMicroAgenticaExecutor.d.ts +3 -4
  81. package/lib/structures/IMicroAgenticaProps.d.ts +3 -8
  82. package/lib/structures/IMicroAgenticaSystemPrompt.d.ts +6 -7
  83. package/lib/transformers/transformHistory.js.map +1 -1
  84. package/lib/utils/ChatGptCompletionStreamingUtil.spec.js +2 -2
  85. package/lib/utils/ChatGptCompletionStreamingUtil.spec.js.map +1 -1
  86. package/lib/utils/request.d.ts +2 -3
  87. package/lib/utils/request.js.map +1 -1
  88. package/package.json +8 -8
  89. package/src/Agentica.ts +24 -26
  90. package/src/MicroAgentica.ts +27 -29
  91. package/src/constants/AgenticaDefaultPrompt.ts +2 -4
  92. package/src/context/AgenticaContext.ts +6 -7
  93. package/src/context/AgenticaOperation.ts +14 -14
  94. package/src/context/AgenticaOperationCollection.ts +5 -8
  95. package/src/context/AgenticaOperationSelection.ts +2 -4
  96. package/src/context/MicroAgenticaContext.ts +5 -6
  97. package/src/context/internal/AgenticaOperationComposer.spec.ts +50 -18
  98. package/src/context/internal/AgenticaOperationComposer.ts +21 -23
  99. package/src/context/internal/__IChatInitialApplication.ts +1 -1
  100. package/src/context/internal/isAgenticaContext.ts +4 -6
  101. package/src/events/AgenticaCallEvent.ts +2 -5
  102. package/src/events/AgenticaCancelEvent.ts +2 -6
  103. package/src/events/AgenticaDescribeEvent.ts +3 -7
  104. package/src/events/AgenticaEvent.ts +17 -19
  105. package/src/events/AgenticaEvent.type.ts +1 -1
  106. package/src/events/AgenticaExecuteEvent.ts +12 -12
  107. package/src/events/AgenticaJsonParseErrorEvent.ts +2 -4
  108. package/src/events/AgenticaSelectEvent.ts +3 -7
  109. package/src/events/AgenticaValidateEvent.ts +2 -5
  110. package/src/events/MicroAgenticaEvent.ts +13 -15
  111. package/src/factory/events.ts +24 -24
  112. package/src/factory/histories.ts +15 -17
  113. package/src/factory/operations.ts +3 -5
  114. package/src/functional/assertHttpController.ts +7 -15
  115. package/src/functional/assertHttpLlmApplication.ts +4 -13
  116. package/src/functional/assertMcpController.ts +6 -8
  117. package/src/functional/validateHttpController.ts +7 -15
  118. package/src/functional/validateHttpLlmApplication.ts +4 -13
  119. package/src/functional/validateMcpController.ts +6 -11
  120. package/src/histories/AgenticaCancelHistory.ts +2 -6
  121. package/src/histories/AgenticaDescribeHistory.ts +2 -6
  122. package/src/histories/AgenticaExecuteHistory.ts +7 -9
  123. package/src/histories/AgenticaHistory.ts +11 -13
  124. package/src/histories/AgenticaSelectHistory.ts +2 -6
  125. package/src/histories/MicroAgenticaHistory.ts +7 -9
  126. package/src/orchestrate/call.ts +55 -56
  127. package/src/orchestrate/cancel.ts +11 -12
  128. package/src/orchestrate/describe.ts +4 -5
  129. package/src/orchestrate/execute.ts +3 -5
  130. package/src/orchestrate/initialize.ts +4 -5
  131. package/src/orchestrate/internal/cancelFunctionFromContext.ts +4 -6
  132. package/src/orchestrate/internal/selectFunctionFromContext.ts +5 -9
  133. package/src/orchestrate/select.ts +11 -12
  134. package/src/structures/IAgenticaConfig.ts +4 -6
  135. package/src/structures/IAgenticaController.ts +11 -14
  136. package/src/structures/IAgenticaExecutor.ts +9 -11
  137. package/src/structures/IAgenticaProps.ts +3 -10
  138. package/src/structures/IAgenticaSystemPrompt.ts +9 -11
  139. package/src/structures/IMicroAgenticaConfig.ts +3 -5
  140. package/src/structures/IMicroAgenticaExecutor.ts +4 -6
  141. package/src/structures/IMicroAgenticaProps.ts +3 -10
  142. package/src/structures/IMicroAgenticaSystemPrompt.ts +6 -8
  143. package/src/transformers/transformHistory.ts +19 -21
  144. package/src/utils/ChatGptCompletionStreamingUtil.spec.ts +4 -5
  145. 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
- model: "chatgpt",
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
- IHttpLlmFunctionchatgpt: {
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 ILlmSchemaV3} to\nescape {@link OpenApi.IJsonSchema.IReference reference types}, and downgrade\nthe version of the JSON schema to OpenAPI 3.0. It's because LLM function call\nfeature cannot understand both reference types and OpenAPI 3.1\nspecification.\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```",
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> - 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`\n\n\n@maxLength 64",
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.IOptions.keyword} as `true`,\nnumber of {@link IHttpLlmFunction.parameters} are always 1 and the first\nparameter's type is always {@link ILlmSchemaV3.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```",
98
- $ref: "#/$defs/IChatGptSchema.IParameters"
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.IOptions.separate} is\nconfigured.",
102
- $ref: "#/$defs/IHttpLlmFunction.ISeparatedchatgpt"
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/IChatGptSchema.INumber"
109
+ $ref: "#/$defs/ILlmSchema.IBoolean"
109
110
  },
110
111
  {
111
- $ref: "#/$defs/IChatGptSchema.IInteger"
112
+ $ref: "#/$defs/ILlmSchema.INumber"
112
113
  },
113
114
  {
114
- $ref: "#/$defs/IChatGptSchema.IBoolean"
115
+ $ref: "#/$defs/ILlmSchema.IInteger"
115
116
  },
116
117
  {
117
- $ref: "#/$defs/IChatGptSchema.IString"
118
+ $ref: "#/$defs/ILlmSchema.IString"
118
119
  },
119
120
  {
120
- $ref: "#/$defs/IChatGptSchema.IArray"
121
+ $ref: "#/$defs/ILlmSchema.IArray"
121
122
  },
122
123
  {
123
- $ref: "#/$defs/IChatGptSchema.IObject"
124
+ $ref: "#/$defs/ILlmSchema.IObject"
124
125
  },
125
126
  {
126
- $ref: "#/$defs/IChatGptSchema.IReference"
127
+ $ref: "#/$defs/ILlmSchema.IReference"
127
128
  },
128
129
  {
129
- $ref: "#/$defs/IChatGptSchema.IAnyOf"
130
+ $ref: "#/$defs/ILlmSchema.IAnyOf"
130
131
  },
131
132
  {
132
- $ref: "#/$defs/IChatGptSchema.IUnknown"
133
+ $ref: "#/$defs/ILlmSchema.IUnknown"
133
134
  },
134
135
  {
135
- $ref: "#/$defs/IChatGptSchema.INull"
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 paragraph of {@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\nhighest priority and should be carefully considered.",
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
- "IChatGptSchema.IParameters": {
163
- description: "Type for function parameters.\n\n`IChatGptSchema.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 ChatGPT responses.",
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/RecordstringIChatGptSchema"
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/RecordstringIChatGptSchema"
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
- RecordstringIChatGptSchema: {
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/IChatGptSchema"
238
+ $ref: "#/$defs/ILlmSchema"
230
239
  }
231
240
  },
232
- IChatGptSchema: {
233
- description: "Type schema info for OpenAI function calling.\n\n`IChatGptSchema` is a type schema info for OpenAI function calling. The type\nname \"ChatGpt\" is intentionally used to avoid confusion with \"OpenAPI\"\nspecification, even though this is designed for OpenAI models.\n\n`IChatGptSchema` basically follows the JSON schema definition of the OpenAPI\nv3.1 specification; {@link OpenApiV3_1.IJsonSchema}. However, it deviates from\nthe standard JSON schema specification and omits many features when used in\n{@link IChatGptSchema.IConfig.strict} mode for OpenAI function calling.\n\n`IChatGptSchema` supports all JSON schema features through workaround\nexpressions using JSDoc tags in the `description` property, so using\n`IChatGptSchema` does not degrade function calling performance even in strict\nmode.\n\nHere is the list of how `IChatGptSchema` is different with the OpenAPI v3.1\nJSON schema:\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 IChatGptSchema.IAnyOf}\n- Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IChatGptSchema.IObject}\n- Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to\n {@link IChatGptSchema.IReference}\n- When {@link IChatGptSchema.IConfig.strict} mode:\n\n - Every object properties must be required\n - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n\nCompared to {@link OpenApi.IJsonSchema}, the emended JSON schema\nspecification:\n\n- {@link IChatGptSchema.IAnyOf} instead of {@link OpenApi.IJsonSchema.IOneOf}\n- {@link IChatGptSchema.IParameters.$defs} instead of\n {@link OpenApi.IComponents.schemas}\n- {@link IChatGptSchema.IString.enum} instead of\n {@link OpenApi.IJsonSchema.IConstant}\n- {@link IChatGptSchema.additionalProperties} is fixed to `false` in strict mode\n- {@link IChatGptSchema.properties} and {@link IChatGptSchema.required} are\n always defined\n- No tuple type {@link OpenApi.IJsonSchema.ITuple} support\n- When {@link IChatGptSchema.IConfig.strict} mode:\n\n - Every object properties must be required\n - Do not allow {@link IChatGptSchema.IObject.additionalProperties}\n\nFor reference, if you compose the `IChatGptSchema` type with the\n{@link IChatGptSchema.IConfig.reference} `false` option (default is `false`),\nonly recursively named types are archived into the\n{@link IChatGptSchema.IParameters.$defs}, and others are escaped from the\n{@link IChatGptSchema.IReference} type.\n\nAlso, OpenAI has banned the following constraint properties. Instead,\n`IChatGptSchema` fills the {@link IChatGptSchema.description} property with\nworkaround expressions using JSDoc tags like `\"@format uuid\"` to convey these\nconstraints:\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 {@link IChatGptSchema.description}\nproperty for the {@link IChatGptSchema.IReference} type, and does not\nunderstand encapsulation of the {@link IChatGptSchema.IAnyOf} type. Therefore,\nthe {@link IChatGptSchema.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```",
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/IChatGptSchema.IBoolean"
245
+ $ref: "#/$defs/ILlmSchema.IBoolean"
237
246
  },
238
247
  {
239
- $ref: "#/$defs/IChatGptSchema.IInteger"
248
+ $ref: "#/$defs/ILlmSchema.IInteger"
240
249
  },
241
250
  {
242
- $ref: "#/$defs/IChatGptSchema.INumber"
251
+ $ref: "#/$defs/ILlmSchema.INumber"
243
252
  },
244
253
  {
245
- $ref: "#/$defs/IChatGptSchema.IString"
254
+ $ref: "#/$defs/ILlmSchema.IString"
246
255
  },
247
256
  {
248
- $ref: "#/$defs/IChatGptSchema.IArray"
257
+ $ref: "#/$defs/ILlmSchema.IArray"
249
258
  },
250
259
  {
251
- $ref: "#/$defs/IChatGptSchema.IObject"
260
+ $ref: "#/$defs/ILlmSchema.IObject"
252
261
  },
253
262
  {
254
- $ref: "#/$defs/IChatGptSchema.IReference"
263
+ $ref: "#/$defs/ILlmSchema.IReference"
255
264
  },
256
265
  {
257
- $ref: "#/$defs/IChatGptSchema.IAnyOf"
266
+ $ref: "#/$defs/ILlmSchema.IAnyOf"
258
267
  },
259
268
  {
260
- $ref: "#/$defs/IChatGptSchema.INull"
269
+ $ref: "#/$defs/ILlmSchema.INull"
261
270
  },
262
271
  {
263
- $ref: "#/$defs/IChatGptSchema.IUnknown"
272
+ $ref: "#/$defs/ILlmSchema.IUnknown"
264
273
  }
265
274
  ]
266
275
  },
267
- "IChatGptSchema.IBoolean": {
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
- "IChatGptSchema.IInteger": {
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
- "IChatGptSchema.INumber": {
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
- "IChatGptSchema.IString": {
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
- "IChatGptSchema.IArray": {
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/IChatGptSchema"
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
- "IChatGptSchema.IObject": {
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/RecordstringIChatGptSchema"
631
+ $ref: "#/$defs/RecordstringILlmSchema"
493
632
  },
494
633
  additionalProperties: {
495
- description: "Additional properties information.\n\nThe `additionalProperties` defines the type schema for 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 IChatGptSchema} type, it means that the additional properties must\nfollow the type schema info.\n\n- `true`: `Record<string, any>`\n- `IChatGptSchema`: `Record<string, T>`\n\nNote: If you've configured {@link IChatGptSchema.IConfig.strict} as\n`true`, ChatGPT function calling does not support dynamic key typed\nproperties, so `additionalProperties` is always `false`.",
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/IChatGptSchema.INumber"
640
+ $ref: "#/$defs/ILlmSchema.IBoolean"
502
641
  },
503
642
  {
504
- $ref: "#/$defs/IChatGptSchema.IInteger"
643
+ $ref: "#/$defs/ILlmSchema.INumber"
505
644
  },
506
645
  {
507
- $ref: "#/$defs/IChatGptSchema.IBoolean"
646
+ $ref: "#/$defs/ILlmSchema.IInteger"
508
647
  },
509
648
  {
510
- $ref: "#/$defs/IChatGptSchema.IString"
649
+ $ref: "#/$defs/ILlmSchema.IString"
511
650
  },
512
651
  {
513
- $ref: "#/$defs/IChatGptSchema.IArray"
652
+ $ref: "#/$defs/ILlmSchema.IArray"
514
653
  },
515
654
  {
516
- $ref: "#/$defs/IChatGptSchema.IObject"
655
+ $ref: "#/$defs/ILlmSchema.IObject"
517
656
  },
518
657
  {
519
- $ref: "#/$defs/IChatGptSchema.IReference"
658
+ $ref: "#/$defs/ILlmSchema.IReference"
520
659
  },
521
660
  {
522
- $ref: "#/$defs/IChatGptSchema.IAnyOf"
661
+ $ref: "#/$defs/ILlmSchema.IAnyOf"
523
662
  },
524
663
  {
525
- $ref: "#/$defs/IChatGptSchema.IUnknown"
664
+ $ref: "#/$defs/ILlmSchema.IUnknown"
526
665
  },
527
666
  {
528
- $ref: "#/$defs/IChatGptSchema.INull"
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
- "IChatGptSchema.IReference": {
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 IChatGptSchema.IParameters.$defs} object.\n\n- `#/$defs/SomeObject`\n- `#/$defs/AnotherObject`",
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
- "IChatGptSchema.IAnyOf": {
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 `anyOf`\ninstead of `oneOf`, {@link IChatGptSchema} forcibly converts it to `anyOf`\ntype.",
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/IChatGptSchema.INumber"
769
+ $ref: "#/$defs/ILlmSchema.IBoolean"
615
770
  },
616
771
  {
617
- $ref: "#/$defs/IChatGptSchema.IInteger"
772
+ $ref: "#/$defs/ILlmSchema.INumber"
618
773
  },
619
774
  {
620
- $ref: "#/$defs/IChatGptSchema.IBoolean"
775
+ $ref: "#/$defs/ILlmSchema.IInteger"
621
776
  },
622
777
  {
623
- $ref: "#/$defs/IChatGptSchema.IString"
778
+ $ref: "#/$defs/ILlmSchema.IString"
624
779
  },
625
780
  {
626
- $ref: "#/$defs/IChatGptSchema.IArray"
781
+ $ref: "#/$defs/ILlmSchema.IArray"
627
782
  },
628
783
  {
629
- $ref: "#/$defs/IChatGptSchema.IObject"
784
+ $ref: "#/$defs/ILlmSchema.IObject"
630
785
  },
631
786
  {
632
- $ref: "#/$defs/IChatGptSchema.IReference"
787
+ $ref: "#/$defs/ILlmSchema.IReference"
633
788
  },
634
789
  {
635
- $ref: "#/$defs/IChatGptSchema.IUnknown"
790
+ $ref: "#/$defs/ILlmSchema.IUnknown"
636
791
  },
637
792
  {
638
- $ref: "#/$defs/IChatGptSchema.INull"
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/IChatGptSchema.IAnyOf.IDiscriminator"
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
- "IChatGptSchema.IUnknown": {
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
- "IChatGptSchema.INull": {
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
- "IChatGptSchema.IAnyOf.IDiscriminator": {
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.ISeparatedchatgpt": {
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/IChatGptSchema.IParameters"
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/IChatGptSchema.IParameters"
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/IHttpLlmFunctionchatgpt"
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.",