fix(rag): pass gcs_path to quickstart entrypoint - #14612
Open
aniruddhaadak80 wants to merge 1 commit into
Open
aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
Fixes GoogleCloudPlatform#14610 Signed-off-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the entry point in quickstart_example.py to pass gcs_path instead of a list of paths containing a Google Drive path. Additionally, a new test file test_quickstart_entrypoint.py is introduced to verify that the entry point correctly invokes the quickstart function with the expected arguments using AST parsing and execution. There are no review comments, and I have no feedback to provide.
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
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.
Description
Fixes #14610
The RAG quickstart entry point passed a
pathskeyword toquickstart, whose signature acceptsgcs_path. The sample therefore raisedTypeErrorbefore making an API request. This change passes the GCS path using the supported argument and removes the unused Drive placeholder from that entry point.A dependency-free regression test executes the entry-point call with the real function signature, so the pre-fix keyword mismatch fails before the API is reached.
Validation:
python -m pytest generative_ai/rag/test_quickstart_entrypoint.py -q— 1 passedTypeError: quickstart() got an unexpected keyword argument 'paths'python -m ruff check generative_ai/rag/quickstart_example.py generative_ai/rag/test_quickstart_entrypoint.py— passedpython -m mypy --follow-imports=skip --ignore-missing-imports generative_ai/rag/quickstart_example.py— no issues foundpython -m black --check generative_ai/rag/test_quickstart_entrypoint.py— passedChecklist
Testing
Compliance & Style
Post-Approval Actions