Files
Auto-GPT/autogpts/autogpt/tests/mocks/mock_commands.py
Reinier van der Leer d938c2595e refactor(agent): Fix all trivial linting errors
* Fix all but one flake8 linting errors
  * Remove unused imports
  * Wrap strings that are too long
  * Add basic autogpts/autogpt/.flake8
* Delete planning_agent.py
* Delete default_prompts.py
* Delete _test_json_parser.py
* Refactor the example function call in AgentProfileGeneratorConfiguration from a string to an object
* Rewrite/update docstrings here and there while I'm at it
* Minor change to the description of the `open_file` command
* Use `user-agent` from config in web_selenium.py
* Delete hardcoded ABILITIES from core/planning/templates.py
* Delete duplicate and superseded test from test_image_gen.py
* Fix parameter definitions in mock_commands.py
* Delete code analysis blocks from test_spinner.py, test_url_validation.py
2023-12-02 05:42:10 +01:00

30 lines
691 B
Python

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}"