feat: Add support for DeepSeek API base URL

This commit is contained in:
Paul Gauthier (aider) 2024-08-12 15:04:05 -07:00
parent d4ae735d43
commit 7822c1c879

View file

@ -1,5 +1,6 @@
import hashlib
import json
import os
import backoff
@ -57,6 +58,9 @@ def send_completion(
temperature=temperature,
stream=stream,
)
if model_name.startswith("deepseek/") and "DEEPSEEK_API_BASE" in os.environ:
kwargs["base_url"] = os.environ["DEEPSEEK_API_BASE"]
if functions is not None:
kwargs["functions"] = functions
if extra_headers is not None: