Improve gpt-oss compatibility (#2461)

The gpt-oss models require reasoning with subsequent Chat Completions
requests because otherwise the model forgets why the tools were called.
This change fixes that and also adds some additional missing
documentation around how to handle context windows in Ollama and how to
show the CoT if you desire to.
This commit is contained in:
Dominik Kundel
2025-09-02 19:49:03 -07:00
committed by GitHub
parent a93a907c7e
commit b127a3643f
5 changed files with 886 additions and 26 deletions

View File

@@ -35,7 +35,7 @@ pub struct Prompt {
/// Tools available to the model, including additional tools sourced from
/// external MCP servers.
pub tools: Vec<OpenAiTool>,
pub(crate) tools: Vec<OpenAiTool>,
/// Optional override for the built-in BASE_INSTRUCTIONS.
pub base_instructions_override: Option<String>,
@@ -174,7 +174,7 @@ pub(crate) fn create_text_param_for_request(
})
}
pub(crate) struct ResponseStream {
pub struct ResponseStream {
pub(crate) rx_event: mpsc::Receiver<Result<ResponseEvent>>,
}