@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
@@ -1,5 +1,3 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
-
3
1
  import type { AgenticaAssistantMessageEvent } from "./AgenticaAssistantMessageEvent";
4
2
  import type { AgenticaCallEvent } from "./AgenticaCallEvent";
5
3
  import type { AgenticaDescribeEvent } from "./AgenticaDescribeEvent";
@@ -20,28 +18,28 @@ import type { AgenticaValidateEvent } from "./AgenticaValidateEvent";
20
18
  *
21
19
  * @author Samchon
22
20
  */
23
- export type MicroAgenticaEvent<Model extends ILlmSchema.Model> =
21
+ export type MicroAgenticaEvent =
24
22
  | AgenticaUserMessageEvent
25
23
  | AgenticaAssistantMessageEvent
26
- | AgenticaCallEvent<Model>
27
- | AgenticaExecuteEvent<Model>
28
- | AgenticaDescribeEvent<Model>
24
+ | AgenticaCallEvent
25
+ | AgenticaExecuteEvent
26
+ | AgenticaDescribeEvent
29
27
  | AgenticaRequestEvent
30
28
  | AgenticaResponseEvent
31
- | AgenticaValidateEvent<Model>
32
- | AgenticaJsonParseErrorEvent<Model>;
29
+ | AgenticaValidateEvent
30
+ | AgenticaJsonParseErrorEvent;
33
31
  export namespace MicroAgenticaEvent {
34
- export type Type = MicroAgenticaEvent<any>["type"];
35
- export interface Mapper<Model extends ILlmSchema.Model> {
32
+ export type Type = MicroAgenticaEvent["type"];
33
+ export interface Mapper {
36
34
  userMessage: AgenticaUserMessageEvent;
37
35
  assistantMessage: AgenticaAssistantMessageEvent;
38
- call: AgenticaCallEvent<Model>;
39
- execute: AgenticaExecuteEvent<Model>;
40
- describe: AgenticaDescribeEvent<Model>;
36
+ call: AgenticaCallEvent;
37
+ execute: AgenticaExecuteEvent;
38
+ describe: AgenticaDescribeEvent;
41
39
  request: AgenticaRequestEvent;
42
40
  response: AgenticaResponseEvent;
43
- validate: AgenticaValidateEvent<Model>;
44
- jsonParseError: AgenticaJsonParseErrorEvent<Model>;
41
+ validate: AgenticaValidateEvent;
42
+ jsonParseError: AgenticaJsonParseErrorEvent;
45
43
  }
46
44
  export type Source = "call" | "describe";
47
45
  }
@@ -1,4 +1,4 @@
1
- import type { ILlmSchema, IValidation } from "@samchon/openapi";
1
+ import type { IValidation } from "@samchon/openapi";
2
2
  import type OpenAI from "openai";
3
3
 
4
4
  import { v4 } from "uuid";
@@ -45,9 +45,9 @@ export function createInitializeEvent(): AgenticaInitializeEvent {
45
45
  };
46
46
  }
47
47
 
48
- export function createSelectEvent<Model extends ILlmSchema.Model>(props: {
49
- selection: AgenticaOperationSelection<Model>;
50
- }): AgenticaSelectEvent<Model> {
48
+ export function createSelectEvent(props: {
49
+ selection: AgenticaOperationSelection;
50
+ }): AgenticaSelectEvent {
51
51
  const id: string = v4();
52
52
  const created_at: string = new Date().toISOString();
53
53
  return {
@@ -69,9 +69,9 @@ export function createSelectEvent<Model extends ILlmSchema.Model>(props: {
69
69
  };
70
70
  }
71
71
 
72
- export function createCancelEvent<Model extends ILlmSchema.Model>(props: {
73
- selection: AgenticaOperationSelection<Model>;
74
- }): AgenticaCancelEvent<Model> {
72
+ export function createCancelEvent(props: {
73
+ selection: AgenticaOperationSelection;
74
+ }): AgenticaCancelEvent {
75
75
  const id: string = v4();
76
76
  const created_at: string = new Date().toISOString();
77
77
  return {
@@ -91,11 +91,11 @@ export function createCancelEvent<Model extends ILlmSchema.Model>(props: {
91
91
  /* -----------------------------------------------------------
92
92
  FUNCTION CALLS
93
93
  ----------------------------------------------------------- */
94
- export function createCallEvent<Model extends ILlmSchema.Model>(props: {
94
+ export function createCallEvent(props: {
95
95
  id: string;
96
- operation: AgenticaOperation<Model>;
96
+ operation: AgenticaOperation;
97
97
  arguments: Record<string, any>;
98
- }): AgenticaCallEvent<Model> {
98
+ }): AgenticaCallEvent {
99
99
  const created_at: string = new Date().toISOString();
100
100
  return {
101
101
  type: "call",
@@ -113,13 +113,13 @@ export function createCallEvent<Model extends ILlmSchema.Model>(props: {
113
113
  };
114
114
  }
115
115
 
116
- export function createJsonParseErrorEvent<Model extends ILlmSchema.Model>(props: {
116
+ export function createJsonParseErrorEvent(props: {
117
117
  call_id: string;
118
- operation: AgenticaOperation<Model>;
118
+ operation: AgenticaOperation;
119
119
  arguments: string;
120
120
  errorMessage: string;
121
121
  life: number;
122
- }): AgenticaJsonParseErrorEvent<Model> {
122
+ }): AgenticaJsonParseErrorEvent {
123
123
  const id: string = v4();
124
124
  const created_at: string = new Date().toISOString();
125
125
  return {
@@ -134,12 +134,12 @@ export function createJsonParseErrorEvent<Model extends ILlmSchema.Model>(props:
134
134
  };
135
135
  }
136
136
 
137
- export function createValidateEvent<Model extends ILlmSchema.Model>(props: {
137
+ export function createValidateEvent(props: {
138
138
  call_id: string;
139
- operation: AgenticaOperation<Model>;
139
+ operation: AgenticaOperation;
140
140
  result: IValidation.IFailure;
141
141
  life: number;
142
- }): AgenticaValidateEvent<Model> {
142
+ }): AgenticaValidateEvent {
143
143
  const id: string = v4();
144
144
  const created_at: string = new Date().toISOString();
145
145
  return {
@@ -162,13 +162,13 @@ export function createValidateEvent<Model extends ILlmSchema.Model>(props: {
162
162
  };
163
163
  }
164
164
 
165
- export function createExecuteEvent<Model extends ILlmSchema.Model>(props: {
165
+ export function createExecuteEvent(props: {
166
166
  call_id: string;
167
- operation: AgenticaOperation<Model>;
167
+ operation: AgenticaOperation;
168
168
  arguments: Record<string, unknown>;
169
169
  value: unknown;
170
170
  success: boolean;
171
- }): AgenticaExecuteEvent<Model> {
171
+ }): AgenticaExecuteEvent {
172
172
  const id: string = v4();
173
173
  const created_at: string = new Date().toISOString();
174
174
  return {
@@ -177,7 +177,7 @@ export function createExecuteEvent<Model extends ILlmSchema.Model>(props: {
177
177
  created_at,
178
178
  call_id: props.call_id,
179
179
  protocol: props.operation.protocol as "class",
180
- operation: props.operation as AgenticaOperation.Class<Model>,
180
+ operation: props.operation as AgenticaOperation.Class,
181
181
  arguments: props.arguments,
182
182
  value: props.value as any,
183
183
  success: props.success,
@@ -197,7 +197,7 @@ export function createExecuteEvent<Model extends ILlmSchema.Model>(props: {
197
197
  id,
198
198
  created_at,
199
199
  ...props,
200
- }) as AgenticaExecuteHistory.Class<Model>,
200
+ }) as AgenticaExecuteHistory.Class,
201
201
  };
202
202
  }
203
203
 
@@ -264,13 +264,13 @@ export function createAssistantMessageEvent(props: {
264
264
  };
265
265
  }
266
266
 
267
- export function createDescribeEvent<Model extends ILlmSchema.Model>(props: {
268
- executes: AgenticaExecuteHistory<Model>[];
267
+ export function createDescribeEvent(props: {
268
+ executes: AgenticaExecuteHistory[];
269
269
  stream: AsyncGenerator<string, undefined, undefined>;
270
270
  done: () => boolean;
271
271
  get: () => string;
272
272
  join: () => Promise<string>;
273
- }): AgenticaDescribeEvent<Model> {
273
+ }): AgenticaDescribeEvent {
274
274
  const id: string = v4();
275
275
  const created_at: string = new Date().toISOString();
276
276
  return {
@@ -1,4 +1,4 @@
1
- import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
1
+ import type { IHttpResponse } from "@samchon/openapi";
2
2
  import type OpenAI from "openai";
3
3
  import type { tags } from "typia";
4
4
 
@@ -18,7 +18,7 @@ import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
18
18
  /**
19
19
  * @internal
20
20
  */
21
- export function decodeHistory<Model extends ILlmSchema.Model>(history: AgenticaHistory<Model>): OpenAI.ChatCompletionMessageParam[] {
21
+ export function decodeHistory(history: AgenticaHistory): OpenAI.ChatCompletionMessageParam[] {
22
22
  // NO NEED TO DECODE DESCRIBE
23
23
  if (history.type === "describe") {
24
24
  return [];
@@ -245,12 +245,12 @@ export function createSystemMessageHistory(props: {
245
245
  /**
246
246
  * @internal
247
247
  */
248
- export function createDescribeHistory<Model extends ILlmSchema.Model>(props: {
248
+ export function createDescribeHistory(props: {
249
249
  id: string;
250
250
  created_at: string & tags.Format<"date-time">;
251
- executes: AgenticaExecuteHistory<Model>[];
251
+ executes: AgenticaExecuteHistory[];
252
252
  text: string;
253
- }): AgenticaDescribeHistory<Model> {
253
+ }): AgenticaDescribeHistory {
254
254
  return {
255
255
  type: "describe",
256
256
  id: props.id,
@@ -273,11 +273,11 @@ export function createDescribeHistory<Model extends ILlmSchema.Model>(props: {
273
273
  /**
274
274
  * @internal
275
275
  */
276
- export function createSelectHistory<Model extends ILlmSchema.Model>(props: {
276
+ export function createSelectHistory(props: {
277
277
  id: string;
278
278
  created_at: string & tags.Format<"date-time">;
279
- selection: AgenticaOperationSelection<Model>;
280
- }): AgenticaSelectHistory<Model> {
279
+ selection: AgenticaOperationSelection;
280
+ }): AgenticaSelectHistory {
281
281
  return {
282
282
  type: "select",
283
283
  id: props.id,
@@ -295,11 +295,11 @@ export function createSelectHistory<Model extends ILlmSchema.Model>(props: {
295
295
  /**
296
296
  * @internal
297
297
  */
298
- export function createCancelHistory<Model extends ILlmSchema.Model>(props: {
298
+ export function createCancelHistory(props: {
299
299
  id: string;
300
300
  created_at: string & tags.Format<"date-time">;
301
- selection: AgenticaOperationSelection<Model>;
302
- }): AgenticaCancelHistory<Model> {
301
+ selection: AgenticaOperationSelection;
302
+ }): AgenticaCancelHistory {
303
303
  return {
304
304
  type: "cancel",
305
305
  id: props.id,
@@ -317,22 +317,20 @@ export function createCancelHistory<Model extends ILlmSchema.Model>(props: {
317
317
  /**
318
318
  * @internal
319
319
  */
320
- export function createExecuteHistory<
321
- Model extends ILlmSchema.Model,
322
- >(props: {
320
+ export function createExecuteHistory(props: {
323
321
  id: string;
324
322
  created_at: string & tags.Format<"date-time">;
325
- operation: AgenticaOperation<Model>;
323
+ operation: AgenticaOperation;
326
324
  arguments: Record<string, any>;
327
325
  value: unknown;
328
326
  success: boolean;
329
- }): AgenticaExecuteHistory<Model> {
327
+ }): AgenticaExecuteHistory {
330
328
  return {
331
329
  type: "execute",
332
330
  protocol: props.operation.protocol as "class",
333
331
  id: props.id,
334
332
  created_at: props.created_at,
335
- operation: props.operation as AgenticaOperation.Class<Model>,
333
+ operation: props.operation as AgenticaOperation.Class,
336
334
  arguments: props.arguments,
337
335
  value: props.value,
338
336
  success: props.success,
@@ -1,12 +1,10 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
-
3
1
  import type { AgenticaOperation } from "../context/AgenticaOperation";
4
2
  import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
5
3
 
6
- export function createOperationSelection<Model extends ILlmSchema.Model>(props: {
7
- operation: AgenticaOperation<Model>;
4
+ export function createOperationSelection(props: {
5
+ operation: AgenticaOperation;
8
6
  reason: string;
9
- }): AgenticaOperationSelection<Model> {
7
+ }): AgenticaOperationSelection {
10
8
  return {
11
9
  operation: props.operation,
12
10
  reason: props.reason,
@@ -1,4 +1,4 @@
1
- import type { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, ILlmSchema, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
1
+ import type { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
2
2
 
3
3
  import { HttpLlm, OpenApi } from "@samchon/openapi";
4
4
  import typia from "typia";
@@ -22,19 +22,12 @@ import type { IAgenticaController } from "../structures/IAgenticaController";
22
22
  * @throws {@link TypeGuardError} when the given document is invalid
23
23
  * @author Samchon
24
24
  */
25
- export function assertHttpController<
26
- Model extends ILlmSchema.Model,
27
- >(props: {
25
+ export function assertHttpController(props: {
28
26
  /**
29
27
  * Name of the controller.
30
28
  */
31
29
  name: string;
32
30
 
33
- /**
34
- * Target LLM model.
35
- */
36
- model: Model;
37
-
38
31
  /**
39
32
  * Swagger/OpenAPI document.
40
33
  */
@@ -55,7 +48,7 @@ export function assertHttpController<
55
48
  /**
56
49
  * Options for the LLM function calling schema composition.
57
50
  */
58
- options?: Partial<IHttpLlmApplication.IOptions<Model>>;
51
+ config?: Partial<IHttpLlmApplication.IConfig>;
59
52
 
60
53
  /**
61
54
  * Executor of the API function.
@@ -72,12 +65,12 @@ export function assertHttpController<
72
65
  /**
73
66
  * Application schema.
74
67
  */
75
- application: IHttpLlmApplication<Model>;
68
+ application: IHttpLlmApplication;
76
69
 
77
70
  /**
78
71
  * Function schema.
79
72
  */
80
- function: IHttpLlmFunction<Model>;
73
+ function: IHttpLlmFunction;
81
74
 
82
75
  /**
83
76
  * Arguments of the function calling.
@@ -91,7 +84,7 @@ export function assertHttpController<
91
84
  */
92
85
  arguments: object;
93
86
  }) => Promise<IHttpResponse>;
94
- }): IAgenticaController.IHttp<Model> {
87
+ }): IAgenticaController.IHttp {
95
88
  const document = OpenApi.convert(typia.assert<
96
89
  | SwaggerV2.IDocument
97
90
  | OpenApiV3.IDocument
@@ -102,9 +95,8 @@ export function assertHttpController<
102
95
  protocol: "http",
103
96
  name: props.name,
104
97
  application: HttpLlm.application({
105
- model: props.model,
106
98
  document,
107
- options: props.options,
99
+ config: props.config,
108
100
  }),
109
101
  execute: props.execute,
110
102
  connection: props.connection,
@@ -1,6 +1,5 @@
1
1
  import type {
2
2
  IHttpLlmApplication,
3
- ILlmSchema,
4
3
  OpenApiV3,
5
4
  OpenApiV3_1,
6
5
  SwaggerV2,
@@ -30,14 +29,7 @@ import typia from "typia";
30
29
  * @author Samchon
31
30
  * @deprecated Use {@link assertHttpController} instead.
32
31
  */
33
- export function assertHttpLlmApplication<
34
- Model extends ILlmSchema.Model,
35
- >(props: {
36
- /**
37
- * Target LLM model.
38
- */
39
- model: Model;
40
-
32
+ export function assertHttpLlmApplication(props: {
41
33
  /**
42
34
  * Swagger/OpenAPI document.
43
35
  */
@@ -51,16 +43,15 @@ export function assertHttpLlmApplication<
51
43
  /**
52
44
  * Options for the LLM function calling schema composition.
53
45
  */
54
- options?: Partial<IHttpLlmApplication.IOptions<Model>>;
55
- }): IHttpLlmApplication<Model> {
46
+ config?: Partial<IHttpLlmApplication.IConfig>;
47
+ }): IHttpLlmApplication {
56
48
  return HttpLlm.application({
57
- model: props.model,
58
49
  document: OpenApi.convert(typia.assert<
59
50
  | SwaggerV2.IDocument
60
51
  | OpenApiV3.IDocument
61
52
  | OpenApiV3_1.IDocument
62
53
  | OpenApi.IDocument
63
54
  >(props.document)),
64
- options: props.options,
55
+ config: props.config,
65
56
  });
66
57
  }
@@ -1,4 +1,4 @@
1
- import type { ILlmSchema, IMcpLlmApplication, IMcpTool } from "@samchon/openapi";
1
+ import type { IMcpLlmApplication, IMcpTool } from "@samchon/openapi";
2
2
 
3
3
  import { McpLlm } from "@samchon/openapi";
4
4
  import typia from "typia";
@@ -20,20 +20,18 @@ import type { IAgenticaController } from "../structures/IAgenticaController";
20
20
  * @returns MCP LLM application instance
21
21
  * @author sunrabbit123
22
22
  */
23
- export async function assertMcpController<Model extends ILlmSchema.Model>(props: {
23
+ export async function assertMcpController(props: {
24
24
  name: string;
25
- model: Model;
26
- client: IAgenticaController.IMcp<Model>["client"];
27
- options?: Partial<IMcpLlmApplication.IOptions<Model>>;
28
- }): Promise<IAgenticaController.IMcp<Model>> {
25
+ client: IAgenticaController.IMcp["client"];
26
+ config?: Partial<IMcpLlmApplication.IConfig>;
27
+ }): Promise<IAgenticaController.IMcp> {
29
28
  // for peerDependencies
30
29
  const { ListToolsResultSchema } = await import("@modelcontextprotocol/sdk/types.js");
31
30
 
32
31
  // get list of tools
33
32
  const { tools } = await props.client.request({ method: "tools/list" }, ListToolsResultSchema);
34
33
 
35
- const application: IMcpLlmApplication<Model> = McpLlm.application<Model>({
36
- model: props.model,
34
+ const application: IMcpLlmApplication = McpLlm.application({
37
35
  tools: typia.assert<Array<IMcpTool>>(tools),
38
36
  });
39
37
 
@@ -1,4 +1,4 @@
1
- import type { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, ILlmSchema, IValidation, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
1
+ import type { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, IValidation, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
2
2
 
3
3
  import { HttpLlm, OpenApi } from "@samchon/openapi";
4
4
  import typia from "typia";
@@ -22,19 +22,12 @@ import type { IAgenticaController } from "../structures/IAgenticaController";
22
22
  * @returns Validation result of the HTTP controller composition
23
23
  * @author Samchon
24
24
  */
25
- export function validateHttpController<
26
- Model extends ILlmSchema.Model,
27
- >(props: {
25
+ export function validateHttpController(props: {
28
26
  /**
29
27
  * Name of the controller.
30
28
  */
31
29
  name: string;
32
30
 
33
- /**
34
- * Target LLM model.
35
- */
36
- model: Model;
37
-
38
31
  /**
39
32
  * Swagger/OpenAPI document.
40
33
  */
@@ -55,7 +48,7 @@ export function validateHttpController<
55
48
  /**
56
49
  * Options for the LLM function calling schema composition.
57
50
  */
58
- options?: Partial<IHttpLlmApplication.IOptions<Model>>;
51
+ config?: Partial<IHttpLlmApplication.IConfig>;
59
52
 
60
53
  /**
61
54
  * Executor of the API function.
@@ -72,12 +65,12 @@ export function validateHttpController<
72
65
  /**
73
66
  * Application schema.
74
67
  */
75
- application: IHttpLlmApplication<Model>;
68
+ application: IHttpLlmApplication;
76
69
 
77
70
  /**
78
71
  * Function schema.
79
72
  */
80
- function: IHttpLlmFunction<Model>;
73
+ function: IHttpLlmFunction;
81
74
 
82
75
  /**
83
76
  * Arguments of the function calling.
@@ -91,7 +84,7 @@ export function validateHttpController<
91
84
  */
92
85
  arguments: object;
93
86
  }) => Promise<IHttpResponse>;
94
- }): IValidation<IAgenticaController.IHttp<Model>> {
87
+ }): IValidation<IAgenticaController.IHttp> {
95
88
  const inspect = typia.validate<
96
89
  | SwaggerV2.IDocument
97
90
  | OpenApiV3.IDocument
@@ -107,9 +100,8 @@ export function validateHttpController<
107
100
  protocol: "http",
108
101
  name: props.name,
109
102
  application: HttpLlm.application({
110
- model: props.model,
111
103
  document: OpenApi.convert(inspect.data),
112
- options: props.options,
104
+ config: props.config,
113
105
  }),
114
106
  execute: props.execute,
115
107
  connection: props.connection,
@@ -1,6 +1,5 @@
1
1
  import type {
2
2
  IHttpLlmApplication,
3
- ILlmSchema,
4
3
  OpenApiV3,
5
4
  OpenApiV3_1,
6
5
  SwaggerV2,
@@ -31,14 +30,7 @@ import typia from "typia";
31
30
  * @author Samchon
32
31
  * @deprecated Use {@link validateHttpController} instead.
33
32
  */
34
- export function validateHttpLlmApplication<
35
- Model extends ILlmSchema.Model,
36
- >(props: {
37
- /**
38
- * Target LLM model.
39
- */
40
- model: Model;
41
-
33
+ export function validateHttpLlmApplication(props: {
42
34
  /**
43
35
  * Swagger/OpenAPI document.
44
36
  */
@@ -52,8 +44,8 @@ export function validateHttpLlmApplication<
52
44
  /**
53
45
  * Options for the LLM function calling schema composition.
54
46
  */
55
- options?: Partial<IHttpLlmApplication.IOptions<Model>>;
56
- }): IValidation<IHttpLlmApplication<Model>> {
47
+ config?: Partial<IHttpLlmApplication.IConfig>;
48
+ }): IValidation<IHttpLlmApplication> {
57
49
  const inspect: IValidation<
58
50
  | SwaggerV2.IDocument
59
51
  | OpenApiV3.IDocument
@@ -71,9 +63,8 @@ export function validateHttpLlmApplication<
71
63
  return {
72
64
  success: true,
73
65
  data: HttpLlm.application({
74
- model: props.model,
75
66
  document: OpenApi.convert(inspect.data),
76
- options: props.options,
67
+ config: props.config,
77
68
  }),
78
69
  };
79
70
  }
@@ -1,4 +1,4 @@
1
- import type { ILlmSchema, IMcpLlmApplication, IMcpTool, IValidation } from "@samchon/openapi";
1
+ import type { IMcpLlmApplication, IMcpTool, IValidation } from "@samchon/openapi";
2
2
 
3
3
  import { McpLlm } from "@samchon/openapi";
4
4
  import typia from "typia";
@@ -20,14 +20,11 @@ import type { IAgenticaController } from "../structures/IAgenticaController";
20
20
  * @returns MCP LLM application instance
21
21
  * @author SunRabbit
22
22
  */
23
- export async function validateMcpController<
24
- Model extends ILlmSchema.Model,
25
- >(props: {
23
+ export async function validateMcpController(props: {
26
24
  name: string;
27
- client: IAgenticaController.IMcp<Model>["client"];
28
- model: Model;
29
- options?: Partial<IMcpLlmApplication.IOptions<Model>>;
30
- }): Promise<IValidation<IAgenticaController.IMcp<Model>>> {
25
+ client: IAgenticaController.IMcp["client"];
26
+ config?: Partial<IMcpLlmApplication.IConfig>;
27
+ }): Promise<IValidation<IAgenticaController.IMcp>> {
31
28
  // for peerDependencies
32
29
  const { ListToolsResultSchema } = await import("@modelcontextprotocol/sdk/types.js");
33
30
 
@@ -38,11 +35,9 @@ export async function validateMcpController<
38
35
  return inspect;
39
36
  }
40
37
 
41
- const application: IMcpLlmApplication<Model> = McpLlm.application<Model>({
42
- model: props.model,
38
+ const application: IMcpLlmApplication = McpLlm.application({
43
39
  tools: typia.assert<Array<IMcpTool>>(tools),
44
40
  });
45
-
46
41
  return {
47
42
  success: true,
48
43
  data: {
@@ -1,12 +1,8 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
-
3
1
  import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
4
2
  import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
5
3
 
6
4
  import type { AgenticaHistoryBase } from "./AgenticaHistoryBase";
7
5
 
8
- export interface AgenticaCancelHistory<
9
- Model extends ILlmSchema.Model,
10
- > extends AgenticaHistoryBase<"cancel", IAgenticaHistoryJson.ICancel> {
11
- selection: AgenticaOperationSelection<Model>;
6
+ export interface AgenticaCancelHistory extends AgenticaHistoryBase<"cancel", IAgenticaHistoryJson.ICancel> {
7
+ selection: AgenticaOperationSelection;
12
8
  }
@@ -1,19 +1,15 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
-
3
1
  import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
4
2
 
5
3
  import type { AgenticaExecuteHistory } from "./AgenticaExecuteHistory";
6
4
  import type { AgenticaHistoryBase } from "./AgenticaHistoryBase";
7
5
 
8
- export interface AgenticaDescribeHistory<
9
- Model extends ILlmSchema.Model,
10
- > extends AgenticaHistoryBase<"describe", IAgenticaHistoryJson.IDescribe> {
6
+ export interface AgenticaDescribeHistory extends AgenticaHistoryBase<"describe", IAgenticaHistoryJson.IDescribe> {
11
7
  /**
12
8
  * Executions of the LLM function calling.
13
9
  *
14
10
  * This prompt describes the return value of them.
15
11
  */
16
- executes: AgenticaExecuteHistory<Model>[];
12
+ executes: AgenticaExecuteHistory[];
17
13
 
18
14
  /**
19
15
  * Description text.
@@ -1,4 +1,4 @@
1
- import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
1
+ import type { IHttpResponse } from "@samchon/openapi";
2
2
 
3
3
  import type { AgenticaOperation } from "../context/AgenticaOperation";
4
4
  import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
@@ -10,25 +10,23 @@ import type { AgenticaHistoryBase } from "./AgenticaHistoryBase";
10
10
  *
11
11
  * @author Samchon
12
12
  */
13
- export type AgenticaExecuteHistory<Model extends ILlmSchema.Model> =
14
- | AgenticaExecuteHistory.Class<Model>
15
- | AgenticaExecuteHistory.Http<Model>;
13
+ export type AgenticaExecuteHistory =
14
+ | AgenticaExecuteHistory.Class
15
+ | AgenticaExecuteHistory.Http;
16
16
  export namespace AgenticaExecuteHistory {
17
17
  /**
18
18
  * Class protocol case.
19
19
  */
20
- export interface Class<Model extends ILlmSchema.Model>
21
- extends Base<"class", AgenticaOperation.Class<Model>, unknown> {}
20
+ export interface Class extends Base<"class", AgenticaOperation.Class, unknown> {}
22
21
 
23
22
  /**
24
23
  * HTTP protocol case.
25
24
  */
26
- export interface Http<Model extends ILlmSchema.Model>
27
- extends Base<"http", AgenticaOperation.Http<Model>, IHttpResponse> {}
25
+ export interface Http extends Base<"http", AgenticaOperation.Http, IHttpResponse> {}
28
26
 
29
27
  interface Base<
30
28
  Protocol extends "http" | "class",
31
- Operation extends AgenticaOperation<any>,
29
+ Operation extends AgenticaOperation,
32
30
  Value,
33
31
  > extends AgenticaHistoryBase<"execute", IAgenticaHistoryJson.IExecute> {
34
32
  /**