Skip to content

Commit 0933a40

Browse files
committed
revert incorrect copilot suggestion
1 parent f52694e commit 0933a40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Sources/InvokeModel/TextCompletion.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ public struct TextCompletion: Codable, Sendable {
2626
}
2727

2828
private static func extractReasoning(from text: String) -> (completion: String, reasoning: String?) {
29-
guard let match = text.firstMatch(of: Self.reasoningRegex) else {
29+
let reasoningRegex = /<reasoning>(.*?)<\/reasoning>/
30+
31+
guard let match = text.firstMatch(of: reasoningRegex) else {
3032
return (text, nil)
3133
}
3234

3335
let reasoning = String(match.1)
34-
let cleanedText = text.replacing(Self.reasoningRegex, with: "")
36+
let cleanedText = text.replacing(reasoningRegex, with: "")
3537

3638
return (cleanedText, reasoning)
3739
}
38-
private static let reasoningRegex = /<reasoning>(.*?)<\/reasoning>/
3940
}

0 commit comments

Comments
 (0)