-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: (GenAI) Reorganized Rag Samples (Group С) #12612
Conversation
Here is the summary of changes. You are about to add 13 region tags.
This comment is generated by snippet-bot.
|
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Note: This can be either format:
projects/{project}/locations/{location}/ragCorpora/{rag_corpus}
or {rag_corpus}
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# file_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}/ragFiles/{rag_file_id}" |
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.
Note: this can be either a full file path or the user can pass a corpus id and the file id to the method.
From the library:
Args
name
Either a full RagFile resource name must be provided, or a RagCorpus name and a RagFile name must be provided. Format:
``projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}``
or ``{rag_file}``.
corpus_name
If name is not a full resource name, an existing RagCorpus name must be provided. Format:
``projects/{project}/locations/{location}/ragCorpora/{rag_corpus}``
or ``{rag_corpus}``.
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.
Create a tracker to re-check this @ #12658
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Similar as before, this parameter can be the full path or just the corpus id
rag_corpus
A Rag corpus resource name or corpus id. Format:
``projects/{project}/locations/{location}/ragCorpora/{rag_corpus_id}``
or ``{rag_corpus_id}``.
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.
Create a tracker to re-check this @ #12658
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Same as before re: full resource names
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Same as before re: full resource paths
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Same as before re: full resource paths
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/[PROJECT_ID]/locations/us-central1/ragCorpora/[rag_corpus_id]" |
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.
Same as before re: full resource paths
|
||
# TODO(developer): Update and un-comment below lines | ||
# PROJECT_ID = "your-project-id" | ||
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}" |
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.
Same as before re: full resource names
Separated document with detailed description of issue. |
@holtskinner PTAL |
Create a tracker to re-check the mentioned comment @ #12658 For now, proceeding with the migration work. |
…orm#12612) * New Samples for Rag folder * Try to run test with created test_file.txt * Returned pytest.skip mark * Added type annotations for Python 3.8
Description
Created new
/generative_ai/rag
folder.I left the
skip
mark on tests but I fixed them all.Actions after approval:
/generative_ai/rag.py
and/generative_ai/rag_test.py
filesgenerative_ai/rag/test_rag.py
->rag_test.py
❗If we want our tests to run successfully, we need to remove the skip marker and ensure that the necessary permissions are granted in the test environment.
Currently, we are catching the following error when tests are running:
google.auth.exceptions.RefreshError: ('invalid_scope: Invalid OAuth scope or ID token audience provided.', {'error': 'invalid_scope', 'error_description': 'Invalid OAuth scope or ID token audience provided.'})
Checklist
nox -s py-3.9
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)