nuclia 4.8.5__py3-none-any.whl → 4.8.6__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.
- nuclia/lib/nua_responses.py +16 -1
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/METADATA +1 -1
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/RECORD +7 -7
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/WHEEL +1 -1
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/entry_points.txt +0 -0
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/licenses/LICENSE +0 -0
- {nuclia-4.8.5.dist-info → nuclia-4.8.6.dist-info}/top_level.txt +0 -0
nuclia/lib/nua_responses.py
CHANGED
@@ -72,6 +72,14 @@ class Image(BaseModel):
|
|
72
72
|
b64encoded: str
|
73
73
|
|
74
74
|
|
75
|
+
class Tool(BaseModel):
|
76
|
+
name: str
|
77
|
+
description: str
|
78
|
+
parameters: Dict[str, Any] = Field(
|
79
|
+
default_factory=dict, description="Schema of the tool"
|
80
|
+
)
|
81
|
+
|
82
|
+
|
75
83
|
class ChatModel(BaseModel):
|
76
84
|
question: str
|
77
85
|
retrieval: bool = True
|
@@ -81,7 +89,7 @@ class ChatModel(BaseModel):
|
|
81
89
|
context: List[Message] = []
|
82
90
|
query_context: Union[List[str], Dict[str, str]] = {}
|
83
91
|
query_context_order: Dict[str, int] = {}
|
84
|
-
truncate: Optional[bool] =
|
92
|
+
truncate: Optional[bool] = True
|
85
93
|
user_prompt: Optional[UserPrompt] = None
|
86
94
|
citations: Optional[bool] = False
|
87
95
|
citation_threshold: Optional[float] = Field(
|
@@ -102,6 +110,9 @@ class ChatModel(BaseModel):
|
|
102
110
|
default=False,
|
103
111
|
description="Whether to reorder the query context based on a reranker. This option will also make it so the first response will contain the scores given for each context piece.",
|
104
112
|
)
|
113
|
+
tools: List[Tool] = Field(
|
114
|
+
default_factory=list, description="List of tools to choose"
|
115
|
+
)
|
105
116
|
|
106
117
|
@model_validator(mode="after")
|
107
118
|
def validate_model(self) -> Self:
|
@@ -109,6 +120,10 @@ class ChatModel(BaseModel):
|
|
109
120
|
raise ValueError("Can not setup markdown and JSON Schema at the same time")
|
110
121
|
if self.citations is True and self.json_schema is not None:
|
111
122
|
raise ValueError("Can not setup citations and JSON Schema at the same time")
|
123
|
+
if self.citations is True and self.tools is not None:
|
124
|
+
raise ValueError("Can not setup citations and Tools at the same time")
|
125
|
+
if self.tools is True and self.json_schema is not None:
|
126
|
+
raise ValueError("Can not setup tools and JSON Schema at the same time")
|
112
127
|
return self
|
113
128
|
|
114
129
|
|
@@ -13,7 +13,7 @@ nuclia/lib/kb.py,sha256=98zpJ8Dp4rQYMNKm4nhpOms3PY-PFOd8acNgDmBud-o,31819
|
|
13
13
|
nuclia/lib/models.py,sha256=lO3TZa4jTQ6C8ptGO1oX-5pxDgv8ocO13z7j5jXOC0Y,1554
|
14
14
|
nuclia/lib/nua.py,sha256=TmjQuYKRjP6R2gjelU2Z354G_7Cm2L58kf8kql7MA3M,25626
|
15
15
|
nuclia/lib/nua_chat.py,sha256=ApL1Y1FWvAVUt-Y9a_8TUSJIhg8-UmBSy8TlDPn6tD8,3874
|
16
|
-
nuclia/lib/nua_responses.py,sha256=
|
16
|
+
nuclia/lib/nua_responses.py,sha256=zji-T-ipYRPo-e1U163Nn_saIiYJYNW3PfjTSL2fQXg,12726
|
17
17
|
nuclia/lib/utils.py,sha256=XAVRRICPem-qOIEcssqDuv-vqD-9PICk6Iuj6DK5GKk,4808
|
18
18
|
nuclia/sdk/__init__.py,sha256=-nAw8i53XBdmbfTa1FJZ0FNRMNakimDVpD6W4OdES-c,1374
|
19
19
|
nuclia/sdk/accounts.py,sha256=7XQ3K9_jlSuk2Cez868FtazZ05xSGab6h3Mt1qMMwIE,647
|
@@ -61,9 +61,9 @@ nuclia/tests/test_nucliadb/test_crud.py,sha256=GuY76HRvt2DFaNgioKm5n0Aco1HnG7zzV
|
|
61
61
|
nuclia/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
62
62
|
nuclia/tests/unit/test_export_import.py,sha256=xo_wVbjUnNlVV65ZGH7LtZ38qy39EkJp2hjOuTHC1nU,980
|
63
63
|
nuclia/tests/unit/test_nua_responses.py,sha256=t_hIdVztTi27RWvpfTJUYcCL0lpKdZFegZIwLdaPNh8,319
|
64
|
-
nuclia-4.8.
|
65
|
-
nuclia-4.8.
|
66
|
-
nuclia-4.8.
|
67
|
-
nuclia-4.8.
|
68
|
-
nuclia-4.8.
|
69
|
-
nuclia-4.8.
|
64
|
+
nuclia-4.8.6.dist-info/licenses/LICENSE,sha256=Ops2LTti_HJtpmWcanuUTdTY3vKDR1myJ0gmGBKC0FA,1063
|
65
|
+
nuclia-4.8.6.dist-info/METADATA,sha256=4MApTsfo0mSQQ23CtcAq93ZW0_g4_dyA1WNQY25P4Xs,2337
|
66
|
+
nuclia-4.8.6.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
67
|
+
nuclia-4.8.6.dist-info/entry_points.txt,sha256=iZHOyXPNS54r3eQmdi5So20xO1gudI9K2oP4sQsCJRw,46
|
68
|
+
nuclia-4.8.6.dist-info/top_level.txt,sha256=cqn_EitXOoXOSUvZnd4q6QGrhm04pg8tLAZtem-Zfdo,7
|
69
|
+
nuclia-4.8.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|