UNPKG

@obayd/agentic

Version:

A powerful agent framework for LLMs.

78 lines (67 loc) 2.63 kB
// src/Toolpack.d.ts import { Tool } from './Tool'; /** * Represents a collection of related Tools. * Toolpacks can be enabled or disabled within a Conversation. */ export declare class Toolpack { /** * The unique name of the toolpack. Should contain only letters, numbers, and underscores. * @readonly */ readonly name: string; #description: string; #tools: Tool[]; /** * Creates a new Toolpack instance. * @param name The name of the toolpack. Must be a non-empty string containing only letters, numbers, and underscores. * @throws {Error} If the name is invalid. */ constructor(name: string); /** * Static factory method to create a new Toolpack instance. * @param name The name of the toolpack. * @returns A new Toolpack instance. */ static make(name: string): Toolpack; /** * Sets the description for the toolpack. * @param description A human-readable explanation of the toolpack's purpose. * @returns The Toolpack instance for chaining. * @throws {Error} If the description is not a string. */ description(description: string): this; /** * Alias for `description()`. * @param description A human-readable explanation of the toolpack's purpose. * @returns The Toolpack instance for chaining. */ desc(description: string): this; /** * Adds a Tool instance to the toolpack. * @param tool The Tool instance to add. * @returns The Toolpack instance for chaining. * @throws {Error} If the provided argument is not an instance of Tool. */ addTool(tool: Tool): this; /** * Adds multiple Tool instances to the toolpack. * @param tools An array of Tool instances to add. * @returns The Toolpack instance for chaining. * @throws {Error} If any element is not a Tool instance. */ add(...tools: Tool[]): this; /** * Gets a copy of the tools contained within this toolpack. * @returns An array of Tool instances. */ getTools(): Tool[]; /** * Builds the string representation of the toolpack for the LLM prompt. * Indicates whether the toolpack is currently enabled or disabled. * @param isEnabled Whether the toolpack is currently enabled in the conversation. * @returns A formatted string describing the toolpack and the tools it provides. * @internal This method is primarily for internal use by the Conversation class. */ buildPromptString(isEnabled: boolean): string; }