datadreamer-dev / DataDreamer

DataDreamer: Prompt. Generate Synthetic Data. Train & Align Models.   🤖💤
https://datadreamer.dev
MIT License
724 stars 39 forks source link

Anthropic Claude 3 invalid_request_error Exception #10

Closed preemware closed 3 months ago

preemware commented 3 months ago

Outdated Anthropic implementation with litellm when using the newer Claude 3 models with DataDreamer.

Traceback (most recent call last):                                                  File "/root/venv/lib/python3.11/site-packages/litellm/main.py", line 987, in completion                                                                               response = anthropic.completion(                                                             ^^^^^^^^^^^^^^^^^^^^^                                                File "/root/venv/lib/python3.11/site-packages/litellm/llms/anthropic.py", line 170, in completion                                                                     raise AnthropicError(                                                         litellm.llms.anthropic.AnthropicError: {"type":"error","error":{"type":"invalid_request_error","message":"\"claude-3-sonnet-20240229\" is not supported on this API. Please use the Messages API instead."}}
AjayP13 commented 3 months ago

Thanks, this may take a little bit to fix, but I'll look into updating our litellm dependency to support this. We also take PRs if you have a quick fix to unblock you: https://datadreamer.dev/docs/latest/pages/contributing.html

AjayP13 commented 3 months ago

Fixed in 0.23.0, thanks again for PR #11.