Class MicroAgenticaRpcService<Model>

RPC service for the MicroAgentica.

MicroAgenticaRpcService is class defining an AI agent service provided from the server to clients through the RPC (Remote Procedure Call) paradigm in the websocket protocol.

Client connecting to the MicroAgenticaRpcService providing websocket server will call the conversate function remotely through its basic interface type IAgenticaRpcService with the RPC paradigm.

Also, the client provides the IMicroAgenticaRpcListener type to the server, so that MicroAgenticaRpcService will remotely call the listener's functions internally.

You can open the WebSocket server of the AI agent like below:

import {
IMicroAgenticaRpcListener,
IAgenticaRpcService,
Agentica,
MicroAgenticaRpcService,
} from "@agentica/core";
import { WebSocketServer } from "tgrid";

const server: WebSocketServer<
null,
IAgenticaRpcService,
IMicroAgenticaRpcListener
> = new WebSocketServer();
await server.open(3001, async (acceptor) => {
await acceptor.accept(
new MicroAgenticaRpcService({
agent: new MicroAgentica({ ... }),
listener: acceptor.getDriver(),
}),
);
});

Samchon

Type Parameters

  • Model extends ILlmSchema.Model

Implements

Constructors

Methods