请求错误时继续翻译
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
__version__="0.2.38"
|
__version__="0.2.39b1"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,9 @@ class Agent:
|
|||||||
result = response.json()["choices"][0]["message"]["content"]
|
result = response.json()["choices"][0]["message"]["content"]
|
||||||
return result
|
return result
|
||||||
except httpx.HTTPStatusError as e:
|
except httpx.HTTPStatusError as e:
|
||||||
raise Exception(f"AI请求错误 (async): {e.response.status_code} - {e.response.text}")
|
translater_logger.warning(f"AI请求错误 (async): {e.response.status_code} - {e.response.text}")
|
||||||
|
print(f"system_prompt:\n{system_prompt}\nprompt:\n{prompt}")
|
||||||
|
return prompt
|
||||||
except httpx.RequestError as e:
|
except httpx.RequestError as e:
|
||||||
translater_logger.warning(f"AI请求连接错误 (async): {repr(e)}")
|
translater_logger.warning(f"AI请求连接错误 (async): {repr(e)}")
|
||||||
except (KeyError, IndexError) as e:
|
except (KeyError, IndexError) as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user