ragit 0.7.2__py3-none-any.whl → 0.7.3__py3-none-any.whl
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.
- ragit/providers/ollama.py +11 -0
- ragit/version.py +1 -1
- {ragit-0.7.2.dist-info → ragit-0.7.3.dist-info}/METADATA +1 -1
- {ragit-0.7.2.dist-info → ragit-0.7.3.dist-info}/RECORD +7 -7
- {ragit-0.7.2.dist-info → ragit-0.7.3.dist-info}/WHEEL +0 -0
- {ragit-0.7.2.dist-info → ragit-0.7.3.dist-info}/licenses/LICENSE +0 -0
- {ragit-0.7.2.dist-info → ragit-0.7.3.dist-info}/top_level.txt +0 -0
ragit/providers/ollama.py
CHANGED
|
@@ -56,6 +56,9 @@ class OllamaProvider(BaseLLMProvider, BaseEmbeddingProvider):
|
|
|
56
56
|
"qwen3-embedding:8b": 4096,
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
# Max characters per embedding request (safe limit for 512 token models)
|
|
60
|
+
MAX_EMBED_CHARS = 1500
|
|
61
|
+
|
|
59
62
|
def __init__(
|
|
60
63
|
self,
|
|
61
64
|
base_url: str | None = None,
|
|
@@ -162,6 +165,10 @@ class OllamaProvider(BaseLLMProvider, BaseEmbeddingProvider):
|
|
|
162
165
|
self._current_embed_model = model
|
|
163
166
|
self._current_dimensions = self.EMBEDDING_DIMENSIONS.get(model, 768)
|
|
164
167
|
|
|
168
|
+
# Truncate oversized inputs to prevent context length errors
|
|
169
|
+
if len(text) > self.MAX_EMBED_CHARS:
|
|
170
|
+
text = text[: self.MAX_EMBED_CHARS]
|
|
171
|
+
|
|
165
172
|
try:
|
|
166
173
|
response = requests.post(
|
|
167
174
|
f"{self.embedding_url}/api/embeddings",
|
|
@@ -199,6 +206,10 @@ class OllamaProvider(BaseLLMProvider, BaseEmbeddingProvider):
|
|
|
199
206
|
results = []
|
|
200
207
|
try:
|
|
201
208
|
for text in texts:
|
|
209
|
+
# Truncate oversized inputs to prevent context length errors
|
|
210
|
+
if len(text) > self.MAX_EMBED_CHARS:
|
|
211
|
+
text = text[: self.MAX_EMBED_CHARS]
|
|
212
|
+
|
|
202
213
|
response = requests.post(
|
|
203
214
|
f"{self.embedding_url}/api/embeddings",
|
|
204
215
|
headers=self._get_headers(include_auth=False),
|
ragit/version.py
CHANGED
|
@@ -2,17 +2,17 @@ ragit/__init__.py,sha256=PjQogIWMlydZFWVECqhmxw-X9i7lEXdUTe2XlT6qYUQ,2213
|
|
|
2
2
|
ragit/assistant.py,sha256=lXjZRUr_WsYLP3XLOktabgfPVyKOZPdREzyL7cSRufk,11251
|
|
3
3
|
ragit/config.py,sha256=uKLchJQHjH8MImZ2OJahDjSzyasFqgrFb9Z4aHxJ7og,1495
|
|
4
4
|
ragit/loaders.py,sha256=keusuPzXPBiLDVj4hKfPCcge-rm-cnzNRk50fGXvTJs,5571
|
|
5
|
-
ragit/version.py,sha256=
|
|
5
|
+
ragit/version.py,sha256=CFB-alDHREO05xLFCQR7rPNEORp480k5e07n0I_NisQ,97
|
|
6
6
|
ragit/core/__init__.py,sha256=j53PFfoSMXwSbK1rRHpMbo8mX2i4R1LJ5kvTxBd7-0w,100
|
|
7
7
|
ragit/core/experiment/__init__.py,sha256=4vAPOOYlY5Dcr2gOolyhBSPGIUxZKwEkgQffxS9BodA,452
|
|
8
8
|
ragit/core/experiment/experiment.py,sha256=Qh1NJkY9LbKaidRfiI8GOwBZqopjK-MSVBuD_JEgO-k,16582
|
|
9
9
|
ragit/core/experiment/results.py,sha256=KHpN3YSLJ83_JUfIMccRPS-q7LEt0S9p8ehDRawk_4k,3487
|
|
10
10
|
ragit/providers/__init__.py,sha256=iliJt74Lt3mFUlKGfSFW-D0cMonUygY6sRZ6lLjeU7M,435
|
|
11
11
|
ragit/providers/base.py,sha256=MJ8mVeXuGWhkX2XGTbkWIY3cVoTOPr4h5XBXw8rAX2Q,3434
|
|
12
|
-
ragit/providers/ollama.py,sha256=
|
|
12
|
+
ragit/providers/ollama.py,sha256=amDDD3KYOU1Hl-ifXtw8Ljvd9Dl5R3JcXGhAAq6telI,9957
|
|
13
13
|
ragit/utils/__init__.py,sha256=-UsE5oJSnmEnBDswl-ph0A09Iu8yKNbPhd1-_7Lcb8Y,3051
|
|
14
|
-
ragit-0.7.
|
|
15
|
-
ragit-0.7.
|
|
16
|
-
ragit-0.7.
|
|
17
|
-
ragit-0.7.
|
|
18
|
-
ragit-0.7.
|
|
14
|
+
ragit-0.7.3.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
15
|
+
ragit-0.7.3.dist-info/METADATA,sha256=UhrFbq_2mob4_11wihdvy_kIvCb-mskBp79eOKhDifo,13662
|
|
16
|
+
ragit-0.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
ragit-0.7.3.dist-info/top_level.txt,sha256=pkPbG7yrw61wt9_y_xcLE2vq2a55fzockASD0yq0g4s,6
|
|
18
|
+
ragit-0.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|