ragxo 0.1.8__tar.gz → 0.1.10__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.1
2
2
  Name: ragxo
3
- Version: 0.1.8
3
+ Version: 0.1.10
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
@@ -60,17 +60,19 @@ pip install ragxo
60
60
  ```python
61
61
  from ragxo import Ragxo, Document
62
62
 
63
- def preprocess_text_lower(text: str) -> str:
64
- return text.lower()
63
+
64
+
65
+ ragxo_client = Ragxo(dimension=1536)
65
66
 
66
67
  def preprocess_text_remove_special_chars(text: str) -> str:
67
68
  return re.sub(r'[^a-zA-Z0-9\s]', '', text)
68
69
 
70
+ def preprocess_text_lower(text: str) -> str:
71
+ return text.lower()
72
+
69
73
  def get_embeddings(text: str) -> list[float]:
70
74
  return openai.embeddings.create(input=text, model="text-embedding-ada-002").data[0].embedding
71
75
 
72
- ragxo_client = Ragxo(dimension=768)
73
-
74
76
  ragxo_client.add_preprocess(preprocess_text_lower)
75
77
  ragxo_client.add_preprocess(preprocess_text_remove_special_chars)
76
78
  ragxo_client.add_embedding_fn(get_embeddings)
@@ -78,6 +80,7 @@ ragxo_client.add_embedding_fn(get_embeddings)
78
80
  ragxo_client.add_system_prompt("You are a helpful assistant that can answer questions about the data provided.")
79
81
  ragxo_client.add_model(
80
82
  "gpt-4o-mini",
83
+ limit=10,
81
84
  temperature=0.5,
82
85
  max_tokens=1000,
83
86
  top_p=1.0,
@@ -93,6 +96,9 @@ ragxo_client.index([
93
96
 
94
97
  ragxo_client.export("my_rag_v1.0.0")
95
98
 
99
+ # or export to s3
100
+ ragxo_client.export("my_rag_v1.0.0", s3_bucket="my_bucket")
101
+
96
102
  ```
97
103
 
98
104
 
@@ -106,6 +112,7 @@ vector_search_results = loaded_ragxo_client.query("What is the capital of France
106
112
  llm_response = loaded_ragxo_client.generate_llm_response(
107
113
  "What is the capital of France?")
108
114
 
115
+ print(llm_response.choices[0].message.content)
109
116
  ```
110
117
 
111
118
 
@@ -30,17 +30,19 @@ pip install ragxo
30
30
  ```python
31
31
  from ragxo import Ragxo, Document
32
32
 
33
- def preprocess_text_lower(text: str) -> str:
34
- return text.lower()
33
+
34
+
35
+ ragxo_client = Ragxo(dimension=1536)
35
36
 
36
37
  def preprocess_text_remove_special_chars(text: str) -> str:
37
38
  return re.sub(r'[^a-zA-Z0-9\s]', '', text)
38
39
 
40
+ def preprocess_text_lower(text: str) -> str:
41
+ return text.lower()
42
+
39
43
  def get_embeddings(text: str) -> list[float]:
40
44
  return openai.embeddings.create(input=text, model="text-embedding-ada-002").data[0].embedding
41
45
 
42
- ragxo_client = Ragxo(dimension=768)
43
-
44
46
  ragxo_client.add_preprocess(preprocess_text_lower)
45
47
  ragxo_client.add_preprocess(preprocess_text_remove_special_chars)
46
48
  ragxo_client.add_embedding_fn(get_embeddings)
@@ -48,6 +50,7 @@ ragxo_client.add_embedding_fn(get_embeddings)
48
50
  ragxo_client.add_system_prompt("You are a helpful assistant that can answer questions about the data provided.")
49
51
  ragxo_client.add_model(
50
52
  "gpt-4o-mini",
53
+ limit=10,
51
54
  temperature=0.5,
52
55
  max_tokens=1000,
53
56
  top_p=1.0,
@@ -63,6 +66,9 @@ ragxo_client.index([
63
66
 
64
67
  ragxo_client.export("my_rag_v1.0.0")
65
68
 
69
+ # or export to s3
70
+ ragxo_client.export("my_rag_v1.0.0", s3_bucket="my_bucket")
71
+
66
72
  ```
67
73
 
68
74
 
@@ -76,6 +82,7 @@ vector_search_results = loaded_ragxo_client.query("What is the capital of France
76
82
  llm_response = loaded_ragxo_client.generate_llm_response(
77
83
  "What is the capital of France?")
78
84
 
85
+ print(llm_response.choices[0].message.content)
79
86
  ```
80
87
 
81
88
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ragxo"
3
- version = "0.1.8"
3
+ version = "0.1.10"
4
4
  description = "A RAG (Retrieval-Augmented Generation) toolkit with Milvus integration"
5
5
  authors = ["Mohamed Sadek <mohamedfawzydes@gmail.com>"]
6
6
  readme = "README.md"
@@ -109,7 +109,8 @@ class Ragxo:
109
109
  self.system_prompt = prompt
110
110
  return self
111
111
 
112
- def add_model(self, model: str, limit: int = 10,
112
+ def add_model(self, model: str,
113
+ limit: int = 10,
113
114
  temperature: float = 0.5,
114
115
  max_tokens: int = 1000,
115
116
  top_p: float = 1.0,
File without changes