StripInjectedMessages removes any tool call / tool result message pairs that were previously injected by this package. It returns cleaned JSON. format must be "openai", "openai-responses", or "claude".
(rawJSON []byte, format string)
| 20 | // |
| 21 | // format must be "openai", "openai-responses", or "claude". |
| 22 | func StripInjectedMessages(rawJSON []byte, format string) []byte { |
| 23 | cleaned, _ := StripAndCaptureInjectedMessages(rawJSON, format) |
| 24 | return cleaned |
| 25 | } |
| 26 | |
| 27 | // StripAndCaptureInjectedMessages removes injected tool call / result pairs |
| 28 | // and also extracts the content of tool results produced by injected calls. |