Files
Auto-GPT/autogpt/commands/task_statuses.py
merwanehamadi 10d7747ae2 Use JSON format for commands signature (#4714)
* Use JSON for command signature

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Improve plugin backward compatibility (#4716)

* Fixed plugin test

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Fix Docker-CI

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Put back commands, clean typing and signatures

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

---------

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Erik Peterson <e@eriklp.com>
Co-authored-by: Luke K (pr-0f3t) <2609441+lc0rp@users.noreply.github.com>
2023-06-17 08:39:17 -07:00

34 lines
924 B
Python

"""Task Statuses module."""
from __future__ import annotations
from typing import NoReturn
from autogpt.agent.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()