coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
3.85k stars 1.58k forks source link

Cohere support added #351

Closed hasanraiyan closed 1 day ago

hasanraiyan commented 1 day ago

Cohere API Integration

Summary

This pull request introduces the integration of Cohere AI models into the project by adding API key management and model retrieval functionalities. The changes allow users to seamlessly connect with Cohere's services and utilize their suite of models.

Changes Made

  1. Environment Variables

    • Added support for the COHERE_API_KEY environment variable.
    • Included instructions on obtaining the API key from Cohere's dashboard.
  2. Cohere Model Management

    • Implemented a function getCohereAIModel(apiKey: string, model: string) to retrieve specified Cohere AI models using their API.
    • Integrated with @ai-sdk/cohere.
  3. Static Model Definitions

    • Defined a list of static models available through Cohere:
      • Command R Plus Latest
      • Command R Latest
      • Command
      • c4AI Aya Expanse (8B and 32B)
      • Others as listed in the staticModels configuration.
  4. Configuration Enhancements

    • Modified case handling to include Cohere integration in the main execution path.
    • Added model mapping for a variety of Cohere's offerings.

Instructions for Use

  1. Set the COHERE_API_KEY in your environment variables.
  2. Use the updated configuration to specify a desired model from the Cohere static model list.
  3. Follow the documentation for the @ai-sdk/cohere package for additional configuration options.
wonderwhy-er commented 1 day ago

Wo great job man with new commits. Will need to test it bit later. I like it!

hasanraiyan commented 1 day ago

Wo great job man with new commits. Will need to test it bit later. I like it!

Hi @wonderwhy-er,

Thanks for the feedback! Let me know if you find anything during testing or have suggestions for improvement.

wonderwhy-er commented 1 day ago

Tested and works!

wonderwhy-er commented 1 day ago

Thank you for your contribution! Is there any way in which you would like to be featured if youtuber pickups and shares your contribution?