_Chenbing commited on
Commit
45b5929
·
1 Parent(s): 246879d

fix(Add model api): Add VolcEngine to create api_key format error (#2490)

Browse files

### What problem does this PR solve?


Add VolcEngine to create api_key format error
When constructing the json string, there was an extra "," at the end,
which caused a formatting error. This commit fixed the problem.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. api/apps/llm_app.py +1 -1
api/apps/llm_app.py CHANGED
@@ -128,7 +128,7 @@ def add_llm():
128
  # Assemble ark_api_key endpoint_id into api_key
129
  llm_name = req["llm_name"]
130
  api_key = '{' + f'"ark_api_key": "{req.get("ark_api_key", "")}", ' \
131
- f'"ep_id": "{req.get("endpoint_id", "")}", ' + '}'
132
  elif factory == "Tencent Hunyuan":
133
  api_key = '{' + f'"hunyuan_sid": "{req.get("hunyuan_sid", "")}", ' \
134
  f'"hunyuan_sk": "{req.get("hunyuan_sk", "")}"' + '}'
 
128
  # Assemble ark_api_key endpoint_id into api_key
129
  llm_name = req["llm_name"]
130
  api_key = '{' + f'"ark_api_key": "{req.get("ark_api_key", "")}", ' \
131
+ f'"ep_id": "{req.get("endpoint_id", "")}" ' + '}'
132
  elif factory == "Tencent Hunyuan":
133
  api_key = '{' + f'"hunyuan_sid": "{req.get("hunyuan_sid", "")}", ' \
134
  f'"hunyuan_sk": "{req.get("hunyuan_sk", "")}"' + '}'