Skip to main content

Function: mockEventContext()

mockEventContext(runId, type, data, at, workerToken): ProviderEventContext

Defined in: packages/agentos/src/io/channels/meetings/providers/mock.ts:16

Builds the context a worker's report would produce, for tests.

Parameters​

runId​

string

type​

ProviderEventType

data​

{ message?: string; participantCount?: number; participantRef?: string; reason?: MeetingLeaveReason; seconds?: number; sender?: string; supplierUsage?: SupplierUsage; text?: string; }

message?​

string

An error's description, on error; on left, the provider's word for why the run ended, which bot:left carries beside the reason.

participantCount?​

number

How many participants besides the bot, on in_call and when one joins or leaves.

participantRef?​

string

The provider's reference for a participant who joined or left.

reason?​

MeetingLeaveReason

Why the bot left, on left.

seconds?​

number

The seconds the worker counted, on usage, left, done and crashed.

sender?​

string

Who sent a chat message or a stop command.

supplierUsage?​

SupplierUsage

What the provider's supplier measured so far, on any report: recorded whatever the run's state, a terminal one included.

text?​

string

A chat message's text.

| undefined

at​

number

workerToken​

string

Returns​

ProviderEventContext