mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
fixes based on PR
This commit is contained in:
parent
17fe859a71
commit
067d886b8d
5 changed files with 18 additions and 9 deletions
|
|
@ -117,6 +117,13 @@ impl ChatCompletionsRequest {
|
|||
self.max_tokens = None;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fix_temperature_if_gpt5(&mut self) {
|
||||
let model = self.model.as_str();
|
||||
if model.starts_with("gpt-5") {
|
||||
self.temperature = Some(1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -599,6 +606,7 @@ impl TryFrom<&[u8]> for ChatCompletionsRequest {
|
|||
let mut req: ChatCompletionsRequest = serde_json::from_slice(bytes).map_err(OpenAIStreamError::from)?;
|
||||
// Use the centralized suppression logic
|
||||
req.suppress_max_tokens_if_o3();
|
||||
req.fix_temperature_if_gpt5();
|
||||
Ok(req)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ impl TryFrom<AnthropicMessagesRequest> for ChatCompletionsRequest {
|
|||
..Default::default()
|
||||
};
|
||||
_chat_completions_req.suppress_max_tokens_if_o3();
|
||||
_chat_completions_req.fix_temperature_if_gpt5();
|
||||
Ok(_chat_completions_req)
|
||||
}
|
||||
}
|
||||
|
|
@ -1014,7 +1015,7 @@ fn convert_content_delta(delta: MessagesContentDelta) -> Result<ChatCompletionsS
|
|||
"unknown",
|
||||
MessageDelta {
|
||||
role: None,
|
||||
content: Some(format!("[Thinking: {}]", thinking)),
|
||||
content: Some(format!("thinking: {}", thinking)),
|
||||
refusal: None,
|
||||
function_call: None,
|
||||
tool_calls: None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue