InjectNonStream dispatches to the format-specific non-streaming injection function.
(resp []byte, rule *config.ToolCallInjectionRule, format string)
| 12 | |
| 13 | // InjectNonStream dispatches to the format-specific non-streaming injection function. |
| 14 | func InjectNonStream(resp []byte, rule *config.ToolCallInjectionRule, format string) []byte { |
| 15 | f := GetFormat(format) |
| 16 | if f == nil { |
| 17 | return resp |
| 18 | } |
| 19 | return f.InjectNonStream(resp, rule) |
| 20 | } |
| 21 | |
| 22 | // InjectOpenAINonStream appends a tool_call to a real OpenAI chat completion response |
| 23 | // and sets finish_reason to "tool_calls". |