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

Usage of vertex model gives type error #63

Open
maidi29 opened this issue Jan 23, 2025 · 4 comments
Open

Usage of vertex model gives type error #63

maidi29 opened this issue Jan 23, 2025 · 4 comments

Comments

@maidi29
Copy link

maidi29 commented Jan 23, 2025

I use the vertex model to create the agent:

import { vertex } from '@ai-sdk/google-vertex';
export { createAgent } from '@statelyai/agent';

createAgent({
    model: vertex('gemini-1.5-pro'),
    ...
  });

but it gives the following type error:

Type '{ type: "reasoning"; textDelta: string; }' is not assignable to type 'LanguageModelV1StreamPart'.
Type '{ type: "reasoning"; textDelta: string; }' is not assignable to type '{ type: "text-delta"; textDelta: string; }'.
Types of property 'type' are incompatible.
Type '"reasoning"' is not assignable to type '"text-delta"'

However, if I declare as any the agent seems to work as expected so it is maybe only a typing issue?

Versions:

 "@ai-sdk/google-vertex": "2.1.1",
 "@statelyai/agent": "1.1.6"
@davidkpiano
Copy link
Member

Try using @stately/agent@next

@ddoria921
Copy link

I'm running into the same issue, except I'm using import { bedrock } from "@ai-sdk/amazon-bedrock";

For reference I'm running

"@ai-sdk/amazon-bedrock": "^1.1.2",

@davidkpiano I'm guessing if you update the ai-sdk deps to the latest it will fix the type error.

@davidkpiano
Copy link
Member

I'm running into the same issue, except I'm using import { bedrock } from "@ai-sdk/amazon-bedrock";

For reference I'm running

"@ai-sdk/amazon-bedrock": "^1.1.2",

@davidkpiano I'm guessing if you update the ai-sdk deps to the latest it will fix the type error.

Which version are you using of @statelyai/agent?

@ddoria921
Copy link

@davidkpiano

"@statelyai/agent": "^2.0.0-next.4",

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

No branches or pull requests

3 participants