chATLAS_Chains 0.1.3__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.
- benchmark/basic.py +34 -0
- benchmark/conversational.py +0 -0
- chATLAS_Chains/__init__.py +0 -0
- chATLAS_Chains/chains/__init__.py +0 -0
- chATLAS_Chains/chains/basic.py +42 -0
- chATLAS_Chains/chains/basic_graph.py +163 -0
- chATLAS_Chains/chains/conversational.py +0 -0
- chATLAS_Chains/chains/websearch_retrieval_chain.py +447 -0
- chATLAS_Chains/llm/__init__.py +0 -0
- chATLAS_Chains/llm/model_selection.py +47 -0
- chATLAS_Chains/log.py +20 -0
- chATLAS_Chains/prompt/__init__.py +0 -0
- chATLAS_Chains/prompt/doc_joiners.py +5 -0
- chATLAS_Chains/prompt/starters.py +151 -0
- chATLAS_Chains/search/__init__.py +0 -0
- chATLAS_Chains/search/basic.py +45 -0
- chATLAS_Chains/utils/__init__.py +0 -0
- chATLAS_Chains/utils/doc_utils.py +28 -0
- chATLAS_Chains/vectorstore.py +94 -0
- chatlas_chains-0.1.3.dist-info/METADATA +113 -0
- chatlas_chains-0.1.3.dist-info/RECORD +30 -0
- chatlas_chains-0.1.3.dist-info/WHEEL +5 -0
- chatlas_chains-0.1.3.dist-info/licenses/LICENSE +201 -0
- chatlas_chains-0.1.3.dist-info/top_level.txt +3 -0
- tests/__init__.py +0 -0
- tests/conftest.py +274 -0
- tests/test_chains.py +54 -0
- tests/test_llm.py +81 -0
- tests/test_search.py +48 -0
- tests/test_utils.py +27 -0
tests/test_utils.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from unittest.mock import MagicMock
|
|
2
|
+
|
|
3
|
+
from chATLAS_Chains.utils.doc_utils import combine_documents # Replace with actual import path
|
|
4
|
+
from chATLAS_Embed.Base import Document
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_combine_documents_returns_string():
|
|
8
|
+
# Arrange: Create mock Document objects
|
|
9
|
+
mock1 = MagicMock(spec=Document)
|
|
10
|
+
mock1.page_content = "Hello."
|
|
11
|
+
mock1.metadata = {
|
|
12
|
+
"last_modification": "2025-04-08", # Add mock metadata
|
|
13
|
+
"name": "Document 1",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
mock2 = MagicMock(spec=Document)
|
|
17
|
+
mock2.page_content = "Hola."
|
|
18
|
+
mock2.metadata = {
|
|
19
|
+
"last_modification": "2025-04-08", # Add mock metadata
|
|
20
|
+
"name": "Document 2",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Act: Combine documents
|
|
24
|
+
result = combine_documents([mock1, mock2])
|
|
25
|
+
|
|
26
|
+
# Assert: Check that result is a string
|
|
27
|
+
assert isinstance(result, str), "combine_documents should return a string"
|