Merge pull request #1395 from shenchucheng/feat-fix-bugs

Support configuration of QianFan API base_url to fix #1392
This commit is contained in:
Alexander Wu 2024-07-16 10:21:10 +08:00 committed by GitHub
commit 0ffe3ef727
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 24 deletions

View file

@ -50,6 +50,9 @@ class QianFanLLM(BaseLLM):
else:
raise ValueError("Set the `access_key`&`secret_key` or `api_key`&`secret_key` first")
if self.config.base_url:
os.environ.setdefault("QIANFAN_BASE_URL", self.config.base_url)
support_system_pairs = [
("ERNIE-Bot-4", "completions_pro"), # (model, corresponding-endpoint)
("ERNIE-Bot-8k", "ernie_bot_8k"),