@agentica/core 0.15.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Agentica.d.ts +21 -21
- package/lib/Agentica.js +27 -27
- package/lib/Agentica.js.map +1 -1
- package/lib/MicroAgentica.d.ts +115 -0
- package/lib/MicroAgentica.js +279 -0
- package/lib/MicroAgentica.js.map +1 -0
- package/lib/constants/AgenticaDefaultPrompt.d.ts +2 -1
- package/lib/constants/AgenticaDefaultPrompt.js +4 -4
- package/lib/constants/AgenticaDefaultPrompt.js.map +1 -1
- package/lib/context/AgenticaCancelPrompt.d.ts +3 -3
- package/lib/context/AgenticaContext.d.ts +12 -12
- package/lib/context/AgenticaOperationCollection.d.ts +1 -1
- package/lib/context/MicroAgenticaContext.d.ts +75 -0
- package/lib/{prompts/AgenticaCancelPrompt.js → context/MicroAgenticaContext.js} +1 -1
- package/lib/context/MicroAgenticaContext.js.map +1 -0
- package/lib/context/internal/AgenticaOperationComposer.d.ts +2 -1
- package/lib/context/internal/AgenticaOperationComposer.js +3 -2
- package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/context/internal/isAgenticaContext.d.ts +1 -0
- package/lib/context/internal/isAgenticaContext.js +10 -0
- package/lib/context/internal/isAgenticaContext.js.map +1 -0
- package/lib/events/AgenticaDescribeEvent.d.ts +4 -4
- package/lib/events/AgenticaEvent.d.ts +1 -0
- package/lib/events/AgenticaExecuteEvent.d.ts +5 -5
- package/lib/events/AgenticaSelectEvent.d.ts +2 -2
- package/lib/events/AgenticaTextEvent.d.ts +2 -2
- package/lib/events/MicroAgenticaEvent.d.ts +32 -0
- package/lib/{prompts/AgenticaTextPrompt.js → events/MicroAgenticaEvent.js} +1 -1
- package/lib/events/MicroAgenticaEvent.js.map +1 -0
- package/lib/factory/events.d.ts +2 -2
- package/lib/factory/events.js +5 -5
- package/lib/factory/events.js.map +1 -1
- package/lib/factory/histories.d.ts +33 -0
- package/lib/factory/{prompts.js → histories.js} +13 -13
- package/lib/factory/histories.js.map +1 -0
- package/lib/factory/index.d.ts +1 -1
- package/lib/factory/index.js +1 -1
- package/lib/factory/index.js.map +1 -1
- package/lib/functional/assertHttpLlmApplication.js +577 -387
- package/lib/functional/assertHttpLlmApplication.js.map +1 -1
- package/lib/functional/validateHttpLlmApplication.js +500 -348
- package/lib/functional/validateHttpLlmApplication.js.map +1 -1
- package/lib/histories/AgenticaCancelHistory.d.ts +8 -0
- package/lib/{prompts/AgenticaExecutePrompt.js → histories/AgenticaCancelHistory.js} +1 -1
- package/lib/histories/AgenticaCancelHistory.js.map +1 -0
- package/lib/histories/AgenticaDescribeHistory.d.ts +16 -0
- package/lib/histories/AgenticaDescribeHistory.js +3 -0
- package/lib/histories/AgenticaDescribeHistory.js.map +1 -0
- package/lib/{prompts/AgenticaExecutePrompt.d.ts → histories/AgenticaExecuteHistory.d.ts} +5 -5
- package/lib/{prompts/AgenticaDescribePrompt.js → histories/AgenticaExecuteHistory.js} +1 -1
- package/lib/histories/AgenticaExecuteHistory.js.map +1 -0
- package/lib/histories/AgenticaHistory.d.ts +17 -0
- package/lib/{prompts/AgenticaPrompt.js → histories/AgenticaHistory.js} +1 -1
- package/lib/histories/AgenticaHistory.js.map +1 -0
- package/lib/{prompts/AgenticaPromptBase.d.ts → histories/AgenticaHistoryBase.d.ts} +4 -4
- package/lib/{json/IAgenticaPromptJson.js → histories/AgenticaHistoryBase.js} +1 -1
- package/lib/histories/AgenticaHistoryBase.js.map +1 -0
- package/lib/histories/AgenticaSelectHistory.d.ts +8 -0
- package/lib/histories/AgenticaSelectHistory.js +3 -0
- package/lib/histories/AgenticaSelectHistory.js.map +1 -0
- package/lib/histories/AgenticaTextHistory.d.ts +6 -0
- package/lib/{prompts/AgenticaPromptBase.js → histories/AgenticaTextHistory.js} +1 -1
- package/lib/histories/AgenticaTextHistory.js.map +1 -0
- package/lib/histories/MicroAgenticaHistory.d.ts +13 -0
- package/lib/histories/MicroAgenticaHistory.js +3 -0
- package/lib/histories/MicroAgenticaHistory.js.map +1 -0
- package/lib/index.d.ts +12 -7
- package/lib/index.js +12 -7
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1392 -901
- package/lib/index.mjs.map +1 -1
- package/lib/json/IAgenticaEventJson.d.ts +6 -5
- package/lib/json/{IAgenticaPromptJson.d.ts → IAgenticaHistoryJson.d.ts} +8 -8
- package/lib/json/IAgenticaHistoryJson.js +3 -0
- package/lib/json/IAgenticaHistoryJson.js.map +1 -0
- package/lib/json/IAgenticaOperationSelectionJson.d.ts +7 -1
- package/lib/json/IMicroAgenticaEventJson.d.ts +13 -0
- package/lib/json/IMicroAgenticaEventJson.js +3 -0
- package/lib/json/IMicroAgenticaEventJson.js.map +1 -0
- package/lib/json/IMicroAgenticaHistoryJson.d.ts +19 -0
- package/lib/json/IMicroAgenticaHistoryJson.js +3 -0
- package/lib/json/IMicroAgenticaHistoryJson.js.map +1 -0
- package/lib/orchestrate/call.d.ts +4 -2
- package/lib/orchestrate/call.js +50 -41
- package/lib/orchestrate/call.js.map +1 -1
- package/lib/orchestrate/cancel.js +4 -4
- package/lib/orchestrate/cancel.js.map +1 -1
- package/lib/orchestrate/describe.d.ts +4 -3
- package/lib/orchestrate/describe.js +3 -3
- package/lib/orchestrate/describe.js.map +1 -1
- package/lib/orchestrate/execute.d.ts +2 -2
- package/lib/orchestrate/execute.js +1 -1
- package/lib/orchestrate/execute.js.map +1 -1
- package/lib/orchestrate/initialize.d.ts +2 -2
- package/lib/orchestrate/initialize.js +3 -3
- package/lib/orchestrate/initialize.js.map +1 -1
- package/lib/orchestrate/internal/selectFunction.d.ts +1 -5
- package/lib/orchestrate/internal/selectFunction.js +3 -0
- package/lib/orchestrate/internal/selectFunction.js.map +1 -1
- package/lib/orchestrate/select.d.ts +2 -2
- package/lib/orchestrate/select.js +5 -5
- package/lib/orchestrate/select.js.map +1 -1
- package/lib/structures/IAgenticaConfig.d.ts +6 -5
- package/lib/structures/IAgenticaController.d.ts +1 -1
- package/lib/structures/IAgenticaExecutor.d.ts +11 -9
- package/lib/structures/IAgenticaProps.d.ts +3 -3
- package/lib/structures/IAgenticaSystemPrompt.d.ts +13 -13
- package/lib/structures/IAgenticaVendor.d.ts +1 -1
- package/lib/structures/IMicroAgenticaConfig.d.ts +74 -0
- package/lib/structures/IMicroAgenticaConfig.js +3 -0
- package/lib/structures/IMicroAgenticaConfig.js.map +1 -0
- package/lib/structures/IMicroAgenticaExecutor.d.ts +57 -0
- package/lib/structures/IMicroAgenticaExecutor.js +3 -0
- package/lib/structures/IMicroAgenticaExecutor.js.map +1 -0
- package/lib/structures/IMicroAgenticaProps.d.ts +63 -0
- package/lib/structures/IMicroAgenticaProps.js +3 -0
- package/lib/structures/IMicroAgenticaProps.js.map +1 -0
- package/lib/structures/IMicroAgenticaSystemPrompt.d.ts +66 -0
- package/lib/structures/IMicroAgenticaSystemPrompt.js +3 -0
- package/lib/structures/IMicroAgenticaSystemPrompt.js.map +1 -0
- package/lib/transformers/AgenticaPromptTransformer.d.ts +19 -19
- package/lib/transformers/AgenticaPromptTransformer.js +27 -27
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
- package/package.json +7 -7
- package/src/Agentica.ts +34 -34
- package/src/MicroAgentica.ts +337 -0
- package/src/constants/AgenticaDefaultPrompt.ts +4 -2
- package/src/context/AgenticaCancelPrompt.ts +3 -3
- package/src/context/AgenticaContext.ts +12 -12
- package/src/context/AgenticaOperationCollection.ts +1 -1
- package/src/context/MicroAgenticaContext.ts +95 -0
- package/src/context/internal/AgenticaOperationComposer.ts +6 -3
- package/src/context/internal/isAgenticaContext.ts +13 -0
- package/src/events/AgenticaDescribeEvent.ts +4 -4
- package/src/events/AgenticaEvent.ts +6 -0
- package/src/events/AgenticaExecuteEvent.ts +5 -5
- package/src/events/AgenticaSelectEvent.ts +2 -2
- package/src/events/AgenticaTextEvent.ts +2 -2
- package/src/events/MicroAgenticaEvent.ts +41 -0
- package/src/factory/events.ts +8 -8
- package/src/factory/{prompts.ts → histories.ts} +18 -18
- package/src/factory/index.ts +1 -1
- package/src/histories/AgenticaCancelHistory.ts +13 -0
- package/src/histories/AgenticaDescribeHistory.ts +22 -0
- package/src/{prompts/AgenticaExecutePrompt.ts → histories/AgenticaExecuteHistory.ts} +7 -7
- package/src/histories/AgenticaHistory.ts +25 -0
- package/src/{prompts/AgenticaPromptBase.ts → histories/AgenticaHistoryBase.ts} +4 -4
- package/src/histories/AgenticaSelectHistory.ts +13 -0
- package/src/histories/AgenticaTextHistory.ts +10 -0
- package/src/histories/MicroAgenticaHistory.ts +18 -0
- package/src/index.ts +18 -15
- package/src/json/IAgenticaEventJson.ts +6 -5
- package/src/json/{IAgenticaPromptJson.ts → IAgenticaHistoryJson.ts} +13 -13
- package/src/json/IAgenticaOperationSelectionJson.ts +8 -1
- package/src/json/IMicroAgenticaEventJson.ts +21 -0
- package/src/json/IMicroAgenticaHistoryJson.ts +23 -0
- package/src/orchestrate/call.ts +83 -59
- package/src/orchestrate/cancel.ts +4 -4
- package/src/orchestrate/describe.ts +11 -7
- package/src/orchestrate/execute.ts +7 -7
- package/src/orchestrate/initialize.ts +6 -6
- package/src/orchestrate/internal/selectFunction.ts +3 -0
- package/src/orchestrate/select.ts +13 -13
- package/src/structures/IAgenticaConfig.ts +6 -5
- package/src/structures/IAgenticaController.ts +1 -1
- package/src/structures/IAgenticaExecutor.ts +12 -10
- package/src/structures/IAgenticaProps.ts +3 -3
- package/src/structures/IAgenticaSystemPrompt.ts +13 -13
- package/src/structures/IAgenticaVendor.ts +1 -1
- package/src/structures/IMicroAgenticaConfig.ts +82 -0
- package/src/structures/IMicroAgenticaExecutor.ts +63 -0
- package/src/structures/IMicroAgenticaProps.ts +70 -0
- package/src/structures/IMicroAgenticaSystemPrompt.ts +71 -0
- package/src/transformers/AgenticaPromptTransformer.ts +46 -46
- package/lib/factory/prompts.d.ts +0 -33
- package/lib/factory/prompts.js.map +0 -1
- package/lib/json/IAgenticaPromptJson.js.map +0 -1
- package/lib/prompts/AgenticaCancelPrompt.d.ts +0 -8
- package/lib/prompts/AgenticaCancelPrompt.js.map +0 -1
- package/lib/prompts/AgenticaDescribePrompt.d.ts +0 -16
- package/lib/prompts/AgenticaDescribePrompt.js.map +0 -1
- package/lib/prompts/AgenticaExecutePrompt.js.map +0 -1
- package/lib/prompts/AgenticaPrompt.d.ts +0 -17
- package/lib/prompts/AgenticaPrompt.js.map +0 -1
- package/lib/prompts/AgenticaPromptBase.js.map +0 -1
- package/lib/prompts/AgenticaSelectPrompt.d.ts +0 -8
- package/lib/prompts/AgenticaSelectPrompt.js +0 -3
- package/lib/prompts/AgenticaSelectPrompt.js.map +0 -1
- package/lib/prompts/AgenticaTextPrompt.d.ts +0 -6
- package/lib/prompts/AgenticaTextPrompt.js.map +0 -1
- package/src/prompts/AgenticaCancelPrompt.ts +0 -13
- package/src/prompts/AgenticaDescribePrompt.ts +0 -22
- package/src/prompts/AgenticaPrompt.ts +0 -25
- package/src/prompts/AgenticaSelectPrompt.ts +0 -13
- 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 {
|
|
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
|
-
*
|
|
11
|
+
* Agentica AI chatbot agent.
|
|
12
12
|
*
|
|
13
|
-
* `Agentica` is a facade class for the super
|
|
14
|
-
* which performs
|
|
15
|
-
*
|
|
16
|
-
* {@link
|
|
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
|
|
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
|
|
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
|
|
53
|
+
* Conversate with the AI chatbot.
|
|
54
54
|
*
|
|
55
|
-
* User talks to the
|
|
55
|
+
* User talks to the AI chatbot with the given content.
|
|
56
56
|
*
|
|
57
|
-
* When the user's conversation implies the
|
|
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
|
|
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<
|
|
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
|
|
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
|
|
90
|
+
* Get the chatbot's histories.
|
|
91
91
|
*
|
|
92
|
-
* Get list of chat
|
|
92
|
+
* Get list of chat histories that the chatbot has been conversated.
|
|
93
93
|
*
|
|
94
|
-
* @returns List of chat
|
|
94
|
+
* @returns List of chat histories
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
getHistories(): AgenticaHistory<Model>[];
|
|
97
97
|
/**
|
|
98
|
-
* Get token usage of the
|
|
98
|
+
* Get token usage of the AI chatbot.
|
|
99
99
|
*
|
|
100
|
-
* Entire token usage of the
|
|
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
|
|
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
|
|
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
|
-
*
|
|
24
|
+
* Agentica AI chatbot agent.
|
|
25
25
|
*
|
|
26
|
-
* `Agentica` is a facade class for the super
|
|
27
|
-
* which performs
|
|
28
|
-
*
|
|
29
|
-
* {@link
|
|
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
|
|
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.
|
|
70
|
+
this.histories_ = ((_a = props.histories) !== null && _a !== void 0 ? _a : []).map(input => AgenticaPromptTransformer_1.AgenticaPromptTransformer.transform({
|
|
71
71
|
operations: this.operations_.group,
|
|
72
|
-
|
|
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
|
|
93
|
+
* Conversate with the AI chatbot.
|
|
94
94
|
*
|
|
95
|
-
* User talks to the
|
|
95
|
+
* User talks to the AI chatbot with the given content.
|
|
96
96
|
*
|
|
97
|
-
* When the user's conversation implies the
|
|
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
|
|
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
|
|
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.
|
|
122
|
-
return [
|
|
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
|
|
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
|
|
158
|
+
* Get the chatbot's histories.
|
|
159
159
|
*
|
|
160
|
-
* Get list of chat
|
|
160
|
+
* Get list of chat histories that the chatbot has been conversated.
|
|
161
161
|
*
|
|
162
|
-
* @returns List of chat
|
|
162
|
+
* @returns List of chat histories
|
|
163
163
|
*/
|
|
164
|
-
|
|
165
|
-
return this.
|
|
164
|
+
getHistories() {
|
|
165
|
+
return this.histories_;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
* Get token usage of the
|
|
168
|
+
* Get token usage of the AI chatbot.
|
|
169
169
|
*
|
|
170
|
-
* Entire token usage of the
|
|
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
|
|
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.
|
|
188
|
+
histories: this.histories_,
|
|
189
189
|
stack: this.stack_,
|
|
190
190
|
ready: () => this.ready_,
|
|
191
191
|
prompt: props.prompt,
|
package/lib/Agentica.js.map
CHANGED
|
@@ -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
|
|
1
|
+
{"version":3,"file":"Agentica.js","sourceRoot":"","sources":["../src/Agentica.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,qEAAkE;AAClE,4FAAyF;AACzF,kGAA+F;AAC/F,6CAA8F;AAC9F,mDAAwD;AACxD,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,UAAU,GAAG,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CACpD,qDAAyB,CAAC,SAAS,CAAC;YAClC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK;YAClC,OAAO,EAAE,KAAK;SACf,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,MAA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C,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
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MicroAgentica = void 0;
|
|
13
|
+
const AgenticaTokenUsage_1 = require("./context/AgenticaTokenUsage");
|
|
14
|
+
const AgenticaOperationComposer_1 = require("./context/internal/AgenticaOperationComposer");
|
|
15
|
+
const AgenticaTokenUsageAggregator_1 = require("./context/internal/AgenticaTokenUsageAggregator");
|
|
16
|
+
const events_1 = require("./factory/events");
|
|
17
|
+
const histories_1 = require("./factory/histories");
|
|
18
|
+
const orchestrate_1 = require("./orchestrate");
|
|
19
|
+
const AgenticaPromptTransformer_1 = require("./transformers/AgenticaPromptTransformer");
|
|
20
|
+
const __map_take_1 = require("./utils/__map_take");
|
|
21
|
+
const ChatGptCompletionMessageUtil_1 = require("./utils/ChatGptCompletionMessageUtil");
|
|
22
|
+
const StreamUtil_1 = require("./utils/StreamUtil");
|
|
23
|
+
/**
|
|
24
|
+
* Micro AI chatbot.
|
|
25
|
+
*
|
|
26
|
+
* `MicroAgentica` is a facade class for the micro 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
|
+
*
|
|
31
|
+
* Different between `MicroAgentica` and {@link Agentica} is that
|
|
32
|
+
* `MicroAgentica` does not have function selecting filter. It directly
|
|
33
|
+
* list up every functions to the agent. Besides, {@link Agentica} has
|
|
34
|
+
* a function selecting mechanism to reduce the number of functions to
|
|
35
|
+
* be listed up to the agent.
|
|
36
|
+
*
|
|
37
|
+
* Therefore, if you have a lot of functions to call, you must not
|
|
38
|
+
* use this `MicroAgentica` class. Use this `MicroAgentica` class only
|
|
39
|
+
* when you have a few functions to call.
|
|
40
|
+
*
|
|
41
|
+
* - [Multi-agent orchestration of `@agentica`](https://wrtnlabs.io/agentica/docs/concepts/function-calling/#orchestration-strategy)
|
|
42
|
+
* - Internal agents of `MicroAgentica`
|
|
43
|
+
* - executor
|
|
44
|
+
* - describier
|
|
45
|
+
* - Internal agents of {@link Agentica}
|
|
46
|
+
* - initializer
|
|
47
|
+
* - **selector**
|
|
48
|
+
* - executor
|
|
49
|
+
* - describer
|
|
50
|
+
*
|
|
51
|
+
* @author Samchon
|
|
52
|
+
*/
|
|
53
|
+
class MicroAgentica {
|
|
54
|
+
/* -----------------------------------------------------------
|
|
55
|
+
CONSTRUCTOR
|
|
56
|
+
----------------------------------------------------------- */
|
|
57
|
+
/**
|
|
58
|
+
* Initializer Constructor.
|
|
59
|
+
*
|
|
60
|
+
* @param props Properties to construct the micro agent
|
|
61
|
+
*/
|
|
62
|
+
constructor(props) {
|
|
63
|
+
var _a;
|
|
64
|
+
this.props = props;
|
|
65
|
+
this.operations_ = AgenticaOperationComposer_1.AgenticaOperationComposer.compose({
|
|
66
|
+
controllers: props.controllers,
|
|
67
|
+
config: props.config,
|
|
68
|
+
});
|
|
69
|
+
this.histories_ = ((_a = props.histories) !== null && _a !== void 0 ? _a : []).map(input => AgenticaPromptTransformer_1.AgenticaPromptTransformer.transform({
|
|
70
|
+
operations: this.operations_.group,
|
|
71
|
+
history: input,
|
|
72
|
+
}));
|
|
73
|
+
this.listeners_ = new Map();
|
|
74
|
+
this.token_usage_ = AgenticaTokenUsage_1.AgenticaTokenUsage.zero();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
clone() {
|
|
80
|
+
var _a;
|
|
81
|
+
return new MicroAgentica(Object.assign(Object.assign({}, this.props), { histories: (_a = this.props.histories) === null || _a === void 0 ? void 0 : _a.slice() }));
|
|
82
|
+
}
|
|
83
|
+
/* -----------------------------------------------------------
|
|
84
|
+
ACCESSORS
|
|
85
|
+
----------------------------------------------------------- */
|
|
86
|
+
/**
|
|
87
|
+
* Conversate with the micro agent.
|
|
88
|
+
*
|
|
89
|
+
* User talks to the AI chatbot with the given content.
|
|
90
|
+
*
|
|
91
|
+
* When the user's conversation implies the AI chatbot to execute a
|
|
92
|
+
* function calling, the returned chat prompts will contain the
|
|
93
|
+
* function callinng information like {@link AgenticaExecuteHistory}
|
|
94
|
+
*
|
|
95
|
+
* @param content The content to talk
|
|
96
|
+
* @returns List of newly created histories
|
|
97
|
+
*/
|
|
98
|
+
conversate(content) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const talk = (0, histories_1.createTextHistory)({
|
|
101
|
+
role: "user",
|
|
102
|
+
text: content,
|
|
103
|
+
});
|
|
104
|
+
yield this.dispatch((0, events_1.createTextEvent)({
|
|
105
|
+
role: "user",
|
|
106
|
+
stream: StreamUtil_1.StreamUtil.to(content),
|
|
107
|
+
done: () => true,
|
|
108
|
+
get: () => content,
|
|
109
|
+
join: () => __awaiter(this, void 0, void 0, function* () { return Promise.resolve(content); }),
|
|
110
|
+
}));
|
|
111
|
+
const ctx = this.getContext({
|
|
112
|
+
prompt: talk,
|
|
113
|
+
usage: this.token_usage_,
|
|
114
|
+
});
|
|
115
|
+
const histories = yield (0, orchestrate_1.call)(ctx, this.operations_.array);
|
|
116
|
+
const executes = histories.filter(p => p.type === "execute");
|
|
117
|
+
if (executes.length) {
|
|
118
|
+
histories.push(...yield (0, orchestrate_1.describe)(ctx, executes));
|
|
119
|
+
}
|
|
120
|
+
this.histories_.push(talk, ...histories);
|
|
121
|
+
return histories;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get configuration.
|
|
126
|
+
*/
|
|
127
|
+
getConfig() {
|
|
128
|
+
return this.props.config;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get LLM vendor.
|
|
132
|
+
*/
|
|
133
|
+
getVendor() {
|
|
134
|
+
return this.props.vendor;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get controllers.
|
|
138
|
+
*
|
|
139
|
+
* Get list of controllers, which are the collection of functions that
|
|
140
|
+
* the agent can execute.
|
|
141
|
+
*/
|
|
142
|
+
getControllers() {
|
|
143
|
+
return this.props.controllers;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get the chatbot's histories.
|
|
147
|
+
*
|
|
148
|
+
* Get list of chat histories that the chatbot has been conversated.
|
|
149
|
+
*
|
|
150
|
+
* @returns List of chat histories
|
|
151
|
+
*/
|
|
152
|
+
getHistories() {
|
|
153
|
+
return this.histories_;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get token usage of the AI chatbot.
|
|
157
|
+
*
|
|
158
|
+
* Entire token usage of the AI chatbot during the conversating
|
|
159
|
+
* with the user by {@link conversate} method callings.
|
|
160
|
+
*
|
|
161
|
+
* @returns Cost of the AI chatbot
|
|
162
|
+
*/
|
|
163
|
+
getTokenUsage() {
|
|
164
|
+
return this.token_usage_;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @internal
|
|
168
|
+
*/
|
|
169
|
+
getContext(props) {
|
|
170
|
+
const dispatch = this.dispatch.bind(this);
|
|
171
|
+
return {
|
|
172
|
+
operations: this.operations_,
|
|
173
|
+
config: this.props.config,
|
|
174
|
+
histories: this.histories_,
|
|
175
|
+
prompt: props.prompt,
|
|
176
|
+
dispatch,
|
|
177
|
+
request: (source, body) => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
// request information
|
|
179
|
+
const event = (0, events_1.createRequestEvent)({
|
|
180
|
+
source,
|
|
181
|
+
body: Object.assign(Object.assign({}, body), { model: this.props.vendor.model, stream: true, stream_options: {
|
|
182
|
+
include_usage: true,
|
|
183
|
+
} }),
|
|
184
|
+
options: this.props.vendor.options,
|
|
185
|
+
});
|
|
186
|
+
yield dispatch(event);
|
|
187
|
+
// completion
|
|
188
|
+
const completion = yield this.props.vendor.api.chat.completions.create(event.body, event.options);
|
|
189
|
+
const [streamForEvent, temporaryStream] = StreamUtil_1.StreamUtil.transform(completion.toReadableStream(), value => ChatGptCompletionMessageUtil_1.ChatGptCompletionMessageUtil.transformCompletionChunk(value)).tee();
|
|
190
|
+
const [streamForAggregate, streamForReturn] = temporaryStream.tee();
|
|
191
|
+
void (() => __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const reader = streamForAggregate.getReader();
|
|
193
|
+
while (true) {
|
|
194
|
+
const chunk = yield reader.read();
|
|
195
|
+
if (chunk.done) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
if (chunk.value.usage != null) {
|
|
199
|
+
AgenticaTokenUsageAggregator_1.AgenticaTokenUsageAggregator.aggregate({
|
|
200
|
+
kind: source,
|
|
201
|
+
completionUsage: chunk.value.usage,
|
|
202
|
+
usage: props.usage,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}))();
|
|
207
|
+
const [streamForStream, streamForJoin] = streamForEvent.tee();
|
|
208
|
+
yield dispatch({
|
|
209
|
+
type: "response",
|
|
210
|
+
source,
|
|
211
|
+
stream: streamForStream,
|
|
212
|
+
body: event.body,
|
|
213
|
+
options: event.options,
|
|
214
|
+
join: () => __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const chunks = yield StreamUtil_1.StreamUtil.readAll(streamForJoin);
|
|
216
|
+
return ChatGptCompletionMessageUtil_1.ChatGptCompletionMessageUtil.merge(chunks);
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
return streamForReturn;
|
|
220
|
+
}),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/* -----------------------------------------------------------
|
|
224
|
+
EVENT HANDLERS
|
|
225
|
+
----------------------------------------------------------- */
|
|
226
|
+
/**
|
|
227
|
+
* Add an event listener.
|
|
228
|
+
*
|
|
229
|
+
* Add an event listener to be called whenever the event is emitted.
|
|
230
|
+
*
|
|
231
|
+
* @param type Type of event
|
|
232
|
+
* @param listener Callback function to be called whenever the event is emitted
|
|
233
|
+
*/
|
|
234
|
+
on(type, listener) {
|
|
235
|
+
/**
|
|
236
|
+
* @TODO remove `as`
|
|
237
|
+
*/
|
|
238
|
+
(0, __map_take_1.__map_take)(this.listeners_, type, () => new Set()).add(listener);
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Erase an event listener.
|
|
243
|
+
*
|
|
244
|
+
* Erase an event listener to stop calling the callback function.
|
|
245
|
+
*
|
|
246
|
+
* @param type Type of event
|
|
247
|
+
* @param listener Callback function to erase
|
|
248
|
+
*/
|
|
249
|
+
off(type, listener) {
|
|
250
|
+
const set = this.listeners_.get(type);
|
|
251
|
+
if (set !== undefined) {
|
|
252
|
+
/**
|
|
253
|
+
* @TODO remove `as`
|
|
254
|
+
*/
|
|
255
|
+
set.delete(listener);
|
|
256
|
+
if (set.size === 0) {
|
|
257
|
+
this.listeners_.delete(type);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return this;
|
|
261
|
+
}
|
|
262
|
+
dispatch(event) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
const set = this.listeners_.get(event.type);
|
|
265
|
+
if (set !== undefined) {
|
|
266
|
+
yield Promise.all(Array.from(set).map((listener) => __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
try {
|
|
268
|
+
yield listener(event);
|
|
269
|
+
}
|
|
270
|
+
catch (_a) {
|
|
271
|
+
/* empty */
|
|
272
|
+
}
|
|
273
|
+
})));
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.MicroAgentica = MicroAgentica;
|
|
279
|
+
//# sourceMappingURL=MicroAgentica.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicroAgentica.js","sourceRoot":"","sources":["../src/MicroAgentica.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,qEAAkE;AAClE,4FAAyF;AACzF,kGAA+F;AAC/F,6CAAuE;AACvE,mDAAwD;AACxD,+CAA+C;AAC/C,wFAAqF;AACrF,mDAAgD;AAChD,uFAAoF;AACpF,mDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,aAAa;IAMxB;;kEAE8D;IAC9D;;;;OAIG;IACH,YAAoC,KAAiC;;QAAjC,UAAK,GAAL,KAAK,CAA4B;QACnE,IAAI,CAAC,WAAW,GAAG,qDAAyB,CAAC,OAAO,CAAC;YACnD,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,GAAG,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CACpD,qDAAyB,CAAC,SAAS,CAAC;YAClC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK;YAClC,OAAO,EAAE,KAAK;SACf,CAAC,CAC8B,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IA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