diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index d959351d4c..73d0c075e1 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1954,7 +1954,10 @@ async def generate_messages( # Convert Anthropic payload to OpenAI format requested_model = form_data.get('model', '') - openai_payload = convert_anthropic_to_openai_payload(form_data) + try: + openai_payload = convert_anthropic_to_openai_payload(form_data) + except (ValueError, NotImplementedError) as e: + raise HTTPException(status_code=400, detail=str(e)) # Route through the existing chat_completion handler response = await chat_completion(request, openai_payload, user)