mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-20 07:24:21 +01:00
Add early abort functions.
This commit is contained in:
@@ -131,6 +131,8 @@ def create_chat_completion(
|
||||
raise RuntimeError(f"Failed to get response after {num_retries} retries")
|
||||
resp = response.choices[0].message["content"]
|
||||
for plugin in CFG.plugins:
|
||||
if not plugin.can_handle_on_response():
|
||||
continue
|
||||
resp = plugin.on_response(resp)
|
||||
return resp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user