RPC service for the Agentica.

AgenticaRpcService 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 AgenticaRpcService providing websocket server will call the conversate function remotely through its basic interface type IAgenticaRpcService with the RPC paradigm.

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

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

import {
IAgenticaRpcListener,
IAgenticaRpcService,
Agentica,
AgenticaRpcService,
} from "@agentica/core";
import { WebSocketServer } from "tgrid";

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

Samchon

Type Parameters

  • Model extends ILlmSchema.Model

Implements

Constructors

Methods

  • Conversate with the AI agent.

    User talks to the AI agent with the content.

    When AI agent responds some actions like conversating or executing LLM (Large Language Model) function calling, the functions defined in the IAgenticaRpcListener would be called through the RPC (Remote Procedure Call) paradigm.

    Parameters

    • content: string

      The content to talk

    Returns Promise<void>

    Returned when the conversation process is completely done