Migrate to Anthropic 0.3
diff --git a/fastchat/llm_judge/README.md b/fastchat/llm_judge/README.md
index caa845ec5f..a9127c6c23 100644
--- a/fastchat/llm_judge/README.md
+++ b/fastchat/llm_judge/README.md
@@ -18,14 +18,14 @@ To automate the evaluation process, we prompt strong LLMs like GPT-4 to act as j
 git clone https://github.com/lm-sys/FastChat.git
 cd FastChat
 pip install -e .
-pip install openai anthropic ray
+pip install openai anthropic==0.3.2 ray
 ```
 
 ## Review Pre-Generated Model Answers and Judgments
 We provide pre-generated model answers and judgments for some models.
 You can view them at this [demo](https://huggingface.co/spaces/lmsys/mt-bench).
 
-To download the pre-generated data, use 
+To download the pre-generated data, use
 ```
 python3 download_mt_bench_pregenerated.py
 ```
diff --git a/fastchat/llm_judge/common.py b/fastchat/llm_judge/common.py
index 7ea156f148..6ec9b5eee7 100644
--- a/fastchat/llm_judge/common.py
+++ b/fastchat/llm_judge/common.py
@@ -422,18 +422,18 @@ def chat_compeletion_anthropic(model, conv, temperature, max_tokens):
     output = API_ERROR_OUTPUT
     for _ in range(API_MAX_RETRY):
         try:
-            c = anthropic.Client(os.environ["ANTHROPIC_API_KEY"])
+            c = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
             prompt = conv.get_prompt()
-            response = c.completion(
+            response = c.completions.create(
                 model=model,
                 prompt=prompt,
                 stop_sequences=[anthropic.HUMAN_PROMPT],
                 max_tokens_to_sample=max_tokens,
                 temperature=temperature,
             )
-            output = response["completion"]
+            output = response.completion
             break
-        except anthropic.ApiException as e:
+        except anthropic.APIError as e:
             print(type(e), e)
             time.sleep(API_RETRY_SLEEP)
     return output.strip()

- https://github.com/anthropics/anthropic-sdk-python#migration-from-v02x-and-below

<!-- Thank you for your contribution! -->

<!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. -->

## Why are these changes needed?

<!-- Please give a short summary of the change and the problem this solves. -->

## Related issue number (if applicable)

<!-- For example: "Closes #1234" -->

## Checks

- [x] I've run `format.sh` to lint the changes in this PR.
- [x] I've included any doc changes needed.
- [x] I've made sure the relevant tests are passing (if applicable).

## POC
### Before
![image](https://github.com/lm-sys/FastChat/assets/459925/790c6872-0102-4305-b52d-aec56c86c164)


### After
![image](https://github.com/lm-sys/FastChat/assets/459925/5990159e-4b87-4097-a9f6-0902ec388b25)

