hyperforge-nucliadb-agentic 1.0.0.post108__tar.gz → 1.0.0.post126__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_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/PKG-INFO +2 -2
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/pyproject.toml +2 -2
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/pyproject.toml.orig +2 -2
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/agent.py +3 -2
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/audit.py +22 -13
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/config.py +3 -3
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/README.md +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/__init__.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/__init__.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/exceptions.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/lifespan.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/model.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/predict.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/predict_models.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/__init__.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/ask.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/graph_strategy.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/highlight.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/hydrator.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/metrics.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/parsers/__init__.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/parsers/ask.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/parsers/fetcher.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/parsers/find.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/prompt.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/rank_fusion.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/rerankers.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/retrieval.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/search/rpc.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/settings.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/utils/ids.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/utils/proto.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/utils/responses.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/ask/utils/text_blocks.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/internal_driver.py +0 -0
- {hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/src/hyperforge_nucliadb_agentic/py.typed +0 -0
{hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperforge_nucliadb_agentic
|
|
3
|
-
Version: 1.0.0.
|
|
3
|
+
Version: 1.0.0.post126
|
|
4
4
|
Summary: NucliaDB Hyperforge agent
|
|
5
5
|
Author: Nuclia
|
|
6
6
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
13
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
-
Requires-Dist: hyperforge>=1.0.0.
|
|
14
|
+
Requires-Dist: hyperforge>=1.0.0.post281
|
|
15
15
|
Requires-Dist: lingua-language-detector
|
|
16
16
|
Requires-Dist: nucliadb-sdk
|
|
17
17
|
Requires-Python: >=3.12, <4
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperforge_nucliadb_agentic"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.post126"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
description = "NucliaDB Hyperforge agent"
|
|
10
10
|
readme = "README.md"
|
|
@@ -18,7 +18,7 @@ classifiers = [
|
|
|
18
18
|
]
|
|
19
19
|
requires-python = ">=3.12, <4"
|
|
20
20
|
dependencies = [
|
|
21
|
-
"hyperforge>=1.0.0.
|
|
21
|
+
"hyperforge>=1.0.0.post281",
|
|
22
22
|
"lingua-language-detector",
|
|
23
23
|
"nucliadb_sdk",
|
|
24
24
|
]
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperforge_nucliadb_agentic"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.post126"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
description = "NucliaDB Hyperforge agent"
|
|
10
10
|
authors = [{ name = "Nuclia", email = "nucliadb@nuclia.com" }]
|
|
@@ -19,7 +19,7 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
requires-python = ">=3.12, <4"
|
|
21
21
|
dependencies = [
|
|
22
|
-
"hyperforge>=1.0.0.
|
|
22
|
+
"hyperforge>=1.0.0.post281",
|
|
23
23
|
"lingua-language-detector",
|
|
24
24
|
"nucliadb_sdk",
|
|
25
25
|
]
|
|
@@ -9,7 +9,7 @@ from hyperforge.agent import Agent
|
|
|
9
9
|
from hyperforge.configure import agent
|
|
10
10
|
from hyperforge.context.agent import ContextAgent
|
|
11
11
|
from hyperforge.definition import FunctionDefinition
|
|
12
|
-
from hyperforge.manager import Manager
|
|
12
|
+
from hyperforge.manager import Manager, build_reasoning
|
|
13
13
|
from hyperforge.memory import Chunk, Context, QuestionMemory, Source
|
|
14
14
|
from hyperforge.models import JSONObject
|
|
15
15
|
from hyperforge_nucliadb.ask.multi import choose_source
|
|
@@ -1010,9 +1010,10 @@ class NucliaDBAgent(ContextAgent, Agent[NucliaDBAgentConfig]):
|
|
|
1010
1010
|
fallback_values = {
|
|
1011
1011
|
"show": [ResourceProperties.BASIC, ResourceProperties.ORIGIN],
|
|
1012
1012
|
"citations": CitationsType.LLM_FOOTNOTES,
|
|
1013
|
-
"generative_model": self.config.generative_model,
|
|
1013
|
+
"generative_model": self.config.generative_model.model_id,
|
|
1014
1014
|
"rag_strategies": rag_strategies,
|
|
1015
1015
|
"generate_answer": self.config.generate_inner_answer,
|
|
1016
|
+
"reasoning": build_reasoning(self.config.generative_model),
|
|
1016
1017
|
}
|
|
1017
1018
|
return ask_request.model_copy(
|
|
1018
1019
|
update={
|
|
@@ -9,7 +9,7 @@ import mmh3
|
|
|
9
9
|
import nats
|
|
10
10
|
from fastapi import Request
|
|
11
11
|
from hyperforge.feature_flag import Features, has_feature
|
|
12
|
-
from hyperforge.models import ExternalUsage, Step
|
|
12
|
+
from hyperforge.models import ExternalUsage, ExternalUsageOperation, Step
|
|
13
13
|
from nucliadb_models.retrieval import RawQuery, RetrievalRequest
|
|
14
14
|
from nucliadb_models.search import (
|
|
15
15
|
NucliaDBClientType,
|
|
@@ -48,20 +48,28 @@ from hyperforge_nucliadb_agentic.ask.model import (
|
|
|
48
48
|
from hyperforge_nucliadb_agentic.ask.predict import AnswerStatusCode
|
|
49
49
|
from hyperforge_nucliadb_agentic.ask.utils.proto import client_type
|
|
50
50
|
|
|
51
|
+
EXTERNAL_USAGE_PREDICT_TYPES = {
|
|
52
|
+
ExternalUsageOperation.INTERNET_SEARCH: PredictType.INTERNET_SEARCH,
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
|
|
52
56
|
def external_usage_to_predict(
|
|
53
57
|
event: ExternalUsage, ndb_client_type: NucliaDBClientType
|
|
54
|
-
) -> Predict:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
) -> list[Predict]:
|
|
59
|
+
client = KbUsageClientType.Value(ndb_client_type.name)
|
|
60
|
+
return [
|
|
61
|
+
Predict(
|
|
62
|
+
client=client,
|
|
63
|
+
type=EXTERNAL_USAGE_PREDICT_TYPES[event.operation],
|
|
64
|
+
# Accounting uses model to identify the external service used.
|
|
65
|
+
model=event.provider,
|
|
66
|
+
input=event.input_tokens,
|
|
67
|
+
output=event.output_tokens,
|
|
68
|
+
image=event.image,
|
|
69
|
+
external_requests=event.requests,
|
|
70
|
+
customer_key=False,
|
|
71
|
+
)
|
|
72
|
+
]
|
|
65
73
|
|
|
66
74
|
|
|
67
75
|
class RequestContext:
|
|
@@ -209,8 +217,9 @@ class StreamAuditStorage:
|
|
|
209
217
|
trace_id: str | None = None,
|
|
210
218
|
) -> None:
|
|
211
219
|
predicts = [
|
|
212
|
-
|
|
220
|
+
predict
|
|
213
221
|
for event in step.external_usage or []
|
|
222
|
+
for predict in external_usage_to_predict(event, client_type)
|
|
214
223
|
]
|
|
215
224
|
if not predicts or self.kb_usage_utility is None:
|
|
216
225
|
logger.warning(
|
|
@@ -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
|
|
@@ -19,11 +20,10 @@ class NucliaDBAgentConfig(ContextAgentConfig):
|
|
|
19
20
|
"show_in_node": True,
|
|
20
21
|
},
|
|
21
22
|
)
|
|
22
|
-
generative_model:
|
|
23
|
-
default=
|
|
23
|
+
generative_model: LLMField = Field(
|
|
24
|
+
default=LLMConfig(model_id=llm_defaults.default),
|
|
24
25
|
title="Generative model",
|
|
25
26
|
description="Model used to generate answers",
|
|
26
|
-
json_schema_extra={"widget": WidgetType.MODEL_SELECT},
|
|
27
27
|
)
|
|
28
28
|
published_functions: Optional[Tuple[str, ...]] = Field(
|
|
29
29
|
default=(
|
{hyperforge_nucliadb_agentic-1.0.0.post108 → hyperforge_nucliadb_agentic-1.0.0.post126}/README.md
RENAMED
|
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
|