From f6f8b2f7075cdb97915f491c351167e6572d2e8e Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Fri, 31 May 2024 14:24:01 -0400 Subject: [PATCH] fix bug --- backend/routes/generate_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index 61ce9c9..3fb92f1 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -123,7 +123,7 @@ async def stream_code(websocket: WebSocket): # Get the Anthropic API key from the request. Fall back to environment variable if not provided. # If neither is provided, we throw an error later only if Claude is used. anthropic_api_key = None - if params["anthropicApiKey"]: + if "anthropicApiKey" in params and params["anthropicApiKey"]: anthropic_api_key = params["anthropicApiKey"] print("Using Anthropic API key from client-side settings dialog") else: