-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: Vertex Check Grounding API integration #186
Conversation
|
||
from google.api_core import exceptions as core_exceptions # type: ignore | ||
from google.auth.credentials import Credentials # type: ignore | ||
from google.cloud import discoveryengine_v1alpha # type: ignore |
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.
it should not be on the top level, otherwise the library can't be used (since it makes an attempt to import on the module level, at __init__.py
)
/gcbrun |
}, | ||
) | ||
for doc in documents | ||
if doc.page_content and doc.metadata |
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.
why are we ignoring documents with empty metadata?
) | ||
|
||
|
||
def test_integration_parse( |
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.
should any additional APIs be enabled on the project where tests are running?
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.
the only API this integration requires is google-cloud-discoveryengine, which should automatically be installed from langchain-google-community[vertexaisearch]
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.
I mean, should any GCP APIs be enabled / whitelisted for the GCP project where this test is running at?
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.
Yes, we would need to whitelist Discovery Engine API if it has not been whitelisted for this to run.
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.
we need to mark it as extended
then
This PR is to integrate the Vertex Standalone API for Check Grounding.
The check grounding API determines how grounded a given piece of text is in a given set of reference texts. The API can generate supporting citations from the reference text to indicate where the given text is supported by the reference texts.
This is implemented as a output parser as Check Grounding is usually done once the generation step of the RAG pipeline is done.