Briyah SDK - v2.0.6
    Preparing search index...

    Class PackInstantiationService

    Index
    • Builds a single free-standing agent from a pack's agent template.

      Free-standing rather than room-owned: this is the "preconfigured witness with the right statements attached" case, which has to be usable before any courtroom exists.

      Parameters

      • packName: string

        The pack holding the template

      • agentKey: string

        The agent template's key

      • models: InstantiateModels

        One model per role

      • Optionaloverrides: Partial<PromptFolderDefaults>

        Anything the caller wants to change, e.g. the agent's name

      Returns Promise<{ agentId: string; warnings: string[] }>

      The agent's id and anything that did not go to plan

      If the pack or the template does not exist

      If the pack is off

    • Builds a room from a pack's room template, with its whole cast.

      Parameters

      • packName: string

        The pack holding the template

      • roomKey: string

        The room template's key

      • models: InstantiateModels

        One model per role the templates ask for

      • Optionalname: string

        Overrides the template's room name

      • Optionaloverrides: RosterOverrides

        Per-agent changes, keyed by roster key — most usefully { player: { agentNickname: 'Homer' } }. Applied over the template's own overrides, which are applied over the prompt folder's defaults

      Returns Promise<InstantiateRoomResult>

      The room, its agents, and anything that did not go to plan

      If the pack or the template does not exist

      If the pack is off, the template is inconsistent, or an override names a key that is not on the roster

      const { roomId } = await packInstantiation.instantiateRoom(
      'dnd5e', 'table',
      { primary: { aiServiceName: 'Anthropic', aiModel: 'claude-sonnet-5' } },
      'Tuesday Night Game',
      { player: { agentName: 'Homer', agentNickname: 'Homer' } },
      );