@cubie-ai/tiny-ai - v0.0.14
    Preparing search index...

    Creating Agents

    When creating a TinyAgent instance you only need to supply an options parameter to the constructor.

    The provider is the only required field.

    interface TinyAgentOptions<T extends TinyProvider<any, any, any>> {
    provider: T;
    }

    The remaining optional fields are:

    interface TinyAgentOptions<T extends TinyProvider<any, any, any>> {
    tools?: TinyTool[] | Record<string, TinyTool>;
    clients?: TinyMCP[];
    name?: string;
    settings?: AgentSettings;
    }

    interface AgentSettings {
    system?: string;
    maxSteps?: number;
    maxTokens?: number;
    temperature?: number;
    topP?: number;
    frequencyPenalty?: number;
    presencePenalty?: number;
    }

    You will need an API_KEY from one of the supported providers.

    1. You create a provider instances
    const provider = new TinyXAI({
    apiKey: "API_KEY",
    });
    1. You create a new TinyAgent and supply the provider
    const agent = new TinyAgent({
    provider,
    });