Skip to content

Commit

Permalink
Fix reading string args from m1 cli (#5343)
Browse files Browse the repository at this point in the history
After #5431 some command-line arguments became string rather than lists.
This PR fixes the issue by checking the type.
  • Loading branch information
afourney authored Feb 3, 2025
1 parent cd88757 commit e8f49ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/packages/magentic-one-cli/src/magentic_one_cli/_m1.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def main() -> None:
else:
config = yaml.safe_load(DEFAULT_CONFIG_CONTENTS)
else:
with open(args.config[0], "r") as f:
with open(args.config if isinstance(args.config, str) else args.config[0], "r") as f:
config = yaml.safe_load(f)

client = ChatCompletionClient.load_component(config["client"])
Expand All @@ -120,7 +120,7 @@ async def run_task(task: str, hil_mode: bool, use_rich_console: bool) -> None:
else:
await Console(m1.run_stream(task=task), output_stats=False, user_input_manager=input_manager)

task = args.task[0]
task = args.task if isinstance(args.task, str) else args.task[0]
asyncio.run(run_task(task, not args.no_hil, args.rich))


Expand Down

0 comments on commit e8f49ef

Please sign in to comment.