Skip to content

Commit f3bd832

Browse files
pwilkinam17an
authored andcommitted
chat: include full unparsed prompt in debug (#24650)
message on parse error
1 parent ed98327 commit f3bd832

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

common/chat.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,10 +2678,9 @@ common_chat_msg common_chat_peg_parse(const common_peg_arena & src_pars
26782678
}
26792679
return msg;
26802680
}
2681-
LOG_WRN("%s: unparsed %s output: %s\n", __func__, common_chat_format_name(params.format),
2682-
effective_input.substr(result.end).c_str());
2683-
throw std::runtime_error(std::string("The model produced output that does not match the expected ") +
2684-
common_chat_format_name(params.format) + " format");
2681+
LOG_WRN("%s: unparsed %s output: %s\n", __func__, common_chat_format_name(params.format), effective_input.substr(result.end).c_str());
2682+
LOG_DBG("%s: full %s output triggering error:\n=== BEGIN ===\n%s\n=== END ===\n", __func__, common_chat_format_name(params.format), effective_input.c_str());
2683+
throw std::runtime_error(std::string("The model produced output that does not match the expected ") + common_chat_format_name(params.format) + " format");
26852684
}
26862685

26872686
common_chat_msg msg;

0 commit comments

Comments
 (0)