aboutsummaryrefslogtreecommitdiff
path: root/autogpts/autogpt/tests/mocks/mock_commands.py
blob: ab9e961b6597e2d74e46f1e9909554941289591b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from autogpt.command_decorator import command
from autogpt.core.utils.json_schema import JSONSchema

COMMAND_CATEGORY = "mock"


@command(
    "function_based_cmd",
    "Function-based test command",
    {
        "arg1": JSONSchema(
            type=JSONSchema.Type.INTEGER,
            description="arg 1",
            required=True,
        ),
        "arg2": JSONSchema(
            type=JSONSchema.Type.STRING,
            description="arg 2",
            required=True,
        ),
    },
)
def function_based_cmd(arg1: int, arg2: str) -> str:
    """A function-based test command.

    Returns:
        str: the two arguments separated by a dash.
    """
    return f"{arg1} - {arg2}"