agent icon indicating copy to clipboard operation
agent copied to clipboard

Usage of vertex model gives type error

Open maidi29 opened this issue 1 year ago • 4 comments

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"

maidi29 avatar Jan 23 '25 12:01 maidi29

Try using @stately/agent@next

davidkpiano avatar Jan 25 '25 13:01 davidkpiano

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.

ddoria921 avatar Jan 28 '25 04:01 ddoria921

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?

davidkpiano avatar Jan 28 '25 05:01 davidkpiano

@davidkpiano

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

ddoria921 avatar Jan 28 '25 19:01 ddoria921