nucliadb-models 6.7.2.post4908__py3-none-any.whl → 6.7.2.post4917__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.

Potentially problematic release.


This version of nucliadb-models might be problematic. Click here for more details.

nucliadb_models/search.py CHANGED
@@ -985,6 +985,29 @@ def parse_max_tokens(max_tokens: Optional[Union[int, MaxTokens]]) -> Optional[Ma
985
985
  return max_tokens
986
986
 
987
987
 
988
+ class Reasoning(BaseModel):
989
+ display: bool = Field(
990
+ default=True,
991
+ description="Whether to display the reasoning steps in the response.",
992
+ )
993
+ effort: Literal["low", "medium", "high"] = Field(
994
+ default="medium",
995
+ description=(
996
+ "Level of reasoning effort. Used by OpenAI models to control the depth of reasoning. "
997
+ "This parameter will be automatically mapped to budget_tokens "
998
+ "if the chosen model does not support effort."
999
+ ),
1000
+ )
1001
+ budget_tokens: int = Field(
1002
+ default=15_000,
1003
+ description=(
1004
+ "Token budget for reasoning. Used by Anthropic or Google models to limit the number of "
1005
+ "tokens used for reasoning. This parameter will be automatically mapped to effort "
1006
+ "if the chosen model does not support budget_tokens."
1007
+ ),
1008
+ )
1009
+
1010
+
988
1011
  class ChatModel(BaseModel):
989
1012
  """
990
1013
  This is the model for the predict request payload on the chat endpoint
@@ -1058,6 +1081,13 @@ class ChatModel(BaseModel):
1058
1081
  default=None,
1059
1082
  description="Seed use for the generative model for a deterministic output.",
1060
1083
  )
1084
+ reasoning: Union[Reasoning, bool] = Field(
1085
+ default=False,
1086
+ description=(
1087
+ "Reasoning options for the generative model. "
1088
+ "Set to True to enable default reasoning, False to disable, or provide a Reasoning object for custom options."
1089
+ ),
1090
+ )
1061
1091
 
1062
1092
 
1063
1093
  class RephraseModel(BaseModel):
@@ -1723,6 +1753,14 @@ Using this feature also disables the `citations` parameter. For maximal accuracy
1723
1753
  description="Load ask parameters from this configuration. Parameters in the request override parameters from the configuration.",
1724
1754
  )
1725
1755
 
1756
+ reasoning: Union[Reasoning, bool] = Field(
1757
+ default=False,
1758
+ description=(
1759
+ "Reasoning options for the generative model. "
1760
+ "Set to True to enable default reasoning, False to disable, or provide a Reasoning object for custom options."
1761
+ ),
1762
+ )
1763
+
1726
1764
  @field_validator("rag_strategies", mode="before")
1727
1765
  @classmethod
1728
1766
  def validate_rag_strategies(cls, rag_strategies: list[RagStrategies]) -> list[RagStrategies]:
@@ -2180,6 +2218,11 @@ class SyncAskResponse(BaseModel):
2180
2218
  title="Answer",
2181
2219
  description="The generative answer to the query",
2182
2220
  )
2221
+ reasoning: Optional[str] = Field(
2222
+ default=None,
2223
+ title="Reasoning",
2224
+ description="The reasoning steps followed by the LLM to generate the answer. This is returned only if the reasoning feature is enabled in the request.", # noqa: E501
2225
+ )
2183
2226
  answer_json: Optional[dict[str, Any]] = Field(
2184
2227
  default=None,
2185
2228
  title="Answer JSON",
@@ -2284,6 +2327,11 @@ class AnswerAskResponseItem(BaseModel):
2284
2327
  text: str
2285
2328
 
2286
2329
 
2330
+ class ReasoningAskResponseItem(BaseModel):
2331
+ type: Literal["reasoning"] = "reasoning"
2332
+ text: str
2333
+
2334
+
2287
2335
  class JSONAskResponseItem(BaseModel):
2288
2336
  type: Literal["answer_json"] = "answer_json"
2289
2337
  object: dict[str, Any]
@@ -2347,6 +2395,7 @@ class DebugAskResponseItem(BaseModel):
2347
2395
 
2348
2396
  AskResponseItemType = Union[
2349
2397
  AnswerAskResponseItem,
2398
+ ReasoningAskResponseItem,
2350
2399
  JSONAskResponseItem,
2351
2400
  MetadataAskResponseItem,
2352
2401
  AugmentedContextResponseItem,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_models
3
- Version: 6.7.2.post4908
3
+ Version: 6.7.2.post4917
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=mna8-AoD_29Wds0Thl0AF0zpERnJmYGLZX1w1fUo
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=RzCos0QRgSMkaV-p7EoceSmt7UTzt9G9be5BKF-iGrQ,9021
19
- nucliadb_models/search.py,sha256=2pmXfnVkmWqs0WAlJC0XlMk3sqnhlpJx1AbtTQ_BjN8,92190
19
+ nucliadb_models/search.py,sha256=d1KTOxd2VDKTkrJmwKSqOcZ8lcSXZpULK7a5zbMUS2c,94050
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=60bxZnOjRHnDdezR8VfR3AZsXTOwePFPs2BKB8wxBak,3414
@@ -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.7.2.post4908.dist-info/METADATA,sha256=5VuyV7-015hZyA4X4lZ8RKmmP2coZ5SodhUr_i9tR0A,794
36
- nucliadb_models-6.7.2.post4908.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- nucliadb_models-6.7.2.post4908.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
- nucliadb_models-6.7.2.post4908.dist-info/RECORD,,
35
+ nucliadb_models-6.7.2.post4917.dist-info/METADATA,sha256=AHr1MblOtlhLomO-AF2r6ID0eu2TZWCzj_cmdYpihYU,794
36
+ nucliadb_models-6.7.2.post4917.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ nucliadb_models-6.7.2.post4917.dist-info/top_level.txt,sha256=UrY1I8oeovIRwkXLYplssTrxQdUjhSEFDFbnwaIV3tA,16
38
+ nucliadb_models-6.7.2.post4917.dist-info/RECORD,,