ragit 0.7.1__tar.gz → 0.7.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragit
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Automatic RAG Pattern Optimization Engine
5
5
  Author: RODMENA LIMITED
6
6
  Maintainer-email: RODMENA LIMITED <info@rodmena.co.uk>
@@ -37,6 +37,10 @@ Provides-Extra: test
37
37
  Requires-Dist: pytest; extra == "test"
38
38
  Requires-Dist: pytest-cov; extra == "test"
39
39
  Requires-Dist: pytest-mock; extra == "test"
40
+ Provides-Extra: docs
41
+ Requires-Dist: sphinx>=7.0; extra == "docs"
42
+ Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
43
+ Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
40
44
  Dynamic: license-file
41
45
 
42
46
  # ragit
@@ -57,6 +57,12 @@ dev = [
57
57
 
58
58
  test = ["pytest", "pytest-cov", "pytest-mock"]
59
59
 
60
+ docs = [
61
+ "sphinx>=7.0",
62
+ "sphinx-rtd-theme>=2.0",
63
+ "sphinx-copybutton>=0.5",
64
+ ]
65
+
60
66
  [tool.setuptools.dynamic]
61
67
  version = { attr = "ragit.version.__version__" }
62
68
 
@@ -164,15 +164,15 @@ class OllamaProvider(BaseLLMProvider, BaseEmbeddingProvider):
164
164
 
165
165
  try:
166
166
  response = requests.post(
167
- f"{self.embedding_url}/api/embed",
167
+ f"{self.embedding_url}/api/embeddings",
168
168
  headers=self._get_headers(include_auth=False),
169
- json={"model": model, "input": text},
169
+ json={"model": model, "prompt": text},
170
170
  timeout=self.timeout,
171
171
  )
172
172
  response.raise_for_status()
173
173
  data = response.json()
174
174
 
175
- embedding = data.get("embeddings", [[]])[0]
175
+ embedding = data.get("embedding", [])
176
176
  if not embedding:
177
177
  raise ValueError("Empty embedding returned from Ollama")
178
178
 
@@ -189,33 +189,38 @@ class OllamaProvider(BaseLLMProvider, BaseEmbeddingProvider):
189
189
  raise ConnectionError(f"Ollama embed failed: {e}") from e
190
190
 
191
191
  def embed_batch(self, texts: list[str], model: str) -> list[EmbeddingResponse]:
192
- """Generate embeddings for multiple texts (uses embedding_url, no auth for local)."""
192
+ """Generate embeddings for multiple texts (uses embedding_url, no auth for local).
193
+
194
+ Note: Ollama /api/embeddings only supports single prompts, so we loop.
195
+ """
193
196
  self._current_embed_model = model
194
197
  self._current_dimensions = self.EMBEDDING_DIMENSIONS.get(model, 768)
195
198
 
199
+ results = []
196
200
  try:
197
- response = requests.post(
198
- f"{self.embedding_url}/api/embed",
199
- headers=self._get_headers(include_auth=False),
200
- json={"model": model, "input": texts},
201
- timeout=self.timeout,
202
- )
203
- response.raise_for_status()
204
- data = response.json()
205
-
206
- embeddings = data.get("embeddings", [])
207
- if embeddings:
208
- self._current_dimensions = len(embeddings[0])
209
-
210
- return [
211
- EmbeddingResponse(
212
- embedding=tuple(emb),
213
- model=model,
214
- provider=self.provider_name,
215
- dimensions=len(emb),
201
+ for text in texts:
202
+ response = requests.post(
203
+ f"{self.embedding_url}/api/embeddings",
204
+ headers=self._get_headers(include_auth=False),
205
+ json={"model": model, "prompt": text},
206
+ timeout=self.timeout,
207
+ )
208
+ response.raise_for_status()
209
+ data = response.json()
210
+
211
+ embedding = data.get("embedding", [])
212
+ if embedding:
213
+ self._current_dimensions = len(embedding)
214
+
215
+ results.append(
216
+ EmbeddingResponse(
217
+ embedding=tuple(embedding),
218
+ model=model,
219
+ provider=self.provider_name,
220
+ dimensions=len(embedding),
221
+ )
216
222
  )
217
- for emb in embeddings
218
- ]
223
+ return results
219
224
  except requests.RequestException as e:
220
225
  raise ConnectionError(f"Ollama batch embed failed: {e}") from e
221
226
 
@@ -2,4 +2,4 @@
2
2
  # Copyright RODMENA LIMITED 2025
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
  #
5
- __version__ = "0.7.1"
5
+ __version__ = "0.7.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragit
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Automatic RAG Pattern Optimization Engine
5
5
  Author: RODMENA LIMITED
6
6
  Maintainer-email: RODMENA LIMITED <info@rodmena.co.uk>
@@ -37,6 +37,10 @@ Provides-Extra: test
37
37
  Requires-Dist: pytest; extra == "test"
38
38
  Requires-Dist: pytest-cov; extra == "test"
39
39
  Requires-Dist: pytest-mock; extra == "test"
40
+ Provides-Extra: docs
41
+ Requires-Dist: sphinx>=7.0; extra == "docs"
42
+ Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
43
+ Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
40
44
  Dynamic: license-file
41
45
 
42
46
  # ragit
@@ -14,6 +14,11 @@ issuedb[web]
14
14
  ruff
15
15
  mypy
16
16
 
17
+ [docs]
18
+ sphinx>=7.0
19
+ sphinx-rtd-theme>=2.0
20
+ sphinx-copybutton>=0.5
21
+
17
22
  [test]
18
23
  pytest
19
24
  pytest-cov
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