Skip to content

Commit 7ddbd01

Browse files
committed
add cli argument for model config
1 parent b71c2e0 commit 7ddbd01

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/seclab_taskflow_agent/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ def main(
107107
list[str] | None,
108108
typer.Argument(help="Remaining prompt text."),
109109
] = None,
110+
model_config: Annotated[
111+
str | None,
112+
typer.Option("-m", "--model-config", help="Model configuration module path. Only relevant when running taskflows"),
113+
] = None,
110114
) -> None:
111115
"""Run a taskflow or personality-based agent session."""
112116
# Debug mode from flag or env var
@@ -156,7 +160,7 @@ def main(
156160
asyncio.run(
157161
run_main(
158162
available_tools, personality, effective_taskflow,
159-
cli_globals, user_prompt, resume_session_id=resume,
163+
cli_globals, user_prompt, cli_model_config = model_config, resume_session_id=resume,
160164
),
161165
debug=debug,
162166
)

src/seclab_taskflow_agent/runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ async def run_main(
451451
taskflow_path: str | None,
452452
cli_globals: dict[str, str],
453453
prompt: str | None,
454+
cli_model_config: str | None,
454455
resume_session_id: str | None = None,
455456
) -> None:
456457
"""Main entry point for taskflow/personality execution.
@@ -461,6 +462,7 @@ async def run_main(
461462
taskflow_path: Taskflow module path, or None.
462463
cli_globals: Global variables from CLI.
463464
prompt: User prompt text.
465+
cli_model_config: Model configuration module path, or None.
464466
resume_session_id: Session ID to resume from a checkpoint.
465467
"""
466468
from .session import TaskflowSession
@@ -511,6 +513,8 @@ async def on_handoff_hook(context: RunContextWrapper[TContext], agent: Agent[TCo
511513

512514
# Resolve model config
513515
model_config_ref = taskflow_doc.model_config_ref
516+
if cli_model_config:
517+
model_config_ref = cli_model_config
514518
model_keys: list[str] = []
515519
model_dict: dict[str, str] = {}
516520
models_params: dict[str, dict[str, Any]] = {}

0 commit comments

Comments
 (0)