Scale3-Labs / langtrace

Langtrace 🔍 is an open-source, Open Telemetry based end-to-end observability tool for LLM applications, providing real-time tracing, evaluations and metrics for popular LLMs, LLM frameworks, vectorDBs and more.. Integrate using Typescript, Python. 🚀💻📊
https://langtrace.ai
GNU Affero General Public License v3.0
617 stars 60 forks source link

Hierarchical processes with custom manager with no agent assignment on task causes an error #366

Closed andrewn3 closed 10 hours ago

andrewn3 commented 22 hours ago

When you define a Hierarchical processes you don't need to specify on the task if it's assigned to an agent as you can let the manager or custom manager do this. I created a custom manager agent and assigned it to "manager=" as part of the crew definition and the left the task with no assigned agents as the manager would choose and the langtrace python sdk will fail.

This flagged this error

File "D:\Users\xxxx\crewai\xxxx\xxx\xxx.venv\Lib\site-packages**langtrace_python_sdk\instrumentation\crewai\patch.py", line 226, in _parse_tasks "agent": task.agent.role, ^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'role'

i did a crude fix just to get it working e.g. "agent": task.agent.role if task.agent else None

karthikscale3 commented 22 hours ago

Hi @andrewn3 , thanks for reporting. We will have a fix for it shortly.

alizenhom commented 22 hours ago

@andrewn3 Nice catch, this now fixed and released in 3.3.12 kindly update to 3.3.12 and will be more than happy if you still face any issues

andrewn3 commented 10 hours ago

Works fine with 3.3.12.