langchain-hsf 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langchain_hsf-0.1.0/PKG-INFO +83 -0
- langchain_hsf-0.1.0/README.md +63 -0
- langchain_hsf-0.1.0/langchain_hsf.egg-info/PKG-INFO +83 -0
- langchain_hsf-0.1.0/langchain_hsf.egg-info/SOURCES.txt +7 -0
- langchain_hsf-0.1.0/langchain_hsf.egg-info/dependency_links.txt +1 -0
- langchain_hsf-0.1.0/langchain_hsf.egg-info/requires.txt +14 -0
- langchain_hsf-0.1.0/langchain_hsf.egg-info/top_level.txt +1 -0
- langchain_hsf-0.1.0/pyproject.toml +28 -0
- langchain_hsf-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langchain_hsf
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A modular RAG retrieval class based on LangChain and Chroma
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: chromadb
|
|
8
|
+
Requires-Dist: langchain-chroma
|
|
9
|
+
Requires-Dist: langchain-community
|
|
10
|
+
Requires-Dist: langchain-core
|
|
11
|
+
Requires-Dist: langchain-openai
|
|
12
|
+
Requires-Dist: langchain-classic
|
|
13
|
+
Requires-Dist: jieba
|
|
14
|
+
Requires-Dist: rank-bm25
|
|
15
|
+
Requires-Dist: python-dotenv
|
|
16
|
+
Requires-Dist: dashscope
|
|
17
|
+
Provides-Extra: publish
|
|
18
|
+
Requires-Dist: build; extra == "publish"
|
|
19
|
+
Requires-Dist: twine; extra == "publish"
|
|
20
|
+
|
|
21
|
+
# langchain_hsf
|
|
22
|
+
|
|
23
|
+
提供一个 `ModularRAG` 类,用于连接已有的 Chroma 知识库并执行在线检索。
|
|
24
|
+
|
|
25
|
+
Python 3.11 及以上。
|
|
26
|
+
|
|
27
|
+
## 安装
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install langchain-modular-rag
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 使用
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from langchain_hsf import ModularRAG
|
|
37
|
+
|
|
38
|
+
rag = ModularRAG({
|
|
39
|
+
"persist_directory": "./chroma_db",
|
|
40
|
+
"collection_name": "study",
|
|
41
|
+
"embedding_model": "text-embedding-v4",
|
|
42
|
+
"top_k": 5,
|
|
43
|
+
"recall_top_k": 20,
|
|
44
|
+
"pre_retrieval": {
|
|
45
|
+
"enabled": False,
|
|
46
|
+
"rewrite_query": False,
|
|
47
|
+
"hyde": False,
|
|
48
|
+
"model": "qwen-plus",
|
|
49
|
+
},
|
|
50
|
+
"hybrid_retrieval": {
|
|
51
|
+
"enabled": True,
|
|
52
|
+
"weights": [0.5, 0.5],
|
|
53
|
+
},
|
|
54
|
+
"post_retrieval": {
|
|
55
|
+
"enabled": True,
|
|
56
|
+
"deduplicate": True,
|
|
57
|
+
"rerank": False,
|
|
58
|
+
"rerank_model": "qwen3-rerank",
|
|
59
|
+
"similarity_filter": False,
|
|
60
|
+
"similarity_threshold": 0.4,
|
|
61
|
+
"compress_context": False,
|
|
62
|
+
"llm_model": "qwen-plus",
|
|
63
|
+
"reorder": False,
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
results = rag.search("公司打卡时间?")
|
|
68
|
+
for document in results:
|
|
69
|
+
print(document.metadata)
|
|
70
|
+
print(document.page_content)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 环境变量
|
|
74
|
+
|
|
75
|
+
需要配置通义 API Key:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
export DASHSCOPE_API_KEY="你的 API Key"
|
|
79
|
+
或
|
|
80
|
+
setx DASHSCOPE_API_KEY="你的 API Key"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`persist_directory` 指向已经完成入库的 Chroma 数据库。这个包当前只提供在线检索,不包含你的个人知识库数据,也不会自动创建或导入知识库。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# langchain_hsf
|
|
2
|
+
|
|
3
|
+
提供一个 `ModularRAG` 类,用于连接已有的 Chroma 知识库并执行在线检索。
|
|
4
|
+
|
|
5
|
+
Python 3.11 及以上。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install langchain-modular-rag
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from langchain_hsf import ModularRAG
|
|
17
|
+
|
|
18
|
+
rag = ModularRAG({
|
|
19
|
+
"persist_directory": "./chroma_db",
|
|
20
|
+
"collection_name": "study",
|
|
21
|
+
"embedding_model": "text-embedding-v4",
|
|
22
|
+
"top_k": 5,
|
|
23
|
+
"recall_top_k": 20,
|
|
24
|
+
"pre_retrieval": {
|
|
25
|
+
"enabled": False,
|
|
26
|
+
"rewrite_query": False,
|
|
27
|
+
"hyde": False,
|
|
28
|
+
"model": "qwen-plus",
|
|
29
|
+
},
|
|
30
|
+
"hybrid_retrieval": {
|
|
31
|
+
"enabled": True,
|
|
32
|
+
"weights": [0.5, 0.5],
|
|
33
|
+
},
|
|
34
|
+
"post_retrieval": {
|
|
35
|
+
"enabled": True,
|
|
36
|
+
"deduplicate": True,
|
|
37
|
+
"rerank": False,
|
|
38
|
+
"rerank_model": "qwen3-rerank",
|
|
39
|
+
"similarity_filter": False,
|
|
40
|
+
"similarity_threshold": 0.4,
|
|
41
|
+
"compress_context": False,
|
|
42
|
+
"llm_model": "qwen-plus",
|
|
43
|
+
"reorder": False,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
results = rag.search("公司打卡时间?")
|
|
48
|
+
for document in results:
|
|
49
|
+
print(document.metadata)
|
|
50
|
+
print(document.page_content)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 环境变量
|
|
54
|
+
|
|
55
|
+
需要配置通义 API Key:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
export DASHSCOPE_API_KEY="你的 API Key"
|
|
59
|
+
或
|
|
60
|
+
setx DASHSCOPE_API_KEY="你的 API Key"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`persist_directory` 指向已经完成入库的 Chroma 数据库。这个包当前只提供在线检索,不包含你的个人知识库数据,也不会自动创建或导入知识库。
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langchain_hsf
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A modular RAG retrieval class based on LangChain and Chroma
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: chromadb
|
|
8
|
+
Requires-Dist: langchain-chroma
|
|
9
|
+
Requires-Dist: langchain-community
|
|
10
|
+
Requires-Dist: langchain-core
|
|
11
|
+
Requires-Dist: langchain-openai
|
|
12
|
+
Requires-Dist: langchain-classic
|
|
13
|
+
Requires-Dist: jieba
|
|
14
|
+
Requires-Dist: rank-bm25
|
|
15
|
+
Requires-Dist: python-dotenv
|
|
16
|
+
Requires-Dist: dashscope
|
|
17
|
+
Provides-Extra: publish
|
|
18
|
+
Requires-Dist: build; extra == "publish"
|
|
19
|
+
Requires-Dist: twine; extra == "publish"
|
|
20
|
+
|
|
21
|
+
# langchain_hsf
|
|
22
|
+
|
|
23
|
+
提供一个 `ModularRAG` 类,用于连接已有的 Chroma 知识库并执行在线检索。
|
|
24
|
+
|
|
25
|
+
Python 3.11 及以上。
|
|
26
|
+
|
|
27
|
+
## 安装
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install langchain-modular-rag
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 使用
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from langchain_hsf import ModularRAG
|
|
37
|
+
|
|
38
|
+
rag = ModularRAG({
|
|
39
|
+
"persist_directory": "./chroma_db",
|
|
40
|
+
"collection_name": "study",
|
|
41
|
+
"embedding_model": "text-embedding-v4",
|
|
42
|
+
"top_k": 5,
|
|
43
|
+
"recall_top_k": 20,
|
|
44
|
+
"pre_retrieval": {
|
|
45
|
+
"enabled": False,
|
|
46
|
+
"rewrite_query": False,
|
|
47
|
+
"hyde": False,
|
|
48
|
+
"model": "qwen-plus",
|
|
49
|
+
},
|
|
50
|
+
"hybrid_retrieval": {
|
|
51
|
+
"enabled": True,
|
|
52
|
+
"weights": [0.5, 0.5],
|
|
53
|
+
},
|
|
54
|
+
"post_retrieval": {
|
|
55
|
+
"enabled": True,
|
|
56
|
+
"deduplicate": True,
|
|
57
|
+
"rerank": False,
|
|
58
|
+
"rerank_model": "qwen3-rerank",
|
|
59
|
+
"similarity_filter": False,
|
|
60
|
+
"similarity_threshold": 0.4,
|
|
61
|
+
"compress_context": False,
|
|
62
|
+
"llm_model": "qwen-plus",
|
|
63
|
+
"reorder": False,
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
results = rag.search("公司打卡时间?")
|
|
68
|
+
for document in results:
|
|
69
|
+
print(document.metadata)
|
|
70
|
+
print(document.page_content)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 环境变量
|
|
74
|
+
|
|
75
|
+
需要配置通义 API Key:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
export DASHSCOPE_API_KEY="你的 API Key"
|
|
79
|
+
或
|
|
80
|
+
setx DASHSCOPE_API_KEY="你的 API Key"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`persist_directory` 指向已经完成入库的 Chroma 数据库。这个包当前只提供在线检索,不包含你的个人知识库数据,也不会自动创建或导入知识库。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
langchain_modular_rag
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "langchain_hsf"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A modular RAG retrieval class based on LangChain and Chroma"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"chromadb",
|
|
13
|
+
"langchain-chroma",
|
|
14
|
+
"langchain-community",
|
|
15
|
+
"langchain-core",
|
|
16
|
+
"langchain-openai",
|
|
17
|
+
"langchain-classic",
|
|
18
|
+
"jieba",
|
|
19
|
+
"rank-bm25",
|
|
20
|
+
"python-dotenv",
|
|
21
|
+
"dashscope",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
publish = ["build", "twine"]
|
|
26
|
+
|
|
27
|
+
[tool.setuptools]
|
|
28
|
+
py-modules = ["langchain_modular_rag"]
|