diff --git a/.gitignore b/.gitignore index 54632f88..7cacd726 100644 --- a/.gitignore +++ b/.gitignore @@ -169,6 +169,7 @@ cython_debug/ # Vscode config files .vscode/ +!.vscode/launch.json # Exception: allow launch.json # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..b52ce41d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug examples/fastapi", + "type": "python", + "request": "launch", + "module": "uvicorn", + "args": ["main:app", "--app-dir", "${workspaceFolder}/examples/fastapi/arcade_example_fastapi"], + "jinja": true, + "justMyCode": true, + "cwd": "${workspaceFolder}/examples/fastapi/arcade_example_fastapi" + }, + { + "name": "Debug arcade dev", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/arcade/run_cli.py", + "args": ["dev"], + "console": "integratedTerminal", + "jinja": true, + "justMyCode": true, + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/arcade/arcade/cli/main.py b/arcade/arcade/cli/main.py index f791fa25..e484b888 100644 --- a/arcade/arcade/cli/main.py +++ b/arcade/arcade/cli/main.py @@ -34,7 +34,7 @@ console = Console() @cli.command(help="Log in to Arcade Cloud") def login( host: str = typer.Option( - "https://cloud.arcade-ai.com", + "cloud.arcade-ai.com", "-h", "--host", help="The Arcade Cloud host to log in to.", @@ -261,7 +261,7 @@ def dev( "127.0.0.1", help="Host for the app, from settings by default.", show_default=True ), port: int = typer.Option( - "8000", "-p", "--port", help="Port for the app, defaults to ", show_default=True + "8002", "-p", "--port", help="Port for the app, defaults to ", show_default=True ), disable_auth: bool = typer.Option( False, diff --git a/arcade/run_cli.py b/arcade/run_cli.py new file mode 100644 index 00000000..ccf215f3 --- /dev/null +++ b/arcade/run_cli.py @@ -0,0 +1,8 @@ +import sys + +from arcade.cli.main import cli + +if __name__ == "__main__": + # Support attaching debugger to cli + mode = sys.argv[1] if len(sys.argv) > 1 else "dev" + cli([mode]) diff --git a/toolkits/math/arcade_arithmetic/tools/arithmetic.py b/toolkits/math/arcade_arithmetic/tools/arithmetic.py index 47ccb01f..d9cb792b 100644 --- a/toolkits/math/arcade_arithmetic/tools/arithmetic.py +++ b/toolkits/math/arcade_arithmetic/tools/arithmetic.py @@ -62,3 +62,14 @@ def sum_list( Sum all numbers in a list """ return sum(numbers) + + +@tool +def sum_range( + start: Annotated[int, "The start of the range to sum"], + end: Annotated[int, "The end of the range to sum"], +) -> Annotated[int, "The sum of the numbers in the list"]: + """ + Sum all numbers from start through end + """ + return sum([i for i in range(start, end + 1)])