(context: dict)
| 169 | |
| 170 | |
| 171 | def get_system_prompt(context: dict) -> str: |
| 172 | global _last_context_key, _last_prompt |
| 173 | key = json.dumps(context, sort_keys=True, ensure_ascii=False, default=str) |
| 174 | if key == _last_context_key and _last_prompt: |
| 175 | return _last_prompt |
| 176 | _last_context_key = key |
| 177 | _last_prompt = assemble_system_prompt(context) |
| 178 | return _last_prompt |
| 179 | |
| 180 | |
| 181 | # ── Tools ── |
no test coverage detected