generated from langchain-ai/integration-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
5,002 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 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 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,59 +1,5 @@ | ||
# 🦜️🔗 LangChain {partner} | ||
# 🦜️🔗 LangChain Milvus | ||
|
||
This repository contains 1 package with {partner} integrations with LangChain: | ||
This repository contains 1 package with Milvus integrations with LangChain: | ||
|
||
- [langchain-{package_lower}](https://pypi.org/project/langchain-{package_lower}/) | ||
|
||
## Initial Repo Checklist (Remove this section after completing) | ||
|
||
This setup assumes that the partner package is already split. For those instructions, | ||
see [these docs](https://python.langchain.com/docs/contributing/integrations#partner-packages). | ||
|
||
Code (auto ecli) | ||
|
||
- [ ] Fill out the readme above (for folks that follow pypi link) | ||
- [ ] Copy package into /libs folder | ||
- [ ] Update these fields in /libs/*/pyproject.toml | ||
|
||
- `tool.poetry.repository` | ||
- `tool.poetry.urls["Source Code"]` | ||
|
||
Workflow code (auto ecli) | ||
|
||
- [ ] Populate .github/workflows/_release.yml with `on.workflow_dispatch.inputs.working-directory.default` | ||
- [ ] Configure `LIB_DIRS` in .github/scripts/check_diff.py | ||
|
||
Workflow code (manual) | ||
|
||
- [ ] Add secrets as env vars in .github/workflows/_release.yml | ||
|
||
In github (manual) | ||
|
||
- [ ] Add integration testing secrets in Github (ask Erick for help) | ||
- [ ] Add partner collaborators in Github (ask Erick for help) | ||
- [ ] "Allow auto-merge" in General Settings | ||
- [ ] Only "Allow squash merging" in General Settings | ||
- [ ] Set up ruleset matching CI build (ask Erick for help) | ||
- name: ci build | ||
- enforcement: active | ||
- bypass: write | ||
- target: default branch | ||
- rules: restrict deletions, require status checks ("CI Success"), block force pushes | ||
- [ ] Set up ruleset | ||
- name: require prs | ||
- enforcement: active | ||
- bypass: none | ||
- target: default branch | ||
- rules: restrict deletions, require a pull request before merging (0 approvals, no boxes), block force pushes | ||
|
||
Pypi (manual) | ||
|
||
- [ ] Add new repo to test-pypi and pypi trusted publishing (ask Erick for help) | ||
|
||
Slack | ||
|
||
- [ ] Set up release alerting in Slack (ask Erick for help) | ||
|
||
release: | ||
/github subscribe langchain-ai/langchain-{partner_lower} releases workflows:{name:"release"} | ||
/github unsubscribe langchain-ai/langchain-{partner_lower} issues pulls commits deployments | ||
- [langchain-milvus](https://pypi.org/project/langchain-milvus/) |
This file contains 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 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) 2023 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 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,59 @@ | ||
.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/ | ||
|
||
test tests integration_test integration_tests: | ||
poetry run pytest $(TEST_FILE) | ||
|
||
test_watch: | ||
poetry run ptw --snapshot-update --now . -- -vv $(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/milvus --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') | ||
lint_package: PYTHON_FILES=langchain_milvus | ||
lint_tests: PYTHON_FILES=tests | ||
lint_tests: MYPY_CACHE=.mypy_cache_test | ||
|
||
lint lint_diff lint_package lint_tests: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff $(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 --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_milvus -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 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,42 @@ | ||
# langchain-milvus | ||
|
||
This is a library integration with [Milvus](https://milvus.io/) and [Zilliz Cloud](https://zilliz.com/cloud). | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install -U langchain-milvus | ||
``` | ||
|
||
## Milvus vector database | ||
|
||
See a [usage example](https://python.langchain.com/v0.2/docs/integrations/vectorstores/milvus/) | ||
|
||
```python | ||
from langchain_milvus import Milvus | ||
``` | ||
|
||
## Milvus hybrid search | ||
|
||
See a [usage example](https://python.langchain.com/v0.2/docs/integrations/retrievers/milvus_hybrid_search/). | ||
|
||
```python | ||
from langchain_milvus import MilvusCollectionHybridSearchRetriever | ||
``` | ||
|
||
|
||
## Zilliz Cloud vector database | ||
|
||
See a [usage example](https://python.langchain.com/v0.2/docs/integrations/vectorstores/zilliz/). | ||
|
||
```python | ||
from langchain_milvus import Zilliz | ||
``` | ||
|
||
## Zilliz Cloud Pipeline Retriever | ||
|
||
See a [usage example](https://python.langchain.com/v0.2/docs/integrations/retrievers/zilliz_cloud_pipeline/). | ||
|
||
```python | ||
from langchain_milvus import ZillizCloudPipelineRetriever | ||
``` |
This file contains 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 @@ | ||
from langchain_milvus.retrievers import ( | ||
MilvusCollectionHybridSearchRetriever, | ||
ZillizCloudPipelineRetriever, | ||
) | ||
from langchain_milvus.vectorstores import Milvus, Zilliz | ||
|
||
__all__ = [ | ||
"Milvus", | ||
"Zilliz", | ||
"ZillizCloudPipelineRetriever", | ||
"MilvusCollectionHybridSearchRetriever", | ||
] |
Empty file.
This file contains 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,8 @@ | ||
from langchain_milvus.retrievers.milvus_hybrid_search import ( | ||
MilvusCollectionHybridSearchRetriever, | ||
) | ||
from langchain_milvus.retrievers.zilliz_cloud_pipeline_retriever import ( | ||
ZillizCloudPipelineRetriever, | ||
) | ||
|
||
__all__ = ["ZillizCloudPipelineRetriever", "MilvusCollectionHybridSearchRetriever"] |
Oops, something went wrong.