LocalAI/core/http
Richard Palethorpe 5195062e12
fix(realtime): Include noAction function in prompt template and handle tool_choice (#8372)
The realtime endpoint was not passing the noAction "answer" function to the
model in the prompt template, causing the model to always call user-provided
tools even when a direct response was appropriate.

Root cause:
- User tools were added to the funcs list
- TemplateMessages() was called to generate the prompt
- noAction function was only added AFTER templating
- This meant the prompt didn't include the "answer" function, even though
  the grammar did

Fix:
- Move noAction function creation before TemplateMessages() call so it's
  included in both the prompt and grammar
- Add proper tool_choice parameter handling to support "auto", "required",
  "none", and specific function selection
- Match behavior of the standard chat endpoint

💘 Generated with Crush

Assisted-by: Claude Sonnet 4.5 via Crush <crush@charm.land>

Signed-off-by: Richard Palethorpe <io@richiejp.com>
2026-02-03 14:30:37 +01:00
..
endpoints fix(realtime): Include noAction function in prompt template and handle tool_choice (#8372) 2026-02-03 14:30:37 +01:00
middleware feat: add VoxCPM tts backend (#8109) 2026-01-28 14:44:04 +01:00
routes fix(videogen): drop incomplete endpoint, add GGUF support for LTX-2 (#8160) 2026-01-22 14:09:20 +01:00
static fix(ui): take account of reasoning in token count calculation (#8324) 2026-02-01 10:48:31 +01:00
views fix(ui): correctly display selected image model (#8208) 2026-01-25 14:54:40 +01:00
app.go feat(api): add support for open responses specification (#8063) 2026-01-17 22:11:47 +01:00
app_test.go chore(refactor): move logging to common package based on slog (#7668) 2025-12-21 19:33:13 +01:00
explorer.go chore(refactor): move logging to common package based on slog (#7668) 2025-12-21 19:33:13 +01:00
http_suite_test.go feat(api): add support for open responses specification (#8063) 2026-01-17 22:11:47 +01:00
openresponses_test.go feat(api): add support for open responses specification (#8063) 2026-01-17 22:11:47 +01:00
render.go feat: migrate to echo and enable cancellation of non-streaming requests (#7270) 2025-11-14 22:57:53 +01:00