ragxo 0.1.6__py3-none-any.whl → 0.1.7__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.
ragxo/client.py CHANGED
@@ -51,8 +51,19 @@ class Ragxo:
51
51
  self.system_prompt = prompt
52
52
  return self
53
53
 
54
- def add_model(self, model: str) -> Self:
54
+ def add_model(self, model: str, limit: int = 10,
55
+ temperature: float = 0.5,
56
+ max_tokens: int = 1000,
57
+ top_p: float = 1.0,
58
+ frequency_penalty: float = 0.0,
59
+ presence_penalty: float = 0.0) -> Self:
55
60
  self.model = model
61
+ self.limit = limit
62
+ self.temperature = temperature
63
+ self.max_tokens = max_tokens
64
+ self.top_p = top_p
65
+ self.frequency_penalty = frequency_penalty
66
+ self.presence_penalty = presence_penalty
56
67
  return self
57
68
 
58
69
  def index(self, data: list[Document]) -> Self:
@@ -240,17 +251,10 @@ class Ragxo:
240
251
  raise
241
252
 
242
253
  def generate_llm_response(self,
243
- query: str,
244
- limit: int = 10,
245
- data: list[dict] = None,
246
- temperature: float = 0.5,
247
- max_tokens: int = 1000,
248
- top_p: float = 1.0,
249
- frequency_penalty: float = 0.0,
250
- presence_penalty: float = 0.0,
251
- ) -> ChatCompletion:
254
+ query: str,
255
+ data: list[dict] = None) -> ChatCompletion:
252
256
  if data is None:
253
- data = self.query(query, limit=limit)[0]
257
+ data = self.query(query, limit=self.limit)[0]
254
258
 
255
259
  if not self.system_prompt:
256
260
  raise ValueError("System prompt not set. Please call add_system_prompt first.")
@@ -261,11 +265,11 @@ class Ragxo:
261
265
  {"role": "system", "content": self.system_prompt},
262
266
  {"role": "user", "content": "query: {} data: {}".format(query, data)}
263
267
  ],
264
- temperature=temperature,
265
- max_tokens=max_tokens,
266
- top_p=top_p,
267
- frequency_penalty=frequency_penalty,
268
- presence_penalty=presence_penalty,
268
+ temperature=self.temperature,
269
+ max_tokens=self.max_tokens,
270
+ top_p=self.top_p,
271
+ frequency_penalty=self.frequency_penalty,
272
+ presence_penalty=self.presence_penalty,
269
273
  )
270
274
 
271
275
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ragxo
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A RAG (Retrieval-Augmented Generation) toolkit with Milvus integration
5
5
  Home-page: https://github.com/yourusername/ragx
6
6
  License: MIT
@@ -20,9 +20,11 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
20
  Requires-Dist: boto3 (>=1.36.14,<2.0.0)
21
21
  Requires-Dist: dill (>=0.3.9,<0.4.0)
22
22
  Requires-Dist: milvus (>=2.3.9,<3.0.0)
23
+ Requires-Dist: mocker (>=1.1.1,<2.0.0)
23
24
  Requires-Dist: openai (>=1.61.1,<2.0.0)
24
25
  Requires-Dist: pydantic (>=2.10.6,<3.0.0)
25
26
  Requires-Dist: pymilvus (>=2.5.4,<3.0.0)
27
+ Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
26
28
  Project-URL: Repository, https://github.com/yourusername/ragx
27
29
  Description-Content-Type: text/markdown
28
30
 
@@ -0,0 +1,5 @@
1
+ ragxo/__init__.py,sha256=0VVe-z4XkkGQLQIG0hF0Hyf87_RgX0E4T9TRwwTkbmE,68
2
+ ragxo/client.py,sha256=kFKLvc1s9JfhO2nTkQd1hgkQ7X0Le47dIs8_3vI916Y,9263
3
+ ragxo-0.1.7.dist-info/METADATA,sha256=g1U7d-b7OtvGwEU01yUxxSSSa8sEVvh6Kl15uCSol_I,6225
4
+ ragxo-0.1.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
+ ragxo-0.1.7.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- ragxo/__init__.py,sha256=0VVe-z4XkkGQLQIG0hF0Hyf87_RgX0E4T9TRwwTkbmE,68
2
- ragxo/client.py,sha256=M4777mj6oPdRIm9TvqIwXoQuJUMc7Ywczlykutd6c70,9068
3
- ragxo-0.1.6.dist-info/METADATA,sha256=1W4vJeY0awkXbtM0o3dyhFRHEY8VLHwkXrm55KECbg4,6141
4
- ragxo-0.1.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
- ragxo-0.1.6.dist-info/RECORD,,
File without changes