@@ -138,7 +138,7 @@ def get_action(self, obs: dict) -> tuple[ToolCall, dict]:
138138 action = self .action_from_message (message )
139139 return action , {"think" : thoughts }
140140
141- def thoughts_from_message (self , message ) -> str :
141+ def thoughts_from_message (self , message : Message ) -> str :
142142 thoughts = []
143143 if reasoning := message .get ("reasoning_content" ):
144144 logger .info (colored (f"LLM reasoning:\n { reasoning } " , "yellow" ))
@@ -153,7 +153,7 @@ def thoughts_from_message(self, message) -> str:
153153 thoughts .append (message .content )
154154 return "\n \n " .join (thoughts )
155155
156- def action_from_message (self , message ) -> ToolCall :
156+ def action_from_message (self , message : Message ) -> ToolCall :
157157 if message .tool_calls :
158158 if len (message .tool_calls ) > 1 :
159159 logger .warning ("Multiple tool calls found in LLM response, using the first one." )
@@ -162,7 +162,7 @@ def action_from_message(self, message) -> ToolCall:
162162 args = json .loads (tool_call .function .arguments )
163163 action = ToolCall (id = tool_call .id , name = name , arguments = args )
164164 self .last_tool_call_id = action .id
165- logger .info (f"Parsed tool call action : { action } " )
165+ logger .info (colored ( f"Parsed tool call: { action } " , "magenta" ) )
166166 else :
167167 raise ValueError (f"No tool call found in LLM response: { message } " )
168168 return action
0 commit comments