nucliadb-models 6.6.1.post4573__py3-none-any.whl → 6.6.1.post4584__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.
- nucliadb_models/search.py +24 -0
- {nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/METADATA +1 -1
- {nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/RECORD +5 -5
- {nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/WHEEL +0 -0
- {nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/top_level.txt +0 -0
nucliadb_models/search.py
CHANGED
@@ -42,6 +42,8 @@ from nucliadb_models.internal.shards import ( # noqa isort: skip
|
|
42
42
|
ShardReplica,
|
43
43
|
KnowledgeboxShards,
|
44
44
|
)
|
45
|
+
from nuclia_models.common.consumption import Consumption
|
46
|
+
|
45
47
|
from nucliadb_models.filters import CatalogFilterExpression, FilterExpression
|
46
48
|
|
47
49
|
ANSWER_JSON_SCHEMA_EXAMPLE = {
|
@@ -1815,6 +1817,7 @@ class SummarizedResponse(BaseModel):
|
|
1815
1817
|
title="Summary",
|
1816
1818
|
description="Global summary of all resources combined.",
|
1817
1819
|
)
|
1820
|
+
consumption: Optional[Consumption] = None
|
1818
1821
|
|
1819
1822
|
|
1820
1823
|
class KnowledgeGraphEntity(BaseModel):
|
@@ -2200,6 +2203,14 @@ class SyncAskResponse(BaseModel):
|
|
2200
2203
|
title="Metadata",
|
2201
2204
|
description="Metadata of the query execution. This includes the number of tokens used in the LLM context and answer, and the timings of the generative model.", # noqa: E501
|
2202
2205
|
)
|
2206
|
+
consumption: Optional[Consumption] = Field(
|
2207
|
+
default=None,
|
2208
|
+
title="Consumption",
|
2209
|
+
description=(
|
2210
|
+
"The consumption of the query execution. Return only if"
|
2211
|
+
" 'X-show-consumption' header is set to true in the request."
|
2212
|
+
),
|
2213
|
+
)
|
2203
2214
|
error_details: Optional[str] = Field(
|
2204
2215
|
default=None,
|
2205
2216
|
title="Error details",
|
@@ -2247,6 +2258,18 @@ class MetadataAskResponseItem(BaseModel):
|
|
2247
2258
|
timings: AskTimings
|
2248
2259
|
|
2249
2260
|
|
2261
|
+
class TokensDetail(BaseModel):
|
2262
|
+
input: float
|
2263
|
+
output: float
|
2264
|
+
image: float
|
2265
|
+
|
2266
|
+
|
2267
|
+
class ConsumptionResponseItem(BaseModel):
|
2268
|
+
type: Literal["consumption"] = "consumption"
|
2269
|
+
normalized_tokens: TokensDetail
|
2270
|
+
customer_key_tokens: TokensDetail
|
2271
|
+
|
2272
|
+
|
2250
2273
|
class AugmentedContextResponseItem(BaseModel):
|
2251
2274
|
type: Literal["augmented_context"] = "augmented_context"
|
2252
2275
|
augmented: AugmentedContext = Field(
|
@@ -2297,6 +2320,7 @@ AskResponseItemType = Union[
|
|
2297
2320
|
RelationsAskResponseItem,
|
2298
2321
|
DebugAskResponseItem,
|
2299
2322
|
PrequeriesAskResponseItem,
|
2323
|
+
ConsumptionResponseItem,
|
2300
2324
|
]
|
2301
2325
|
|
2302
2326
|
|
{nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/RECORD
RENAMED
@@ -16,7 +16,7 @@ nucliadb_models/notifications.py,sha256=3w1HeX9F8nuA7WupHdpXIksX7d0bHO9ofmemYp4R
|
|
16
16
|
nucliadb_models/processing.py,sha256=nhKuHQjqCdb9zJVkYGPTLub23tK9e_lwL5OCDVymZjY,719
|
17
17
|
nucliadb_models/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
nucliadb_models/resource.py,sha256=FkhwmbjoqQBGyKQIqa40WK2Vq3wtryZeIVWmJ4b-84g,9003
|
19
|
-
nucliadb_models/search.py,sha256=
|
19
|
+
nucliadb_models/search.py,sha256=eV3XKS4XbR8iw0Rnw3S3OTRLvjB_iHgWqezGnDrXIIU,90829
|
20
20
|
nucliadb_models/security.py,sha256=opxaDLfvk3aU0sjesK0jGrYLx5h4YCwlKKN0moYs_ig,1150
|
21
21
|
nucliadb_models/synonyms.py,sha256=afbaVqSQSxGLwi2PusVaLSRpkOtA5AZmWOKd1f4nl2E,690
|
22
22
|
nucliadb_models/text.py,sha256=kY2ub7AaGm-4vNaLX3Ju2VvRw-eKZ2LRdM9z7XCNaG0,2898
|
@@ -32,7 +32,7 @@ nucliadb_models/graph/responses.py,sha256=Sdq8OgFAL1YT-1lJyLLrkqcScvj7YTEqAUwQ-k
|
|
32
32
|
nucliadb_models/internal/__init__.py,sha256=zG33bUz1rHFPtvqQPWn4rDwBJt3FJodGuQYD45quiQg,583
|
33
33
|
nucliadb_models/internal/predict.py,sha256=Pnx6MmLfK65eExe1XnVxqmSlvMwdowewwks9BOEoqMw,2029
|
34
34
|
nucliadb_models/internal/shards.py,sha256=__y1OZtWGiNcPQEWfSFOj8yw458WGi7mM4vZe0K-L1Y,1691
|
35
|
-
nucliadb_models-6.6.1.
|
36
|
-
nucliadb_models-6.6.1.
|
37
|
-
nucliadb_models-6.6.1.
|
38
|
-
nucliadb_models-6.6.1.
|
35
|
+
nucliadb_models-6.6.1.post4584.dist-info/METADATA,sha256=fz9kWvEuuAPmk3-JYssjzarXREkuPXXughb3r9D1RKg,794
|
36
|
+
nucliadb_models-6.6.1.post4584.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
37
|
+
nucliadb_models-6.6.1.post4584.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
|
38
|
+
nucliadb_models-6.6.1.post4584.dist-info/RECORD,,
|
File without changes
|
{nucliadb_models-6.6.1.post4573.dist-info → nucliadb_models-6.6.1.post4584.dist-info}/top_level.txt
RENAMED
File without changes
|