diff --git a/libs/python/agent/agent/cli.py b/libs/python/agent/agent/cli.py index 7669b255..49793ba6 100644 --- a/libs/python/agent/agent/cli.py +++ b/libs/python/agent/agent/cli.py @@ -297,6 +297,20 @@ Examples: help="Maximum number of retries for the LLM API calls", ) + # Provider override credentials + parser.add_argument( + "--api-key", + dest="api_key", + type=str, + help="API key override for the model provider (passed to ComputerAgent)", + ) + parser.add_argument( + "--api-url", + dest="api_url", + type=str, + help="API base URL override for the model provider (passed to ComputerAgent)", + ) + args = parser.parse_args() # Check for required environment variables @@ -380,6 +394,12 @@ Examples: "max_retries": args.max_retries, } + # Thread API credentials to agent if provided + if args.api_key: + agent_kwargs["api_key"] = args.api_key + if args.api_url: + agent_kwargs["api_url"] = args.api_url + if args.images > 0: agent_kwargs["only_n_most_recent_images"] = args.images