voltagent icon indicating copy to clipboard operation
voltagent copied to clipboard

[BUG] bedrock over vercel ai provider error

Open wakeupmh opened this issue 1 year ago • 3 comments

Describe the bug

Summary

When attempting to use Amazon Bedrock models via VercelAIProvider in a VoltAgent setup, the agent initialization fails with an AI_LoadSettingError.
The error lacks detailed information, making it difficult to diagnose.

Environment

  • @voltagent/core
  • @voltagent/vercel-ai
  • @ai-sdk/amazon-bedrock
  • Model: anthropic.claude-3-7-sonnet-20250219-v1:0
  • Runtime: Vercel environment

Code Snippet

import VoltAgent, { Agent, createReasoningTools, MCPConfiguration, Toolkit } from "@voltagent/core";
import { VercelAIProvider } from "@voltagent/vercel-ai";
import { bedrock } from "@ai-sdk/amazon-bedrock";

async function main() {
  try {
    const agent = new Agent({
      name: "Reasoning Assistant",
      description: "A reasoning assistant using a lightweight provider",
      llm: new VercelAIProvider(),
      model: bedrock('anthropic.claude-3-7-sonnet-20250219-v1:0'),
      markdown: true,
    });

    new VoltAgent({
      agents: { agent },
    });
  } catch (error) {
    console.error("Failed to initialize VoltAgent:", error);
  }
}

main();

Image

Image

Image

Steps To Reproduce

Steps to Reproduce

  1. Install the following packages:
    • @voltagent/core
    • @voltagent/vercel-ai
    • @ai-sdk/amazon-bedrock
  2. Import VercelAIProvider and bedrock() into your project.
  3. Create a new Agent with:
    • llm: new VercelAIProvider()
    • model: bedrock('anthropic.claude-3-7-sonnet-20250219-v1:0')
  4. Initialize VoltAgent with the agent.
  5. Run the application.
  6. Observe that the Reasoning Assistant agent immediately fails with:
    • Status: error
    • Event Type: finished (error)
    • Error: { "name": "AI_LoadSettingError" }
  7. Check browser console logs for repeated error: {error: null, message: undefined} entries.

Expected behavior

Expected Behavior

  • The VoltAgent should successfully initialize the Reasoning Assistant agent without any errors.
  • The Bedrock model (anthropic.claude-3-7-sonnet-20250219-v1:0) should be properly loaded and made available for reasoning through the VercelAIProvider.
  • No AI_LoadSettingError or undefined error messages should occur during agent startup.
  • The agent should enter a working or idle state, ready to process user input.

Packages

  • @voltagent/core — ^0.1.7
  • @voltagent/vercel-ai — ^0.1.3
  • @ai-sdk/amazon-bedrock — ^2.2.8
  • composio-core — ^0.5.33
  • zod — ^3.24.3

Additional Context

No response

wakeupmh avatar Apr 27 '25 03:04 wakeupmh

[BUG] bedrock over vercel ai provider error

Describe the bug

Summary

When attempting to use Amazon Bedrock models via VercelAIProvider in a VoltAgent setup, the agent initialization fails with an AI_LoadSettingError.
The error lacks detailed information, making it difficult to diagnose.

Environment

  • @voltagent/core
  • @voltagent/vercel-ai
  • @ai-sdk/amazon-bedrock
  • Model: anthropic.claude-3-7-sonnet-20250219-v1:0
  • Runtime: Vercel environment

Code Snippet

import VoltAgent, { Agent, createReasoningTools, MCPConfiguration, Toolkit } from "@voltagent/core";
import { VercelAIProvider } from "@voltagent/vercel-ai";
import { bedrock } from "@ai-sdk/amazon-bedrock";

async function main() {
  try {
    const agent = new Agent({
      name: "Reasoning Assistant",
      description: "A reasoning assistant using a lightweight provider",
      llm: new VercelAIProvider(),
      model: bedrock('anthropic.claude-3-7-sonnet-20250219-v1:0'),
      markdown: true,
    });

    new VoltAgent({
      agents: { agent },
    });
  } catch (error) {
    console.error("Failed to initialize VoltAgent:", error);
  }
}

main();

Image

Image

Image

Steps To Reproduce

Steps to Reproduce

  1. Install the following packages:
    • @voltagent/core
    • @voltagent/vercel-ai
    • @ai-sdk/amazon-bedrock
  2. Import VercelAIProvider and bedrock() into your project.
  3. Create a new Agent with:
    • llm: new VercelAIProvider()
    • model: bedrock('anthropic.claude-3-7-sonnet-20250219-v1:0')
  4. Initialize VoltAgent with the agent.
  5. Run the application.
  6. Observe that the Reasoning Assistant agent immediately fails with:
    • Status: error
    • Event Type: finished (error)
    • Error: { "name": "AI_LoadSettingError" }
  7. Check browser console logs for repeated error: {error: null, message: undefined} entries.

Expected behavior

Expected Behavior

  • The VoltAgent should successfully initialize the Reasoning Assistant agent without any errors.
  • The Bedrock model (anthropic.claude-3-7-sonnet-20250219-v1:0) should be properly loaded and made available for reasoning through the VercelAIProvider.
  • No AI_LoadSettingError or undefined error messages should occur during agent startup.
  • The agent should enter a working or idle state, ready to process user input.

Packages

  • @voltagent/core — ^0.1.7
  • @voltagent/vercel-ai — ^0.1.3
  • @ai-sdk/amazon-bedrock — ^2.2.8
  • composio-core — ^0.5.33
  • zod — ^3.24.3

Additional Context

No response

Hey @wakeupmh

Here is my answer:

The issue you're encountering with the AI_LoadSettingError when using Amazon Bedrock models via the VercelAIProvider in VoltAgent could be due to several factors. Here are some potential causes and solutions:

  1. Provider Compatibility: Ensure that the VercelAIProvider is compatible with the Amazon Bedrock models. The provider might not fully support the specific model or API version you're trying to use. Check the documentation for any compatibility notes or updates.

  2. Model Configuration: The error might be related to incorrect model configuration. Verify that the model identifier anthropic.claude-3-7-sonnet-20250219-v1:0 is correctly specified and supported by the VercelAIProvider.

  3. API Key and Authentication: Ensure that all necessary API keys and authentication details are correctly configured. Missing or incorrect credentials can lead to initialization errors.

  4. Error Details: The error message { "name": "AI_LoadSettingError" } lacks detail. Check the console logs for any additional error messages or stack traces that might provide more context. The repeated error: {error: null, message: undefined} entries suggest that the error handling might not be capturing the full error details.

  5. Provider Initialization: Double-check the initialization of the VercelAIProvider and ensure that all required parameters are provided. Any missing configuration could lead to errors during agent setup.

  6. Library Versions: Ensure that all libraries (@voltagent/core, @voltagent/vercel-ai, @ai-sdk/amazon-bedrock) are up to date. Incompatibilities between library versions can cause unexpected errors.

For further troubleshooting, consider enabling more detailed logging or debugging to capture additional information about the error. If the issue persists, reaching out to the maintainers or community for support might provide additional insights.


Trust Score: 🟡 60%

Sources:

👀 View on Gurubase for a better UX

Tag @gurubase to ask me a question.

gurubase avatar Apr 27 '25 03:04 gurubase

Hey @wakeupmh 👋, Thank you for reporting this issue. We’ll take a look soon!

omeraplak avatar Apr 27 '25 16:04 omeraplak

Hey @wakeupmh , I just tried it and it worked fine on my end. Could you double-check your environment variables and model name? If the issue persists, please re-open issue so we can take a closer look.

Here’s the link for reference: https://sdk.vercel.ai/providers/ai-sdk-providers/amazon-bedrock

omeraplak avatar May 01 '25 14:05 omeraplak