Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error when defining Agent model with createGoogleGenerativeAI #2534

Open
Mrinank-Bhowmick opened this issue Feb 25, 2025 · 2 comments
Open
Labels
Agents Issue with anything related to Mastra Agents bug Something isn't working LLM Issue with Mastra's interaction with an LLM

Comments

@Mrinank-Bhowmick
Copy link

I'm encountering a type error when defining an Agent with a Google Generative AI model. The error message indicates a mismatch in the LanguageModelV1 type between different versions of @ai-sdk/provider.

Code

import { createGoogleGenerativeAI } from '@ai-sdk/google';

const google = createGoogleGenerativeAI({
  apiKey: '',
});

export const chefAgent = new Agent({
  name: 'chefAgent',
  instructions:
    'You are Michel",
  model: google('gemini-2.0-flash-001'),
  memory,
});
@github-actions github-actions bot added Agents Issue with anything related to Mastra Agents bug Something isn't working LLM Issue with Mastra's interaction with an LLM labels Feb 25, 2025
@Mrinank-Bhowmick
Copy link
Author

I found a way :)
this solves the problem

model: google('gemini-1.5-pro') as LanguageModel, 

@abhiaiyer91
Copy link
Contributor

Ah yes I am not sure why ai-sdk doesnt ship a language model class on that one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agents Issue with anything related to Mastra Agents bug Something isn't working LLM Issue with Mastra's interaction with an LLM
Projects
None yet
Development

No branches or pull requests

2 participants