nucliadb-models 6.5.0.post4476__py3-none-any.whl → 6.5.0.post4488__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 CHANGED
@@ -2035,6 +2035,39 @@ def validate_facets(facets):
2035
2035
  return facets
2036
2036
 
2037
2037
 
2038
+ class TextBlockAugmentationType(str, Enum):
2039
+ NEIGHBOURING_PARAGRAPHS = "neighbouring_paragraphs"
2040
+ CONVERSATION = "conversation"
2041
+ HIERARCHY = "hierarchy"
2042
+ FULL_RESOURCE = "full_resource"
2043
+ FIELD_EXTENSION = "field_extension"
2044
+ METADATA_EXTENSION = "metadata_extension"
2045
+
2046
+
2047
+ class AugmentedTextBlock(BaseModel):
2048
+ id: str = Field(
2049
+ description="The id of the augmented text bloc. It can be a paragraph id or a field id."
2050
+ )
2051
+ text: str = Field(
2052
+ description="The text of the augmented text block. It may include additional metadata to enrich the context"
2053
+ )
2054
+ parent: Optional[str] = Field(
2055
+ default=None, description="The parent text block that was augmented for."
2056
+ )
2057
+ augmentation_type: TextBlockAugmentationType = Field(description="Type of augmentation.")
2058
+
2059
+
2060
+ class AugmentedContext(BaseModel):
2061
+ paragraphs: dict[str, AugmentedTextBlock] = Field(
2062
+ default={},
2063
+ description="Paragraphs added to the context as a result of using the `rag_strategies` parameter, typically the neighbouring_paragraphs or the conversation strategies",
2064
+ )
2065
+ fields: dict[str, AugmentedTextBlock] = Field(
2066
+ default={},
2067
+ description="Field extracted texts added to the context as a result of using the `rag_strategies` parameter, typically the hierarcy or full_resource strategies.",
2068
+ )
2069
+
2070
+
2038
2071
  class AskTokens(BaseModel):
2039
2072
  input: int = Field(
2040
2073
  title="Input tokens",
@@ -2132,6 +2165,13 @@ class SyncAskResponse(BaseModel):
2132
2165
  title="Citations",
2133
2166
  description="The citations of the answer. List of references to the resources used to generate the answer.",
2134
2167
  )
2168
+ augmented_context: Optional[AugmentedContext] = Field(
2169
+ default=None,
2170
+ description=(
2171
+ "Augmented text blocks that were sent to the LLM as part of the RAG strategies "
2172
+ "applied on the retrieval results in the request."
2173
+ ),
2174
+ )
2135
2175
  prompt_context: Optional[list[str]] = Field(
2136
2176
  default=None,
2137
2177
  title="Prompt context",
@@ -2194,6 +2234,16 @@ class MetadataAskResponseItem(BaseModel):
2194
2234
  timings: AskTimings
2195
2235
 
2196
2236
 
2237
+ class AugmentedContextResponseItem(BaseModel):
2238
+ type: Literal["augmented_context"] = "augmented_context"
2239
+ augmented: AugmentedContext = Field(
2240
+ description=(
2241
+ "Augmented text blocks that were sent to the LLM as part of the RAG strategies "
2242
+ "applied on the retrieval results in the request."
2243
+ )
2244
+ )
2245
+
2246
+
2197
2247
  class CitationsAskResponseItem(BaseModel):
2198
2248
  type: Literal["citations"] = "citations"
2199
2249
  citations: dict[str, Any]
@@ -2226,6 +2276,7 @@ AskResponseItemType = Union[
2226
2276
  AnswerAskResponseItem,
2227
2277
  JSONAskResponseItem,
2228
2278
  MetadataAskResponseItem,
2279
+ AugmentedContextResponseItem,
2229
2280
  CitationsAskResponseItem,
2230
2281
  StatusAskResponseItem,
2231
2282
  ErrorAskResponseItem,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_models
3
- Version: 6.5.0.post4476
3
+ Version: 6.5.0.post4488
4
4
  Author-email: Nuclia <nucliadb@nuclia.com>
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://nuclia.com
@@ -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=roDk6DCSM3QAolyl4bgBh17D4Uao1-J2IbZPay4bUy4,87137
19
+ nucliadb_models/search.py,sha256=W2dRUUst4ZqWitbCrvR1OV9rptYHXzODMI0seeTUzbs,89147
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.5.0.post4476.dist-info/METADATA,sha256=LkSE_e0mIhFu41_q7yI_mrx39OQIOZT_2uYeaf9-W_g,776
36
- nucliadb_models-6.5.0.post4476.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- nucliadb_models-6.5.0.post4476.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
- nucliadb_models-6.5.0.post4476.dist-info/RECORD,,
35
+ nucliadb_models-6.5.0.post4488.dist-info/METADATA,sha256=4HYNY0A_51S7UmhCzRxq-yiIKbnBlF6_iYOrHCD5pHg,776
36
+ nucliadb_models-6.5.0.post4488.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ nucliadb_models-6.5.0.post4488.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
+ nucliadb_models-6.5.0.post4488.dist-info/RECORD,,