diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py index 19fbbece2..d7a852b0b 100644 --- a/api/apps/llm_app.py +++ b/api/apps/llm_app.py @@ -130,8 +130,7 @@ def add_llm(): # For VolcEngine, due to its special authentication method # Assemble ark_api_key endpoint_id into api_key llm_name = req["llm_name"] - api_key = '{' + f'"ark_api_key": "{req.get("ark_api_key", "")}", ' \ - f'"ep_id": "{req.get("endpoint_id", "")}" ' + '}' + api_key = f'{{ "ark_api_key":"{req.get("ark_api_key", "")}", "ep_id":"{req.get("endpoint_id", "")}" }}' elif factory == "Tencent Hunyuan": api_key = '{' + f'"hunyuan_sid": "{req.get("hunyuan_sid", "")}", ' \ f'"hunyuan_sk": "{req.get("hunyuan_sk", "")}"' + '}'