mirror of
https://github.com/trycua/computer.git
synced 2026-01-02 19:40:18 -06:00
add api key/url param to cli
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user