ragit 0.8.2__py3-none-any.whl → 0.11.0__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/__init__.py +27 -15
- ragit/assistant.py +431 -40
- ragit/config.py +165 -22
- ragit/core/experiment/experiment.py +7 -1
- ragit/exceptions.py +271 -0
- ragit/loaders.py +200 -44
- ragit/logging.py +194 -0
- ragit/monitor.py +307 -0
- ragit/providers/__init__.py +1 -13
- ragit/providers/ollama.py +379 -121
- ragit/utils/__init__.py +0 -22
- ragit/version.py +1 -1
- {ragit-0.8.2.dist-info → ragit-0.11.0.dist-info}/METADATA +48 -25
- ragit-0.11.0.dist-info/RECORD +22 -0
- {ragit-0.8.2.dist-info → ragit-0.11.0.dist-info}/WHEEL +1 -1
- ragit/providers/sentence_transformers.py +0 -225
- ragit-0.8.2.dist-info/RECORD +0 -20
- {ragit-0.8.2.dist-info → ragit-0.11.0.dist-info}/licenses/LICENSE +0 -0
- {ragit-0.8.2.dist-info → ragit-0.11.0.dist-info}/top_level.txt +0 -0
ragit/__init__.py
CHANGED
|
@@ -16,11 +16,7 @@ Quick Start
|
|
|
16
16
|
>>> assistant = RAGAssistant("docs/", embed_fn=my_embed)
|
|
17
17
|
>>> results = assistant.retrieve("How do I create a REST API?")
|
|
18
18
|
>>>
|
|
19
|
-
>>> # With
|
|
20
|
-
>>> from ragit.providers import SentenceTransformersProvider
|
|
21
|
-
>>> assistant = RAGAssistant("docs/", provider=SentenceTransformersProvider())
|
|
22
|
-
>>>
|
|
23
|
-
>>> # With Ollama (explicit)
|
|
19
|
+
>>> # With Ollama
|
|
24
20
|
>>> from ragit.providers import OllamaProvider
|
|
25
21
|
>>> assistant = RAGAssistant("docs/", provider=OllamaProvider())
|
|
26
22
|
>>> answer = assistant.ask("How do I create a REST API?")
|
|
@@ -63,14 +59,27 @@ from ragit.core.experiment.experiment import ( # noqa: E402
|
|
|
63
59
|
RagitExperiment,
|
|
64
60
|
)
|
|
65
61
|
from ragit.core.experiment.results import EvaluationResult, ExperimentResults # noqa: E402
|
|
62
|
+
from ragit.exceptions import ( # noqa: E402
|
|
63
|
+
ConfigurationError,
|
|
64
|
+
EvaluationError,
|
|
65
|
+
ExceptionAggregator,
|
|
66
|
+
GenerationError,
|
|
67
|
+
IndexingError,
|
|
68
|
+
ProviderError,
|
|
69
|
+
RagitError,
|
|
70
|
+
RetrievalError,
|
|
71
|
+
)
|
|
66
72
|
from ragit.loaders import ( # noqa: E402
|
|
67
73
|
chunk_by_separator,
|
|
68
74
|
chunk_document,
|
|
69
75
|
chunk_rst_sections,
|
|
70
76
|
chunk_text,
|
|
77
|
+
deduplicate_documents,
|
|
78
|
+
generate_document_id,
|
|
71
79
|
load_directory,
|
|
72
80
|
load_text,
|
|
73
81
|
)
|
|
82
|
+
from ragit.monitor import ExecutionMonitor # noqa: E402
|
|
74
83
|
from ragit.providers import ( # noqa: E402
|
|
75
84
|
BaseEmbeddingProvider,
|
|
76
85
|
BaseLLMProvider,
|
|
@@ -89,6 +98,8 @@ __all__ = [
|
|
|
89
98
|
"chunk_document",
|
|
90
99
|
"chunk_by_separator",
|
|
91
100
|
"chunk_rst_sections",
|
|
101
|
+
"generate_document_id",
|
|
102
|
+
"deduplicate_documents",
|
|
92
103
|
# Core classes
|
|
93
104
|
"Document",
|
|
94
105
|
"Chunk",
|
|
@@ -97,6 +108,17 @@ __all__ = [
|
|
|
97
108
|
"FunctionProvider",
|
|
98
109
|
"BaseLLMProvider",
|
|
99
110
|
"BaseEmbeddingProvider",
|
|
111
|
+
# Exceptions
|
|
112
|
+
"RagitError",
|
|
113
|
+
"ConfigurationError",
|
|
114
|
+
"ProviderError",
|
|
115
|
+
"IndexingError",
|
|
116
|
+
"RetrievalError",
|
|
117
|
+
"GenerationError",
|
|
118
|
+
"EvaluationError",
|
|
119
|
+
"ExceptionAggregator",
|
|
120
|
+
# Monitoring
|
|
121
|
+
"ExecutionMonitor",
|
|
100
122
|
# Optimization
|
|
101
123
|
"RagitExperiment",
|
|
102
124
|
"BenchmarkQuestion",
|
|
@@ -104,13 +126,3 @@ __all__ = [
|
|
|
104
126
|
"EvaluationResult",
|
|
105
127
|
"ExperimentResults",
|
|
106
128
|
]
|
|
107
|
-
|
|
108
|
-
# Conditionally add SentenceTransformersProvider if available
|
|
109
|
-
try:
|
|
110
|
-
from ragit.providers import ( # noqa: E402
|
|
111
|
-
SentenceTransformersProvider as SentenceTransformersProvider,
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
__all__ += ["SentenceTransformersProvider"]
|
|
115
|
-
except ImportError:
|
|
116
|
-
pass
|