GPT评价错误提示中止
This commit is contained in:
parent
a2f02f92df
commit
2e3727e9cf
|
@ -184,6 +184,10 @@ def generation_ai(pname, _class=0, _type=1, opts=None):
|
|||
}
|
||||
)
|
||||
response_text = response.json()
|
||||
if "error" in response_text:
|
||||
print("\nOpenAI API 调用错误:\n", response_text["error"]["message"])
|
||||
exit()
|
||||
else:
|
||||
return 5, response_text["choices"][0]["message"]["content"].strip()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue