-
Notifications
You must be signed in to change notification settings - Fork 2.1k
use persona info when creating tool args #4397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR refines tool argument construction by leveraging persona information from the prompt builder to improve both forced and automatic tool calls.
- In backend/onyx/chat/tool_handling/tool_response_handler.py, get_tool_call_for_non_tool_calling_llm_impl now uses AnswerPromptBuilder to refine the user query.
- In backend/onyx/chat/process_message.py, prompt assignment now defaults to the first persona prompt if final_msg.prompt is missing; ensure handling of empty or invalid persona.prompts.
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
prompt_config = PromptConfig.from_model( | ||
final_msg.prompt or persona.prompts[0] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Ensure persona.prompts is non-empty to avoid index errors if final_msg.prompt is falsy.
34a0d24
to
4d7745e
Compare
6793334
to
59451f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 🍾
* use persona info when creating tool args * fixed unit test * include system message * fix unit test * nit
* use persona info when creating tool args * fixed unit test * include system message * fix unit test * nit
Description
Fixes https://linear.app/danswer/issue/DAN-1634/address-weird-tool-calling-behavior-with-claude-37
How Has This Been Tested?
tested in UI + tests now cover this case (ensure that system message is in task prompt)
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.