fix: serialize datetime objects in agent dict before JSON encoding in create_agent_execution
This commit is contained in:
@@ -543,9 +543,14 @@ async def create_agent_execution(
|
||||
if task_for_context.get(key):
|
||||
task_for_context[key] = task_for_context[key].isoformat() if hasattr(task_for_context[key], 'isoformat') else task_for_context[key]
|
||||
|
||||
agent_for_context = dict(agent)
|
||||
for key in ["created_at"]:
|
||||
if agent_for_context.get(key):
|
||||
agent_for_context[key] = agent_for_context[key].isoformat() if hasattr(agent_for_context[key], 'isoformat') else agent_for_context[key]
|
||||
|
||||
input_context = {
|
||||
"task": task_for_context,
|
||||
"agent": dict(agent),
|
||||
"agent": agent_for_context,
|
||||
"timestamp": datetime.utcnow().isoformat()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user