Files
Auto-GPT/agent/hook.py
2023-06-30 10:50:54 -04:00

11 lines
387 B
Python

async def run_specific_agent(task, conn):
while (
not conn.poll()
): # Check if there's a termination signal from the main process
response, cycle_count = await run_agent(
task
) # run the agent and get the response and cycle count
# Send response and cycle count back to the main process
conn.send((response, cycle_count))