| 124 | |
| 125 | |
| 126 | def parse_args() -> argparse.Namespace: |
| 127 | p = argparse.ArgumentParser( |
| 128 | description="SkillOpt: Executive Strategy for Self-Evolving Agent Skills", |
| 129 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 130 | epilog=__doc__, |
| 131 | ) |
| 132 | p.add_argument("--config", type=str, required=True, |
| 133 | help="Path to YAML config file") |
| 134 | p.add_argument("--cfg-options", nargs="+", default=[], |
| 135 | help="Override config: section.key=value (e.g. train.batch_size=40)") |
| 136 | |
| 137 | # Legacy flat CLI overrides (still work, prefer --cfg-options for new usage) |
| 138 | p.add_argument("--env", type=str) |
| 139 | p.add_argument("--backend", type=str, |
| 140 | choices=["azure_openai", "codex", "codex_exec", "claude", "claude_chat", "claude_code_exec", "qwen", "qwen_chat", "minimax", "minimax_chat"]) |
| 141 | p.add_argument("--optimizer_model", type=str) |
| 142 | p.add_argument("--target_model", type=str) |
| 143 | p.add_argument("--optimizer_backend", type=str) |
| 144 | p.add_argument("--target_backend", type=str) |
| 145 | p.add_argument("--reasoning_effort", type=str, |
| 146 | choices=["", "low", "medium", "high", "xhigh", "max"]) |
| 147 | p.add_argument("--rewrite_reasoning_effort", type=str) |
| 148 | p.add_argument("--rewrite_max_completion_tokens", type=int) |
| 149 | p.add_argument("--azure_endpoint", type=str) |
| 150 | p.add_argument("--azure_api_version", type=str) |
| 151 | p.add_argument("--azure_api_key", type=str) |
| 152 | p.add_argument("--azure_openai_endpoint", type=str) |
| 153 | p.add_argument("--azure_openai_api_version", type=str) |
| 154 | p.add_argument("--azure_openai_api_key", type=str) |
| 155 | p.add_argument("--azure_openai_auth_mode", type=str) |
| 156 | p.add_argument("--azure_openai_ad_scope", type=str) |
| 157 | p.add_argument("--azure_openai_managed_identity_client_id", type=str) |
| 158 | p.add_argument("--optimizer_azure_openai_endpoint", type=str) |
| 159 | p.add_argument("--optimizer_azure_openai_api_version", type=str) |
| 160 | p.add_argument("--optimizer_azure_openai_api_key", type=str) |
| 161 | p.add_argument("--optimizer_azure_openai_auth_mode", type=str) |
| 162 | p.add_argument("--optimizer_azure_openai_ad_scope", type=str) |
| 163 | p.add_argument("--optimizer_azure_openai_managed_identity_client_id", type=str) |
| 164 | p.add_argument("--target_azure_openai_endpoint", type=str) |
| 165 | p.add_argument("--target_azure_openai_api_version", type=str) |
| 166 | p.add_argument("--target_azure_openai_api_key", type=str) |
| 167 | p.add_argument("--target_azure_openai_auth_mode", type=str) |
| 168 | p.add_argument("--target_azure_openai_ad_scope", type=str) |
| 169 | p.add_argument("--target_azure_openai_managed_identity_client_id", type=str) |
| 170 | p.add_argument("--qwen_chat_base_url", type=str) |
| 171 | p.add_argument("--qwen_chat_api_key", type=str) |
| 172 | p.add_argument("--qwen_chat_temperature", type=float) |
| 173 | p.add_argument("--qwen_chat_timeout_seconds", type=float) |
| 174 | p.add_argument("--qwen_chat_max_tokens", type=int) |
| 175 | p.add_argument("--qwen_chat_enable_thinking", type=_BOOL) |
| 176 | p.add_argument("--optimizer_qwen_chat_base_url", type=str) |
| 177 | p.add_argument("--optimizer_qwen_chat_api_key", type=str) |
| 178 | p.add_argument("--optimizer_qwen_chat_temperature", type=float) |
| 179 | p.add_argument("--optimizer_qwen_chat_timeout_seconds", type=float) |
| 180 | p.add_argument("--optimizer_qwen_chat_max_tokens", type=int) |
| 181 | p.add_argument("--optimizer_qwen_chat_enable_thinking", type=_BOOL) |
| 182 | p.add_argument("--target_qwen_chat_base_url", type=str) |
| 183 | p.add_argument("--target_qwen_chat_api_key", type=str) |