nucliadb 6.5.1.post4539__py3-none-any.whl → 6.6.1.post4558__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.
@@ -199,6 +199,8 @@ async def catalog(
199
199
  response_model=CatalogFacetsResponse,
200
200
  response_model_exclude_unset=True,
201
201
  tags=["Search"],
202
+ summary="Show facets in Knowledge Box",
203
+ description="List all facets in a Knowledge Box and how many resources they apply to",
202
204
  include_in_schema=False,
203
205
  )
204
206
  @requires(NucliaDBRoles.READER)
@@ -133,7 +133,8 @@ async def find_knowledgebox(
133
133
  rank_fusion: RankFusionName = fastapi_query(SearchParamDefaults.rank_fusion),
134
134
  reranker: Union[RerankerName, Reranker] = fastapi_query(SearchParamDefaults.reranker),
135
135
  search_configuration: Optional[str] = Query(
136
- default=None, description="Load find parameters from this configuration"
136
+ default=None,
137
+ description="Load find parameters from this configuration. Parameters in the request override parameters from the configuration.",
137
138
  ),
138
139
  x_ndb_client: NucliaDBClientType = Header(NucliaDBClientType.API),
139
140
  x_nucliadb_user: str = Header(""),
@@ -19,7 +19,7 @@
19
19
  #
20
20
  import json
21
21
  from enum import Enum
22
- from typing import Any, AsyncIterable, Optional, Union
22
+ from typing import Any, Optional, Union
23
23
 
24
24
  import aiohttp
25
25
  from fastapi.datastructures import QueryParams
@@ -171,21 +171,13 @@ async def chat_streaming_generator(
171
171
  user_query: str,
172
172
  is_json: bool,
173
173
  ):
174
- stream: AsyncIterable[bytes]
175
- if is_json:
176
- # ndjson: stream lines
177
- stream = predict_response.content
178
- else:
179
- # plain text: stream chunks (last chunk is status)
180
- stream = predict_response.content.iter_any()
181
-
182
174
  first = True
183
175
  status_code = AnswerStatusCode.ERROR.value
184
176
  text_answer = ""
185
177
  json_object = None
186
178
  metrics = AskMetrics()
187
179
  with metrics.time(PREDICT_ANSWER_METRIC):
188
- async for chunk in stream:
180
+ async for chunk in predict_response.content:
189
181
  if first:
190
182
  metrics.record_first_chunk_yielded()
191
183
  first = False
@@ -211,7 +203,11 @@ async def chat_streaming_generator(
211
203
 
212
204
  if is_json is False and chunk: # Ensure chunk is not empty before decoding
213
205
  # If response is text the status_code comes at the last chunk of data
214
- status_code = chunk.decode()
206
+ last_chunk = chunk.decode()
207
+ if last_chunk[-1] == "0":
208
+ status_code = "0"
209
+ else:
210
+ status_code = last_chunk[-2:]
215
211
 
216
212
  audit_predict_proxy_endpoint(
217
213
  headers=predict_response.headers,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.5.1.post4539
3
+ Version: 6.6.1.post4558
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -19,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Requires-Python: <4,>=3.9
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: nucliadb-telemetry[all]>=6.5.1.post4539
23
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.5.1.post4539
24
- Requires-Dist: nucliadb-protos>=6.5.1.post4539
25
- Requires-Dist: nucliadb-models>=6.5.1.post4539
26
- Requires-Dist: nidx-protos>=6.5.1.post4539
22
+ Requires-Dist: nucliadb-telemetry[all]>=6.6.1.post4558
23
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.6.1.post4558
24
+ Requires-Dist: nucliadb-protos>=6.6.1.post4558
25
+ Requires-Dist: nucliadb-models>=6.6.1.post4558
26
+ Requires-Dist: nidx-protos>=6.6.1.post4558
27
27
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
28
28
  Requires-Dist: nuclia-models>=0.24.2
29
29
  Requires-Dist: uvicorn[standard]
@@ -221,9 +221,9 @@ nucliadb/search/utilities.py,sha256=9SsRDw0rJVXVoLBfF7rBb6q080h-thZc7u8uRcTiBeY,
221
221
  nucliadb/search/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
222
222
  nucliadb/search/api/v1/__init__.py,sha256=DH16OYnw9jQ38OpKlmdXeoq2j40ZPXZRtGvClKOkMhw,1239
223
223
  nucliadb/search/api/v1/ask.py,sha256=b4tz33HNsfT5DXv_2DMc_jirnFsHuobreWkbAKkzj5o,5337
224
- nucliadb/search/api/v1/catalog.py,sha256=aBNhgg-8Dj4kiB9IYshe46ph1FaeaPCjyxnNPgUu3AQ,7942
224
+ nucliadb/search/api/v1/catalog.py,sha256=5ZY3d8sVia1traUxVS0Q4aQJmgcOuXzbxis_uY4ulE4,8077
225
225
  nucliadb/search/api/v1/feedback.py,sha256=kNLc4dHz2SXHzV0PwC1WiRAwY88fDptPcP-kO0q-FrQ,2620
226
- nucliadb/search/api/v1/find.py,sha256=iMjyq4y0JOMC_x1B8kUfVdkCoc9G9Ark58kPLLY4HDw,10824
226
+ nucliadb/search/api/v1/find.py,sha256=j6mxEyxjlLnZSqCT_N2LmOJlytsm1vkY4KFFmJRrtP8,10904
227
227
  nucliadb/search/api/v1/graph.py,sha256=gthqxCOn9biE6D6s93jRGLglk0ono8U7OyS390kWiI8,4178
228
228
  nucliadb/search/api/v1/knowledgebox.py,sha256=e9xeLPUqnQTx33i4A8xuV93ENvtJGrpjPlLRbGJtAI8,8415
229
229
  nucliadb/search/api/v1/predict_proxy.py,sha256=TnXKAqf_Go-9QVi6L5z4cXjnuNRe7XLJjF5QH_uwA1I,3504
@@ -255,7 +255,7 @@ nucliadb/search/search/merge.py,sha256=XiRBsxhYPshPV7lZXD-9E259KZOPIf4I2tKosY0lP
255
255
  nucliadb/search/search/metrics.py,sha256=3I6IN0qDSmqIvUaWJmT3rt-Jyjs6LcvnKI8ZqCiuJPY,3501
256
256
  nucliadb/search/search/paragraphs.py,sha256=pNAEiYqJGGUVcEf7xf-PFMVqz0PX4Qb-WNG-_zPGN2o,7799
257
257
  nucliadb/search/search/pgcatalog.py,sha256=_AiyW6it66UX6BsZbM3-230IQhiEG4utoKYboviyOFI,16799
258
- nucliadb/search/search/predict_proxy.py,sha256=Q12I3VIAQqFgzBe9UeVEiAjUAdVT8NBfNDXWiP-pn1M,8858
258
+ nucliadb/search/search/predict_proxy.py,sha256=jJj9LrxBOFo5AMn_EB7MNo1hqiTN-PkeBYINIpVKzl8,8735
259
259
  nucliadb/search/search/query.py,sha256=0qIQdt548L3jtKOyKo06aGJ73SLBxAW3N38_Hc1M3Uw,11528
260
260
  nucliadb/search/search/rank_fusion.py,sha256=xZtXhbmKb_56gs73u6KkFm2efvTATOSMmpOV2wrAIqE,9613
261
261
  nucliadb/search/search/rerankers.py,sha256=E2J1QdKAojqbhHM3KAyaOXKf6tJyETUxKs4tf_BEyqk,7472
@@ -375,8 +375,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
375
375
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
376
376
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
377
377
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
378
- nucliadb-6.5.1.post4539.dist-info/METADATA,sha256=fB-dfmL9TqpjyMPOiHEu-EIwQLqH-a_j3bl3eTsjbFc,4158
379
- nucliadb-6.5.1.post4539.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
380
- nucliadb-6.5.1.post4539.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
381
- nucliadb-6.5.1.post4539.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
382
- nucliadb-6.5.1.post4539.dist-info/RECORD,,
378
+ nucliadb-6.6.1.post4558.dist-info/METADATA,sha256=eIPyyCTmA3lSk-xvNdTwiqdm0HlVRKvNKD3pM8S_Pbg,4158
379
+ nucliadb-6.6.1.post4558.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
380
+ nucliadb-6.6.1.post4558.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
381
+ nucliadb-6.6.1.post4558.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
382
+ nucliadb-6.6.1.post4558.dist-info/RECORD,,