feat: pass-by metadata to predict options (#8795)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2026-03-05 22:50:10 +01:00
committed by GitHub
parent 0cf7c18177
commit 580517f9db
10 changed files with 72 additions and 11 deletions

View File

@@ -1297,6 +1297,13 @@ public:
body_json["min_p"] = data["min_p"];
}
// Pass metadata fields to body_json
const auto& metadata = request->metadata();
auto et_it = metadata.find("enable_thinking");
if (et_it != metadata.end()) {
body_json["enable_thinking"] = (et_it->second == "true");
}
// Debug: Print full body_json before template processing (includes messages, tools, tool_choice, etc.)
SRV_DBG("[CONVERSATION DEBUG] PredictStream: Full body_json before oaicompat_chat_params_parse:\n%s\n", body_json.dump(2).c_str());
@@ -2064,6 +2071,13 @@ public:
body_json["min_p"] = data["min_p"];
}
// Pass metadata fields to body_json
const auto& predict_metadata = request->metadata();
auto predict_et_it = predict_metadata.find("enable_thinking");
if (predict_et_it != predict_metadata.end()) {
body_json["enable_thinking"] = (predict_et_it->second == "true");
}
// Debug: Print full body_json before template processing (includes messages, tools, tool_choice, etc.)
SRV_DBG("[CONVERSATION DEBUG] Predict: Full body_json before oaicompat_chat_params_parse:\n%s\n", body_json.dump(2).c_str());