ragxo 0.1.8__py3-none-any.whl → 0.1.10__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
@@ -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,
|
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,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ragxo
|
3
|
-
Version: 0.1.
|
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
|
-
|
64
|
-
|
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
|
|
@@ -0,0 +1,5 @@
|
|
1
|
+
ragxo/__init__.py,sha256=0VVe-z4XkkGQLQIG0hF0Hyf87_RgX0E4T9TRwwTkbmE,68
|
2
|
+
ragxo/client.py,sha256=rmV01TZ3F8McLavVOokjLSUv78fdCA80oDRVWSw-38M,12791
|
3
|
+
ragxo-0.1.10.dist-info/METADATA,sha256=uk-eth9MdnPkG2WeZU7WGr7cVa6HuPtTZFjTkFVSJ_A,6371
|
4
|
+
ragxo-0.1.10.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
5
|
+
ragxo-0.1.10.dist-info/RECORD,,
|
ragxo-0.1.8.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
ragxo/__init__.py,sha256=0VVe-z4XkkGQLQIG0hF0Hyf87_RgX0E4T9TRwwTkbmE,68
|
2
|
-
ragxo/client.py,sha256=5AvARwpm4ux-7nWRLs4k5lDFhkgbjl6B9yNjdxcK8vo,12766
|
3
|
-
ragxo-0.1.8.dist-info/METADATA,sha256=4uo_8ewStWVyYQYtpfktLz9i8jVfQPReeZxAxfhrWQ4,6227
|
4
|
-
ragxo-0.1.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
5
|
-
ragxo-0.1.8.dist-info/RECORD,,
|
File without changes
|