(context: dict)
| 163 | |
| 164 | |
| 165 | def get_system_prompt(context: dict) -> str: |
| 166 | global _last_context_key, _last_prompt |
| 167 | key = json.dumps(context, sort_keys=True, ensure_ascii=False, default=str) |
| 168 | if key == _last_context_key and _last_prompt: |
| 169 | return _last_prompt |
| 170 | _last_context_key = key |
| 171 | _last_prompt = assemble_system_prompt(context) |
| 172 | return _last_prompt |
| 173 | |
| 174 | |
| 175 | # ── Tools ── |
no test coverage detected