瀏覽代碼

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

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: 海贼宅 <stu_xyx@163.com>
tags/v0.12.0
yungongzi 1 年之前
父節點
當前提交
4f962d6bff
No account linked to committer's email address
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      api/apps/llm_app.py

+ 1
- 2
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", "")}"' + '}'

Loading…
取消
儲存