@agentica/core 0.15.7 → 0.16.1

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 (195) hide show
  1. package/lib/Agentica.d.ts +21 -21
  2. package/lib/Agentica.js +29 -29
  3. package/lib/Agentica.js.map +1 -1
  4. package/lib/MicroAgentica.d.ts +115 -0
  5. package/lib/MicroAgentica.js +279 -0
  6. package/lib/MicroAgentica.js.map +1 -0
  7. package/lib/constants/AgenticaDefaultPrompt.d.ts +2 -1
  8. package/lib/constants/AgenticaDefaultPrompt.js +4 -4
  9. package/lib/constants/AgenticaDefaultPrompt.js.map +1 -1
  10. package/lib/context/AgenticaCancelPrompt.d.ts +3 -3
  11. package/lib/context/AgenticaContext.d.ts +12 -12
  12. package/lib/context/AgenticaOperationCollection.d.ts +1 -1
  13. package/lib/context/MicroAgenticaContext.d.ts +75 -0
  14. package/lib/{prompts/AgenticaCancelPrompt.js → context/MicroAgenticaContext.js} +1 -1
  15. package/lib/context/MicroAgenticaContext.js.map +1 -0
  16. package/lib/context/internal/AgenticaOperationComposer.d.ts +2 -1
  17. package/lib/context/internal/AgenticaOperationComposer.js +3 -2
  18. package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
  19. package/lib/context/internal/isAgenticaContext.d.ts +1 -0
  20. package/lib/context/internal/isAgenticaContext.js +10 -0
  21. package/lib/context/internal/isAgenticaContext.js.map +1 -0
  22. package/lib/events/AgenticaDescribeEvent.d.ts +4 -4
  23. package/lib/events/AgenticaEvent.d.ts +1 -0
  24. package/lib/events/AgenticaExecuteEvent.d.ts +5 -5
  25. package/lib/events/AgenticaSelectEvent.d.ts +2 -2
  26. package/lib/events/AgenticaTextEvent.d.ts +2 -2
  27. package/lib/events/MicroAgenticaEvent.d.ts +32 -0
  28. package/lib/{prompts/AgenticaTextPrompt.js → events/MicroAgenticaEvent.js} +1 -1
  29. package/lib/events/MicroAgenticaEvent.js.map +1 -0
  30. package/lib/factory/events.d.ts +2 -2
  31. package/lib/factory/events.js +5 -5
  32. package/lib/factory/events.js.map +1 -1
  33. package/lib/factory/histories.d.ts +33 -0
  34. package/lib/factory/{prompts.js → histories.js} +13 -13
  35. package/lib/factory/histories.js.map +1 -0
  36. package/lib/factory/index.d.ts +1 -1
  37. package/lib/factory/index.js +1 -1
  38. package/lib/factory/index.js.map +1 -1
  39. package/lib/functional/assertHttpLlmApplication.js +577 -387
  40. package/lib/functional/assertHttpLlmApplication.js.map +1 -1
  41. package/lib/functional/validateHttpLlmApplication.js +500 -348
  42. package/lib/functional/validateHttpLlmApplication.js.map +1 -1
  43. package/lib/histories/AgenticaCancelHistory.d.ts +8 -0
  44. package/lib/{prompts/AgenticaExecutePrompt.js → histories/AgenticaCancelHistory.js} +1 -1
  45. package/lib/histories/AgenticaCancelHistory.js.map +1 -0
  46. package/lib/histories/AgenticaDescribeHistory.d.ts +16 -0
  47. package/lib/histories/AgenticaDescribeHistory.js +3 -0
  48. package/lib/histories/AgenticaDescribeHistory.js.map +1 -0
  49. package/lib/{prompts/AgenticaExecutePrompt.d.ts → histories/AgenticaExecuteHistory.d.ts} +5 -5
  50. package/lib/{prompts/AgenticaDescribePrompt.js → histories/AgenticaExecuteHistory.js} +1 -1
  51. package/lib/histories/AgenticaExecuteHistory.js.map +1 -0
  52. package/lib/histories/AgenticaHistory.d.ts +17 -0
  53. package/lib/{prompts/AgenticaPrompt.js → histories/AgenticaHistory.js} +1 -1
  54. package/lib/histories/AgenticaHistory.js.map +1 -0
  55. package/lib/{prompts/AgenticaPromptBase.d.ts → histories/AgenticaHistoryBase.d.ts} +4 -4
  56. package/lib/{json/IAgenticaPromptJson.js → histories/AgenticaHistoryBase.js} +1 -1
  57. package/lib/histories/AgenticaHistoryBase.js.map +1 -0
  58. package/lib/histories/AgenticaSelectHistory.d.ts +8 -0
  59. package/lib/histories/AgenticaSelectHistory.js +3 -0
  60. package/lib/histories/AgenticaSelectHistory.js.map +1 -0
  61. package/lib/histories/AgenticaTextHistory.d.ts +6 -0
  62. package/lib/{prompts/AgenticaPromptBase.js → histories/AgenticaTextHistory.js} +1 -1
  63. package/lib/histories/AgenticaTextHistory.js.map +1 -0
  64. package/lib/histories/MicroAgenticaHistory.d.ts +13 -0
  65. package/lib/histories/MicroAgenticaHistory.js +3 -0
  66. package/lib/histories/MicroAgenticaHistory.js.map +1 -0
  67. package/lib/index.d.ts +12 -7
  68. package/lib/index.js +12 -7
  69. package/lib/index.js.map +1 -1
  70. package/lib/index.mjs +1408 -917
  71. package/lib/index.mjs.map +1 -1
  72. package/lib/json/IAgenticaEventJson.d.ts +6 -5
  73. package/lib/json/{IAgenticaPromptJson.d.ts → IAgenticaHistoryJson.d.ts} +8 -8
  74. package/lib/json/IAgenticaHistoryJson.js +3 -0
  75. package/lib/json/IAgenticaHistoryJson.js.map +1 -0
  76. package/lib/json/IAgenticaOperationSelectionJson.d.ts +7 -1
  77. package/lib/json/IMicroAgenticaEventJson.d.ts +13 -0
  78. package/lib/json/IMicroAgenticaEventJson.js +3 -0
  79. package/lib/json/IMicroAgenticaEventJson.js.map +1 -0
  80. package/lib/json/IMicroAgenticaHistoryJson.d.ts +19 -0
  81. package/lib/json/IMicroAgenticaHistoryJson.js +3 -0
  82. package/lib/json/IMicroAgenticaHistoryJson.js.map +1 -0
  83. package/lib/orchestrate/call.d.ts +4 -2
  84. package/lib/orchestrate/call.js +58 -49
  85. package/lib/orchestrate/call.js.map +1 -1
  86. package/lib/orchestrate/cancel.js +4 -4
  87. package/lib/orchestrate/cancel.js.map +1 -1
  88. package/lib/orchestrate/describe.d.ts +4 -3
  89. package/lib/orchestrate/describe.js +5 -5
  90. package/lib/orchestrate/describe.js.map +1 -1
  91. package/lib/orchestrate/execute.d.ts +2 -2
  92. package/lib/orchestrate/execute.js +1 -1
  93. package/lib/orchestrate/execute.js.map +1 -1
  94. package/lib/orchestrate/initialize.d.ts +2 -2
  95. package/lib/orchestrate/initialize.js +5 -5
  96. package/lib/orchestrate/initialize.js.map +1 -1
  97. package/lib/orchestrate/internal/selectFunction.d.ts +1 -5
  98. package/lib/orchestrate/internal/selectFunction.js +5 -2
  99. package/lib/orchestrate/internal/selectFunction.js.map +1 -1
  100. package/lib/orchestrate/select.d.ts +2 -2
  101. package/lib/orchestrate/select.js +5 -5
  102. package/lib/orchestrate/select.js.map +1 -1
  103. package/lib/structures/IAgenticaConfig.d.ts +6 -5
  104. package/lib/structures/IAgenticaController.d.ts +1 -1
  105. package/lib/structures/IAgenticaExecutor.d.ts +11 -9
  106. package/lib/structures/IAgenticaProps.d.ts +3 -3
  107. package/lib/structures/IAgenticaSystemPrompt.d.ts +13 -13
  108. package/lib/structures/IAgenticaVendor.d.ts +1 -1
  109. package/lib/structures/IMicroAgenticaConfig.d.ts +74 -0
  110. package/lib/structures/IMicroAgenticaConfig.js +3 -0
  111. package/lib/structures/IMicroAgenticaConfig.js.map +1 -0
  112. package/lib/structures/IMicroAgenticaExecutor.d.ts +57 -0
  113. package/lib/structures/IMicroAgenticaExecutor.js +3 -0
  114. package/lib/structures/IMicroAgenticaExecutor.js.map +1 -0
  115. package/lib/structures/IMicroAgenticaProps.d.ts +63 -0
  116. package/lib/structures/IMicroAgenticaProps.js +3 -0
  117. package/lib/structures/IMicroAgenticaProps.js.map +1 -0
  118. package/lib/structures/IMicroAgenticaSystemPrompt.d.ts +66 -0
  119. package/lib/structures/IMicroAgenticaSystemPrompt.js +3 -0
  120. package/lib/structures/IMicroAgenticaSystemPrompt.js.map +1 -0
  121. package/lib/transformers/AgenticaPromptTransformer.d.ts +19 -19
  122. package/lib/transformers/AgenticaPromptTransformer.js +27 -27
  123. package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
  124. package/package.json +7 -7
  125. package/src/Agentica.ts +36 -36
  126. package/src/MicroAgentica.ts +337 -0
  127. package/src/constants/AgenticaDefaultPrompt.ts +4 -2
  128. package/src/context/AgenticaCancelPrompt.ts +3 -3
  129. package/src/context/AgenticaContext.ts +12 -12
  130. package/src/context/AgenticaOperationCollection.ts +1 -1
  131. package/src/context/MicroAgenticaContext.ts +95 -0
  132. package/src/context/internal/AgenticaOperationComposer.ts +6 -3
  133. package/src/context/internal/isAgenticaContext.ts +13 -0
  134. package/src/events/AgenticaDescribeEvent.ts +4 -4
  135. package/src/events/AgenticaEvent.ts +6 -0
  136. package/src/events/AgenticaExecuteEvent.ts +5 -5
  137. package/src/events/AgenticaSelectEvent.ts +2 -2
  138. package/src/events/AgenticaTextEvent.ts +2 -2
  139. package/src/events/MicroAgenticaEvent.ts +41 -0
  140. package/src/factory/events.ts +8 -8
  141. package/src/factory/{prompts.ts → histories.ts} +18 -18
  142. package/src/factory/index.ts +1 -1
  143. package/src/histories/AgenticaCancelHistory.ts +13 -0
  144. package/src/histories/AgenticaDescribeHistory.ts +22 -0
  145. package/src/{prompts/AgenticaExecutePrompt.ts → histories/AgenticaExecuteHistory.ts} +7 -7
  146. package/src/histories/AgenticaHistory.ts +25 -0
  147. package/src/{prompts/AgenticaPromptBase.ts → histories/AgenticaHistoryBase.ts} +4 -4
  148. package/src/histories/AgenticaSelectHistory.ts +13 -0
  149. package/src/histories/AgenticaTextHistory.ts +10 -0
  150. package/src/histories/MicroAgenticaHistory.ts +18 -0
  151. package/src/index.ts +18 -15
  152. package/src/json/IAgenticaEventJson.ts +6 -5
  153. package/src/json/{IAgenticaPromptJson.ts → IAgenticaHistoryJson.ts} +13 -13
  154. package/src/json/IAgenticaOperationSelectionJson.ts +8 -1
  155. package/src/json/IMicroAgenticaEventJson.ts +21 -0
  156. package/src/json/IMicroAgenticaHistoryJson.ts +23 -0
  157. package/src/orchestrate/call.ts +91 -67
  158. package/src/orchestrate/cancel.ts +4 -4
  159. package/src/orchestrate/describe.ts +13 -9
  160. package/src/orchestrate/execute.ts +7 -7
  161. package/src/orchestrate/initialize.ts +8 -8
  162. package/src/orchestrate/internal/selectFunction.ts +5 -2
  163. package/src/orchestrate/select.ts +13 -13
  164. package/src/structures/IAgenticaConfig.ts +6 -5
  165. package/src/structures/IAgenticaController.ts +1 -1
  166. package/src/structures/IAgenticaExecutor.ts +12 -10
  167. package/src/structures/IAgenticaProps.ts +3 -3
  168. package/src/structures/IAgenticaSystemPrompt.ts +13 -13
  169. package/src/structures/IAgenticaVendor.ts +1 -1
  170. package/src/structures/IMicroAgenticaConfig.ts +82 -0
  171. package/src/structures/IMicroAgenticaExecutor.ts +63 -0
  172. package/src/structures/IMicroAgenticaProps.ts +70 -0
  173. package/src/structures/IMicroAgenticaSystemPrompt.ts +71 -0
  174. package/src/transformers/AgenticaPromptTransformer.ts +46 -46
  175. package/lib/factory/prompts.d.ts +0 -33
  176. package/lib/factory/prompts.js.map +0 -1
  177. package/lib/json/IAgenticaPromptJson.js.map +0 -1
  178. package/lib/prompts/AgenticaCancelPrompt.d.ts +0 -8
  179. package/lib/prompts/AgenticaCancelPrompt.js.map +0 -1
  180. package/lib/prompts/AgenticaDescribePrompt.d.ts +0 -16
  181. package/lib/prompts/AgenticaDescribePrompt.js.map +0 -1
  182. package/lib/prompts/AgenticaExecutePrompt.js.map +0 -1
  183. package/lib/prompts/AgenticaPrompt.d.ts +0 -17
  184. package/lib/prompts/AgenticaPrompt.js.map +0 -1
  185. package/lib/prompts/AgenticaPromptBase.js.map +0 -1
  186. package/lib/prompts/AgenticaSelectPrompt.d.ts +0 -8
  187. package/lib/prompts/AgenticaSelectPrompt.js +0 -3
  188. package/lib/prompts/AgenticaSelectPrompt.js.map +0 -1
  189. package/lib/prompts/AgenticaTextPrompt.d.ts +0 -6
  190. package/lib/prompts/AgenticaTextPrompt.js.map +0 -1
  191. package/src/prompts/AgenticaCancelPrompt.ts +0 -13
  192. package/src/prompts/AgenticaDescribePrompt.ts +0 -22
  193. package/src/prompts/AgenticaPrompt.ts +0 -25
  194. package/src/prompts/AgenticaSelectPrompt.ts +0 -13
  195. package/src/prompts/AgenticaTextPrompt.ts +0 -10
package/lib/Agentica.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import type { ILlmSchema } from "@samchon/openapi";
2
2
  import type { AgenticaOperation } from "./context/AgenticaOperation";
3
3
  import type { AgenticaEvent } from "./events/AgenticaEvent";
4
- import type { AgenticaPrompt } from "./prompts/AgenticaPrompt";
4
+ import type { AgenticaHistory } from "./histories/AgenticaHistory";
5
5
  import type { IAgenticaConfig } from "./structures/IAgenticaConfig";
6
6
  import type { IAgenticaController } from "./structures/IAgenticaController";
7
7
  import type { IAgenticaProps } from "./structures/IAgenticaProps";
8
8
  import type { IAgenticaVendor } from "./structures/IAgenticaVendor";
9
9
  import { AgenticaTokenUsage } from "./context/AgenticaTokenUsage";
10
10
  /**
11
- * Nestia A.I. chatbot agent.
11
+ * Agentica AI chatbot agent.
12
12
  *
13
- * `Agentica` is a facade class for the super A.I. chatbot agent
14
- * which performs the {@link conversate user's conversation function}
15
- * with LLM (Large Language Model) function calling and manages the
16
- * {@link getPromptHistories prompt histories}.
13
+ * `Agentica` is a facade class for the super AI chatbot agent
14
+ * which performs LLM (Large Language Model) function calling from the
15
+ * {@link conversate user's conversation}, and manages the
16
+ * {@link getHistories prompt histories}.
17
17
  *
18
18
  * To understand and compose the `Agentica` class exactly, reference
19
19
  * below types concentrating on the documentation comments please.
@@ -28,7 +28,7 @@ import { AgenticaTokenUsage } from "./context/AgenticaTokenUsage";
28
28
  * - {@link IAgenticaSystemPrompt}
29
29
  * - Accessors
30
30
  * - {@link IAgenticaOperation}
31
- * - {@link IAgenticaPromptJson}
31
+ * - {@link IAgenticaHistoryJson}
32
32
  * - {@link IAgenticaEventJson}
33
33
  * - {@link IAgenticaTokenUsageJson}
34
34
  *
@@ -38,7 +38,7 @@ export declare class Agentica<Model extends ILlmSchema.Model> {
38
38
  private readonly props;
39
39
  private readonly operations_;
40
40
  private readonly stack_;
41
- private readonly prompt_histories_;
41
+ private readonly histories_;
42
42
  private readonly listeners_;
43
43
  private readonly token_usage_;
44
44
  private ready_;
@@ -50,18 +50,18 @@ export declare class Agentica<Model extends ILlmSchema.Model> {
50
50
  */
51
51
  constructor(props: IAgenticaProps<Model>);
52
52
  /**
53
- * Conversate with the A.I. chatbot.
53
+ * Conversate with the AI chatbot.
54
54
  *
55
- * User talks to the A.I. chatbot with the content.
55
+ * User talks to the AI chatbot with the given content.
56
56
  *
57
- * When the user's conversation implies the A.I. chatbot to execute a
57
+ * When the user's conversation implies the AI chatbot to execute a
58
58
  * function calling, the returned chat prompts will contain the
59
- * function calling information like {@link IAgenticaPromptJson.IExecute}.
59
+ * function calling information like {@link AgenticaExecuteHistory}.
60
60
  *
61
61
  * @param content The content to talk
62
62
  * @returns List of newly created chat prompts
63
63
  */
64
- conversate(content: string): Promise<AgenticaPrompt<Model>[]>;
64
+ conversate(content: string): Promise<AgenticaHistory<Model>[]>;
65
65
  /**
66
66
  * Get configuration.
67
67
  */
@@ -74,7 +74,7 @@ export declare class Agentica<Model extends ILlmSchema.Model> {
74
74
  * Get controllers.
75
75
  *
76
76
  * Get list of controllers, which are the collection of functions that
77
- * the "Super A.I. Chatbot" can execute.
77
+ * the "Super AI Chatbot" can execute.
78
78
  */
79
79
  getControllers(): ReadonlyArray<IAgenticaController<Model>>;
80
80
  /**
@@ -87,20 +87,20 @@ export declare class Agentica<Model extends ILlmSchema.Model> {
87
87
  */
88
88
  getOperations(): ReadonlyArray<AgenticaOperation<Model>>;
89
89
  /**
90
- * Get the chatbot's prompt histories.
90
+ * Get the chatbot's histories.
91
91
  *
92
- * Get list of chat prompts that the chatbot has been conversated.
92
+ * Get list of chat histories that the chatbot has been conversated.
93
93
  *
94
- * @returns List of chat prompts
94
+ * @returns List of chat histories
95
95
  */
96
- getPromptHistories(): AgenticaPrompt<Model>[];
96
+ getHistories(): AgenticaHistory<Model>[];
97
97
  /**
98
- * Get token usage of the A.I. chatbot.
98
+ * Get token usage of the AI chatbot.
99
99
  *
100
- * Entire token usage of the A.I. chatbot during the conversating
100
+ * Entire token usage of the AI chatbot during the conversating
101
101
  * with the user by {@link conversate} method callings.
102
102
  *
103
- * @returns Cost of the A.I. chatbot
103
+ * @returns Cost of the AI chatbot
104
104
  */
105
105
  getTokenUsage(): AgenticaTokenUsage;
106
106
  /**
package/lib/Agentica.js CHANGED
@@ -14,19 +14,19 @@ const AgenticaTokenUsage_1 = require("./context/AgenticaTokenUsage");
14
14
  const AgenticaOperationComposer_1 = require("./context/internal/AgenticaOperationComposer");
15
15
  const AgenticaTokenUsageAggregator_1 = require("./context/internal/AgenticaTokenUsageAggregator");
16
16
  const events_1 = require("./factory/events");
17
- const prompts_1 = require("./factory/prompts");
17
+ const histories_1 = require("./factory/histories");
18
18
  const execute_1 = require("./orchestrate/execute");
19
19
  const AgenticaPromptTransformer_1 = require("./transformers/AgenticaPromptTransformer");
20
20
  const __map_take_1 = require("./utils/__map_take");
21
21
  const ChatGptCompletionMessageUtil_1 = require("./utils/ChatGptCompletionMessageUtil");
22
22
  const StreamUtil_1 = require("./utils/StreamUtil");
23
23
  /**
24
- * Nestia A.I. chatbot agent.
24
+ * Agentica AI chatbot agent.
25
25
  *
26
- * `Agentica` is a facade class for the super A.I. chatbot agent
27
- * which performs the {@link conversate user's conversation function}
28
- * with LLM (Large Language Model) function calling and manages the
29
- * {@link getPromptHistories prompt histories}.
26
+ * `Agentica` is a facade class for the super AI chatbot agent
27
+ * which performs LLM (Large Language Model) function calling from the
28
+ * {@link conversate user's conversation}, and manages the
29
+ * {@link getHistories prompt histories}.
30
30
  *
31
31
  * To understand and compose the `Agentica` class exactly, reference
32
32
  * below types concentrating on the documentation comments please.
@@ -41,7 +41,7 @@ const StreamUtil_1 = require("./utils/StreamUtil");
41
41
  * - {@link IAgenticaSystemPrompt}
42
42
  * - Accessors
43
43
  * - {@link IAgenticaOperation}
44
- * - {@link IAgenticaPromptJson}
44
+ * - {@link IAgenticaHistoryJson}
45
45
  * - {@link IAgenticaEventJson}
46
46
  * - {@link IAgenticaTokenUsageJson}
47
47
  *
@@ -67,9 +67,9 @@ class Agentica {
67
67
  // STATUS
68
68
  this.stack_ = [];
69
69
  this.listeners_ = new Map();
70
- this.prompt_histories_ = ((_a = props.histories) !== null && _a !== void 0 ? _a : []).map(input => AgenticaPromptTransformer_1.AgenticaPromptTransformer.transform({
70
+ this.histories_ = ((_a = props.histories) !== null && _a !== void 0 ? _a : []).map(input => AgenticaPromptTransformer_1.AgenticaPromptTransformer.transform({
71
71
  operations: this.operations_.group,
72
- prompt: input,
72
+ history: input,
73
73
  }));
74
74
  // STATUS
75
75
  this.token_usage_ = AgenticaTokenUsage_1.AgenticaTokenUsage.zero();
@@ -90,20 +90,20 @@ class Agentica {
90
90
  ACCESSORS
91
91
  ----------------------------------------------------------- */
92
92
  /**
93
- * Conversate with the A.I. chatbot.
93
+ * Conversate with the AI chatbot.
94
94
  *
95
- * User talks to the A.I. chatbot with the content.
95
+ * User talks to the AI chatbot with the given content.
96
96
  *
97
- * When the user's conversation implies the A.I. chatbot to execute a
97
+ * When the user's conversation implies the AI chatbot to execute a
98
98
  * function calling, the returned chat prompts will contain the
99
- * function calling information like {@link IAgenticaPromptJson.IExecute}.
99
+ * function calling information like {@link AgenticaExecuteHistory}.
100
100
  *
101
101
  * @param content The content to talk
102
102
  * @returns List of newly created chat prompts
103
103
  */
104
104
  conversate(content) {
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
- const prompt = (0, prompts_1.createTextPrompt)({
106
+ const text = (0, histories_1.createTextHistory)({
107
107
  role: "user",
108
108
  text: content,
109
109
  });
@@ -115,11 +115,11 @@ class Agentica {
115
115
  join: () => __awaiter(this, void 0, void 0, function* () { return Promise.resolve(content); }),
116
116
  }));
117
117
  const newbie = yield this.executor_(this.getContext({
118
- prompt,
118
+ prompt: text,
119
119
  usage: this.token_usage_,
120
120
  }));
121
- this.prompt_histories_.push(prompt, ...newbie);
122
- return [prompt, ...newbie];
121
+ this.histories_.push(text, ...newbie);
122
+ return [text, ...newbie];
123
123
  });
124
124
  }
125
125
  /**
@@ -138,7 +138,7 @@ class Agentica {
138
138
  * Get controllers.
139
139
  *
140
140
  * Get list of controllers, which are the collection of functions that
141
- * the "Super A.I. Chatbot" can execute.
141
+ * the "Super AI Chatbot" can execute.
142
142
  */
143
143
  getControllers() {
144
144
  return this.props.controllers;
@@ -155,22 +155,22 @@ class Agentica {
155
155
  return this.operations_.array;
156
156
  }
157
157
  /**
158
- * Get the chatbot's prompt histories.
158
+ * Get the chatbot's histories.
159
159
  *
160
- * Get list of chat prompts that the chatbot has been conversated.
160
+ * Get list of chat histories that the chatbot has been conversated.
161
161
  *
162
- * @returns List of chat prompts
162
+ * @returns List of chat histories
163
163
  */
164
- getPromptHistories() {
165
- return this.prompt_histories_;
164
+ getHistories() {
165
+ return this.histories_;
166
166
  }
167
167
  /**
168
- * Get token usage of the A.I. chatbot.
168
+ * Get token usage of the AI chatbot.
169
169
  *
170
- * Entire token usage of the A.I. chatbot during the conversating
170
+ * Entire token usage of the AI chatbot during the conversating
171
171
  * with the user by {@link conversate} method callings.
172
172
  *
173
- * @returns Cost of the A.I. chatbot
173
+ * @returns Cost of the AI chatbot
174
174
  */
175
175
  getTokenUsage() {
176
176
  return this.token_usage_;
@@ -185,7 +185,7 @@ class Agentica {
185
185
  operations: this.operations_,
186
186
  config: this.props.config,
187
187
  // STATES
188
- histories: this.prompt_histories_,
188
+ histories: this.histories_,
189
189
  stack: this.stack_,
190
190
  ready: () => this.ready_,
191
191
  prompt: props.prompt,
@@ -205,7 +205,7 @@ class Agentica {
205
205
  const completion = yield this.props.vendor.api.chat.completions.create(event.body, event.options);
206
206
  const [streamForEvent, temporaryStream] = StreamUtil_1.StreamUtil.transform(completion.toReadableStream(), value => ChatGptCompletionMessageUtil_1.ChatGptCompletionMessageUtil.transformCompletionChunk(value)).tee();
207
207
  const [streamForAggregate, streamForReturn] = temporaryStream.tee();
208
- void (() => __awaiter(this, void 0, void 0, function* () {
208
+ (() => __awaiter(this, void 0, void 0, function* () {
209
209
  const reader = streamForAggregate.getReader();
210
210
  while (true) {
211
211
  const chunk = yield reader.read();
@@ -220,7 +220,7 @@ class Agentica {
220
220
  });
221
221
  }
222
222
  }
223
- }))();
223
+ }))().catch(() => { });
224
224
  const [streamForStream, streamForJoin] = streamForEvent.tee();
225
225
  yield dispatch({
226
226
  type: "response",
@@ -1 +1 @@
1
- {"version":3,"file":"Agentica.js","sourceRoot":"","sources":["../src/Agentica.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,qEAAkE;AAClE,4FAAyF;AACzF,kGAA+F;AAC/F,6CAA8F;AAC9F,+CAAqD;AACrD,mDAAgD;AAChD,wFAAqF;AACrF,mDAAgD;AAChD,uFAAoF;AACpF,mDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,QAAQ;IAgBnB;;kEAE8D;IAC9D;;;;OAIG;IACH,YAAoC,KAA4B;;QAA5B,UAAK,GAAL,KAAK,CAAuB;QAC9D,aAAa;QACb,IAAI,CAAC,WAAW,GAAG,qDAAyB,CAAC,OAAO,CAAC;YACnD,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QAEH,SAAS;QACT,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,iBAAiB,GAAG,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAC3D,qDAAyB,CAAC,SAAS,CAAC;YAClC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK;YAClC,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAC;QAEF,SAAS;QACT,IAAI,CAAC,YAAY,GAAG,uCAAkB,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS;cACV,OAAO,CAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,QAAQ,CAAA,KAAK,UAAU;gBAC5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,CAAC,GAAG,CAAC,QAAiE,CAAC,CAAC;QAC1H,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACI,GAAG,CACR,IAAU,EACV,QAEyB;QAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACxB;;eAEG;YACD,GAAG,CAAC,MAAM,CAAC,QAAiE,CAAC,CAAC;YAC9E,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEa,QAAQ,CACpB,KAAY;;YAEZ,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAO,QAAQ,EAAE,EAAE;oBACrC,IAAI,CAAC;wBACH,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;oBACxB,CAAC;oBACD,WAAM,CAAC;wBACL,WAAW;oBACb,CAAC;gBACH,CAAC,CAAA,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF;AA7TD,4BA6TC"}
@@ -0,0 +1,115 @@
1
+ import type { ILlmSchema } from "@samchon/openapi";
2
+ import type { MicroAgenticaEvent } from "./events/MicroAgenticaEvent";
3
+ import type { MicroAgenticaHistory } from "./histories/MicroAgenticaHistory";
4
+ import type { IAgenticaController } from "./structures/IAgenticaController";
5
+ import type { IAgenticaVendor } from "./structures/IAgenticaVendor";
6
+ import type { IMicroAgenticaConfig } from "./structures/IMicroAgenticaConfig";
7
+ import type { IMicroAgenticaProps } from "./structures/IMicroAgenticaProps";
8
+ import { AgenticaTokenUsage } from "./context/AgenticaTokenUsage";
9
+ /**
10
+ * Micro AI chatbot.
11
+ *
12
+ * `MicroAgentica` is a facade class for the micro AI chatbot agent
13
+ * which performs LLM (Large Language Model) function calling from the
14
+ * {@link conversate user's conversation} and manages the
15
+ * {@link getHistories prompt histories}.
16
+ *
17
+ * Different between `MicroAgentica` and {@link Agentica} is that
18
+ * `MicroAgentica` does not have function selecting filter. It directly
19
+ * list up every functions to the agent. Besides, {@link Agentica} has
20
+ * a function selecting mechanism to reduce the number of functions to
21
+ * be listed up to the agent.
22
+ *
23
+ * Therefore, if you have a lot of functions to call, you must not
24
+ * use this `MicroAgentica` class. Use this `MicroAgentica` class only
25
+ * when you have a few functions to call.
26
+ *
27
+ * - [Multi-agent orchestration of `@agentica`](https://wrtnlabs.io/agentica/docs/concepts/function-calling/#orchestration-strategy)
28
+ * - Internal agents of `MicroAgentica`
29
+ * - executor
30
+ * - describier
31
+ * - Internal agents of {@link Agentica}
32
+ * - initializer
33
+ * - **selector**
34
+ * - executor
35
+ * - describer
36
+ *
37
+ * @author Samchon
38
+ */
39
+ export declare class MicroAgentica<Model extends ILlmSchema.Model> {
40
+ private readonly props;
41
+ private readonly operations_;
42
+ private readonly histories_;
43
+ private readonly listeners_;
44
+ private readonly token_usage_;
45
+ /**
46
+ * Initializer Constructor.
47
+ *
48
+ * @param props Properties to construct the micro agent
49
+ */
50
+ constructor(props: IMicroAgenticaProps<Model>);
51
+ /**
52
+ * Conversate with the micro agent.
53
+ *
54
+ * User talks to the AI chatbot with the given content.
55
+ *
56
+ * When the user's conversation implies the AI chatbot to execute a
57
+ * function calling, the returned chat prompts will contain the
58
+ * function callinng information like {@link AgenticaExecuteHistory}
59
+ *
60
+ * @param content The content to talk
61
+ * @returns List of newly created histories
62
+ */
63
+ conversate(content: string): Promise<MicroAgenticaHistory<Model>[]>;
64
+ /**
65
+ * Get configuration.
66
+ */
67
+ getConfig(): IMicroAgenticaConfig<Model> | undefined;
68
+ /**
69
+ * Get LLM vendor.
70
+ */
71
+ getVendor(): IAgenticaVendor;
72
+ /**
73
+ * Get controllers.
74
+ *
75
+ * Get list of controllers, which are the collection of functions that
76
+ * the agent can execute.
77
+ */
78
+ getControllers(): ReadonlyArray<IAgenticaController<Model>>;
79
+ /**
80
+ * Get the chatbot's histories.
81
+ *
82
+ * Get list of chat histories that the chatbot has been conversated.
83
+ *
84
+ * @returns List of chat histories
85
+ */
86
+ getHistories(): MicroAgenticaHistory<Model>[];
87
+ /**
88
+ * Get token usage of the AI chatbot.
89
+ *
90
+ * Entire token usage of the AI chatbot during the conversating
91
+ * with the user by {@link conversate} method callings.
92
+ *
93
+ * @returns Cost of the AI chatbot
94
+ */
95
+ getTokenUsage(): AgenticaTokenUsage;
96
+ /**
97
+ * Add an event listener.
98
+ *
99
+ * Add an event listener to be called whenever the event is emitted.
100
+ *
101
+ * @param type Type of event
102
+ * @param listener Callback function to be called whenever the event is emitted
103
+ */
104
+ on<Type extends MicroAgenticaEvent.Type>(type: Type, listener: (event: MicroAgenticaEvent.Mapper<Model>[Type]) => void | Promise<void>): this;
105
+ /**
106
+ * Erase an event listener.
107
+ *
108
+ * Erase an event listener to stop calling the callback function.
109
+ *
110
+ * @param type Type of event
111
+ * @param listener Callback function to erase
112
+ */
113
+ off<Type extends MicroAgenticaEvent.Type>(type: Type, listener: (event: MicroAgenticaEvent.Mapper<Model>[Type]) => void | Promise<void>): this;
114
+ private dispatch;
115
+ }