Skip to content

Conversation

@richiejp
Copy link
Collaborator

@richiejp richiejp commented Feb 3, 2026

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

…e tool_choice

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 <[email protected]>
Signed-off-by: Richard Palethorpe <[email protected]>
@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 9d009d7
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/6981e6cb0c456600087a7eb6
😎 Deploy Preview https://deploy-preview-8372--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mudler mudler merged commit 5195062 into mudler:master Feb 3, 2026
36 checks passed
@mudler mudler added the bug Something isn't working label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants