Skip to content

Conversation

@de1987
Copy link

@de1987 de1987 commented Oct 20, 2025

Jira Issue: AAP-54071

Description

As reported, there were some prompts that the responses contains raw tool_call.
By adjusting the system prompt instructions the issue was fixed for Granite models.

Testing

Steps to test

  1. Pull down the PR
  2. make build
  3. make run
  4. Open the chatbot UI and ask for "How do I upgrade to latest version of Ansible Automation Platform?"

Scenarios tested

Verified with at least 20 prompts asking questions about AAP, create Ansible playbooks...

Production deployment

  • This code change is ready for production on its own
  • This code change requires the following considerations before going to production:

Copy link
Member

@mabashian mabashian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert in the chatbot but this approach seems reasonable to me

Copy link
Contributor

@romartin romartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @de1987 ,

thanks, looking good, although let me share a few comments:

  • I use to wrap code blocks, as commented below, and preferable use of MarkDown syntax in general.

  • Which models have you tested? We need to be sure that it works with Gemini and Granite, if possible, and we don't care about OpenAI at this point

  • The files you changed, in fact, are not being used on the deployments in our clusters. Those files you changed are only applicable when running locally the chatbot. So it is fine doing this change, but if we want this change applied to our deployed chatbots, you'll have to also update our -ops repo, such as this PR does

  • As a final comment, we have an evaluation tool for the chatbot, that evaluates queries around AAP. I tihnk it should be good running it, once changing the sys. prompt, just to be sure we're not breaking anything

For single tool needed: Reply with <tool_call> followed by one-item JSON list containing the tool
Multiple tools example:
Input: "How do I configure AAP authentication?"
Response: <tool_call>[{"name": "knowledge_search", "arguments": {"query": "AAP authentication configuration"}}, {"name": "knowledge_search", "arguments": {"query": "AAP LDAP setup"}}]</tool_call>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to wrap those kind of JSON blocks by using code block (an example here), so the LLM knows exactly when the block starts and end.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using Granite. I addressed all your suggestions and run the evaluation tool:

...
Processing query 84: What is subscription usage?...
✅ Success for query 84

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@TamiTakamiya TamiTakamiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I am not sure how much efforts we want to put on Granite LLM specific changes, I think the changes are clear and looks good to me.

@de1987 de1987 force-pushed the aap-54071-fix-raw-tool-call-answers branch from 9847227 to 93f51cd Compare October 20, 2025 23:04
@de1987 de1987 requested a review from romartin October 20, 2025 23:05
@de1987 de1987 force-pushed the aap-54071-fix-raw-tool-call-answers branch from 93f51cd to d01dec5 Compare October 21, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants