Releases: VoltAgent/voltagent
[email protected]
@voltagent/[email protected]
@voltagent/[email protected]
@voltagent/[email protected]
@voltagent/[email protected]
@voltagent/[email protected]
Minor Changes
-
#29
82e27c2
Thanks @foxy17! - feat(google-ai): Add initial Google AI provider package - #12Introduces 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.
- The core
Patch Changes
- Updated dependencies [
52d5fa9
,3ef2eaa
,52d5fa9
]:- @voltagent/[email protected]
@voltagent/[email protected]
Patch Changes
e328613
Thanks @omeraplak! - fix: preventReferenceError: module is not defined
in ES module environments by adding guards around the CommonJS-specificrequire.main === module
check in the main entry point.
@voltagent/[email protected]
Patch Changes
-
#41
52d5fa9
Thanks @omeraplak! - ## Introducing Toolkits for Better Tool ManagementManaging related tools and their instructions is now simpler with
Toolkit
s.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 sharedinstructions
and anaddInstructions
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:
ToolManager
Upgrade: Now manages bothTool
andToolkit
objects.AgentOptions
Update: Thetools
option accepts(Tool<any> | Toolkit)[]
.- Simplified Instruction Handling:
Agent
now only adds instructions fromToolkit
s whereaddInstructions
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
HelperWe'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 thefiles
array. - Add explicit
exports
field for better module resolution.
- Remove
-
#41
52d5fa9
Thanks @omeraplak! - ## Introducing Reasoning Tools HelperThis update introduces a new helper function,
createReasoningTools
, to easily add step-by-step reasoning capabilities to your agents. #24New
createReasoningTools
HelperFeature: Easily add
think
andanalyze
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
namedreasoning_tools
. - Tools included: Contains the
think
tool (for internal monologue/planning) and theanalyze
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 bycreateReasoningTools
directly to the agent'stools
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.
- What it does: Returns a pre-configured
@voltagent/[email protected]
@voltagent/[email protected]
Patch Changes
-
#35
9acbbb8
Thanks @omeraplak! - fix: Prevent potential error when accessing debug option in LibSQLStorage - #34- Modified the
debug
method within theLibSQLStorage
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 theoptions
object is fully initialized or ifoptions
becomes unexpectedlynull
orundefined
. It ensures the debug logging mechanism is more robust. - Modified the