UNPKG

adk-typescript

Version:

TypeScript port of Google's Agent Development Kit (ADK)

66 lines (65 loc) 1.93 kB
import { Content, GenerateContentConfig, LiveConnectConfig, FunctionDeclaration } from './types'; import { BaseTool } from '../tools/BaseTool'; /** * LLM request class that allows passing in tools, output schema and system * instructions to the model. */ export declare class LlmRequest { /** * The model name. */ model?: string; /** * The contents to send to the model. */ contents: Content[]; /** * Additional config for the generate content request. * Tools in generate_content_config should not be set. */ config: GenerateContentConfig; /** * Configuration for live connections */ liveConnectConfig: LiveConnectConfig; /** * The tools dictionary. * Maps tool names to tool instances. * @private Not serialized when converting to JSON */ private toolsDict; /** * Creates a new LLM request. */ constructor(); /** * Appends instructions to the system instruction. * @param instructions The instructions to append. */ appendInstructions(instructions: string[]): void; /** * Appends tools to the request. * @param tools The tools to append. */ appendTools(tools: BaseTool[]): void; /** * Sets the output schema for the request. * @param baseModel The schema class to set the output schema to. */ setOutputSchema(baseModel: any): void; /** * Get the tools dictionary for this request. * @returns The tools dictionary */ getToolsDict(): Record<string, BaseTool>; /** * Adds a function declaration to the tools. * @param functionDef The function definition to add */ addFunction(functionDef: FunctionDeclaration): void; /** * Converts this LlmRequest to a plain object for API requests. * @returns A plain object representation of this request */ toRequestObject(): any; }