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 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,4 +2,4 @@
2
2
  # Copyright RODMENA LIMITED 2025
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
  #
5
- __version__ = "0.7.2"
5
+ __version__ = "0.7.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragit
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: Automatic RAG Pattern Optimization Engine
5
5
  Author: RODMENA LIMITED
6
6
  Maintainer-email: RODMENA LIMITED <info@rodmena.co.uk>
@@ -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=5FNjmLKNB4z5E3tbMqwASQafUUFSWnaxBRb0EsQPVK8,97
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=epmXiJ06jCWFERWFMdCNr8FP6WubxdHXj8dUn71WJuQ,9502
12
+ ragit/providers/ollama.py,sha256=amDDD3KYOU1Hl-ifXtw8Ljvd9Dl5R3JcXGhAAq6telI,9957
13
13
  ragit/utils/__init__.py,sha256=-UsE5oJSnmEnBDswl-ph0A09Iu8yKNbPhd1-_7Lcb8Y,3051
14
- ragit-0.7.2.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
15
- ragit-0.7.2.dist-info/METADATA,sha256=TZ_VuZbe4GKkb8Jo8tC_NgT3hcu7e-uy7S9w6kpURlE,13662
16
- ragit-0.7.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- ragit-0.7.2.dist-info/top_level.txt,sha256=pkPbG7yrw61wt9_y_xcLE2vq2a55fzockASD0yq0g4s,6
18
- ragit-0.7.2.dist-info/RECORD,,
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