mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 10:46:21 +00:00
fix(ai): convert \n escape sequences to actual newlines in LLM responses
This commit is contained in:
@@ -608,6 +608,9 @@ _parse_ai_response(const gchar* response_json)
|
||||
if (*in == '\\' && *(in + 1) == '"') {
|
||||
*out++ = '"';
|
||||
in += 2;
|
||||
} else if (*in == '\\' && *(in + 1) == 'n') {
|
||||
*out++ = '\n';
|
||||
in += 2;
|
||||
} else {
|
||||
*out++ = *in++;
|
||||
}
|
||||
@@ -646,6 +649,9 @@ _parse_ai_response(const gchar* response_json)
|
||||
if (*in == '\\' && *(in + 1) == '"') {
|
||||
*out++ = '"';
|
||||
in += 2;
|
||||
} else if (*in == '\\' && *(in + 1) == 'n') {
|
||||
*out++ = '\n';
|
||||
in += 2;
|
||||
} else {
|
||||
*out++ = *in++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user