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

feat: claude 3.5 sonnet support #990

Merged
merged 1 commit into from
Jun 22, 2024
Merged

Conversation

s1moe2
Copy link
Contributor

@s1moe2 s1moe2 commented Jun 21, 2024

User description

Adding Claude 3.5 Sonnet support. Not sure if this all it takes but I tried to check previous similar changes. Glad to add whatever else is necessary if I'm able and someone points me to it.

Tested locally with Docker:

[simoes@sl4 pr-agent]$ docker run --rm -it -e ANTHROPIC.KEY=... -e GITHUB.USER_TOKEN=github_pat_SECRET agent:latest --pr_url https://github.com/s1moe2/testrepo/pull/2 review
2024-06-21 09:01:14.109 | INFO     | pr_agent.tools.pr_reviewer:run:106 - Reviewing PR: https://github.com/s1moe2/testrepo/pull/2 ...
2024-06-21 09:01:16.716 | INFO     | pr_agent.algo.pr_processing:get_pr_diff:73 - PR main language: Go
2024-06-21 09:01:16.721 | INFO     | pr_agent.algo.pr_processing:get_pr_diff:83 - Tokens: 1481, total tokens under limit: 32000, returning full diff.
2024-06-21 09:01:21.183 | INFO     | pr_agent.tools.pr_reviewer:set_review_labels:396 - Setting review labels:
['Review effort [1-5]: 2']
[simoes@sl4 pr-agent]$ docker run --rm -it -e ANTHROPIC.KEY=... -e GITHUB.USER_TOKEN=github_pat_SECRET agent:latest --pr_url https://github.com/s1moe2/testrepo/pull/2 describe
2024-06-21 09:01:33.695 | INFO     | pr_agent.git_providers.git_provider:get_user_description:76 - Existing description was not generated by the pr-agent
2024-06-21 09:01:33.986 | INFO     | pr_agent.git_providers.git_provider:get_user_description:76 - Existing description was not generated by the pr-agent
2024-06-21 09:01:34.009 | INFO     | pr_agent.tools.pr_description:run:77 - Generating a PR description for pr_id: s1moe2/testrepo/2
2024-06-21 09:01:36.687 | INFO     | pr_agent.algo.pr_processing:get_pr_diff:73 - PR main language: Go
2024-06-21 09:01:36.692 | INFO     | pr_agent.algo.pr_processing:get_pr_diff:83 - Tokens: 1558, total tokens under limit: 32000, returning full diff.
[simoes@sl4 pr-agent]$ docker run --rm -it -e ANTHROPIC.KEY=... -e GITHUB.USER_TOKEN=github_pat_SECRET agent:latest --pr_url https://github.com/s1moe2/testrepo/pull/2 improve
2024-06-21 09:02:11.979 | INFO     | pr_agent.tools.pr_code_suggestions:__init__:35 - Setting max_model_tokens to 8000 for PR improve
2024-06-21 09:02:11.980 | INFO     | pr_agent.tools.pr_code_suggestions:_get_is_extended:342 - Extended mode is enabled automatically based on the configuration toggle
2024-06-21 09:02:12.288 | INFO     | pr_agent.tools.pr_code_suggestions:run:75 - Generating code suggestions for PR...
2024-06-21 09:02:14.973 | INFO     | pr_agent.tools.pr_code_suggestions:_prepare_prediction_extended:350 - Number of PR chunk calls: 1

PR Type

Enhancement


Description

  • Added support for anthropic/claude-3-5-sonnet-20240620 in the token limits configuration.
  • Updated the token limits dictionary to include the new model.

Changes walkthrough 📝

Relevant files
Enhancement
__init__.py
Add support for Claude 3.5 Sonnet in token limits               

pr_agent/algo/init.py

  • Added support for anthropic/claude-3-5-sonnet-20240620 with a token
    limit of 100000.
  • +1/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 1
    🏅 Score 95
    🧪 Relevant tests No
    🔒 Security concerns No
    🔀 Multiple PR themes

    No

    ⚡ Key issues to review None

    Copy link
    Contributor

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Sort the keys in alphabetical order for better readability and maintainability

    Consider sorting the keys in alphabetical order to maintain consistency and improve
    readability. This will make it easier to locate specific entries in the future.

    pr_agent/algo/init.py [32-38]

     'anthropic.claude-v1': 100000,
     'anthropic.claude-v2': 100000,
    +'anthropic/claude-3-5-sonnet-20240620': 100000,
     'anthropic/claude-3-opus-20240229': 100000,
    -'anthropic/claude-3-5-sonnet-20240620': 100000,
     'bedrock/anthropic.claude-instant-v1': 100000,
     'bedrock/anthropic.claude-v2': 100000,
     'bedrock/anthropic.claude-v2:1': 100000,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Sorting the keys alphabetically would indeed improve readability and maintainability, making it easier to locate and manage entries. The suggestion is relevant and correctly identifies the new code added in the PR.

    7

    @mrT23 mrT23 merged commit 685c443 into Codium-ai:main Jun 22, 2024
    1 check passed
    @mrT23
    Copy link
    Collaborator

    mrT23 commented Jun 22, 2024

    Looks good. i was able to generate:
    #966 (comment)
    with the new sonnet model
    image

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants