File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -485,6 +485,7 @@ def unpack_tool_call(self, call: LC_ToolCall) -> LC_ToolCall:
485485 id = call ["id" ],
486486 name = call ["name" ],
487487 args = unpacked_args ,
488+ type = "tool_call" ,
488489 )
489490
490491 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 )
@@ -1646,7 +1648,7 @@ def _map_tool_call_to_langchain(call: ToolCall | SubagentCall) -> LC_ToolCall:
16461648 name = _normalize_tool_name (call .name , call .type )
16471649 args = call .args
16481650
1649- return LC_ToolCall (id = call .id , name = name , args = args )
1651+ return LC_ToolCall (id = call .id , name = name , args = args , type = "tool_call" )
16501652
16511653
16521654def _map_content_from_langchain (
@@ -1754,6 +1756,7 @@ def _map_message_to_langchain(message: BaseMessage) -> LC_AnyMessage:
17541756 id = call .id ,
17551757 name = f"{ TOOL_STRATEGY_TOOL_PREFIX } { call .name } " ,
17561758 args = call .args ,
1759+ type = "tool_call" ,
17571760 )
17581761 for call in message .structured_output_calls
17591762 )
You can’t perform that action at this time.
0 commit comments