Skip to content

Releases: VoltAgent/voltagent

[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

  • #33 3ef2eaa Thanks @kwaa! - Update package.json files:

    • Remove src directory from the files array.
    • Add explicit exports field for better module resolution.

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Minor Changes

  • #29 82e27c2 Thanks @foxy17! - feat(google-ai): Add initial Google AI provider package - #12

    Introduces the @voltagent/google-ai package to integrate Google's Generative AI capabilities directly into VoltAgent. This allows developers to leverage powerful models like Gemini within their agents.

    This initial version includes:

    • The core GoogleGenAIProvider class for interfacing with the @google/genai SDK.
    • Configuration options for API key authentication.
    • Basic setup and usage examples in the README.
    • Documentation outlining future support and considerations for Vertex AI.

Patch Changes

@voltagent/[email protected]

25 Apr 23:28
0da82f2
Compare
Choose a tag to compare

Patch Changes

  • e328613 Thanks @omeraplak! - fix: prevent ReferenceError: module is not defined in ES module environments by adding guards around the CommonJS-specific require.main === module check in the main entry point.

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

  • #41 52d5fa9 Thanks @omeraplak! - ## Introducing Toolkits for Better Tool Management

    Managing related tools and their instructions is now simpler with Toolkits.

    Motivation:

    • Defining shared instructions for multiple related tools was cumbersome.
    • The logic for deciding which instructions to add to the agent's system prompt could become complex.
    • We wanted a cleaner way to group tools logically.

    What's New: The Toolkit

    A Toolkit bundles related tools and allows defining shared instructions and an addInstructions flag at the toolkit level.

    // packages/core/src/tool/toolkit.ts
    export type Toolkit = {
      /**
       * Unique identifier name for the toolkit.
       */
      name: string;
      /**
       * A brief description of what the toolkit does. Optional.
       */
      description?: string;
      /**
       * Shared instructions for the LLM on how to use the tools within this toolkit.
       * Optional.
       */
      instructions?: string;
      /**
       * Whether to automatically add the toolkit's `instructions` to the agent's system prompt.
       * Defaults to false.
       */
      addInstructions?: boolean;
      /**
       * An array of Tool instances that belong to this toolkit.
       */
      tools: Tool<any>[];
    };

    Key Changes to Core:

    1. ToolManager Upgrade: Now manages both Tool and Toolkit objects.
    2. AgentOptions Update: The tools option accepts (Tool<any> | Toolkit)[].
    3. Simplified Instruction Handling: Agent now only adds instructions from Toolkits where addInstructions is true.

    This change leads to a clearer separation of concerns, simplifies the agent's internal logic, and makes managing tool instructions more predictable and powerful.

    New createToolkit Helper

    We've also added a helper function, createToolkit, to simplify the creation of toolkits. It provides default values and basic validation:

    // packages/core/src/tool/toolkit.ts
    export const createToolkit = (options: Toolkit): Toolkit => {
      if (!options.name) {
        throw new Error("Toolkit name is required");
      }
      if (!options.tools || options.tools.length === 0) {
        console.warn(`Toolkit '${options.name}' created without any tools.`);
      }
    
      return {
        name: options.name,
        description: options.description || "", // Default empty description
        instructions: options.instructions,
        addInstructions: options.addInstructions || false, // Default to false
        tools: options.tools || [], // Default to empty array
      };
    };

    Example Usage:

    import { createTool, createToolkit } from "@voltagent/core";
    import { z } from "zod";
    
    // Define some tools first
    const getWeather = createTool({
      name: "getWeather",
      description: "Gets the weather for a location.",
      schema: z.object({ location: z.string() }),
      run: async ({ location }) => ({ temperature: "25C", condition: "Sunny" }),
    });
    
    const searchWeb = createTool({
      name: "searchWeb",
      description: "Searches the web for a query.",
      schema: z.object({ query: z.string() }),
      run: async ({ query }) => ({ results: ["Result 1", "Result 2"] }),
    });
    
    // Create a toolkit using the helper
    const webInfoToolkit = createToolkit({
      name: "web_information",
      description: "Tools for getting information from the web.",
      instructions: "Use these tools to find current information online.",
      addInstructions: true, // Add the instructions to the system prompt
      tools: [getWeather, searchWeb],
    });
    
    console.log(webInfoToolkit);
    /*
    Output:
    {
      name: 'web_information',
      description: 'Tools for getting information from the web.',
      instructions: 'Use these tools to find current information online.',
      addInstructions: true,
      tools: [ [Object Tool: getWeather], [Object Tool: searchWeb] ]
    }
    */
  • #33 3ef2eaa Thanks @kwaa! - Update package.json files:

    • Remove src directory from the files array.
    • Add explicit exports field for better module resolution.
  • #41 52d5fa9 Thanks @omeraplak! - ## Introducing Reasoning Tools Helper

    This update introduces a new helper function, createReasoningTools, to easily add step-by-step reasoning capabilities to your agents. #24

    New createReasoningTools Helper

    Feature: Easily add think and analyze tools for step-by-step reasoning.

    We've added a new helper function, createReasoningTools, which makes it trivial to equip your agents with structured thinking capabilities, similar to patterns seen in advanced AI systems.

    • What it does: Returns a pre-configured Toolkit named reasoning_tools.
    • Tools included: Contains the think tool (for internal monologue/planning) and the analyze tool (for evaluating results and deciding next steps).
    • Instructions: Includes detailed instructions explaining how the agent should use these tools iteratively to solve problems. You can choose whether these instructions are automatically added to the system prompt via the addInstructions option.
    import { createReasoningTools, type Toolkit } from "@voltagent/core";
    
    // Get the reasoning toolkit (with instructions included in the system prompt)
    const reasoningToolkit: Toolkit = createReasoningTools({ addInstructions: true });
    
    // Get the toolkit without automatically adding instructions
    const reasoningToolkitManual: Toolkit = createReasoningTools({ addInstructions: false });

    How to Use Reasoning Tools

    Pass the Toolkit object returned by createReasoningTools directly to the agent's tools array.

    // Example: Using the new reasoning tools helper
    import { Agent, createReasoningTools, type Toolkit } from "@voltagent/core";
    import { VercelAIProvider } from "@voltagent/vercel-ai";
    import { openai } from "@ai-sdk/openai";
    
    const reasoningToolkit: Toolkit = createReasoningTools({
      addInstructions: true,
    });
    
    const agent = new Agent({
      name: "MyThinkingAgent",
      description: "An agent equipped with reasoning tools.",
      llm: new VercelAIProvider(),
      model: openai("gpt-4o-mini"),
      tools: [reasoningToolkit], // Pass the toolkit
    });
    
    // Agent's system message will include reasoning instructions.

    This change simplifies adding reasoning capabilities to your agents.

@voltagent/[email protected]

25 Apr 16:57
d5f8255
Compare
Choose a tag to compare

Patch Changes

  • #33 3ef2eaa Thanks @kwaa! - Update package.json files:

    • Remove src directory from the files array.
    • Add explicit exports field for better module resolution.

@voltagent/[email protected]

24 Apr 17:05
ccbe44c
Compare
Choose a tag to compare

Patch Changes

  • #35 9acbbb8 Thanks @omeraplak! - fix: Prevent potential error when accessing debug option in LibSQLStorage - #34

    • Modified the debug method within the LibSQLStorage class.
    • Changed the access to this.options.debug to use optional chaining (this.options?.debug).

    This change prevents runtime errors that could occur in specific environments, such as Next.js, if the debug method is invoked before the options object is fully initialized or if options becomes unexpectedly null or undefined. It ensures the debug logging mechanism is more robust.