mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
fix(vision): bump vision timeout from 60s to 180s to avoid premature failures
This commit is contained in:
@@ -31,7 +31,7 @@ from common.log import logger
|
|||||||
from config import conf
|
from config import conf
|
||||||
|
|
||||||
DEFAULT_MODEL = const.GPT_41_MINI
|
DEFAULT_MODEL = const.GPT_41_MINI
|
||||||
DEFAULT_TIMEOUT = 60
|
DEFAULT_TIMEOUT = 180
|
||||||
MAX_TOKENS = 4000
|
MAX_TOKENS = 4000
|
||||||
COMPRESS_THRESHOLD = 1_048_576 # 1 MB
|
COMPRESS_THRESHOLD = 1_048_576 # 1 MB
|
||||||
|
|
||||||
|
|||||||
@@ -657,7 +657,7 @@ class DeepSeekBot(Bot, OpenAICompatibleBot):
|
|||||||
headers = self._build_headers()
|
headers = self._build_headers()
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
f"{self.api_base}/chat/completions",
|
f"{self.api_base}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60,
|
headers=headers, json=payload, timeout=180,
|
||||||
)
|
)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class DoubaoBot(Bot):
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
resp = requests.post(f"{self.base_url}/chat/completions",
|
resp = requests.post(f"{self.base_url}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60)
|
headers=headers, json=payload, timeout=180)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class GoogleGeminiBot(Bot):
|
|||||||
}
|
}
|
||||||
endpoint = f"{self.api_base}/v1beta/models/{model_name}:generateContent"
|
endpoint = f"{self.api_base}/v1beta/models/{model_name}:generateContent"
|
||||||
headers = {"x-goog-api-key": self.api_key, "Content-Type": "application/json"}
|
headers = {"x-goog-api-key": self.api_key, "Content-Type": "application/json"}
|
||||||
resp = requests.post(endpoint, headers=headers, json=payload, timeout=60)
|
resp = requests.post(endpoint, headers=headers, json=payload, timeout=180)
|
||||||
|
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ class MimoBot(Bot, OpenAICompatibleBot):
|
|||||||
headers = self._build_headers()
|
headers = self._build_headers()
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
f"{self.api_base}/chat/completions",
|
f"{self.api_base}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60,
|
headers=headers, json=payload, timeout=180,
|
||||||
)
|
)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class MinimaxBot(Bot):
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
resp = requests.post(f"{self.api_base}/chat/completions",
|
resp = requests.post(f"{self.api_base}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60)
|
headers=headers, json=payload, timeout=180)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class MoonshotBot(Bot):
|
|||||||
}
|
}
|
||||||
headers = self._build_headers()
|
headers = self._build_headers()
|
||||||
resp = requests.post(f"{self.base_url}/chat/completions",
|
resp = requests.post(f"{self.base_url}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60)
|
headers=headers, json=payload, timeout=180)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
return {"error": True, "message": f"HTTP {resp.status_code}: {resp.text[:300]}"}
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ class OpenAICompatibleBot:
|
|||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
f"{api_base}/chat/completions",
|
f"{api_base}/chat/completions",
|
||||||
headers=headers, json=payload, timeout=60,
|
headers=headers, json=payload, timeout=180,
|
||||||
)
|
)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
body = resp.text[:500]
|
body = resp.text[:500]
|
||||||
|
|||||||
Reference in New Issue
Block a user