| 196 | * Return modified message text. |
| 197 | */ |
| 198 | export function removeCodeBlocksAndTrim(text: string): string { |
| 199 | const codeBlockRegex = /```[\s\S]*?```/g; |
| 200 | const thinkBlockRegex = /<think>[\s\S]*?<\/think>/g; |
| 201 | |
| 202 | // Remove code blocks and think blocks from the message text |
| 203 | let processedText = text.replace(codeBlockRegex, ""); |
| 204 | processedText = processedText.replace(thinkBlockRegex, ""); |
| 205 | |
| 206 | return processedText.trim(); |
| 207 | } |
| 208 | |
| 209 | export function splitCamelCaseAndNonAlphaNumeric(value: string) { |
| 210 | return value |