UNPKG

adk-typescript

Version:

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

44 lines (43 loc) 1.23 kB
import { BaseLlm } from './BaseLlm'; /** * Type for LLM constructor classes that have the supportedModels static method */ type LlmConstructor = { new (model: string): BaseLlm; supportedModels(): string[]; }; /** * Registry for LLMs. */ export declare class LlmRegistry { /** * Creates a new LLM instance. * @param model The model name. * @returns The LLM instance. */ static newLlm(model: string): BaseLlm; /** * Registers a new LLM class. * @param modelNameRegex The regex that matches the model name. * @param llmClass The constructor class that implements the model. */ private static _register; /** * Registers a new LLM class. * @param llmClass The constructor class that implements the model. */ static register(llmClass: LlmConstructor): void; /** * Simple LRU cache implementation */ private static resolveCache; private static readonly MAX_CACHE_SIZE; /** * Resolves the model to a BaseLlm constructor. * @param model The model name. * @returns The BaseLlm constructor. * @throws Error if the model is not found. */ static resolve(model: string): LlmConstructor; } export {};