File size: 375 Bytes
2f7798c c74ff6a 2f7798c c74ff6a 2f7798c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
export function dirtyLLMResponseCleaner(input: string) {
return (
`${input || ""}`
// a summary of all the weird hallucinations I saw it make..
.replaceAll("}}", "}")
.replaceAll("]]", "]")
.replaceAll(",,", ",")
.replaceAll("[0]", "")
.replaceAll("[1]", "")
.replaceAll("[2]", "")
.replaceAll("[3]", "")
.replaceAll("[4]", "")
)
} |