File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 162
162
"PredictionRoundResult" ,
163
163
"PromptProcessingCallback" ,
164
164
"SerializedLMSExtendedError" ,
165
+ "ToolDefinition" ,
165
166
"ToolFunctionDef" ,
166
167
"ToolFunctionDefDict" ,
167
168
]
@@ -1361,6 +1362,9 @@ def _additional_config_options(cls) -> DictObject:
1361
1362
return {"for_text_completion" : True }
1362
1363
1363
1364
1365
+ ToolDefinition : TypeAlias = ToolFunctionDef | ToolFunctionDefDict | Callable [..., Any ]
1366
+
1367
+
1364
1368
class ChatResponseEndpoint (PredictionEndpoint [TPrediction ]):
1365
1369
"""API channel endpoint for requesting a chat response from a model."""
1366
1370
@@ -1371,7 +1375,7 @@ class ChatResponseEndpoint(PredictionEndpoint[TPrediction]):
1371
1375
# TODO: Consider implementing this conversion in _kv_config.py
1372
1376
@staticmethod
1373
1377
def parse_tools (
1374
- tools : Iterable [ToolFunctionDef | ToolFunctionDefDict | Callable [..., Any ] ],
1378
+ tools : Iterable [ToolDefinition ],
1375
1379
) -> tuple [LlmToolUseSettingToolArray , ClientToolMap ]:
1376
1380
"""Split tool function definitions into server and client details."""
1377
1381
if not tools :
Original file line number Diff line number Diff line change 103
103
RemoteCallHandler ,
104
104
TModelInfo ,
105
105
TPrediction ,
106
- ToolFunctionDef ,
107
- ToolFunctionDefDict ,
106
+ ToolDefinition ,
108
107
check_model_namespace ,
109
108
load_struct ,
110
109
_model_spec_to_api_dict ,
@@ -1547,7 +1546,7 @@ def respond(
1547
1546
def act (
1548
1547
self ,
1549
1548
chat : Chat | ChatHistoryDataDict | str ,
1550
- tools : Iterable [ToolFunctionDef | ToolFunctionDefDict ],
1549
+ tools : Iterable [ToolDefinition ],
1551
1550
* ,
1552
1551
max_prediction_rounds : int | None = None ,
1553
1552
config : LlmPredictionConfig | LlmPredictionConfigDict | None = None ,
You can’t perform that action at this time.
0 commit comments