@@ -44,21 +44,27 @@ def tool_cozeloop_input(params: ToolAttributesParams) -> ExtractorResponse:
4444 "description" : params .tool .description ,
4545 "parameters" : params .args ,
4646 }
47- return ExtractorResponse (content = json .dumps (tool_input ) or "<unknown_tool_input>" )
47+ return ExtractorResponse (
48+ content = json .dumps (tool_input , ensure_ascii = False ) or "<unknown_tool_input>"
49+ )
4850
4951
5052def tool_gen_ai_tool_name (params : ToolAttributesParams ) -> ExtractorResponse :
5153 return ExtractorResponse (content = params .tool .name or "<unknown_tool_name>" )
5254
5355
5456def tool_cozeloop_output (params : ToolAttributesParams ) -> ExtractorResponse :
55- function_response = params .function_response_event .get_function_responses ()[0 ]
57+ function_response = params .function_response_event .get_function_responses ()[
58+ 0
59+ ].model_dump ()
5660 tool_output = {
57- "id" : function_response . id ,
58- "name" : function_response . name ,
59- "response" : function_response . response ,
61+ "id" : function_response [ "id" ] ,
62+ "name" : function_response [ " name" ] ,
63+ "response" : function_response [ " response" ] ,
6064 }
61- return ExtractorResponse (content = json .dumps (tool_output ) or "<unknown_tool_output>" )
65+ return ExtractorResponse (
66+ content = json .dumps (tool_output , ensure_ascii = False ) or "<unknown_tool_output>"
67+ )
6268
6369
6470TOOL_ATTRIBUTES = {
0 commit comments