kssrag 0.1.0__tar.gz → 0.1.1__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.
- {kssrag-0.1.0 → kssrag-0.1.1}/PKG-INFO +6 -6
- {kssrag-0.1.0 → kssrag-0.1.1}/README.md +5 -3
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/cli.py +16 -2
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/PKG-INFO +6 -6
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/SOURCES.txt +0 -1
- {kssrag-0.1.0 → kssrag-0.1.1}/setup.py +1 -1
- kssrag-0.1.0/LICENSE +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/__init__.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/config.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/core/__init__.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/core/agents.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/core/chunkers.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/core/retrievers.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/core/vectorstores.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/kssrag.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/models/__init__.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/models/local_llms.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/models/openrouter.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/server.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/utils/__init__.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/utils/document_loaders.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/utils/helpers.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag/utils/preprocessors.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/dependency_links.txt +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/entry_points.txt +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/requires.txt +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/kssrag.egg-info/top_level.txt +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/setup.cfg +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/tests/__init__.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/tests/test_basic.py +0 -0
- {kssrag-0.1.0 → kssrag-0.1.1}/tests/test_vectorstores.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kssrag
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A flexible Retrieval-Augmented Generation framework by Ksschkw
|
|
5
5
|
Home-page: https://github.com/Ksschkw/kssrag
|
|
6
6
|
Author: Ksschkw
|
|
@@ -22,7 +22,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Requires-Python: >=3.8, <4
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
|
-
License-File: LICENSE
|
|
26
25
|
Requires-Dist: fastapi>=0.104.0
|
|
27
26
|
Requires-Dist: uvicorn>=0.24.0
|
|
28
27
|
Requires-Dist: python-dotenv>=1.0.0
|
|
@@ -55,7 +54,6 @@ Dynamic: description
|
|
|
55
54
|
Dynamic: description-content-type
|
|
56
55
|
Dynamic: home-page
|
|
57
56
|
Dynamic: keywords
|
|
58
|
-
Dynamic: license-file
|
|
59
57
|
Dynamic: project-url
|
|
60
58
|
Dynamic: provides-extra
|
|
61
59
|
Dynamic: requires-dist
|
|
@@ -65,6 +63,8 @@ Dynamic: summary
|
|
|
65
63
|
# 🚀 KSS RAG - Knowledge Retrieval Augmented Generation Framework
|
|
66
64
|
|
|
67
65
|
> Built by [Ksschkw](https://github.com/Ksschkw)
|
|
66
|
+
\
|
|
67
|
+
> View at: [PyPi](https://pypi.org/project/kssrag/0.1.0/)
|
|
68
68
|
|
|
69
69
|

|
|
70
70
|

|
|
@@ -118,10 +118,10 @@ print(response)
|
|
|
118
118
|
export OPENROUTER_API_KEY="your_key_here"
|
|
119
119
|
|
|
120
120
|
# Query documents
|
|
121
|
-
python -m kssrag.cli query --file document.txt --query "Main ideas?"
|
|
121
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Main ideas?"
|
|
122
122
|
|
|
123
123
|
# Start API server
|
|
124
|
-
python -m kssrag.cli server --file document.txt --port 8000
|
|
124
|
+
python -m kssrag.cli server --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --port 8000
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## 🐳 Docker Deployment
|
|
@@ -265,7 +265,7 @@ python -m pytest --cov=kssrag tests/
|
|
|
265
265
|
**CLI Command Not Found**
|
|
266
266
|
```bash
|
|
267
267
|
# Use module syntax on Windows
|
|
268
|
-
python -m kssrag.cli query --file document.txt --query "Your question"
|
|
268
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Your question"
|
|
269
269
|
```
|
|
270
270
|
|
|
271
271
|
**FAISS Windows Issues**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# 🚀 KSS RAG - Knowledge Retrieval Augmented Generation Framework
|
|
2
2
|
|
|
3
3
|
> Built by [Ksschkw](https://github.com/Ksschkw)
|
|
4
|
+
\
|
|
5
|
+
> View at: [PyPi](https://pypi.org/project/kssrag/0.1.0/)
|
|
4
6
|
|
|
5
7
|

|
|
6
8
|

|
|
@@ -54,10 +56,10 @@ print(response)
|
|
|
54
56
|
export OPENROUTER_API_KEY="your_key_here"
|
|
55
57
|
|
|
56
58
|
# Query documents
|
|
57
|
-
python -m kssrag.cli query --file document.txt --query "Main ideas?"
|
|
59
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Main ideas?"
|
|
58
60
|
|
|
59
61
|
# Start API server
|
|
60
|
-
python -m kssrag.cli server --file document.txt --port 8000
|
|
62
|
+
python -m kssrag.cli server --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --port 8000
|
|
61
63
|
```
|
|
62
64
|
|
|
63
65
|
## 🐳 Docker Deployment
|
|
@@ -201,7 +203,7 @@ python -m pytest --cov=kssrag tests/
|
|
|
201
203
|
**CLI Command Not Found**
|
|
202
204
|
```bash
|
|
203
205
|
# Use module syntax on Windows
|
|
204
|
-
python -m kssrag.cli query --file document.txt --query "Your question"
|
|
206
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Your question"
|
|
205
207
|
```
|
|
206
208
|
|
|
207
209
|
**FAISS Windows Issues**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import sys
|
|
3
|
+
import os # Add this import if not already present
|
|
3
4
|
from .utils.document_loaders import load_document, load_json_documents
|
|
4
5
|
from .core.chunkers import TextChunker, JSONChunker, PDFChunker
|
|
5
6
|
from .core.vectorstores import BM25VectorStore, FAISSVectorStore, TFIDFVectorStore, HybridVectorStore, HybridOfflineVectorStore
|
|
@@ -24,6 +25,7 @@ def main():
|
|
|
24
25
|
choices=["bm25", "faiss", "tfidf", "hybrid_online", "hybrid_offline"],
|
|
25
26
|
help="Vector store type")
|
|
26
27
|
query_parser.add_argument("--top-k", type=int, default=config.TOP_K, help="Number of results to retrieve")
|
|
28
|
+
query_parser.add_argument("--system-prompt", type=str, help="Path to a file containing the system prompt or the prompt text itself")
|
|
27
29
|
|
|
28
30
|
# Server command
|
|
29
31
|
server_parser = subparsers.add_parser("server", help="Start the RAG API server")
|
|
@@ -35,12 +37,22 @@ def main():
|
|
|
35
37
|
help="Vector store type")
|
|
36
38
|
server_parser.add_argument("--port", type=int, default=config.SERVER_PORT, help="Port to run server on")
|
|
37
39
|
server_parser.add_argument("--host", type=str, default=config.SERVER_HOST, help="Host to run server on")
|
|
40
|
+
server_parser.add_argument("--system-prompt", type=str, help="Path to a file containing the system prompt or the prompt text itself")
|
|
38
41
|
|
|
39
42
|
args = parser.parse_args()
|
|
40
43
|
|
|
41
44
|
# Validate config
|
|
42
45
|
validate_config()
|
|
43
46
|
|
|
47
|
+
def load_system_prompt(prompt_arg):
|
|
48
|
+
"""Load system prompt from file or use as text"""
|
|
49
|
+
if not prompt_arg:
|
|
50
|
+
return None
|
|
51
|
+
if os.path.exists(prompt_arg):
|
|
52
|
+
with open(prompt_arg, 'r', encoding='utf-8') as f:
|
|
53
|
+
return f.read()
|
|
54
|
+
return prompt_arg
|
|
55
|
+
|
|
44
56
|
if args.command == "query":
|
|
45
57
|
# Load and process document
|
|
46
58
|
if args.format == "text":
|
|
@@ -78,7 +90,8 @@ def main():
|
|
|
78
90
|
# Create retriever and agent
|
|
79
91
|
retriever = SimpleRetriever(vector_store)
|
|
80
92
|
llm = OpenRouterLLM()
|
|
81
|
-
|
|
93
|
+
system_prompt = load_system_prompt(args.system_prompt)
|
|
94
|
+
agent = RAGAgent(retriever, llm, system_prompt=system_prompt)
|
|
82
95
|
|
|
83
96
|
# Query and print response
|
|
84
97
|
response = agent.query(args.query, top_k=args.top_k)
|
|
@@ -122,7 +135,8 @@ def main():
|
|
|
122
135
|
# Create retriever and agent
|
|
123
136
|
retriever = SimpleRetriever(vector_store)
|
|
124
137
|
llm = OpenRouterLLM()
|
|
125
|
-
|
|
138
|
+
system_prompt = load_system_prompt(args.system_prompt)
|
|
139
|
+
agent = RAGAgent(retriever, llm, system_prompt=system_prompt)
|
|
126
140
|
|
|
127
141
|
# Create and run server
|
|
128
142
|
from .server import create_app
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kssrag
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A flexible Retrieval-Augmented Generation framework by Ksschkw
|
|
5
5
|
Home-page: https://github.com/Ksschkw/kssrag
|
|
6
6
|
Author: Ksschkw
|
|
@@ -22,7 +22,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Requires-Python: >=3.8, <4
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
|
-
License-File: LICENSE
|
|
26
25
|
Requires-Dist: fastapi>=0.104.0
|
|
27
26
|
Requires-Dist: uvicorn>=0.24.0
|
|
28
27
|
Requires-Dist: python-dotenv>=1.0.0
|
|
@@ -55,7 +54,6 @@ Dynamic: description
|
|
|
55
54
|
Dynamic: description-content-type
|
|
56
55
|
Dynamic: home-page
|
|
57
56
|
Dynamic: keywords
|
|
58
|
-
Dynamic: license-file
|
|
59
57
|
Dynamic: project-url
|
|
60
58
|
Dynamic: provides-extra
|
|
61
59
|
Dynamic: requires-dist
|
|
@@ -65,6 +63,8 @@ Dynamic: summary
|
|
|
65
63
|
# 🚀 KSS RAG - Knowledge Retrieval Augmented Generation Framework
|
|
66
64
|
|
|
67
65
|
> Built by [Ksschkw](https://github.com/Ksschkw)
|
|
66
|
+
\
|
|
67
|
+
> View at: [PyPi](https://pypi.org/project/kssrag/0.1.0/)
|
|
68
68
|
|
|
69
69
|

|
|
70
70
|

|
|
@@ -118,10 +118,10 @@ print(response)
|
|
|
118
118
|
export OPENROUTER_API_KEY="your_key_here"
|
|
119
119
|
|
|
120
120
|
# Query documents
|
|
121
|
-
python -m kssrag.cli query --file document.txt --query "Main ideas?"
|
|
121
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Main ideas?"
|
|
122
122
|
|
|
123
123
|
# Start API server
|
|
124
|
-
python -m kssrag.cli server --file document.txt --port 8000
|
|
124
|
+
python -m kssrag.cli server --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --port 8000
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## 🐳 Docker Deployment
|
|
@@ -265,7 +265,7 @@ python -m pytest --cov=kssrag tests/
|
|
|
265
265
|
**CLI Command Not Found**
|
|
266
266
|
```bash
|
|
267
267
|
# Use module syntax on Windows
|
|
268
|
-
python -m kssrag.cli query --file document.txt --query "Your question"
|
|
268
|
+
python -m kssrag.cli query --file document.txt --system-prompt custom_prompt.txt(`or just insert plain text here in quotes`) --query "Your question"
|
|
269
269
|
```
|
|
270
270
|
|
|
271
271
|
**FAISS Windows Issues**
|
|
@@ -6,7 +6,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="kssrag",
|
|
9
|
-
version="0.1.
|
|
9
|
+
version="0.1.1",
|
|
10
10
|
description="A flexible Retrieval-Augmented Generation framework by Ksschkw",
|
|
11
11
|
long_description=long_description,
|
|
12
12
|
long_description_content_type="text/markdown",
|
kssrag-0.1.0/LICENSE
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|