sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.27k stars 214 forks source link

Chat: Anthropic chat client for cody.dev.models #4610

Closed abeatrix closed 2 weeks ago

abeatrix commented 2 weeks ago

CLOSE https://linear.app/sourcegraph/issue/CODY-2431

This PR adds a custom chat client for anthropic when an anthropic model is provided through the cody.dev.models config.

This allows us to test new models that are not yet available through Cody Gateway in the client locally.

Test plan

  1. Build Cody from this branch
  2. In your VS CODE settings file, configure cody.dev.models to add a new claude model. For example:
    {
    "cody.dev.models": [
        {
            "provider": "anthropic",
            "model": "claude-3-new-model-name",
            "apiKey": "$GET_ACCESS_TOKEN_FROM_1PASSWORD"
        },
    ]
    }
  3. Reload VS Code
  4. Verify you can choose the new model from the chat model dropdown list
  5. Verify you are getting response back when using the new model
Screenshot 2024-06-18 at 9 03 44 PM