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

community: Add support for order_by and canonical_filter fields in VertexAISearchRetriever #529

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

lgesuellip
Copy link
Contributor

@lgesuellip lgesuellip commented Oct 2, 2024

PR Description

This PR introduces two new optional fields, order_by and canonical_filter, to the VertexAISearchRetriever class. These fields enhance the flexibility and control over search queries when using Google Vertex AI Search.

Type

🆕 New Feature
✅ Test

Issue

#530

Testing

I added the corresponding unit test for creating a search request to verify that the VertexAISearchRetriever correctly creates a SearchRequest object with the expected auto-populated fields, including the newly added order_by and canonical_filter fields.

Also, I tested it using my data in GCP, checking different configurations and verifying that the parameters are correctly applied and produce the expected results.

vertex = VertexAISearchRetriever(
    project_id=project_id,
    data_store_id=data_store_id,
    max_documents=2,
    max_extractive_segment_count=1,
    num_previous_segments=3,
    num_next_segments=3,
    return_extractive_segment_score=True,
    order_by="title desc",  # Add order_by parameter
    canonical_filter="true"  # Add canonical_filter parameter
)

Thank you again Team!

@lgesuellip
Copy link
Contributor Author

Hi @lkuligin ,
I would appreciate your review and feedback.
Thanks,

@lkuligin lkuligin merged commit 441e48c into langchain-ai:main Oct 3, 2024
15 checks passed
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.

None yet

2 participants