Get the underlying event.
Verify this event is an agent handoff with optional type matching.
Optional options: AgentHandoffAssertOptionsresult.expect.nextEvent().isAgentHandoff({ newAgentType: MyAgent });
Verify this event is a function call with optional name/args matching.
Optional options: FunctionCallAssertOptionsresult.expect.nextEvent().isFunctionCall({ name: 'order_item', args: { id: 'big_mac' } });
Verify this event is a function call output with optional matching.
Optional options: FunctionCallOutputAssertOptionsresult.expect.nextEvent().isFunctionCallOutput({ isError: false });
Verify this event is a message with optional role matching.
Optional options: MessageAssertOptionsresult.expect.nextEvent().isMessage({ role: 'assistant' });
Evaluate whether the message fulfills the given intent using an LLM.
Self for chaining further assertions
await result.expect
.nextEvent()
.isMessage({ role: 'assistant' })
.judge(llm, { intent: 'should ask for the drink size' });
Assertion wrapper for message events.