add api key/url param to cli

This commit is contained in:
Dillon DuPont
2025-10-30 12:38:18 -04:00
parent 4026ed3aa2
commit 9bcf5ead1b

View File

@@ -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