Spaces:
Running
Running
fix google ai studio user
Browse files
pragent/backend/agents.py
CHANGED
|
@@ -18,10 +18,10 @@ def _prepare_extra_body(model_name: str, disable_qwen_thinking: bool) -> Optiona
|
|
| 18 |
async def setup_client(api_key: str, base_url: str) -> AsyncIterator[AsyncOpenAI]:
|
| 19 |
"""使用异步上下文管理器来创建和妥善销毁API客户端。"""
|
| 20 |
client = None
|
| 21 |
-
if not api_key or "sk-" not in api_key:
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
try:
|
| 27 |
tqdm.write("[*] 正在初始化API客户端...")
|
|
|
|
| 18 |
async def setup_client(api_key: str, base_url: str) -> AsyncIterator[AsyncOpenAI]:
|
| 19 |
"""使用异步上下文管理器来创建和妥善销毁API客户端。"""
|
| 20 |
client = None
|
| 21 |
+
# if not api_key or "sk-" not in api_key:
|
| 22 |
+
# tqdm.write("[!] 错误: API Key无效或未设置。")
|
| 23 |
+
# yield None
|
| 24 |
+
# return
|
| 25 |
|
| 26 |
try:
|
| 27 |
tqdm.write("[*] 正在初始化API客户端...")
|