@agentica/rpc 0.10.4 → 0.11.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.
- package/lib/AgenticaRpcService.d.ts +2 -3
- package/lib/AgenticaRpcService.js +5 -3
- package/lib/AgenticaRpcService.js.map +1 -1
- package/lib/IAgenticaRpcListener.d.ts +11 -13
- package/lib/IAgenticaRpcService.d.ts +1 -2
- package/lib/index.mjs +7 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/AgenticaRpcService.ts +12 -10
- package/src/IAgenticaRpcListener.ts +11 -15
- package/src/IAgenticaRpcService.ts +1 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Agentica, IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { Primitive } from "typia";
|
|
4
3
|
import { IAgenticaRpcListener } from "./IAgenticaRpcListener";
|
|
5
4
|
import { IAgenticaRpcService } from "./IAgenticaRpcService";
|
|
6
5
|
/**
|
|
@@ -61,7 +60,7 @@ export declare class AgenticaRpcService<Model extends ILlmSchema.Model> implemen
|
|
|
61
60
|
/**
|
|
62
61
|
* @inheritDoc
|
|
63
62
|
*/
|
|
64
|
-
getControllers(): Promise<
|
|
63
|
+
getControllers(): Promise<IAgenticaController<Model>[]>;
|
|
65
64
|
}
|
|
66
65
|
export declare namespace AgenticaRpcService {
|
|
67
66
|
/**
|
|
@@ -75,6 +74,6 @@ export declare namespace AgenticaRpcService {
|
|
|
75
74
|
/**
|
|
76
75
|
* Listener to be binded on the agent.
|
|
77
76
|
*/
|
|
78
|
-
listener: IAgenticaRpcListener
|
|
77
|
+
listener: IAgenticaRpcListener;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
@@ -63,15 +63,17 @@ class AgenticaRpcService {
|
|
|
63
63
|
this.props = props;
|
|
64
64
|
const { agent, listener } = props;
|
|
65
65
|
// ESSENTIAL LISTENERS
|
|
66
|
-
agent.on("text", (evt) => listener.text(primitive(evt)));
|
|
67
|
-
agent.on("describe", (evt) =>
|
|
66
|
+
agent.on("text", (evt) => __awaiter(this, void 0, void 0, function* () { return listener.text(Object.assign(primitive(evt), { text: yield evt.join() })); }));
|
|
67
|
+
agent.on("describe", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return listener.describe(Object.assign(primitive(evt), { text: yield evt.join() }));
|
|
69
|
+
}));
|
|
68
70
|
// OPTIONAL LISTENERS
|
|
69
71
|
agent.on("initialize", (evt) => listener.initialize(primitive(evt)));
|
|
70
72
|
agent.on("select", (evt) => listener.select(primitive(evt)));
|
|
71
73
|
agent.on("cancel", (evt) => listener.cancel(primitive(evt)));
|
|
72
74
|
agent.on("call", (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
73
75
|
const args = yield listener.call(primitive(evt));
|
|
74
|
-
if (
|
|
76
|
+
if (args)
|
|
75
77
|
evt.arguments = args;
|
|
76
78
|
}));
|
|
77
79
|
agent.on("execute", (evt) => listener.execute(primitive(evt)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaRpcService.js","sourceRoot":"","sources":["../src/AgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,kBAAkB;IAG7B;;;;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,
|
|
1
|
+
{"version":3,"file":"AgenticaRpcService.js","sourceRoot":"","sources":["../src/AgenticaRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,kBAAkB;IAG7B;;;;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,gDAC7B,OAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAA,GAAA,CACzE,CAAC;QACF,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,CAAO,GAAG,EAAE,EAAE;YACjC,OAAA,QAAQ,CAAC,QAAQ,CACf,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAC1D,CAAA;UAAA,CACF,CAAC;QAEF,qBAAqB;QACrB,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9D,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9D,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAO,GAAG,EAAE,EAAE;YAC7B,MAAM,IAAI,GAA8B,MAAM,QAAQ,CAAC,IAAK,CAC1D,SAAS,CAAC,GAAG,CAAC,CACf,CAAC;YACF,IAAI,IAAI;gBAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;QACjC,CAAC,CAAA,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAQ,CAAC,SAAS,CAAC,GAAU,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACU,UAAU,CAAC,OAAe;;YACrC,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;AA/CD,gDA+CC;AAkBD;;GAEG;AACH,MAAM,SAAS,GAAG,CAAI,GAAM,EAAgB,EAAE,CAC5C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAiB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { Primitive } from "typia";
|
|
1
|
+
import { IAgenticaEventJson } from "@agentica/core";
|
|
4
2
|
/**
|
|
5
3
|
* RPC interface of AI agent listener.
|
|
6
4
|
*
|
|
@@ -8,7 +6,7 @@ import { Primitive } from "typia";
|
|
|
8
6
|
* provided from the client to server through the RPC (Remote Procedure Call)
|
|
9
7
|
* paradigm in the websocket protocol.
|
|
10
8
|
*
|
|
11
|
-
* It has defined the event listener functions of {@link
|
|
9
|
+
* It has defined the event listener functions of {@link AgenticaEvent}
|
|
12
10
|
* types. If you skip some event typed functions' implementations,
|
|
13
11
|
* the skipped event would be ignored.
|
|
14
12
|
*
|
|
@@ -43,7 +41,7 @@ import { Primitive } from "typia";
|
|
|
43
41
|
*
|
|
44
42
|
* @author Samchon
|
|
45
43
|
*/
|
|
46
|
-
export interface IAgenticaRpcListener
|
|
44
|
+
export interface IAgenticaRpcListener {
|
|
47
45
|
/**
|
|
48
46
|
* Describe the function executions' results.
|
|
49
47
|
*
|
|
@@ -52,13 +50,13 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
52
50
|
*
|
|
53
51
|
* @param evt Event of a description of function execution results
|
|
54
52
|
*/
|
|
55
|
-
describe(evt:
|
|
53
|
+
describe(evt: IAgenticaEventJson.IDescribe): Promise<void>;
|
|
56
54
|
/**
|
|
57
55
|
* Text conversation message.
|
|
58
56
|
*
|
|
59
57
|
* @param evt Event of a text conversation message
|
|
60
58
|
*/
|
|
61
|
-
text(evt:
|
|
59
|
+
text(evt: IAgenticaEventJson.IText): Promise<void>;
|
|
62
60
|
/**
|
|
63
61
|
* Initialize the AI agent.
|
|
64
62
|
*
|
|
@@ -67,7 +65,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
67
65
|
*
|
|
68
66
|
* @param evt Event of initialization
|
|
69
67
|
*/
|
|
70
|
-
initialize?(evt:
|
|
68
|
+
initialize?(evt: IAgenticaEventJson.IInitialize): Promise<void>;
|
|
71
69
|
/**
|
|
72
70
|
* Select a function to call.
|
|
73
71
|
*
|
|
@@ -75,7 +73,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
75
73
|
*
|
|
76
74
|
* @param evt Event of selecting a function to call
|
|
77
75
|
*/
|
|
78
|
-
select?(evt:
|
|
76
|
+
select?(evt: IAgenticaEventJson.ISelect): Promise<void>;
|
|
79
77
|
/**
|
|
80
78
|
* Cancel a function to call.
|
|
81
79
|
*
|
|
@@ -83,14 +81,14 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
83
81
|
*
|
|
84
82
|
* @param evt Event of canceling a function to call
|
|
85
83
|
*/
|
|
86
|
-
cancel?(evt:
|
|
84
|
+
cancel?(evt: IAgenticaEventJson.ICancel): Promise<void>;
|
|
87
85
|
/**
|
|
88
86
|
* Call a function.
|
|
89
87
|
*
|
|
90
88
|
* Informs a function calling from the AI agent server to client.
|
|
91
89
|
*
|
|
92
90
|
* This event comes before the function execution, so that if you return
|
|
93
|
-
* a different value from the original {@link
|
|
91
|
+
* a different value from the original {@link IAgenticaEventJson.ICall.arguments},
|
|
94
92
|
* you can modify the arguments of the function calling.
|
|
95
93
|
*
|
|
96
94
|
* Otherwise you do not return anything (`undefined`) or `null` value, the
|
|
@@ -101,7 +99,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
101
99
|
* @param evt Event of a function calling
|
|
102
100
|
* @return New arguments if you want to modify, otherwise null or undefined
|
|
103
101
|
*/
|
|
104
|
-
call?(evt:
|
|
102
|
+
call?(evt: IAgenticaEventJson.ICall): Promise<object | null | undefined>;
|
|
105
103
|
/**
|
|
106
104
|
* Executition of a function.
|
|
107
105
|
*
|
|
@@ -109,5 +107,5 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
109
107
|
*
|
|
110
108
|
* @param evt Event of a function execution
|
|
111
109
|
*/
|
|
112
|
-
execute?(evt:
|
|
110
|
+
execute?(evt: IAgenticaEventJson.IExecute): Promise<void>;
|
|
113
111
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { Primitive } from "typia";
|
|
4
3
|
/**
|
|
5
4
|
* RPC interface of AI agent service.
|
|
6
5
|
*
|
|
@@ -35,5 +34,5 @@ export interface IAgenticaRpcService<Model extends ILlmSchema.Model> {
|
|
|
35
34
|
* Get controllers, collection of functions that would be
|
|
36
35
|
* called by the AI chatbot.
|
|
37
36
|
*/
|
|
38
|
-
getControllers(): Promise<
|
|
37
|
+
getControllers(): Promise<IAgenticaController<Model>[]>;
|
|
39
38
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -2,14 +2,18 @@ class AgenticaRpcService {
|
|
|
2
2
|
constructor(props) {
|
|
3
3
|
this.props = props;
|
|
4
4
|
const {agent, listener} = props;
|
|
5
|
-
agent.on("text", (evt => listener.text(primitive(evt)
|
|
6
|
-
|
|
5
|
+
agent.on("text", (async evt => listener.text(Object.assign(primitive(evt), {
|
|
6
|
+
text: await evt.join()
|
|
7
|
+
}))));
|
|
8
|
+
agent.on("describe", (async evt => listener.describe(Object.assign(primitive(evt), {
|
|
9
|
+
text: await evt.join()
|
|
10
|
+
}))));
|
|
7
11
|
agent.on("initialize", (evt => listener.initialize(primitive(evt))));
|
|
8
12
|
agent.on("select", (evt => listener.select(primitive(evt))));
|
|
9
13
|
agent.on("cancel", (evt => listener.cancel(primitive(evt))));
|
|
10
14
|
agent.on("call", (async evt => {
|
|
11
15
|
const args = await listener.call(primitive(evt));
|
|
12
|
-
if (
|
|
16
|
+
if (args) evt.arguments = args;
|
|
13
17
|
}));
|
|
14
18
|
agent.on("execute", (evt => listener.execute(primitive(evt))));
|
|
15
19
|
}
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/AgenticaRpcService.ts"],"sourcesContent":[null],"names":["AgenticaRpcService","constructor","props","this","agent","listener","on","evt","text","primitive","describe","initialize","select","cancel","
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/AgenticaRpcService.ts"],"sourcesContent":[null],"names":["AgenticaRpcService","constructor","props","this","agent","listener","on","async","evt","text","Object","assign","primitive","join","describe","initialize","select","cancel","args","call","arguments","execute","conversate","content","getControllers","obj","JSON","parse","stringify"],"mappings":"MAkDaA;IAQX,WAAAC,CAAoCC;QAAAC,KAAKD,QAALA;QAClC,OAAME,OAAOC,YAAeH;QAG5BE,MAAME,GAAG,SAAQC,MAAOC,OACtBH,SAASI,KAAKC,OAAOC,OAAOC,UAAUJ,MAAM;YAAEC,YAAYD,IAAIK;;QAEhET,MAAME,GAAG,aAAYC,MAAOC,OAC1BH,SAASS,SACPJ,OAAOC,OAAOC,UAAUJ,MAAM;YAAEC,YAAYD,IAAIK;;QAKpDT,MAAME,GAAG,eAAeE,OAAQH,SAASU,WAAYH,UAAUJ;QAC/DJ,MAAME,GAAG,WAAWE,OAAQH,SAASW,OAAQJ,UAAUJ;QACvDJ,MAAME,GAAG,WAAWE,OAAQH,SAASY,OAAQL,UAAUJ;QACvDJ,MAAME,GAAG,SAAQC,MAAOC;YACtB,MAAMU,aAAwCb,SAASc,KACrDP,UAAUJ;YAEZ,IAAIU,MAAMV,IAAIY,YAAYF;AAAI;QAEhCd,MAAME,GAAG,YAAYE,OAAQH,SAASgB,QAAST,UAAUJ;;IAMpD,gBAAMc,CAAWC;cAChBpB,KAAKD,MAAME,MAAMkB,WAAWC;;IAM7B,oBAAMC;QACX,OAAOrB,KAAKD,MAAME,MAAMoB;;;;AAuB5B,MAAMZ,YAAgBa,OACpBC,KAAKC,MAAMD,KAAKE,UAAUH;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentica/rpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "Agentic AI Library specialized in LLM Function Calling",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"src"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@agentica/core": "^0.
|
|
40
|
+
"@agentica/core": "^0.11.1",
|
|
41
41
|
"@samchon/openapi": "^3.0.0",
|
|
42
42
|
"chalk": "4.1.2",
|
|
43
43
|
"openai": "^4.80.0",
|
|
@@ -60,8 +60,14 @@ export class AgenticaRpcService<Model extends ILlmSchema.Model>
|
|
|
60
60
|
const { agent, listener } = props;
|
|
61
61
|
|
|
62
62
|
// ESSENTIAL LISTENERS
|
|
63
|
-
agent.on("text", (evt) =>
|
|
64
|
-
|
|
63
|
+
agent.on("text", async (evt) =>
|
|
64
|
+
listener.text(Object.assign(primitive(evt), { text: await evt.join() })),
|
|
65
|
+
);
|
|
66
|
+
agent.on("describe", async (evt) =>
|
|
67
|
+
listener.describe(
|
|
68
|
+
Object.assign(primitive(evt), { text: await evt.join() }),
|
|
69
|
+
),
|
|
70
|
+
);
|
|
65
71
|
|
|
66
72
|
// OPTIONAL LISTENERS
|
|
67
73
|
agent.on("initialize", (evt) => listener.initialize!(primitive(evt)));
|
|
@@ -71,7 +77,7 @@ export class AgenticaRpcService<Model extends ILlmSchema.Model>
|
|
|
71
77
|
const args: object | null | undefined = await listener.call!(
|
|
72
78
|
primitive(evt),
|
|
73
79
|
);
|
|
74
|
-
if (
|
|
80
|
+
if (args) evt.arguments = args;
|
|
75
81
|
});
|
|
76
82
|
agent.on("execute", (evt) => listener.execute!(primitive(evt as any)));
|
|
77
83
|
}
|
|
@@ -86,12 +92,8 @@ export class AgenticaRpcService<Model extends ILlmSchema.Model>
|
|
|
86
92
|
/**
|
|
87
93
|
* @inheritDoc
|
|
88
94
|
*/
|
|
89
|
-
public async getControllers(): Promise<
|
|
90
|
-
|
|
91
|
-
> {
|
|
92
|
-
return this.props.agent.getControllers() satisfies ReadonlyArray<
|
|
93
|
-
IAgenticaController<Model>
|
|
94
|
-
> as Primitive<IAgenticaController<Model>>[];
|
|
95
|
+
public async getControllers(): Promise<IAgenticaController<Model>[]> {
|
|
96
|
+
return this.props.agent.getControllers() as IAgenticaController<Model>[];
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
export namespace AgenticaRpcService {
|
|
@@ -107,7 +109,7 @@ export namespace AgenticaRpcService {
|
|
|
107
109
|
/**
|
|
108
110
|
* Listener to be binded on the agent.
|
|
109
111
|
*/
|
|
110
|
-
listener: IAgenticaRpcListener
|
|
112
|
+
listener: IAgenticaRpcListener;
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { Primitive } from "typia";
|
|
1
|
+
import { IAgenticaEventJson } from "@agentica/core";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* RPC interface of AI agent listener.
|
|
@@ -9,7 +7,7 @@ import { Primitive } from "typia";
|
|
|
9
7
|
* provided from the client to server through the RPC (Remote Procedure Call)
|
|
10
8
|
* paradigm in the websocket protocol.
|
|
11
9
|
*
|
|
12
|
-
* It has defined the event listener functions of {@link
|
|
10
|
+
* It has defined the event listener functions of {@link AgenticaEvent}
|
|
13
11
|
* types. If you skip some event typed functions' implementations,
|
|
14
12
|
* the skipped event would be ignored.
|
|
15
13
|
*
|
|
@@ -44,7 +42,7 @@ import { Primitive } from "typia";
|
|
|
44
42
|
*
|
|
45
43
|
* @author Samchon
|
|
46
44
|
*/
|
|
47
|
-
export interface IAgenticaRpcListener
|
|
45
|
+
export interface IAgenticaRpcListener {
|
|
48
46
|
/**
|
|
49
47
|
* Describe the function executions' results.
|
|
50
48
|
*
|
|
@@ -53,14 +51,14 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
53
51
|
*
|
|
54
52
|
* @param evt Event of a description of function execution results
|
|
55
53
|
*/
|
|
56
|
-
describe(evt:
|
|
54
|
+
describe(evt: IAgenticaEventJson.IDescribe): Promise<void>;
|
|
57
55
|
|
|
58
56
|
/**
|
|
59
57
|
* Text conversation message.
|
|
60
58
|
*
|
|
61
59
|
* @param evt Event of a text conversation message
|
|
62
60
|
*/
|
|
63
|
-
text(evt:
|
|
61
|
+
text(evt: IAgenticaEventJson.IText): Promise<void>;
|
|
64
62
|
|
|
65
63
|
/**
|
|
66
64
|
* Initialize the AI agent.
|
|
@@ -70,7 +68,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
70
68
|
*
|
|
71
69
|
* @param evt Event of initialization
|
|
72
70
|
*/
|
|
73
|
-
initialize?(evt:
|
|
71
|
+
initialize?(evt: IAgenticaEventJson.IInitialize): Promise<void>;
|
|
74
72
|
|
|
75
73
|
/**
|
|
76
74
|
* Select a function to call.
|
|
@@ -79,7 +77,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
79
77
|
*
|
|
80
78
|
* @param evt Event of selecting a function to call
|
|
81
79
|
*/
|
|
82
|
-
select?(evt:
|
|
80
|
+
select?(evt: IAgenticaEventJson.ISelect): Promise<void>;
|
|
83
81
|
|
|
84
82
|
/**
|
|
85
83
|
* Cancel a function to call.
|
|
@@ -88,7 +86,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
88
86
|
*
|
|
89
87
|
* @param evt Event of canceling a function to call
|
|
90
88
|
*/
|
|
91
|
-
cancel?(evt:
|
|
89
|
+
cancel?(evt: IAgenticaEventJson.ICancel): Promise<void>;
|
|
92
90
|
|
|
93
91
|
/**
|
|
94
92
|
* Call a function.
|
|
@@ -96,7 +94,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
96
94
|
* Informs a function calling from the AI agent server to client.
|
|
97
95
|
*
|
|
98
96
|
* This event comes before the function execution, so that if you return
|
|
99
|
-
* a different value from the original {@link
|
|
97
|
+
* a different value from the original {@link IAgenticaEventJson.ICall.arguments},
|
|
100
98
|
* you can modify the arguments of the function calling.
|
|
101
99
|
*
|
|
102
100
|
* Otherwise you do not return anything (`undefined`) or `null` value, the
|
|
@@ -107,9 +105,7 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
107
105
|
* @param evt Event of a function calling
|
|
108
106
|
* @return New arguments if you want to modify, otherwise null or undefined
|
|
109
107
|
*/
|
|
110
|
-
call?(
|
|
111
|
-
evt: Primitive<IAgenticaEvent.ICall<Model>>,
|
|
112
|
-
): Promise<object | null | undefined>;
|
|
108
|
+
call?(evt: IAgenticaEventJson.ICall): Promise<object | null | undefined>;
|
|
113
109
|
|
|
114
110
|
/**
|
|
115
111
|
* Executition of a function.
|
|
@@ -118,5 +114,5 @@ export interface IAgenticaRpcListener<Model extends ILlmSchema.Model> {
|
|
|
118
114
|
*
|
|
119
115
|
* @param evt Event of a function execution
|
|
120
116
|
*/
|
|
121
|
-
execute?(evt:
|
|
117
|
+
execute?(evt: IAgenticaEventJson.IExecute): Promise<void>;
|
|
122
118
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { Primitive } from "typia";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* RPC interface of AI agent service.
|
|
@@ -37,5 +36,5 @@ export interface IAgenticaRpcService<Model extends ILlmSchema.Model> {
|
|
|
37
36
|
* Get controllers, collection of functions that would be
|
|
38
37
|
* called by the AI chatbot.
|
|
39
38
|
*/
|
|
40
|
-
getControllers(): Promise<
|
|
39
|
+
getControllers(): Promise<IAgenticaController<Model>[]>;
|
|
41
40
|
}
|