From e92e8c9a6f757249db5c6531f6840101f2e6165d Mon Sep 17 00:00:00 2001 From: Ali Waleed Date: Tue, 3 Dec 2024 21:29:28 +0200 Subject: [PATCH] check for empty task agent --- src/langtrace_python_sdk/instrumentation/crewai/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langtrace_python_sdk/instrumentation/crewai/patch.py b/src/langtrace_python_sdk/instrumentation/crewai/patch.py index dfe20bde..73f903f8 100644 --- a/src/langtrace_python_sdk/instrumentation/crewai/patch.py +++ b/src/langtrace_python_sdk/instrumentation/crewai/patch.py @@ -223,7 +223,7 @@ def _parse_tasks(self, tasks): for task in tasks: self.crew["tasks"].append( { - "agent": task.agent.role, + "agent": task.agent.role if task.agent else None, "description": task.description, "async_execution": task.async_execution, "expected_output": task.expected_output,