Build a system-reminder block for MCP resource text content.
(filename: &str, uri: &str, content: &str)
| 26 | |
| 27 | /// Build a system-reminder block for MCP resource text content. |
| 28 | pub fn mcp_resource_reminder(filename: &str, uri: &str, content: &str) -> String { |
| 29 | let (content, truncated) = trim_for_prompt(content, MAX_MCP_RESOURCE_CHARS); |
| 30 | let truncation_hint = if truncated { |
| 31 | "\n\n[Content truncated for prompt safety.]" |
| 32 | } else { |
| 33 | "" |
| 34 | }; |
| 35 | let body = format!( |
| 36 | "MCP resource context from {} ({}):\n{}{}", |
| 37 | filename, uri, content, truncation_hint |
| 38 | ); |
| 39 | Self::system_reminder(&body) |
| 40 | } |
| 41 | |
| 42 | /// Select the appropriate system prompt based on model API ID. |
| 43 | /// TS: `SystemPrompt.provider(model)` in session/system.ts |
nothing calls this directly
no test coverage detected