Spaces:
Runtime error
Runtime error
莘权 马
commited on
Commit
·
755c751
1
Parent(s):
f76965a
feat: + httpx.ReadTimeout
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ from json import JSONDecodeError
|
|
14 |
from typing import Dict
|
15 |
|
16 |
import fire
|
|
|
17 |
import openai
|
18 |
import tenacity
|
19 |
import uvicorn
|
@@ -161,6 +162,11 @@ class Service:
|
|
161 |
title = "OpenAI APITimeoutError"
|
162 |
think_act_prompt = cls.create_error_think_act_prompt(tc_id, title, title, answer)
|
163 |
return think_act_prompt.prompt + "\n\n"
|
|
|
|
|
|
|
|
|
|
|
164 |
elif isinstance(original_exception, JSONDecodeError):
|
165 |
answer = str(original_exception)
|
166 |
title = "MetaGPT Error"
|
|
|
14 |
from typing import Dict
|
15 |
|
16 |
import fire
|
17 |
+
import httpx
|
18 |
import openai
|
19 |
import tenacity
|
20 |
import uvicorn
|
|
|
162 |
title = "OpenAI APITimeoutError"
|
163 |
think_act_prompt = cls.create_error_think_act_prompt(tc_id, title, title, answer)
|
164 |
return think_act_prompt.prompt + "\n\n"
|
165 |
+
elif isinstance(original_exception, httpx.ReadTimeout):
|
166 |
+
answer = f"{original_exception}. {original_exception.request}"
|
167 |
+
title = "httpx ReadTimeout"
|
168 |
+
think_act_prompt = cls.create_error_think_act_prompt(tc_id, title, title, answer)
|
169 |
+
return think_act_prompt.prompt + "\n\n"
|
170 |
elif isinstance(original_exception, JSONDecodeError):
|
171 |
answer = str(original_exception)
|
172 |
title = "MetaGPT Error"
|
init.sh
CHANGED
@@ -17,7 +17,7 @@ done
|
|
17 |
|
18 |
rm -rf static
|
19 |
|
20 |
-
wget -O dist.tar.gz https://public-frontend-1300249583.cos.ap-nanjing.myqcloud.com/test-hp-metagpt-web/dist-
|
21 |
tar xvzf dist.tar.gz
|
22 |
mv dist static
|
23 |
rm dist.tar.gz
|
|
|
17 |
|
18 |
rm -rf static
|
19 |
|
20 |
+
wget -O dist.tar.gz https://public-frontend-1300249583.cos.ap-nanjing.myqcloud.com/test-hp-metagpt-web/dist-20240118153159.tar.gz
|
21 |
tar xvzf dist.tar.gz
|
22 |
mv dist static
|
23 |
rm dist.tar.gz
|