Files
Auto-GPT/autogpt/commands/task_statuses.py
James Collins c9adedf746 Refactor/rename agent subpackage to agents (#4961)
* Add links to github issues in the README and clarify run instructions

* Rename agent subpackage to agents

* Revert all unwanted changes

* Use relative import in `agents/__init__.py`

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
2023-07-13 07:31:49 -07:00

34 lines
925 B
Python

"""Task Statuses module."""
from __future__ import annotations
from typing import NoReturn
from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.logs import logger
@command(
"goals_accomplished",
"Goals are accomplished and there is nothing left to do",
{
"reason": {
"type": "string",
"description": "A summary to the user of how the goals were accomplished",
"required": True,
}
},
)
def task_complete(reason: str, agent: Agent) -> NoReturn:
"""
A function that takes in a string and exits the program
Parameters:
reason (str): A summary to the user of how the goals were accomplished.
Returns:
A result string from create chat completion. A list of suggestions to
improve the code.
"""
logger.info(title="Shutting down...\n", message=reason)
quit()