()
| 19 | |
| 20 | |
| 21 | def _build_parser() -> argparse.ArgumentParser: |
| 22 | parser = argparse.ArgumentParser( |
| 23 | prog="plan-execute", |
| 24 | description="Run a question through the MCP plan-execute workflow.", |
| 25 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 26 | epilog=""" |
| 27 | model-id format: |
| 28 | The provider is encoded in the model-id prefix: |
| 29 | watsonx/<model> IBM WatsonX (e.g. watsonx/meta-llama/llama-3-3-70b-instruct) |
| 30 | litellm_proxy/<model> LiteLLM proxy (e.g. litellm_proxy/GCP/claude-4-sonnet) |
| 31 | |
| 32 | environment variables: |
| 33 | WATSONX_APIKEY IBM WatsonX API key (required for watsonx/* models) |
| 34 | WATSONX_PROJECT_ID IBM WatsonX project ID (required for watsonx/* models) |
| 35 | WATSONX_URL IBM WatsonX endpoint (optional, defaults to us-south) |
| 36 | |
| 37 | LITELLM_API_KEY LiteLLM API key (required for non-watsonx models) |
| 38 | LITELLM_BASE_URL LiteLLM base URL (required for non-watsonx models) |
| 39 | TOKENROUTER_API_KEY TokenRouter API key (for tokenrouter/* models) |
| 40 | TOKENROUTER_BASE_URL TokenRouter base URL (e.g. https://api.tokenrouter.com/v1) |
| 41 | |
| 42 | LOG_LEVEL Log level for MCP servers (default: WARNING) |
| 43 | |
| 44 | examples: |
| 45 | plan-execute "What assets are at site MAIN?" |
| 46 | plan-execute --model-id watsonx/ibm/granite-3-3-8b-instruct --show-plan "List sensors" |
| 47 | plan-execute --model-id litellm_proxy/GCP/claude-4-sonnet "What are the failure modes?" |
| 48 | plan-execute --verbose --show-trajectory --json "How many IoT observations exist for CH-1?" |
| 49 | """, |
| 50 | ) |
| 51 | add_common_args(parser, default_model=_DEFAULT_MODEL) |
| 52 | parser.add_argument( |
| 53 | "--show-plan", |
| 54 | action="store_true", |
| 55 | help="Print the generated plan before execution.", |
| 56 | ) |
| 57 | return parser |
| 58 | |
| 59 | |
| 60 | def _build_llm(model_id: str): |
nothing calls this directly
no test coverage detected