Skip to content

Conversation

@voltagent-bot
Copy link
Member

@voltagent-bot voltagent-bot commented Apr 25, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@voltagent/[email protected]

Minor 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] ]
    }
    */
  • #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. Reasoning Tools (Think/Analyze) #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.

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]

Minor Changes

  • #29 82e27c2 Thanks @foxy17! - feat(google-ai): Add initial Google AI provider package - Google AI (Gemini) Provider Integration #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]

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.

[email protected]

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]

Patch Changes

@voltagent/[email protected]

Patch Changes

@voltagent/[email protected]

Patch Changes

@voltagent/[email protected]

Patch Changes

@voltagent/[email protected]

Patch Changes

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 25, 2025

Deploying voltagent with  Cloudflare Pages  Cloudflare Pages

Latest commit: c40d618
Status: ✅  Deploy successful!
Preview URL: https://baab4574.voltagent.pages.dev
Branch Preview URL: https://changeset-release-main.voltagent.pages.dev

View logs

@voltagent-bot voltagent-bot force-pushed the changeset-release/main branch 2 times, most recently from fc45c71 to 9150968 Compare April 25, 2025 15:19
@voltagent-bot voltagent-bot force-pushed the changeset-release/main branch from 9150968 to c40d618 Compare April 25, 2025 15:27
@omeraplak omeraplak closed this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants