fix(qwen): align with dashscope 1.25.21 API; remove InvalidApiKey monkey-patch
This commit is contained in:
+2
-4
@@ -10,8 +10,6 @@ from dashscope.common.error import (
|
||||
)
|
||||
from src.ai_client import ProviderError
|
||||
|
||||
dashscope.common.error.InvalidApiKey = dashscope.common.error.AuthenticationError
|
||||
|
||||
def build_dashscope_tools(openai_tools: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
out: list[dict[str, Any]] = []
|
||||
for t in openai_tools:
|
||||
@@ -29,9 +27,9 @@ def classify_dashscope_error(exc: Exception) -> ProviderError:
|
||||
if isinstance(exc, AuthenticationError):
|
||||
return ProviderError(kind="auth", provider="qwen", original=exc)
|
||||
if isinstance(exc, TimeoutException):
|
||||
return ProviderError(kind="rate_limit", provider="qwen", original=exc)
|
||||
return ProviderError(kind="network", provider="qwen", original=exc)
|
||||
if isinstance(exc, ServiceUnavailableError):
|
||||
return ProviderError(kind="quota", provider="qwen", original=exc)
|
||||
return ProviderError(kind="network", provider="qwen", original=exc)
|
||||
if isinstance(exc, InvalidParameter):
|
||||
return ProviderError(kind="quota", provider="qwen", original=exc)
|
||||
if isinstance(exc, RequestFailure):
|
||||
|
||||
Reference in New Issue
Block a user