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

Oraclevs integration #28464

Conversation

skmishraoracle
Copy link
Contributor

Thank you for contributing to LangChain!

This change adds support for the Oracle Connection pool. In addition, it also adds support for dsl where a dsl is specified as follows:
db_filter = {
"_and": [
{"key": "id", "oper": "EQ", "value": "101"},
{
"_or": [
{"key": "status", "oper": "EQ", "value": "approved" },
{"key": "link", "oper": "EQ", "value": "Document Example Test 2"},
{
"_and": [
{"key": "status", "oper": "EQ", "value": "approved"},
{"key": "link", "oper": "EQ", "value": "Document Example Test 2"}
]
}
]
}
]
}
This can be used in calls such as similarity_search_with_score, where, along with other arguments, one can specify db_filter = db_filter.
@baskaryan, @efriis - can you please approve this PR.

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 1:53am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. community Related to langchain-community Ɑ: vector store Related to vector store module labels Dec 3, 2024
@skmishraoracle
Copy link
Contributor Author

I had a lint failure that I have fixed. @baskaryan, @efriis. Everything passes now; please take a look and approve this PR.

Copy link
Member

@efriis efriis left a comment

Choose a reason for hiding this comment

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

hey there! This is a difficult PR to review because it modifies a lot of lines unnecessarily. Could you resubmit as a minimal change?

I believe there is also some work at oracle to launch a langchain-oracle integration package, so might make sense to collaborate with that team to do so, such that PRs like this can be reviewed by oracle folks instead of us!

@@ -1,3 +1,4 @@
# OopCompanion:suppressRename
Copy link
Member

Choose a reason for hiding this comment

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

remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @efriis: Thanks for the feedback. I will remove the offending line and resubmit.
You see a lot of changes because in this version, a client can be a connection or a database connection pool. We have thus changed what used to be a connection to a client that is dynamically resolved based on whether a connection or connection pool is being passed. This rename has resulted in a no. of trivial changes which is contributing to the diffs. In addition, the transaction also supports DSL, which is passed through kwargs that can act as a pre/in-filter based on the way the SQL optimizer costs the query. Finally, to the best of my knowledge, I don't know of another Oracle team - we work for the Oracle database group and are responsible for the langchain integration. I will try to inquire and find out, though. Hope this helps.

Copy link
Member

Choose a reason for hiding this comment

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

great thanks! You're also welcome to publish as separate packages. Here's the docs if you wanted to pursue separately: https://python.langchain.com/docs/contributing/how_to/integrations/

I just emailed Kohei to see if they can reach out to you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @efriis: I have made the change to oraclevs_integration of the offending line and pushed it to remote. Kindly review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@efriis - Thanks.

@efriis efriis self-assigned this Dec 10, 2024
@efriis
Copy link
Member

efriis commented Dec 10, 2024

still not a minimal change - going to mark as needs support, and can review when that's through! in general would recommend doing refactors like renaming client -> connection as a separate PR because it makes the PR unnecessarily long to review

@efriis
Copy link
Member

efriis commented Dec 17, 2024

going to close for now due to the potential for vulnerabilities getting passed in those kwargs, and would highly recommend publishing a separate langchain-oracleevs package with the changes as mentioned above, and just documenting them in the docs!

https://python.langchain.com/docs/contributing/how_to/integrations/

@efriis efriis closed this Dec 17, 2024
@skmishraoracle
Copy link
Contributor Author

Ok. I will bifurcate the transaction to make it easier for you to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Related to langchain-community size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants