feat(captcha): LLM text-image OCR solver with strict-retry

This commit is contained in:
2026-06-07 13:15:32 +01:00
parent ca9add612e
commit c0da1121d9
3 changed files with 106 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
package captcha
import "strings"
// extractJSON returns the first {...} JSON object found in s, or s unchanged.
func extractJSON(s string) string {
start := strings.Index(s, "{")
end := strings.LastIndex(s, "}")
if start >= 0 && end > start {
return s[start : end+1]
}
return s
}