-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Improve system prompt and tool descriptions #90
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Reorganized content with clearer hierarchy and section headings - Moved database schema and DuckDB tips earlier for better context - Simplified DuckDB percentile guidance with concrete examples and preference for `quantile_*` functions - Enhanced "Suggestions" section with comprehensive syntax examples, usage guidelines, and best practices for when to include clickable prompts - Streamlined filtering/sorting instructions by removing redundant explanations - Clarified that no response is needed after successful dashboard updates - Added explicit Markdown table formatting guideline - Improved examples to be more concise and realistic - Made extra_instructions conditional with proper formatting - Overall: more scannable structure with better separation of concerns
Also uses DataSourceBase class to get default `get_db_type()` implementation
|
I'm going to merge this so that we can start to get community feedback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR focuses on improving the clarity and effectiveness of the LLM system prompt, along with enhancements to the Python package implementation.
System Prompt Refactoring
The main system prompt has been restructured for better clarity and usability:
quantile_*functionsextra_instructionsconditional with proper formattingTool Description Improvements
We now also store tool descriptions in separate markdown files for easier editing and consistency between R and Python packages. The tool descriptions have been improved to clarify when and when not to use each tool, along with important constraints and guidelines.
Python Package Changes
.get_db_type()method to theDataSourceprotocol class, plus a newDataSourceBaseclass that contains the default implementation. TheSQLAlchemySourcehas a custom method to return the exact DB type, which is different from thedb_engine(alwaysSQLAlchemy).While here, I also fixed unsafe access to
QUERYCHAT_CLIENT_ARGSenvironment variable whenquerychat.init(client=)is a string.Infrastructure
prompt.mdtoinst/promptsdirectory to match ellmer conventionsget_db_type()value of"standard"