Skip to content

Commit d869c89

Browse files
committed
Explicitly set type in every LC_ToolCall
1 parent a6dc599 commit d869c89

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

splunklib/ai/engines/langchain.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ def unpack_tool_call(self, call: LC_ToolCall) -> LC_ToolCall:
487487
id=call["id"],
488488
name=call["name"],
489489
args=unpacked_args,
490+
type="tool_call",
490491
)
491492

492493
return call
@@ -1142,6 +1143,7 @@ def _convert_model_response_to_model_result(
11421143
id=call.id,
11431144
name=f"{TOOL_STRATEGY_TOOL_PREFIX}{call.name}",
11441145
args=call.args,
1146+
type="tool_call",
11451147
)
11461148
for call in resp.message.structured_output_calls
11471149
)
@@ -1648,7 +1650,7 @@ def _map_tool_call_to_langchain(call: ToolCall | SubagentCall) -> LC_ToolCall:
16481650
name = _normalize_tool_name(call.name, call.type)
16491651
args = call.args
16501652

1651-
return LC_ToolCall(id=call.id, name=name, args=args)
1653+
return LC_ToolCall(id=call.id, name=name, args=args, type="tool_call")
16521654

16531655

16541656
def _map_content_from_langchain(
@@ -1756,6 +1758,7 @@ def _map_message_to_langchain(message: BaseMessage) -> LC_AnyMessage:
17561758
id=call.id,
17571759
name=f"{TOOL_STRATEGY_TOOL_PREFIX}{call.name}",
17581760
args=call.args,
1761+
type="tool_call",
17591762
)
17601763
for call in message.structured_output_calls
17611764
)

0 commit comments

Comments
 (0)