Prevent adding content that starts with 'x-anthropic-' to system_content. (#1436)

This commit is contained in:
hksdpc255 2026-03-16 18:57:09 +11:00 committed by GitHub
parent d83b0172b1
commit a655a95378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -1202,8 +1202,11 @@ json anthropic_params_from_json(
}
else if (system_param.is_array()) {
for (const auto& block : system_param) {
if (json_value(block, "type", std::string()) == "text") {
system_content += json_value(block, "text", std::string());
if (json_value(block, "type", std::string()) == "text") {
std::string content_block = json_value(block, "text", std::string());
if (!string_starts_with(content_block, "x-anthropic-")) {
system_content += content_block;
}
}
}
}