Skip to content

Bump anthropic from 0.7.7 to 0.8.0

Tan Le requested to merge bump-anthropic-0.7.8 into main

What does this merge request do and why?

Bump anthropic from 0.7.7 to 0.8.0.

This is mainly to address a memory leak issue when Client.with_options is used.

Two notable changes that I think will be beneficial to AI Gateway.

  • avoid leaking memory when Client.with_options is used (#275) (5e51ebd)
  • ensure retried requests are closed (#261) (5d9aa75)

Full changelog.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Check out to this merge request's branch.
  2. Ensure a local Docker image built successfully.
    docker buildx build --platform linux/amd64 \
      -t ai-gateway:dev .
  3. Run a local service on Docker.
    docker run --platform linux/amd64 --rm \
      -p 5052:5052 \
      -e AUTH_BYPASS_EXTERNAL=true \
      -v $PWD:/app -it ai-gateway:dev
  4. Run a cURL command to test code generations
    curl --request POST \
      --url http://codesuggestions.gdk.test:5052/v2/code/generations \
      --header 'Content-Type: application/json' \
      --header 'X-Gitlab-Authentication-Type: oidc' \
      --data '{
      "prompt_version": 2,
      "project_path": "awesome_project",
      "project_id": 23,
      "current_file": {
        "file_name": "main.go",
        "content_above_cursor": "",
        "content_below_cursor": ""
      },
      "prompt": "write me a Dr Seus poem about GitLab AIDevSecOps for 30 words\n",
      "model_provider": "anthropic"
    }'
    
    {
      "id": "id",
      "model": {
        "engine": "anthropic",
        "name": "claude-2.0",
        "lang": "go"
      },
      "experiments": [],
      "object": "text_completion",
      "created": 1703047941,
      "choices": [
        {
          "text": "\nHere is a 30-word Dr. Seuss-style poem about GitLab AIDevSecOps:\n\nGitLab AI, GitLab AI, \nHelping devs and secops play.\nWith tools to scan, tools to fix,\nBugs and risks it nix and nix.  \nCI/CD pipelines it fuels,\nTo push code that nobody rues.\nSo hurray for GitLab AI, \nMaking app sec easy as pie!",
          "index": 0,
          "finish_reason": "length"
        }
      ]
    }

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Shinya Maeda

Merge request reports