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

Migrate to Vercel AI SDK #291

Open
7 tasks
rmarescu opened this issue Jan 25, 2025 · 1 comment
Open
7 tasks

Migrate to Vercel AI SDK #291

rmarescu opened this issue Jan 25, 2025 · 1 comment
Assignees
Labels
Milestone

Comments

@rmarescu
Copy link
Member

rmarescu commented Jan 25, 2025

What

  • Replace @anthropic-ai/sdk with @ai-sdk/anthropic

  • New config structure (when ai.provider is anthropic, ai.apiKey is required); future provider will be amazon-bedrock with different props

      export default {
        headless: false,
        baseUrl: "https://youtube.com",
        testPattern: "app/**/*.test.ts", // Don't test example tests
        ai: {
          provider: "anthropic",
          apiKey: process.env.ANTHROPIC_API_KEY,
          model: "claude-3-5-sonnet-20241022"
        },
        mailosaur: {
          apiKey: process.env.MAILOSAUR_API_KEY,
          serverId: process.env.MAILOSAUR_SERVER_ID,
        },
      } satisfies ShortestConfig;
  • All provider props should be optional

    • Shortest code provides the latest model available (e.g. claude-3-5-sonnet-20241022)
    • [to-be-considered] Whitelist models that work with Shortest framework?
  • Automatically support ENV for the API key

    ANTHROPIC_API_KEY
    

    or with SHORTEST_* prefix

    SHORTEST_ANTHROPIC_API_KEY
    

Note

All AI-related ENVs supported by Vercel AI SDK should be automatically generally supported as-si (same value), or with the SHORTEST_ prefix (in case users would want to use separate keys)

  • backward compatibity for config.anthropicKey with warn message

Resources

Why

Simplify the introduction of new providers and models in the future. Specifically, Amazon Bedrock and OpenAI once they release computer use on the API.

Example

No response

@rmarescu
Copy link
Member Author

rmarescu commented Feb 3, 2025

@gladyshcodes I've updated the issue with more info based on what I learned from the investigation into #268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Building needed
Development

No branches or pull requests

2 participants