I was trying to save a variable value to agent extra_data from within one of its tool function, but not working.
when i initialize the agent with extra_data paramater, i can seen that it got saved in sqlite db. but when i try to do the same from agent’s tool function, then no values are getting saved in db.
below is the code snippet(dummy) of my agent & tool
def save_job_requirement_details(agent: Agent,requirement_text: str):
print('agent.extra_data',agent.extra_data) #==> agent.extra_data {'req': 'req'}
agent.extra_data['status'] = 'Python'
print('agent.extra_data',agent.extra_data) #==>agent.extra_data {'req': 'req', 'status': 'Python'}
return 'details saved successfully'
i have defined agent like this
agent1 = Agent(
name="Screener",
model=azure_model,
tools=[save_job_requirement_details]})
agent_main = Agent(
name="Master",
team=[agent1]
model=azure_model,
extra_data={'req':'req'})
even after executing the tool, db is still having the value ‘{‘req’:‘req’}’ not {‘req’: ‘req’, ‘status’: ‘Python’}
Note: im calling Master agent and trying to save data from slave agent’s tool.
Is it a bug or am i doing somethng wrong. Please help.