Added a new feature to log the final thoughts of each agent 🚀
A really helpful feature to have is that we know what each agent produced as their final answer (not the entire chain of thought) which was fed to the next agent in line in a sequential system.
For example, one agent X writes code and another agent Y explains that code. Then instead of having just the final explanation, it would be nice to retrieve what code was actually written by X. See my project on this here.
I have added a class variable called logs in the Crew class. Every time _execute_tasks() is called, logs is updated (overwritten) with the latest thoughts of the current agent. The idea is - for each task_index the last update will always be the agent's final thought - which is the final answer (see translations/en.json for more clarity).
Thus, after kickoff() completes execution, logs has the final answer of each intermediate agent stored as a dictionary with the integer keys denoting the order of execution of tasks starting from 0.
If somebody wants just the raw output and not the entire mess of TaskOutput, then just write -
logs[<task_number>][0].raw
Hope this helps 😀
Hey @shiladityasarkar at the end of the crew execution you should be able to get the final result and call .tasks_output on it to get the results of each individual task, isn't that exactly what you need? I might be missing something, sorry if that is the case
This PR is stale because it has been open for 45 days with no activity.
Hi @shiladityasarkar,
Could you please take a moment to see if this makes sense in light of @joaomdmoura’s comments? I’d appreciate it if you could also share a test or use case for it.
Thanks