Before calling the Crew() constructor in your code, call agentops.init()
At the end of your Crew run, call agentops.end_session("Success")
import agentops# Beginning of program (i.e. main.py, __init__.py)# IMPORTANT: Must be before calling the `Crew()` constructoragentops.init(<INSERT YOUR API KEY HERE>)...# End of program (e.g. main.py)agentops.end_session("Success") # Success|Fail|Indeterminate
Instantiating the AgentOps client will automatically instrument Crew, meaning you will be able to see all
of your sessions on the AgentOps Dashboard along with the full LLM chat histories, cost, token counts, etc.
The Crew framework is capable of determining when all tasks have been accomplished and to halt execution. AgentOps will automatically end your active session
when this determination is made. If you don’t want your AgentOps session to end at this time, add an optional parameter to your agentops.init() call.