hyperforge-nucliadb 1.0.0.post72__tar.gz → 1.0.0.post87__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.post72 → hyperforge_nucliadb-1.0.0.post87}/PKG-INFO +1 -1
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/pyproject.toml +1 -1
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/advanced_ask_agent.py +1 -1
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/advanced_ask_config.py +3 -3
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/config.py +3 -3
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/basic_ask_agent.py +3 -3
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/basic_ask_config.py +3 -3
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb.egg-info/PKG-INFO +1 -1
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/tests/test_nucliadb.py +10 -6
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/tests/test_sync.py +3 -3
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/README.md +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/setup.cfg +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/ask.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/hydrate.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/kb_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/knowledge_scan.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/models.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/multi.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/nucliadb.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/prompt_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/query_analysis.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/rerank.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask/utils.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/ask_utils.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/driver.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/driver_config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/py.typed +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/sync/__init__.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/sync/agent.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/sync/config.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/sync/config_driver.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb/sync/driver.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb.egg-info/SOURCES.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb.egg-info/dependency_links.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb.egg-info/requires.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/src/hyperforge_nucliadb.egg-info/top_level.txt +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/tests/test_ask_utils.py +0 -0
- {hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/tests/test_driver.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.post87"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
description = "NucliaDB Hyperforge agent"
|
|
10
10
|
authors = [{ name = "Nuclia", email = "nucliadb@nuclia.com" }]
|
|
@@ -190,7 +190,7 @@ def build_ask_request(
|
|
|
190
190
|
filter_expression = parse_filter_expression(agent, driver)
|
|
191
191
|
ask_request = AskRequest(
|
|
192
192
|
query=question,
|
|
193
|
-
generative_model=agent.generative_model,
|
|
193
|
+
generative_model=agent.generative_model.model_id,
|
|
194
194
|
citations=True,
|
|
195
195
|
filters=driver.filters,
|
|
196
196
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Any, List, Literal, Optional, Union
|
|
2
2
|
|
|
3
3
|
from hyperforge.context.config import ContextAgentConfig
|
|
4
|
+
from hyperforge.llm_config import LLMConfig, LLMField, llm_defaults
|
|
4
5
|
from hyperforge.utils import WidgetType
|
|
5
6
|
from nucliadb_models.filters import FilterExpression
|
|
6
7
|
from nucliadb_models.search import (
|
|
@@ -30,11 +31,10 @@ class AdvancedAskAgentConfig(ContextAgentConfig):
|
|
|
30
31
|
"show_in_node": True,
|
|
31
32
|
},
|
|
32
33
|
)
|
|
33
|
-
generative_model:
|
|
34
|
-
default=
|
|
34
|
+
generative_model: LLMField = Field(
|
|
35
|
+
default=LLMConfig(model_id=llm_defaults.default),
|
|
35
36
|
title="Generative model",
|
|
36
37
|
description="Model used to generate answers",
|
|
37
|
-
json_schema_extra={"widget": WidgetType.MODEL_SELECT},
|
|
38
38
|
)
|
|
39
39
|
features: Optional[list[ChatOptions]] = Field(
|
|
40
40
|
default=None,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import List, Literal, Optional
|
|
2
2
|
|
|
3
3
|
from hyperforge.context.config import ContextAgentConfig
|
|
4
|
+
from hyperforge.llm_config import LLMConfig, LLMField, llm_defaults
|
|
4
5
|
from hyperforge.utils import WidgetType
|
|
5
6
|
from nucliadb_models.search import KnowledgeGraphEntity
|
|
6
7
|
from pydantic import Field
|
|
@@ -40,11 +41,10 @@ class AskAgentConfig(ContextAgentConfig):
|
|
|
40
41
|
"show_in_node": True,
|
|
41
42
|
},
|
|
42
43
|
)
|
|
43
|
-
configuration_model:
|
|
44
|
-
default=
|
|
44
|
+
configuration_model: LLMField = Field(
|
|
45
|
+
default=LLMConfig(model_id=llm_defaults.fast),
|
|
45
46
|
title="Generative model",
|
|
46
47
|
description="Model used to generate the configuration",
|
|
47
|
-
json_schema_extra={"widget": WidgetType.MODEL_SELECT},
|
|
48
48
|
)
|
|
49
49
|
fast_answer: bool = True
|
|
50
50
|
# Setting this to True so that this PR will not break the current behavior
|
|
@@ -709,7 +709,7 @@ class BasicAskAgent(ContextAgent, Agent[BasicAskAgentConfig]):
|
|
|
709
709
|
# Use full resource strategy by requesting title and summary fields
|
|
710
710
|
ask_request = AskRequest(
|
|
711
711
|
query=question,
|
|
712
|
-
generative_model=self.config.generative_model,
|
|
712
|
+
generative_model=self.config.generative_model.model_id,
|
|
713
713
|
# TODO: Consider what to do when multiple resources match
|
|
714
714
|
filter_expression=filter_expression,
|
|
715
715
|
rag_strategies=[
|
|
@@ -1132,7 +1132,7 @@ class BasicAskAgent(ContextAgent, Agent[BasicAskAgentConfig]):
|
|
|
1132
1132
|
query=question,
|
|
1133
1133
|
show=[ResourceProperties.BASIC, ResourceProperties.ORIGIN],
|
|
1134
1134
|
citations=CitationsType.LLM_FOOTNOTES,
|
|
1135
|
-
generative_model=self.config.generative_model,
|
|
1135
|
+
generative_model=self.config.generative_model.model_id,
|
|
1136
1136
|
filter_expression=filter_expression,
|
|
1137
1137
|
rag_strategies=rag_strategies,
|
|
1138
1138
|
)
|
|
@@ -1244,7 +1244,7 @@ class BasicAskAgent(ContextAgent, Agent[BasicAskAgentConfig]):
|
|
|
1244
1244
|
ask_request = AskRequest(
|
|
1245
1245
|
query=question,
|
|
1246
1246
|
citations=True,
|
|
1247
|
-
generative_model=self.config.generative_model,
|
|
1247
|
+
generative_model=self.config.generative_model.model_id,
|
|
1248
1248
|
filters=nucliadb_driver.config.filters,
|
|
1249
1249
|
)
|
|
1250
1250
|
paragraphs = await nucliadb_driver.ask(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import List, Literal, Optional, Tuple
|
|
2
2
|
|
|
3
3
|
from hyperforge.context.agent import ContextAgentConfig
|
|
4
|
+
from hyperforge.llm_config import LLMConfig, LLMField, llm_defaults
|
|
4
5
|
from hyperforge.utils import WidgetType
|
|
5
6
|
from pydantic import Field
|
|
6
7
|
from pydantic.config import ConfigDict
|
|
@@ -15,11 +16,10 @@ class BasicAskAgentConfig(ContextAgentConfig):
|
|
|
15
16
|
"show_in_node": True,
|
|
16
17
|
},
|
|
17
18
|
)
|
|
18
|
-
generative_model:
|
|
19
|
-
default=
|
|
19
|
+
generative_model: LLMField = Field(
|
|
20
|
+
default=LLMConfig(model_id=llm_defaults.default),
|
|
20
21
|
title="Generative model",
|
|
21
22
|
description="Model used to generate answers",
|
|
22
|
-
json_schema_extra={"widget": WidgetType.MODEL_SELECT},
|
|
23
23
|
)
|
|
24
24
|
published_functions: Optional[Tuple[str, ...]] = Field(
|
|
25
25
|
default=(
|
{hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/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
|
{hyperforge_nucliadb-1.0.0.post72 → hyperforge_nucliadb-1.0.0.post87}/tests/test_ask_utils.py
RENAMED
|
File without changes
|
|
File without changes
|