From bcce1bef9965ebbd798b596f201b35a4f0887dea Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Wed, 21 Jan 2026 14:56:16 -0800 Subject: [PATCH] fix for \\n -> \n --- internal/plugins/ai/anthropic/anthropic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/plugins/ai/anthropic/anthropic.go b/internal/plugins/ai/anthropic/anthropic.go index e7d2fe28..f3d4115e 100644 --- a/internal/plugins/ai/anthropic/anthropic.go +++ b/internal/plugins/ai/anthropic/anthropic.go @@ -395,7 +395,7 @@ func (an *Client) toMessages(msgs []*chat.ChatCompletionMessage) (ret []anthropi continue } if systemContent != "" { - systemContent += "\\n" + systemText + systemContent += "\n" + systemText } else { systemContent = systemText } @@ -454,7 +454,7 @@ func messageTextFromParts(msg *chat.ChatCompletionMessage) string { textParts = append(textParts, part.Text) } } - return strings.Join(textParts, "\\n") + return strings.Join(textParts, "\n") } func contentBlocksFromMessage(msg *chat.ChatCompletionMessage) []anthropic.ContentBlockParamUnion { @@ -485,7 +485,7 @@ func prependSystemContentToBlocks(systemContent string, blocks []anthropic.Conte return []anthropic.ContentBlockParamUnion{anthropic.NewTextBlock(systemContent)} } if blocks[0].OfText != nil { - blocks[0].OfText.Text = systemContent + "\\n\\n" + blocks[0].OfText.Text + blocks[0].OfText.Text = systemContent + "\n\n" + blocks[0].OfText.Text return blocks } return append([]anthropic.ContentBlockParamUnion{anthropic.NewTextBlock(systemContent)}, blocks...)