fix parameter parsing
Browse files- src/proxy_lite/cli.py +9 -9
src/proxy_lite/cli.py
CHANGED
|
@@ -12,9 +12,9 @@ from proxy_lite.logger import logger
|
|
| 12 |
|
| 13 |
def update_config_from_env(config: RunnerConfig) -> RunnerConfig:
|
| 14 |
if os.getenv("PROXY_LITE_API_BASE"):
|
| 15 |
-
config.solver.client.api_base = os.getenv("PROXY_LITE_API_BASE")
|
| 16 |
if os.getenv("PROXY_LITE_MODEL"):
|
| 17 |
-
config.solver.client.model_id = os.getenv("PROXY_LITE_MODEL")
|
| 18 |
if os.getenv("PROXY_LITE_VIEWPORT_WIDTH"):
|
| 19 |
config.environment.viewport_width = int(os.getenv("PROXY_LITE_VIEWPORT_WIDTH"))
|
| 20 |
if os.getenv("PROXY_LITE_VIEWPORT_HEIGHT"):
|
|
@@ -31,9 +31,9 @@ def do_command(args):
|
|
| 31 |
config = update_config_from_env(config)
|
| 32 |
# Update config from command-line arguments
|
| 33 |
if args.api_base:
|
| 34 |
-
config.solver.client.api_base = args.api_base
|
| 35 |
if args.model:
|
| 36 |
-
config.solver.client.model_id = args.model
|
| 37 |
if args.homepage:
|
| 38 |
config.environment.homepage = args.homepage
|
| 39 |
if args.viewport_width:
|
|
@@ -68,33 +68,33 @@ def main():
|
|
| 68 |
)
|
| 69 |
parser.add_argument(
|
| 70 |
"--model",
|
| 71 |
-
type=
|
| 72 |
default=None,
|
| 73 |
help="The model to use.",
|
| 74 |
)
|
| 75 |
parser.add_argument(
|
| 76 |
"--api_base",
|
| 77 |
-
type=
|
| 78 |
default=None,
|
| 79 |
help="The API base URL to use.",
|
| 80 |
)
|
| 81 |
# New option for setting a homepage URL:
|
| 82 |
parser.add_argument(
|
| 83 |
"--homepage",
|
| 84 |
-
type=
|
| 85 |
default=None,
|
| 86 |
help="The homepage URL to use.",
|
| 87 |
)
|
| 88 |
# New viewport controls:
|
| 89 |
parser.add_argument(
|
| 90 |
"--viewport-width",
|
| 91 |
-
type=
|
| 92 |
default=None,
|
| 93 |
help="Viewport width in pixels.",
|
| 94 |
)
|
| 95 |
parser.add_argument(
|
| 96 |
"--viewport-height",
|
| 97 |
-
type=
|
| 98 |
default=None,
|
| 99 |
help="Viewport height in pixels.",
|
| 100 |
)
|
|
|
|
| 12 |
|
| 13 |
def update_config_from_env(config: RunnerConfig) -> RunnerConfig:
|
| 14 |
if os.getenv("PROXY_LITE_API_BASE"):
|
| 15 |
+
config.solver.agent.client.api_base = os.getenv("PROXY_LITE_API_BASE")
|
| 16 |
if os.getenv("PROXY_LITE_MODEL"):
|
| 17 |
+
config.solver.agent.client.model_id = os.getenv("PROXY_LITE_MODEL")
|
| 18 |
if os.getenv("PROXY_LITE_VIEWPORT_WIDTH"):
|
| 19 |
config.environment.viewport_width = int(os.getenv("PROXY_LITE_VIEWPORT_WIDTH"))
|
| 20 |
if os.getenv("PROXY_LITE_VIEWPORT_HEIGHT"):
|
|
|
|
| 31 |
config = update_config_from_env(config)
|
| 32 |
# Update config from command-line arguments
|
| 33 |
if args.api_base:
|
| 34 |
+
config.solver.agent.client.api_base = args.api_base
|
| 35 |
if args.model:
|
| 36 |
+
config.solver.agent.client.model_id = args.model
|
| 37 |
if args.homepage:
|
| 38 |
config.environment.homepage = args.homepage
|
| 39 |
if args.viewport_width:
|
|
|
|
| 68 |
)
|
| 69 |
parser.add_argument(
|
| 70 |
"--model",
|
| 71 |
+
type=str,
|
| 72 |
default=None,
|
| 73 |
help="The model to use.",
|
| 74 |
)
|
| 75 |
parser.add_argument(
|
| 76 |
"--api_base",
|
| 77 |
+
type=str,
|
| 78 |
default=None,
|
| 79 |
help="The API base URL to use.",
|
| 80 |
)
|
| 81 |
# New option for setting a homepage URL:
|
| 82 |
parser.add_argument(
|
| 83 |
"--homepage",
|
| 84 |
+
type=str,
|
| 85 |
default=None,
|
| 86 |
help="The homepage URL to use.",
|
| 87 |
)
|
| 88 |
# New viewport controls:
|
| 89 |
parser.add_argument(
|
| 90 |
"--viewport-width",
|
| 91 |
+
type=int,
|
| 92 |
default=None,
|
| 93 |
help="Viewport width in pixels.",
|
| 94 |
)
|
| 95 |
parser.add_argument(
|
| 96 |
"--viewport-height",
|
| 97 |
+
type=int,
|
| 98 |
default=None,
|
| 99 |
help="Viewport height in pixels.",
|
| 100 |
)
|