-
Notifications
You must be signed in to change notification settings - Fork 17
Initial add IBM DB2 vector store . #68
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
base: main
Are you sure you want to change the base?
Conversation
return True | ||
|
||
|
||
def _get_distance_function(distance_strategy: DistanceStrategy) -> str: |
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.
can we add support for all 6 distance strategies that we support at Db2?
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 saw the db2 support:
metric
Identifies the metric used to compute the distance between vector1 and vector2. The supported metrics are:
COSINE
DOT
EUCLIDEAN
EUCLIDEAN_SQUARED
HAMMING
MANHATTAN
However, the langchain I only found:
class DistanceStrategy(str, Enum):
"""Enumerator of the Distance strategies for calculating distances
between vectors."""
EUCLIDEAN_DISTANCE = "EUCLIDEAN_DISTANCE"
MAX_INNER_PRODUCT = "MAX_INNER_PRODUCT"
DOT_PRODUCT = "DOT_PRODUCT"
JACCARD = "JACCARD"
COSINE = "COSINE"
So I guess I can only add the 3 strategies as I did now. Please tell me if I am wrong.
This PR adds a new folder under libs for the DB2 vector store langchain connector code, i.e., libs/langchain-db2.
Other companies are doing the same things for their vector store (e.g. Google, AWS and Azure). Thanks for @ccurme to give me some guidance about where to put the code and @MateuszOssGit gave me the access to this repo .
Later, I will create a package on Pypi of the vector store connector, i.e.
pip install langchain-db2
. Note that it should have no impact on the current packagepip install langchain-ibm
. I just need a separate directory libs/langchain-db2 to put open-source code.The major changes in this PR are in the files below: