-
Notifications
You must be signed in to change notification settings - Fork 99
refactor: describegpt enable disk cache by default, etc.
#2951
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
refactor: describegpt enable disk cache by default, etc.
#2951
Conversation
- improve usage text with a dedicated Caching section - updated examples - changed default enum-threshold from 50 to 20 - added `-p` shortcut for `--prompt` - added enclosing brackets to INPUT_TABLE_NAME to minimize mismatches - added dedicated envar for describegpt Redis connection string QSV_DG_REDIS_CONNSTR - added delimiter to AnalysisResults struct - changed get_prompt function to use AnalysisResults struct as an Option - fine-tuned DuckDB SQL generation guidelines to minimize invalid SQL - change cache keys, eliminating args.arg_input and making file_hash the first field, this should increase cache hits for the same file, even if they're in different locations - make DuckDB INPUT_TABLE_NAME replacement more robust, by using regex, rather than a simple contains/replace - replaced nested if for cache processing with more maintainable match statement
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
This PR refactors the describegpt command to enable disk cache by default, improve the user experience, and enhance SQL generation capabilities. The changes focus on making caching more user-friendly while providing better guidance for SQL query generation.
Key changes include:
- Enable disk cache by default instead of requiring explicit opt-in
- Improved usage documentation with dedicated caching section
- Enhanced SQL generation guidelines for DuckDB with more robust table name replacement
- Streamlined cache key generation for better cache hit rates
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/cmd/describegpt.rs | Main refactoring with default disk cache, improved SQL guidelines, better cache key generation, and enhanced error handling |
| docs/ENVIRONMENT_VARIABLES.md | Added documentation for new QSV_DG_REDIS_CONNSTR environment variable |
-pshortcut for--prompt