Return a prompt template, optionally with variables filled in.
(
arguments: Dict[str, Any],
store: SessionStore,
)
| 75 | "Save the result as overview.md." |
| 76 | ), |
| 77 | }, |
| 78 | } |
| 79 | |
| 80 | |
| 81 | def handle_get_prompt( |
| 82 | arguments: Dict[str, Any], |
| 83 | store: SessionStore, |
| 84 | ) -> str: |
| 85 | """Return a prompt template, optionally with variables filled in.""" |
| 86 | prompt_type = arguments["prompt_type"] |
| 87 | variables = arguments.get("variables", {}) |
| 88 | |
| 89 | if prompt_type not in _PROMPT_CATALOG: |
| 90 | available = list(_PROMPT_CATALOG.keys()) |
| 91 | return json.dumps( |
| 92 | { |
| 93 | "error": f"Unknown prompt_type: {prompt_type}", |
| 94 | "available_types": available, |
| 95 | } |
| 96 | ) |
| 97 | |
| 98 | catalog_entry = _PROMPT_CATALOG[prompt_type] |
| 99 | |
| 100 | # Resolve the prompt content |
| 101 | content = _resolve_prompt(prompt_type, variables) |
| 102 | |
| 103 | result = { |
| 104 | "prompt_type": prompt_type, |
| 105 | "description": catalog_entry["description"], |
| 106 | "usage_hint": catalog_entry["usage_hint"], |
nothing calls this directly
no test coverage detected