yungongzi OnePieceMan commited on
Commit
04c2182
·
1 Parent(s): 1e6f0e2

BugFix: Fixed api_key generation error for VolcEngine (#2502)

Browse files

BugFix: Fixed api_key generation error for VolcEngine with python's
f-string syntax

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

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

Co-authored-by: 海贼宅 <[email protected]>

Files changed (1) hide show
  1. api/apps/llm_app.py +1 -2
api/apps/llm_app.py CHANGED
@@ -130,8 +130,7 @@ def add_llm():
130
  # For VolcEngine, due to its special authentication method
131
  # Assemble ark_api_key endpoint_id into api_key
132
  llm_name = req["llm_name"]
133
- api_key = '{' + f'"ark_api_key": "{req.get("ark_api_key", "")}", ' \
134
- f'"ep_id": "{req.get("endpoint_id", "")}" ' + '}'
135
  elif factory == "Tencent Hunyuan":
136
  api_key = '{' + f'"hunyuan_sid": "{req.get("hunyuan_sid", "")}", ' \
137
  f'"hunyuan_sk": "{req.get("hunyuan_sk", "")}"' + '}'
 
130
  # For VolcEngine, due to its special authentication method
131
  # Assemble ark_api_key endpoint_id into api_key
132
  llm_name = req["llm_name"]
133
+ api_key = f'{{ "ark_api_key":"{req.get("ark_api_key", "")}", "ep_id":"{req.get("endpoint_id", "")}" }}'
 
134
  elif factory == "Tencent Hunyuan":
135
  api_key = '{' + f'"hunyuan_sid": "{req.get("hunyuan_sid", "")}", ' \
136
  f'"hunyuan_sk": "{req.get("hunyuan_sk", "")}"' + '}'