fix: support flexible JSON order for GPT-oSS thinking signals
All checks were successful
BotServer CI/CD / build (push) Successful in 2m36s
All checks were successful
BotServer CI/CD / build (push) Successful in 2m36s
This commit is contained in:
parent
8a6970734e
commit
fc68b21252
1 changed files with 4 additions and 3 deletions
|
|
@ -882,9 +882,10 @@ impl BotOrchestrator {
|
|||
// Add chunk to tool_call_buffer and try to parse
|
||||
// Tool calls arrive as JSON that can span multiple chunks
|
||||
|
||||
// Extract and send any thinking signals embedded in the chunk
|
||||
// Thinking signals can appear anywhere in the chunk (start, middle, or end)
|
||||
let thinking_regex = regex::Regex::new(r#"\{"content":"[^"]*","type":"thinking"\}|\{"type":"thinking_clear"\}"#).unwrap();
|
||||
// Extract and send any thinking signals embedded in the chunk
|
||||
// Thinking signals can appear anywhere in the chunk (start, middle, or end)
|
||||
// Support both formats: {"content":"...","type":"thinking"} and {"type":"thinking","content":"..."}
|
||||
let thinking_regex = regex::Regex::new(r#"\{"content":"([^"]*)"\s*,\s*"type":"thinking"\}|\{"type":"thinking"\s*,\s*"content":"([^"]*)"\}|\{"type":"thinking_clear"\}"#).unwrap();
|
||||
let mut cleaned_chunk = chunk.clone();
|
||||
let mut found_thinking = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue