e2b-dev / fragments

Open-source Next.js template for building apps that are fully generated by AI. By E2B.
https://fragments.e2b.dev
Apache License 2.0
2.42k stars 298 forks source link

Add OpenRouter Anthropic model and update model list #50

Closed PierrunoYT closed 6 days ago

PierrunoYT commented 1 month ago

Add OpenRouter Anthropic model and update model list

Changes

  1. Added OpenRouter as a new provider in lib/models.ts
  2. Updated lib/models.json to include Claude 3.5 Sonnet via OpenRouter
  3. Modified getDefaultMode function to use 'json' mode for OpenRouter

    Details

    New OpenRouter Provider

    • Added OpenRouter to the providerConfigs in lib/models.ts
    • Uses the OpenAI-compatible API endpoint for OpenRouter
    • Configurable with OPENROUTER_API_KEY environment variable

    New Model: Claude 3.5 Sonnet via OpenRouter

    • Added "anthropic/claude-3.5-sonnet" to the models list in lib/models.json
    • Provides access to Anthropic's Claude 3.5 Sonnet model through OpenRouter

    Default Mode Update

    • Updated getDefaultMode function to return 'json' for OpenRouter, similar to Fireworks

    Testing

    • Ensure the OpenRouter API key is set in the environment variables
    • Test creating a client for the new OpenRouter model
    • Verify that the model appears in the UI and can be selected
    • Test interactions with the Claude 3.5 Sonnet model via OpenRouter

    Notes

    • OpenRouter logo should be added to public/thirdparty/logos/ if not already present
    • Update documentation to include information about the new OpenRouter integration and how to obtain and set up an API key
vercel[bot] commented 1 month ago

Someone is attempting to deploy a commit to the E2B Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-artifacts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 1, 2024 10:58am
mishushakov commented 1 month ago

Why did you:

?

PierrunoYT commented 6 days ago

Why did you:

* Updated `getDefaultMode` function to return 'json' for OpenRouter, similar to Fireworks

?

The AI did this