@agentica/rpc 0.23.0 → 0.25.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/README.md +1 -1
- package/lib/AgenticaRpcService.js +5 -2
- package/lib/AgenticaRpcService.js.map +1 -1
- package/lib/IAgenticaRpcListener.d.ts +9 -3
- package/lib/IAgenticaRpcService.d.ts +2 -2
- package/lib/IMicroAgenticaRpcListener.d.ts +9 -3
- package/lib/MicroAgenticaRpcService.js +5 -2
- package/lib/MicroAgenticaRpcService.js.map +1 -1
- package/lib/index.mjs +10 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/AgenticaRpcService.ts +5 -2
- package/src/IAgenticaRpcListener.ts +10 -3
- package/src/IAgenticaRpcService.ts +7 -2
- package/src/IMicroAgenticaRpcListener.ts +10 -3
- package/src/MicroAgenticaRpcService.ts +5 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- https://github.com/user-attachments/assets/5326cc59-5129-470d-abcb-c3f458b5c488 -->
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
[](https://github.com/wrtnlabs/agentica/blob/master/LICENSE)
|
|
8
8
|
[](https://www.npmjs.com/package/@agentica/core)
|
|
@@ -63,9 +63,12 @@ class AgenticaRpcService {
|
|
|
63
63
|
this.props = props;
|
|
64
64
|
const { agent, listener } = props;
|
|
65
65
|
// ESSENTIAL LISTENERS
|
|
66
|
-
agent.on("
|
|
66
|
+
agent.on("userMessage", (event) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
listener.userMessage(event.toJSON()).catch(() => { });
|
|
68
|
+
}));
|
|
69
|
+
agent.on("assistantMessage", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
67
70
|
yield evt.join();
|
|
68
|
-
listener.
|
|
71
|
+
listener.assistantMessage(evt.toJSON()).catch(() => { });
|
|
69
72
|
}));
|
|
70
73
|
agent.on("describe", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
71
74
|
yield evt.join();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaRpcService.js","sourceRoot":"","sources":["../src/AgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,kBAAkB;IAE7B;;;;OAIG;IACH,YAAoC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;QACzE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAElC,sBAAsB;QACtB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAO,GAAG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"AgenticaRpcService.js","sourceRoot":"","sources":["../src/AgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,kBAAkB;IAE7B;;;;OAIG;IACH,YAAoC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;QACzE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAElC,sBAAsB;QACtB,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,CAAO,KAAK,EAAE,EAAE;YACtC,QAAQ,CAAC,WAAY,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACxD,CAAC,CAAA,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAO,GAAG,EAAE,EAAE;YACzC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YACjB,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,C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AK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAO,GAAG,EAAE,EAAE;YAChC,QAAQ,CAAC,OAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClD,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACU,UAAU,CAAC,OAAqE;;YAC3F,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;KAAA;IAED;;OAEG;IACU,cAAc;;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAkC,CAAC;QAC3E,CAAC;KAAA;CACF;AA3DD,gDA2DC"}
|
|
@@ -52,11 +52,17 @@ export interface IAgenticaRpcListener {
|
|
|
52
52
|
*/
|
|
53
53
|
describe: (evt: IAgenticaEventJson.IDescribe) => Promise<void>;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Assistant conversation message.
|
|
56
56
|
*
|
|
57
|
-
* @param evt Event of
|
|
57
|
+
* @param evt Event of assistant conversation
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
assistantMessage: (evt: IAgenticaEventJson.IAssistantMessage) => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* User conversation message.
|
|
62
|
+
*
|
|
63
|
+
* @param evt Event of user conversation
|
|
64
|
+
*/
|
|
65
|
+
userMessage?: (evt: IAgenticaEventJson.IUserMessage) => Promise<void>;
|
|
60
66
|
/**
|
|
61
67
|
* Initialize the AI agent.
|
|
62
68
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAgenticaController } from "@agentica/core";
|
|
1
|
+
import type { AgenticaUserMessageContent, IAgenticaController } from "@agentica/core";
|
|
2
2
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
/**
|
|
4
4
|
* RPC interface of AI agent service.
|
|
@@ -27,7 +27,7 @@ export interface IAgenticaRpcService<Model extends ILlmSchema.Model> {
|
|
|
27
27
|
* @param content The content to talk
|
|
28
28
|
* @returns Returned when the conversation process is completely done
|
|
29
29
|
*/
|
|
30
|
-
conversate: (content: string) => Promise<void>;
|
|
30
|
+
conversate: (content: string | AgenticaUserMessageContent | Array<AgenticaUserMessageContent>) => Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* Get controllers.
|
|
33
33
|
*
|
|
@@ -55,11 +55,17 @@ export interface IMicroAgenticaRpcListener {
|
|
|
55
55
|
*/
|
|
56
56
|
describe: (evt: IAgenticaEventJson.IDescribe) => Promise<void>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Assistant conversation message.
|
|
59
59
|
*
|
|
60
|
-
* @param evt Event of
|
|
60
|
+
* @param evt Event of assistant conversation
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
assistantMessage: (evt: IAgenticaEventJson.IAssistantMessage) => Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* User conversation message.
|
|
65
|
+
*
|
|
66
|
+
* @param evt Event of user conversation
|
|
67
|
+
*/
|
|
68
|
+
userMessage?: (evt: IAgenticaEventJson.IUserMessage) => Promise<void>;
|
|
63
69
|
/**
|
|
64
70
|
* Call a function.
|
|
65
71
|
*
|
|
@@ -63,9 +63,12 @@ class MicroAgenticaRpcService {
|
|
|
63
63
|
this.props = props;
|
|
64
64
|
const { agent, listener } = props;
|
|
65
65
|
// ESSENTIAL LISTENERS
|
|
66
|
-
agent.on("
|
|
66
|
+
agent.on("userMessage", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
listener.userMessage(evt.toJSON()).catch(() => { });
|
|
68
|
+
}));
|
|
69
|
+
agent.on("assistantMessage", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
67
70
|
yield evt.join();
|
|
68
|
-
listener.
|
|
71
|
+
listener.assistantMessage(evt.toJSON()).catch(() => { });
|
|
69
72
|
}));
|
|
70
73
|
agent.on("describe", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
71
74
|
yield evt.join();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MicroAgenticaRpcService.js","sourceRoot":"","sources":["../src/MicroAgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,uBAAuB;IAElC;;;;OAIG;IACH,YAAoC,KAA4C;QAA5C,UAAK,GAAL,KAAK,CAAuC;QAC9E,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAElC,sBAAsB;QACtB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAO,GAAG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"MicroAgenticaRpcService.js","sourceRoot":"","sources":["../src/MicroAgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,uBAAuB;IAElC;;;;OAIG;IACH,YAAoC,KAA4C;QAA5C,UAAK,GAAL,KAAK,CAAuC;QAC9E,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAElC,sBAAsB;QACtB,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,CAAO,GAAG,EAAE,EAAE;YACpC,QAAQ,CAAC,WAAY,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACtD,CAAC,CAAA,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAO,GAAG,EAAE,EAAE;YACzC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YACjB,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAA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
|
5
|
-
agent.on("
|
|
5
|
+
agent.on("userMessage", (async event => {
|
|
6
|
+
listener.userMessage(event.toJSON()).catch((() => {}));
|
|
7
|
+
}));
|
|
8
|
+
agent.on("assistantMessage", (async evt => {
|
|
6
9
|
await evt.join();
|
|
7
|
-
listener.
|
|
10
|
+
listener.assistantMessage(evt.toJSON()).catch((() => {}));
|
|
8
11
|
}));
|
|
9
12
|
agent.on("describe", (async evt => {
|
|
10
13
|
await evt.join();
|
|
@@ -41,9 +44,12 @@ class MicroAgenticaRpcService {
|
|
|
41
44
|
constructor(props) {
|
|
42
45
|
this.props = props;
|
|
43
46
|
const {agent, listener} = props;
|
|
44
|
-
agent.on("
|
|
47
|
+
agent.on("userMessage", (async evt => {
|
|
48
|
+
listener.userMessage(evt.toJSON()).catch((() => {}));
|
|
49
|
+
}));
|
|
50
|
+
agent.on("assistantMessage", (async evt => {
|
|
45
51
|
await evt.join();
|
|
46
|
-
listener.
|
|
52
|
+
listener.assistantMessage(evt.toJSON()).catch((() => {}));
|
|
47
53
|
}));
|
|
48
54
|
agent.on("describe", (async evt => {
|
|
49
55
|
await evt.join();
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/AgenticaRpcService.ts","../src/MicroAgenticaRpcService.ts"],"sourcesContent":[null,null],"names":["AgenticaRpcService","constructor","props","this","agent","listener","on","async","
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/AgenticaRpcService.ts","../src/MicroAgenticaRpcService.ts"],"sourcesContent":[null,null],"names":["AgenticaRpcService","constructor","props","this","agent","listener","on","async","event","userMessage","toJSON","catch","evt","join","assistantMessage","describe","initialize","select","cancel","args","call","arguments","execute","conversate","content","getControllers","MicroAgenticaRpcService"],"mappings":"MAiDaA;IAOX,WAAAC,CAAoCC;QAAAC,KAAKD,QAALA;QAClC,OAAME,OAAOC,YAAeH;QAG5BE,MAAME,GAAG,gBAAeC,MAAOC;YAC7BH,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ASe,KAC5DR,IAAIF;YAEN,IAAIS,QAAQ,MAAM;gBAChBP,IAAIS,YAAYF;;;QAGpBf,MAAME,GAAG,YAAWC,MAAOK;YACzBP,SAASiB,QAASV,IAAIF,UAAUC,OAAM;AAAS;;IAO5C,gBAAMY,CAAWC;cAChBrB,KAAKD,MAAME,MAAMmB,WAAWC;;IAM7B,oBAAMC;QACX,OAAOtB,KAAKD,MAAME,MAAMqB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentica/rpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Agentic AI Library specialized in LLM Function Calling",
|
|
5
5
|
"author": "Wrtn Technologies",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"src"
|
|
36
36
|
],
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@agentica/core": "^0.
|
|
38
|
+
"@agentica/core": "^0.25.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@samchon/openapi": "^4.
|
|
42
|
-
"typia": "^9.0
|
|
43
|
-
"@agentica/core": "^0.
|
|
41
|
+
"@samchon/openapi": "^4.3.0",
|
|
42
|
+
"typia": "^9.3.0",
|
|
43
|
+
"@agentica/core": "^0.25.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -58,9 +58,12 @@ implements IAgenticaRpcService<Model> {
|
|
|
58
58
|
const { agent, listener } = props;
|
|
59
59
|
|
|
60
60
|
// ESSENTIAL LISTENERS
|
|
61
|
-
agent.on("
|
|
61
|
+
agent.on("userMessage", async (event) => {
|
|
62
|
+
listener.userMessage!(event.toJSON()).catch(() => {});
|
|
63
|
+
});
|
|
64
|
+
agent.on("assistantMessage", async (evt) => {
|
|
62
65
|
await evt.join();
|
|
63
|
-
listener.
|
|
66
|
+
listener.assistantMessage(evt.toJSON()).catch(() => {});
|
|
64
67
|
});
|
|
65
68
|
agent.on("describe", async (evt) => {
|
|
66
69
|
await evt.join();
|
|
@@ -54,11 +54,18 @@ export interface IAgenticaRpcListener {
|
|
|
54
54
|
describe: (evt: IAgenticaEventJson.IDescribe) => Promise<void>;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Assistant conversation message.
|
|
58
58
|
*
|
|
59
|
-
* @param evt Event of
|
|
59
|
+
* @param evt Event of assistant conversation
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
assistantMessage: (evt: IAgenticaEventJson.IAssistantMessage) => Promise<void>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* User conversation message.
|
|
65
|
+
*
|
|
66
|
+
* @param evt Event of user conversation
|
|
67
|
+
*/
|
|
68
|
+
userMessage?: (evt: IAgenticaEventJson.IUserMessage) => Promise<void>;
|
|
62
69
|
|
|
63
70
|
/**
|
|
64
71
|
* Initialize the AI agent.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAgenticaController } from "@agentica/core";
|
|
1
|
+
import type { AgenticaUserMessageContent, IAgenticaController } from "@agentica/core";
|
|
2
2
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -28,7 +28,12 @@ export interface IAgenticaRpcService<Model extends ILlmSchema.Model> {
|
|
|
28
28
|
* @param content The content to talk
|
|
29
29
|
* @returns Returned when the conversation process is completely done
|
|
30
30
|
*/
|
|
31
|
-
conversate: (
|
|
31
|
+
conversate: (
|
|
32
|
+
content:
|
|
33
|
+
| string
|
|
34
|
+
| AgenticaUserMessageContent
|
|
35
|
+
| Array<AgenticaUserMessageContent>,
|
|
36
|
+
) => Promise<void>;
|
|
32
37
|
|
|
33
38
|
/**
|
|
34
39
|
* Get controllers.
|
|
@@ -57,11 +57,18 @@ export interface IMicroAgenticaRpcListener {
|
|
|
57
57
|
describe: (evt: IAgenticaEventJson.IDescribe) => Promise<void>;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Assistant conversation message.
|
|
61
61
|
*
|
|
62
|
-
* @param evt Event of
|
|
62
|
+
* @param evt Event of assistant conversation
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
assistantMessage: (evt: IAgenticaEventJson.IAssistantMessage) => Promise<void>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* User conversation message.
|
|
68
|
+
*
|
|
69
|
+
* @param evt Event of user conversation
|
|
70
|
+
*/
|
|
71
|
+
userMessage?: (evt: IAgenticaEventJson.IUserMessage) => Promise<void>;
|
|
65
72
|
|
|
66
73
|
/**
|
|
67
74
|
* Call a function.
|
|
@@ -58,9 +58,12 @@ implements IAgenticaRpcService<Model> {
|
|
|
58
58
|
const { agent, listener } = props;
|
|
59
59
|
|
|
60
60
|
// ESSENTIAL LISTENERS
|
|
61
|
-
agent.on("
|
|
61
|
+
agent.on("userMessage", async (evt) => {
|
|
62
|
+
listener.userMessage!(evt.toJSON()).catch(() => {});
|
|
63
|
+
});
|
|
64
|
+
agent.on("assistantMessage", async (evt) => {
|
|
62
65
|
await evt.join();
|
|
63
|
-
listener.
|
|
66
|
+
listener.assistantMessage(evt.toJSON()).catch(() => {});
|
|
64
67
|
});
|
|
65
68
|
agent.on("describe", async (evt) => {
|
|
66
69
|
await evt.join();
|