Concrete implementation of TrackedChat that provides chat functionality by delegating to an AIProvider implementation. This class handles conversation management and tracking, while delegating the actual model invocation to the provider.

Hierarchy

  • TrackedChat

Constructors

Properties

aiConfig: LDAIConfig
messages: LDMessage[]
provider: AIProvider

Methods

  • Append messages to the conversation history. Adds messages to the conversation history without invoking the model, which is useful for managing multi-turn conversations or injecting context.

    Parameters

    • messages: LDMessage[]

      Array of messages to append to the conversation history

    Returns void

  • Get all messages in the conversation history.

    Parameters

    • includeConfigMessages: boolean = false

      Whether to include the config messages from the AIConfig. Defaults to false.

    Returns LDMessage[]

    Array of messages. When includeConfigMessages is true, returns both config messages and conversation history with config messages prepended. When false, returns only the conversation history messages.

Generated using TypeDoc