fix(provider): 修复DeepSeek开发凭据解析

This commit is contained in:
2026-08-30 10:48:12 +08:00
parent 340bfbbd07
commit dc5ee76bed
7 changed files with 47 additions and 1 deletions
@@ -264,6 +264,11 @@ class OpenAICompatibleProvider(TurnStreamingMixin):
def _headers(self) -> dict[str, str]:
headers = {"Content-Type": "application/json"}
api_key = self.credentials.resolve(self.credential_id)
if self.credential_id and not api_key:
raise ProviderError(
"PROVIDER_CREDENTIAL_MISSING",
f'Credential "{self.credential_id}" is not available in the AI Core process.',
)
if api_key:
headers["Authorization"] = f"Bearer {api_key}"
return headers