Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

  • 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

- 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
@jqnatividad jqnatividad requested a review from Copilot August 31, 2025 21:46
@jqnatividad jqnatividad marked this pull request as draft August 31, 2025 21:47

This comment was marked as outdated.

@jqnatividad jqnatividad requested a review from Copilot August 31, 2025 22:01

This comment was marked as outdated.

jqnatividad and others added 2 commits August 31, 2025 18:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jqnatividad jqnatividad requested a review from Copilot August 31, 2025 22:12

This comment was marked as outdated.

@jqnatividad jqnatividad requested a review from Copilot August 31, 2025 22:32
Copy link
Contributor

Copilot AI left a 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

@jqnatividad jqnatividad marked this pull request as ready for review August 31, 2025 23:08
@jqnatividad jqnatividad merged commit 7ac14cc into master Aug 31, 2025
15 checks passed
@jqnatividad jqnatividad deleted the describe_gpt-enable-disk_cache-by-default branch August 31, 2025 23:08
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.

2 participants