Result of a test run containing recorded events and assertion utilities.
const result = await session.run({ userInput: 'Hello' });result.expect.nextEvent().isMessage({ role: 'assistant' });result.expect.noMoreEvents(); Copy
const result = await session.run({ userInput: 'Hello' });result.expect.nextEvent().isMessage({ role: 'assistant' });result.expect.noMoreEvents();
Optional
List of all recorded events generated during the run.
Provides an assertion helper for verifying the run events.
Returns the final output of the run after completion.
Error - Not implemented yet.
Indicates whether the run has finished processing all events.
Wait for the RunResult to complete. Returns this for method chaining.
this
const result = session.run({ userInput: 'Hi!' });await result.wait(); // waits for completionresult.expect.nextEvent().isMessage({ role: 'assistant' }); Copy
const result = session.run({ userInput: 'Hi!' });await result.wait(); // waits for completionresult.expect.nextEvent().isMessage({ role: 'assistant' });
Result of a test run containing recorded events and assertion utilities.
Example