Skip to content

Commit 54cb014

Browse files
Fix undefined variable in _cast_arguments logging statement
- Replace undefined `function_name` with `getattr(func, '__name__', 'unknown function')` - This prevents NameError when type casting fails and provides robust function name extraction - Addresses CodeRabbit review feedback Co-authored-by: MervinPraison <[email protected]>
1 parent f3d6145 commit 54cb014

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/praisonai-agents/praisonaiagents/agent

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def _cast_arguments(self, func, arguments):
561561

562562
return casted_args
563563
except Exception as e:
564-
logging.debug(f"Type casting failed for {function_name}: {e}")
564+
logging.debug(f"Type casting failed for {getattr(func, '__name__', 'unknown function')}: {e}")
565565
return arguments
566566

567567
def execute_tool(self, function_name, arguments):

0 commit comments

Comments
 (0)