Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(agent, benchmark): Specify `path_type=Path` for CLI path options/arguments

Reinier van der Leerdb0e72695491
diff --git a/autogpt/autogpt/app/cli.py b/autogpt/autogpt/app/cli.py
index 65aa6f514a..71658dbf25 100644
--- a/autogpt/autogpt/app/cli.py
+++ b/autogpt/autogpt/app/cli.py
@@ -113,7 +113,7 @@ def cli(ctx: click.Context):
@click.option(
"--component-config-file",
help="Path to a json configuration file",
- type=click.Path(exists=True, dir_okay=False, resolve_path=True),
+ type=click.Path(exists=True, dir_okay=False, resolve_path=True, path_type=Path),
)
def run(
continuous: bool,
diff --git a/autogpt/scripts/git_log_to_release_notes.py b/autogpt/scripts/git_log_to_release_notes.py
index 9d8afd6a49..8ae2a9bc91 100755
--- a/autogpt/scripts/git_log_to_release_notes.py
+++ b/autogpt/scripts/git_log_to_release_notes.py
@@ -19,7 +19,7 @@ from autogpt.app.utils import coroutine
help="Path to the git repository",
)
@coroutine
-async def generate_release_notes(repo_path: Optional[Path] = None):
+async def generate_release_notes(repo_path: Optional[str | Path] = None):
logger = logging.getLogger(generate_release_notes.name) # pyright: ignore
repo = Repo(repo_path, search_parent_directories=True)
diff --git a/benchmark/agbenchmark/__main__.py b/benchmark/agbenchmark/__main__.py
index c8f2a14301..9463d4c81c 100644
--- a/benchmark/agbenchmark/__main__.py
+++ b/benchmark/agbenchmark/__main__.py
@@ -97,7 +97,9 @@ def start():
help="Write log output to a file instead of the terminal.",
)
# @click.argument(
-# "agent_path", type=click.Path(exists=True, file_okay=False), required=False
+# "agent_path",
+# type=click.Path(exists=True, file_okay=False, path_type=Path),
+# required=False,
# )
def run(
maintain: bool,
diff --git a/benchmark/reports/format.py b/benchmark/reports/format.py
index e4b6469db9..c8eb662b27 100755
--- a/benchmark/reports/format.py
+++ b/benchmark/reports/format.py
@@ -1,13 +1,16 @@
#!/usr/bin/env python3
from pathlib import Path
+
import click
from agbenchmark.reports.processing.report_types import Report
@click.command()
[email protected]("report_json_file", type=click.Path(exists=True, dir_okay=False))
+ "report_json_file", type=click.Path(exists=True, dir_okay=False, path_type=Path)
+)
def print_markdown_report(report_json_file: Path):
"""
Generates a Markdown report from a given report.json file.