bothy-sdk
    Preparing search index...

    Function expectationFor

    • Returns what point 6 compares for an event (Design note 8 of M2-29).

      Rows: agent.invocation (run, thread, and by trigger_kind message_id, interaction_id or command_id), agent.followup (run, thread, message_id), interaction.created (interaction.id, its run_id and thread_id), command.invoked (command_id, run_id and thread_id when present), command.autocomplete_requested (command_id, its thread when present, no run). AgentInvocationPayload has no command_id yet (only command_invocation_id), so trigger_kind = command has no counterpart and every such token is invalid. IDs are compared in their canonical lower-case form.

      Parameters

      • envelopeType: string

        The envelope type.

      • event: unknown

        The event (an envelope or a decoded event with payload).

      Returns Expectation

      The expectation.

      RangeError when the type carries no invocation token; TypeError when the payload is not the payload of that type.

      const expect = expectationFor(envelope.type, envelope);
      const check = await verifier.check(token, expect, actual);