@@ -301,13 +301,9 @@ async def awrap_tool_call(
301301 assert resp .artifact is None , "artifact is already populated"
302302
303303 if resp .name .startswith (AGENT_PREFIX ):
304- resp .artifact = SubagentFailureResult (
305- error_message = str (resp .content ) # pyright: ignore[reportUnknownArgumentType]
306- )
304+ resp .artifact = SubagentFailureResult (error_message = str (resp .content ))
307305 else :
308- resp .artifact = ToolFailureResult (
309- error_message = str (resp .content ) # pyright: ignore[reportUnknownArgumentType]
310- )
306+ resp .artifact = ToolFailureResult (error_message = str (resp .content ))
311307
312308 return resp
313309
@@ -1247,12 +1243,10 @@ def _convert_tool_message_from_lc(
12471243 name = message .name .removeprefix (TOOL_STRATEGY_TOOL_PREFIX ),
12481244 call_id = message .tool_call_id ,
12491245 status = message .status ,
1250- content = str (message .content ), # pyright: ignore[reportUnknownArgumentType]
1246+ content = str (message .content ),
12511247 )
12521248
1253- assert isinstance (message .artifact , ToolResult ) or isinstance (
1254- message .artifact , ToolFailureResult
1255- )
1249+ assert isinstance (message .artifact , (ToolResult , ToolFailureResult ))
12561250
12571251 tool_type : ToolType = (
12581252 ToolType .LOCAL if message .name .startswith (LOCAL_TOOL_PREFIX ) else ToolType .REMOTE
@@ -1284,7 +1278,7 @@ def _convert_model_result_from_lc(model_response: LC_ModelCallResult) -> ModelRe
12841278 call_id = m .tool_call_id ,
12851279 name = m .name .removeprefix (TOOL_STRATEGY_TOOL_PREFIX ) if m .name else "" ,
12861280 status = m .status ,
1287- content = str (m .content ), # pyright: ignore[reportUnknownArgumentType]
1281+ content = str (m .content ),
12881282 )
12891283 for m in model_response .result
12901284 if isinstance (m , LC_ToolMessage )
@@ -1298,7 +1292,7 @@ def _convert_model_result_from_lc(model_response: LC_ModelCallResult) -> ModelRe
12981292 additional_kwargs = cast (dict [str , Any ], ai_message .additional_kwargs )
12991293 return ModelResponse (
13001294 message = AIMessage (
1301- content = _map_content_from_langchain (ai_message .content ), # pyright: ignore[reportUnknownArgumentType]
1295+ content = _map_content_from_langchain (ai_message .content ),
13021296 calls = [
13031297 _map_tool_call_from_langchain (tc )
13041298 for tc in ai_message .tool_calls
@@ -1706,7 +1700,7 @@ def _map_message_from_langchain(message: LC_BaseMessage) -> BaseMessage:
17061700 match message :
17071701 case LC_AIMessage ():
17081702 return AIMessage (
1709- content = _map_content_from_langchain (message .content ), # pyright: ignore[reportUnknownArgumentType]
1703+ content = _map_content_from_langchain (message .content ),
17101704 calls = [
17111705 _map_tool_call_from_langchain (tc )
17121706 for tc in message .tool_calls
0 commit comments