botas-core
    Preparing search index...

    Class TurnStateImplInternal

    Internal TurnState implementation.

    Implements

    Index

    Constructors

    Properties

    conversation: StateScopeImpl

    Conversation-scoped state (persisted per conversation).

    User-scoped state (persisted per user across conversations).

    Temporary state for the current turn (not persisted).

    Methods

    • Get a value by path. Path format: "[scope].property" or "property" (defaults to temp).

      Type Parameters

      • T = unknown

      Parameters

      • path: string

      Returns T | undefined

      ctx.state?.getValue<number>('conversation.count')
      ctx.state?.getValue<string>('input') // defaults to temp scope
    • Set a value by path. Path format: "[scope].property" or "property" (defaults to temp).

      Type Parameters

      • T

      Parameters

      • path: string
      • value: T

      Returns void

      ctx.state?.setValue('conversation.count', 42)
      ctx.state?.setValue('input', 'hello') // defaults to temp scope