Skip to content
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

Semantic retriever #168

Merged
merged 28 commits into from
Jan 30, 2024
Merged

Semantic retriever #168

merged 28 commits into from
Jan 30, 2024

Conversation

shilpakancharla
Copy link
Collaborator

Change-Id: I5c4f35238f3bc0bbc798abd72cf824ebe1103152

Description of the change

Adding Semantic Retriever Python Client Library.

Change-Id: I5c4f35238f3bc0bbc798abd72cf824ebe1103152
@shilpakancharla shilpakancharla requested a review from a team as a code owner January 12, 2024 19:03
@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels Jan 12, 2024
Copy link
Collaborator

@MarkDaoust MarkDaoust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the tests.

google/generativeai/client.py Outdated Show resolved Hide resolved
google/generativeai/utils.py Outdated Show resolved Hide resolved
google/generativeai/models.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
shilpakancharla and others added 5 commits January 17, 2024 10:37
Co-authored-by: Mark Daoust <markdaoust@google.com>
Co-authored-by: Mark Daoust <markdaoust@google.com>
Co-authored-by: Mark Daoust <markdaoust@google.com>
Co-authored-by: Mark Daoust <markdaoust@google.com>
Copy link
Collaborator

@MarkDaoust MarkDaoust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test like test_async_code_match?

google/generativeai/retriever.py Outdated Show resolved Hide resolved
google/generativeai/retriever.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/embedding_types.py Outdated Show resolved Hide resolved
google/generativeai/types/embedding_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
google/generativeai/types/retriever_types.py Outdated Show resolved Hide resolved
client = get_default_retriever_async_client()

if results_count:
if results_count < 0 or results_count >= 100:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here for the result counts

google/generativeai/retriever.py Show resolved Hide resolved
def delete_document(
self,
name: str,
force: Optional[bool] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the user specifies it wouldn't we pass None to the request on line 444? Either we make the default false or if none, we don't set it in the request in line 444

Copy link
Contributor

@TYMichaelChen TYMichaelChen Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this:

File "/opt/homebrew/lib/python3.11/site-packages/proto/message.py", line 558, in init
raise TypeError(
TypeError: Invalid constructor input for DeleteDocumentRequest: 'corpusname'

google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
@MarkDaoust
Copy link
Collaborator

#184

We'll resolve the open comments in follow on PRs before making the release.

@MarkDaoust MarkDaoust dismissed their stale review January 30, 2024 21:11

Will resolve in #184.

google/generativeai/retriever.py Show resolved Hide resolved
google/generativeai/retriever.py Show resolved Hide resolved
google/generativeai/retriever.py Show resolved Hide resolved
google/generativeai/retriever.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/retriever_types.py Show resolved Hide resolved
google/generativeai/types/embedding_types.py Show resolved Hide resolved
@MarkDaoust MarkDaoust merged commit 6fe8c12 into google-gemini:main Jan 30, 2024
7 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants