Skip to content

Feat/production readiness#82

Open
sharathjogi2040 wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
sharathjogi2040:feat/production-readiness
Open

Feat/production readiness#82
sharathjogi2040 wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
sharathjogi2040:feat/production-readiness

Conversation

@sharathjogi2040
Copy link

No description provided.

sharathjogi2040 and others added 4 commits April 7, 2025 12:58
This commit introduces a major new capability to the Open Data QnA system,
allowing you to query collections of JSON files using natural language.
The system now translates natural language questions into Python code,
which is then executed to retrieve data from the specified JSON files.

Key changes include:

- New capabilities for generating Python code from natural language
  and contextual information (JSON schemas, CSV schemas, JSON file manifest).
- New capabilities for validating Python code syntax.
- New capabilities for fixing erroneous Python code.
- A new mechanism for safely executing the generated Python code
  in a restricted environment and returning structured results or errors.
- Adapted capabilities for embedding JSON/CSV schema descriptions and
  JSON filename manifests.
- Adapted capabilities for handling results or errors from Python
  code execution and generating natural language responses.
- Configuration updates to orchestrate the new JSON querying workflow,
  including paths to JSON data, schema files, and manifest files,
  and new prompts for the JSON querying capabilities.
- Data Handling:
    - The system processes your provided JSON schemas, CSV schemas, and
      JSON filename information to guide query generation.
    - It can handle lookups in potentially large collections of individual
      JSON files, optionally using CSV files for initial filtering.
- Testing:
    - A comprehensive test plan with diverse test cases was developed to ensure functionality and guide iteration.

This enables querying of complex, nested JSON structures, significantly
expanding the types of data sources the system can interact with beyond
traditional SQL databases.
This change introduces a series of improvements to make the application more robust, secure, testable, and ready for containerized deployment.

Key changes:
- Refactored the core logic from `opendataqna.py` into a new `Pipeline` class in `pipeline.py`. This improves code organization and maintainability.
- Introduced a testing framework (`pytest`, `pytest-asyncio`, `pytest-mock`) and added initial unit tests for the pipeline.
- Modified the application to be configurable via environment variables, with `config.ini` as a fallback. This is essential for containerized deployments.
- Added support for fetching secrets (e.g., database passwords) from Google Secret Manager, improving security.
- Created a `Dockerfile.cli` to containerize the command-line application.
- Added a `.dockerignore` file to optimize the Docker build context.
- Updated the `README.md` to document the new Docker and secret management features.
- Fixed several bugs uncovered during the refactoring process, including import errors and incorrect method signatures.
@google-cla
Copy link

google-cla bot commented Aug 11, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

1 participant