mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-08 08:44:23 +01:00
* Add config as attribute to Agent, rename old config to ai_config * Code review: Pass ai_config * Pass agent to commands instead of config * Lint * Fix merge error * Fix memory challenge a --------- Co-authored-by: Nicholas Tindle <nick@ntindle.com> Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
28 lines
698 B
Python
28 lines
698 B
Python
"""Task Statuses module."""
|
|
from __future__ import annotations
|
|
|
|
from typing import NoReturn
|
|
|
|
from autogpt.agent.agent import Agent
|
|
from autogpt.commands.command import command
|
|
from autogpt.logs import logger
|
|
|
|
|
|
@command(
|
|
"task_complete",
|
|
"Task Complete (Shutdown)",
|
|
'"reason": "<reason>"',
|
|
)
|
|
def task_complete(reason: str, agent: Agent) -> NoReturn:
|
|
"""
|
|
A function that takes in a string and exits the program
|
|
|
|
Parameters:
|
|
reason (str): The reason for shutting down.
|
|
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()
|