@launchdarkly/server-sdk-ai - v2.0.21
    Preparing search index...

    Class ManagedAgent

    ManagedAgent provides agent invocation with automatic tracking and automatic judge evaluation.

    The class is stateless: each run() call sends the prompt directly to the underlying Runner and returns a ManagedResult. Conversation history, if any, must be managed by the caller (or by the Runner implementation).

    Obtain an instance via LDAIClient.createAgent().

    Index
    aiAgentConfig: LDAIAgentConfig
    runner: Runner
    • Invoke the agent with a prompt string and return a ManagedResult.

      run() resolves before ManagedResult.evaluations resolves. Awaiting evaluations guarantees both judge evaluation and tracker.trackJudgeResult() are complete.

      Parameters

      • prompt: string

        The user input to send to the agent.

      Returns Promise<ManagedResult>

      Promise resolving to ManagedResult (before evaluations settle).