Interface ILlmController<Model, Class>

Controller of LLM function calling.

ILlmController is a controller of LLM function calling, containing not only the application of function calling schemas, but also identifier name of the application and executor of its TypeScript class/interface functions.

Here is an example of using ILlmController type for AI agent development of performing AI function calling to mobile API classes/interfaces through typia and @agentica.

import { Agentica } from "@agentica/core";
import typia from "typia";

const agentica = new Agentica({
model: "chatgpt",
vendor: {
api: new OpenAI({ apiKey: "********" }),
model: "gpt-4o-mini",
},
controllers: [
typia.llm.controller<ReactNativeFileSystem, "chatgpt">(
"filesystem",
new ReactNativeFileSystem(),
),
typia.llm.controller<ReactNativeGallery, "chatgpt">(
"gallery",
new ReactNativeGallery(),
),
],
});
await agentica.conversate(
"Organize photo collection and sort them into appropriate folders.",
);

For reference, this ILlmController type is designed for TypeScript classes/interfaces. If you want to make a controller of another protocol like HTTP or MCP, use below types instead:

interface ILlmController<Model extends Model, Class extends object = any> {
    application: ILlmApplication<Model, Class>;
    execute: Class;
    name: string;
    protocol: "class";
}

Type Parameters

  • Model extends Model

    Type of the LLM model

  • Class extends object = any

    Class type of the function executor

Properties

application: ILlmApplication<Model, Class>

Application schema of function calling.

execute: Class

Executor of the class function.

Executor of the class function, by target class instance.

name: string

Identifier name of the controller.

protocol: "class"

Protocol discriminator.