fix: address all differential review feedback
1. Reduced repeat_penalty to 1.15 to avoid degrading normal generation. 2. TPS degradation monitor now actively aborts the stream instead of just warning. 3. Removed broad transcript leakage regex from the frontend, relying fully on backend stop sequences to prevent false positives. 4. Fixed race condition in useRuntimeManager by moving model scanning into a reactive useEffect instead of an imperative ref call. 5. Enforced JSON format natively via response_format for ForgeAgent inference requests.
This commit is contained in:
1 parent
943bf6321f
commit
36b80bc0a8
6 files changed
+273
-73
No files matched your search
@@ -624,16 +624,31 @@ async fn start_forgeagent_session_command(
|
||||
return;
|
||||
};
|
||||
|
||||
let request_body = serde_json::json!({
|
||||
let mut request_body = serde_json::json!({
|
||||
"model": "local",
|
||||
"messages": [
|
||||
{ "role": "system", "content": system_prompt },
|
||||
{ "role": "user", "content": &prompt }
|
||||
],
|
||||
"stream": false,
|
||||
"max_tokens": 2048
|
||||
"max_tokens": 1024,
|
||||
"response_format": { "type": "json_object" }
|
||||
});
|
||||
|
||||
if let Some(messages) = request_body.get_mut("messages") {
|
||||
if let Some(arr) = messages.as_array_mut() {
|
||||
if let Some(system) = arr.get_mut(0) {
|
||||
if let Some(content) = system.get_mut("content") {
|
||||
let augmented = format!(
|
||||
"{}\n\nLimite a cadeia de raciocínio (thinking) a no máximo 1024 tokens e só entregue a resposta final depois de concluir o thinking.",
|
||||
content.as_str().unwrap_or_default()
|
||||
);
|
||||
*content = serde_json::Value::String(augmented);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let Ok(resp) = client
|
||||
.post(format!("{}/v1/chat/completions", runtime_url))
|
||||
.header("Content-Type", "application/json")
|
||||
|
||||
Reference in new issue
Block a user