UNPKG

@agentica/core

Version:

Agentic AI Library specialized in LLM Function Calling

72 lines (71 loc) 2.91 kB
import type { AgenticaTokenUsage } from "../context/AgenticaTokenUsage"; import type { IAgenticaTokenUsageJson } from "../json/IAgenticaTokenUsageJson"; import type { IMicroAgenticaHistoryJson } from "../json/IMicroAgenticaHistoryJson"; import type { IAgenticaController } from "./IAgenticaController"; import type { IAgenticaVendor } from "./IAgenticaVendor"; import type { IMicroAgenticaConfig } from "./IMicroAgenticaConfig"; /** * Properties of the Micro Agentica Agent. * * `IMicroAgenticaProps` is an interface that defines the properties * of the {@link MicroAgentica.constructor}. In the `IMicroAgenticaProps`, * there're everything to prepare to create a Micro A.I. chatbot * performing the LLM (Large Language Model) function calling. * * At first, you have to specify the LLM service {@link vendor} like * OpenAI with its API key and client API. And then, you have to define * the {@link controllers} serving the functions to call. The controllers * are separated by two protocols; HTTP API and TypeScript class. At last, * you can {@link config configure} the agent by setting the locale, * timezone, and some of system prompts. * * Additionally, if you want to start from the previous A.I. chatbot * session, you can accomplish it by assigning the previous prompt * histories to the {@link histories} property. * * @author Samchon */ export interface IMicroAgenticaProps { /** * LLM service vendor. */ vendor: IAgenticaVendor; /** * Controllers serving functions to call. */ controllers: IAgenticaController[]; /** * Configuration of agent. * * Configuration of A.I. chatbot agent including the user's locale, * timezone, and some of system prompts. Also, you can affect to the * LLM function selecting/calling logic by configuring additional * properties. * * If you don't configure this property, these values would be default. * * - `locale`: your system's locale and timezone * - `timezone`: your system's timezone * - `systemPrompt`: default prompts written in markdown * - https://github.com/wrtnlabs/agentica/tree/main/packages/core/prompts */ config?: IMicroAgenticaConfig; /** * Prompt histories. * * If you're starting the conversation from an existing session, * assign the previouis prompt histories to this property. */ histories?: IMicroAgenticaHistoryJson[]; /** * Token usage information. * * You can start token usage tracing by assigning this property. * * If you assign {@link IAgenticaTokenUsageJson} value, the * token usage tracing would be from the value. Otherwise you * assign the {@link AgenticaTokenUsage} typed instance, the * tracing would be binded to the instance. */ tokenUsage?: IAgenticaTokenUsageJson | AgenticaTokenUsage | undefined; }