generated from langchain-ai/integration-repo-template
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1434ef4
Initial add db2 vector store.
yiweiHeOSS a6065c4
Update readme for db2vs.
yiweiHeOSS d92d8ba
Add dependency sentence-transformers
yiweiHeOSS b09e874
Improve error handling and comments.
yiweiHeOSS 77c9500
Improve error handling.
yiweiHeOSS 02fab26
Improve the code and testcase.
yiweiHeOSS f6990b3
Small change.
yiweiHeOSS a034a4e
Remove the debug message in code.
yiweiHeOSS e3cd88a
Change the term to Db2. Update the sample document.
yiweiHeOSS a9f4c86
Update the insert code to use bulk insert.
yiweiHeOSS 0e98c3c
update CI script
ccurme c39ae64
add a test
ccurme aa171e8
auto format (run [ "." = "" ] || poetry run ruff format .
ccurme fcb1a9c
Resolve ccurme's comments.
yiweiHeOSS f84ea7f
Update poetry.lock
yiweiHeOSS 3b96720
Run format.
yiweiHeOSS ca6da1b
add test for compiling integration tests
ccurme 65ae542
Merge branch 'db2vs' of github.com:yiweiHeOSS/langchain-ibm into db2vs
ccurme ae8833e
make format and make lint
MateuszOssGit 756f43f
Revert a change in integration_tests/test_db2vs.py
yiweiHeOSS 3477f09
Resolve comments.
yiweiHeOSS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# 🦜️🔗 LangChain IBM Watsonx | ||
# 🦜️🔗 LangChain IBM | ||
|
||
This repository contains 1 package with IBM integrations with LangChain: | ||
This repository contains 2 package with IBM integrations with LangChain: | ||
|
||
- [langchain-ibm](https://pypi.org/project/langchain-ibm/) integrates [IBM Watsonx](https://www.ibm.com/watsonx). | ||
|
||
- [langchain-db2](https://pypi.org/project/langchain-db2/)(will be uploaded very soon) integrates IBM Db2 database vector store and vector search. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2025 LangChain, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.PHONY: all format lint test tests integration_tests docker_tests help extended_tests | ||
|
||
# Default target executed when no arguments are given to make. | ||
all: help | ||
|
||
# Define a variable for the test file path. | ||
TEST_FILE ?= tests/unit_tests/ | ||
integration_test integration_tests: TEST_FILE = tests/integration_tests/ | ||
|
||
|
||
# unit tests are run with the --disable-socket flag to prevent network calls | ||
test tests: | ||
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE) | ||
|
||
test_watch: | ||
poetry run ptw --snapshot-update --now . -- -vv $(TEST_FILE) | ||
|
||
# integration tests are run without the --disable-socket flag to allow network calls | ||
integration_test integration_tests: | ||
poetry run pytest $(TEST_FILE) | ||
|
||
###################### | ||
# LINTING AND FORMATTING | ||
###################### | ||
|
||
# Define a variable for Python and notebook files. | ||
PYTHON_FILES=. | ||
MYPY_CACHE=.mypy_cache | ||
lint format: PYTHON_FILES=. | ||
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/partners/db2 --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') | ||
lint_package: PYTHON_FILES=langchain_db2 | ||
lint_tests: PYTHON_FILES=tests | ||
lint_tests: MYPY_CACHE=.mypy_cache_test | ||
|
||
lint lint_diff lint_package lint_tests: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff | ||
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) | ||
|
||
format format_diff: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --select I --fix $(PYTHON_FILES) | ||
|
||
spell_check: | ||
poetry run codespell --toml pyproject.toml | ||
|
||
spell_fix: | ||
poetry run codespell --toml pyproject.toml -w | ||
|
||
check_imports: $(shell find langchain_db2 -name '*.py') | ||
poetry run python ./scripts/check_imports.py $^ | ||
|
||
###################### | ||
# HELP | ||
###################### | ||
|
||
help: | ||
@echo '----' | ||
@echo 'check_imports - check imports' | ||
@echo 'format - run code formatters' | ||
@echo 'lint - run linters' | ||
@echo 'test - run unit tests' | ||
@echo 'tests - run unit tests' | ||
@echo 'test TEST_FILE=<test_file> - run all tests in file' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# langchain-db2 | ||
|
||
This package contains the LangChain integration with the connector to Db2 vector store. This will allow user to leverage the vector store and vector search ablility of the IBM Db2 relational datebase. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install -U langchain-db2 | ||
``` | ||
|
||
See more details of how to use it in the Jupyter Notebook: langchain-db2/docs/db2.ipynb (This link will be updated https://github.com/langchain-ai/langchain-ibm/blob/756f43fe392f70f6c4b755d7966ea8ee1cc42759/libs/langchain-db2/docs/db2.ipynb) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.