Complete the code to import the class used for tracking costs in LangChain.
from langchain.callbacks import [1]
The CostTracker class is used to track costs across runs in LangChain.
Complete the code to create a new cost tracker instance.
tracker = [1]()To track costs, you create an instance of CostTracker.
Fix the error in the code to add the cost tracker to the callback manager.
callback_manager = CallbackManager(callbacks=[[1]])You must pass the instance tracker to the callbacks list, not the class name.
Fill both blanks to update the cost tracker after a run and then print the total cost.
tracker.[1](run) print(tracker.[2])
Use on_run_end to update the tracker after a run, and total_cost to get the current total cost.
Fill all three blanks to reset the cost tracker, run a new process, and then print the updated cost.
tracker.[1]() result = process.run(input) tracker.[2](result) print(tracker.[3])
First, reset the tracker with reset(). Then update it with on_run_end() after the run. Finally, print the total_cost.