Hi all,
I see a previous post around this topic but I find the replies confusing.
I am building a simulation with multiple rounds where agents need to solve jobs each round. I am using LangGraph for the simulation loop.
In each round a list of different jobs are generated. I want to do this in the very first node of my graph (a start_round node). At the end of every round I will loop back to this node and generate new jobs.
For generating the jobs I want to pass an instance of my JobGenerator class such that the node can use the methods provided by this class.
Should I pass the instance of the class via the config or context argument and why? Is what I am trying to achieve even possible?
Another possibility would be to add the instance to the state, but fields in the state need to be serializable right?
Any guidance is appreciated - I am happy to provide more information if needed.