hyperforge-nucliadb 1.0.0.post62__tar.gz → 1.0.0.post85__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.
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/PKG-INFO +1 -1
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/pyproject.toml +1 -1
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/driver.py +4 -8
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb.egg-info/PKG-INFO +1 -1
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb.egg-info/SOURCES.txt +1 -0
- hyperforge_nucliadb-1.0.0.post85/tests/test_driver.py +34 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/tests/test_nucliadb.py +10 -6
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/tests/test_sync.py +3 -3
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/README.md +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/setup.cfg +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/advanced_ask_agent.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/advanced_ask_config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/ask.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/hydrate.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/kb_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/knowledge_scan.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/models.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/multi.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/nucliadb.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/prompt_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/query_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/rerank.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask/utils.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/ask_utils.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/basic_ask_agent.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/basic_ask_config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/driver_config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/py.typed +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/sync/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/sync/agent.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/sync/config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/sync/config_driver.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb/sync/driver.py +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb.egg-info/dependency_links.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb.egg-info/requires.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/src/hyperforge_nucliadb.egg-info/top_level.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/tests/test_ask_utils.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperforge_nucliadb"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.post85"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
description = "NucliaDB Hyperforge agent"
|
|
10
10
|
authors = [{ name = "Nuclia", email = "nucliadb@nuclia.com" }]
|
|
@@ -111,14 +111,10 @@ class NucliaDBDriver(Driver):
|
|
|
111
111
|
|
|
112
112
|
async def labels(self) -> Dict[str, List[str]]:
|
|
113
113
|
labelsets = await self.driver.get_labelsets(kbid=self.config.kbid)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
)
|
|
119
|
-
result[labelset] = [x.title for x in labels.labels]
|
|
120
|
-
|
|
121
|
-
return result
|
|
114
|
+
return {
|
|
115
|
+
labelset_id: [label.title for label in labelset.labels]
|
|
116
|
+
for labelset_id, labelset in labelsets.labelsets.items()
|
|
117
|
+
}
|
|
122
118
|
|
|
123
119
|
async def field_facets(self) -> Dict[str, int]:
|
|
124
120
|
field_labels = {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from types import SimpleNamespace
|
|
2
|
+
from unittest.mock import AsyncMock
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from hyperforge_nucliadb.driver import NucliaDBDriver
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def make_driver(client):
|
|
10
|
+
return NucliaDBDriver.model_construct(
|
|
11
|
+
provider="nucliadb",
|
|
12
|
+
name="test",
|
|
13
|
+
config=SimpleNamespace(kbid="test-kb"),
|
|
14
|
+
driver=client,
|
|
15
|
+
manager=SimpleNamespace(),
|
|
16
|
+
_synonyms=None,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.mark.asyncio
|
|
21
|
+
async def test_labels_uses_complete_labelsets_response():
|
|
22
|
+
client = AsyncMock()
|
|
23
|
+
client.get_labelsets.return_value = SimpleNamespace(
|
|
24
|
+
labelsets={
|
|
25
|
+
"type": SimpleNamespace(labels=[SimpleNamespace(title="report")]),
|
|
26
|
+
"topic": SimpleNamespace(labels=[SimpleNamespace(title="science")]),
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
driver = make_driver(client)
|
|
30
|
+
|
|
31
|
+
assert await driver.labels() == {"type": ["report"], "topic": ["science"]}
|
|
32
|
+
|
|
33
|
+
client.get_labelsets.assert_awaited_once_with(kbid="test-kb")
|
|
34
|
+
client.get_labelset.assert_not_awaited()
|
{hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/tests/test_nucliadb.py
RENAMED
|
@@ -28,7 +28,7 @@ from hyperforge_nucliadb.driver_config import (
|
|
|
28
28
|
|
|
29
29
|
NUA_KEY = os.environ.get(
|
|
30
30
|
"NUA_KEY",
|
|
31
|
-
) or cassette_nua_key("https://europe-1.
|
|
31
|
+
) or cassette_nua_key("https://europe-1.dp.progress.cloud/")
|
|
32
32
|
KB_DE48CFAA_3209_4041_BB64_8604AFF061FB = os.environ.get(
|
|
33
33
|
"KB_DE48CFAA_3209_4041_BB64_8604AFF061FB"
|
|
34
34
|
) or cassette_nua_key("https://europe-1.nuclia.cloud/")
|
|
@@ -250,7 +250,7 @@ async def test_nucliadb_agent():
|
|
|
250
250
|
|
|
251
251
|
|
|
252
252
|
@pytest.mark.asyncio
|
|
253
|
-
@pytest.mark.vcr(ignore_localhost=True
|
|
253
|
+
@pytest.mark.vcr(ignore_localhost=True)
|
|
254
254
|
async def test_nucliadb_agent_simple():
|
|
255
255
|
answers = []
|
|
256
256
|
|
|
@@ -276,7 +276,7 @@ async def test_nucliadb_agent_simple():
|
|
|
276
276
|
|
|
277
277
|
|
|
278
278
|
@pytest.mark.asyncio
|
|
279
|
-
@pytest.mark.vcr(ignore_localhost=True
|
|
279
|
+
@pytest.mark.vcr(ignore_localhost=True)
|
|
280
280
|
async def test_nucliadb_agent_simple_disable_ai_parameter_search():
|
|
281
281
|
question_memory = await arag_main(
|
|
282
282
|
agent_id="default",
|
|
@@ -294,7 +294,7 @@ async def test_nucliadb_agent_simple_disable_ai_parameter_search():
|
|
|
294
294
|
|
|
295
295
|
|
|
296
296
|
@pytest.mark.asyncio
|
|
297
|
-
@pytest.mark.vcr(ignore_localhost=True
|
|
297
|
+
@pytest.mark.vcr(ignore_localhost=True)
|
|
298
298
|
async def test_nucliadb_agent_basic_ask():
|
|
299
299
|
config = deepcopy(CONFIG_SIMPLE)
|
|
300
300
|
|
|
@@ -475,13 +475,17 @@ def test_build_ask_request():
|
|
|
475
475
|
|
|
476
476
|
@pytest.mark.asyncio
|
|
477
477
|
async def test_nucliadb_not_localhost():
|
|
478
|
+
config = deepcopy(CONFIG_LOCAL)
|
|
479
|
+
config["preprocess"] = []
|
|
480
|
+
config["generation"] = []
|
|
481
|
+
|
|
478
482
|
with pytest.raises(PrivateUrlError):
|
|
479
483
|
await arag_main(
|
|
480
484
|
agent_id="default",
|
|
481
485
|
internal_nua=False,
|
|
482
|
-
external_nua_api_key=
|
|
486
|
+
external_nua_api_key=None,
|
|
483
487
|
question="Como usar max_tokens.answer. En español y dame link a la doucmentación",
|
|
484
|
-
config=
|
|
488
|
+
config=config,
|
|
485
489
|
loaded_modules=[
|
|
486
490
|
"hyperforge_nucliadb",
|
|
487
491
|
"hyperforge_summarize",
|
|
@@ -15,7 +15,7 @@ from hyperforge.pubsub import UserToAgentInteraction
|
|
|
15
15
|
|
|
16
16
|
NUA_KEY = os.environ.get(
|
|
17
17
|
"NUA_KEY",
|
|
18
|
-
) or cassette_nua_key("https://europe-1.
|
|
18
|
+
) or cassette_nua_key("https://europe-1.dp.progress.cloud/")
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
KB_E103CAF3_F8CB_4161_A57C_AAD1192D0666 = os.environ.get(
|
|
@@ -23,7 +23,7 @@ KB_E103CAF3_F8CB_4161_A57C_AAD1192D0666 = os.environ.get(
|
|
|
23
23
|
) or cassette_nua_key("https://europe-1.nuclia.cloud/")
|
|
24
24
|
|
|
25
25
|
pytestmark = [
|
|
26
|
-
pytest.mark.vcr(ignore_localhost=True
|
|
26
|
+
pytest.mark.vcr(ignore_localhost=True),
|
|
27
27
|
pytest.mark.asyncio,
|
|
28
28
|
]
|
|
29
29
|
|
|
@@ -87,7 +87,7 @@ def _mock_sync_response(
|
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
async def test_sync_agent(
|
|
90
|
+
async def test_sync_agent():
|
|
91
91
|
sync_driver_config = cast(dict[str, Any], CONFIG["drivers"][0]["config"]) # type: ignore
|
|
92
92
|
sync_base_url = f"{sync_driver_config['url']}/v1/kb/{sync_driver_config['kbid']}"
|
|
93
93
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge_nucliadb-1.0.0.post62 → hyperforge_nucliadb-1.0.0.post85}/tests/test_ask_utils.py
RENAMED
|
File without changes
|