ai icon indicating copy to clipboard operation
ai copied to clipboard

Fix: Anthropic vertex provider

Open nalaso opened this issue 1 year ago • 0 comments

This pr provides support for claude models on vertex ai by introducing a new package, ai/anthropic-vertex.

Solves the issue #2441

It can't be added to ai/google-vertex because the vertex ai sdk doesn't support third-party models (claude models). It can't be added to ai/anthropic because vertex models require the google-auth-library for authentication (possible though). Let me know if i should implement this way

example `import { anthropicVertex } from '@ai-sdk/anthropic-vertex'; import { generateText } from 'ai';

const { text } = await generateText({ model: anthropicVertex('claude-3-haiku@20240307'), prompt: 'Write a vegetarian lasagna recipe for 4 people.', });`

nalaso avatar Jul 30 '24 14:07 nalaso