Enable your Agents to wait for human input.
waitForEvent()
step method:
ask_developer
tool will wait up to 4 hours for a "developer.response"
event to be received, pausing the execution of the AgentKit network.
The incoming "developer.response"
event will be matched against the data.ticketId
field of the event that trigger the AgentKit network.
For this reason, the AgentKit network will need to be wrapped in an Inngest function as demonstrated in the next section.
network.run()
is now performed by the Inngest function.
Don’t forget to register the function with createServer
’s functions
property.
ask_developer
tool to the network"app/support.ticket.created"
event which carries
the data.ticketId
field.
The Technical Support
Agent will now use the ask_developer
tool to ask a developer for input on a technical issue:
ask_developer
tool will now wait for a "developer.response"
event to be received (ex: from a Slack message), and match it against the data.ticketId
field.
The result of the ask_developer
tool will be returned to the Technical Support
Agent.
Look at the Inngest step.waitForEvent()
documentation for more details and examples.