Member Junction
    Preparing search index...

    Comprehensive test harness component for AI Agent development and testing. Provides a full-featured chat interface with conversation management, data context configuration, template data management, streaming responses, conversation persistence, and import/export capabilities.

    • Interactive Chat: Real-time conversation with AI agents
    • Streaming Support: Live streaming of agent responses with elapsed time tracking
    • Data Context Management: Configure variables passed to agent during execution
    • Template Data Management: Manage template variables for agent prompts
    • Conversation Persistence: Save/load conversations with full state restoration
    • Import/Export: JSON-based conversation backup and sharing
    • Content Formatting: Automatic detection and rendering of Markdown, JSON, and plain text
    • Raw Content Toggle: View both processed and raw AI responses
    • Error Handling: Comprehensive error display and user feedback
    <mj-ai-agent-test-harness 
    [aiAgent]="myAgent"
    [isVisible]="true"
    (visibilityChange)="onVisibilityChanged($event)">
    </mj-ai-agent-test-harness>
    // Using with agent entity
    const agent = await metadata.GetEntityObject<MJAIAgentEntityExtended>('MJ: AI Agents');
    await agent.Load('agent-id');
    this.testHarness.aiAgent = agent;
    this.testHarness.isVisible = true;

    Hierarchy (View Summary)

    Implements

    • OnInit
    • OnDestroy
    • OnChanges
    • AfterViewChecked
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    activeTab:
        | "agentVariables"
        | "executionMonitor"
        | "agentSettings"
        | "templateVariables"
        | "modelSettings"
        | "savedConversations" = 'agentVariables'

    Currently active tab in the sidebar

    advancedParams: {
        frequencyPenalty: number | null;
        includeLogProbs: boolean;
        minP: number | null;
        presencePenalty: number | null;
        seed: number | null;
        stopSequences: string[];
        temperature: number | null;
        topK: number | null;
        topLogProbs: number;
        topP: number | null;
    } = ...

    Advanced LLM Parameters

    advancedParamsExpanded: boolean = false

    Whether advanced parameters panel is expanded

    agentConfigurationId: string = ''

    Selected AI configuration for agent execution

    agentVariables: DataContextVariable[] = []

    Unified variables for agent execution (combines data context and template data)

    availableConfigurations: MJAIConfigurationEntity[] = []

    Available AI configurations

    availableModels: any[] = []

    Available AI models for prompt execution

    availableVendors: any[] = []

    Available AI vendors for the selected model

    conversationMessages: ConversationMessage[] = []

    Complete array of all messages in the current conversation session

    currentAgentRun: MJAIAgentRunEntityExtended | null = null

    Current agent run being displayed in execution monitor

    currentConversationId: string | null = null

    ID of the currently active/loaded conversation, if any

    currentJsonContent: string = ''

    Current JSON content to display in the dialog

    currentUserMessage: string = ''

    Current text input by the user (bound to textarea)

    The entity to test - either an AI Agent or AI Prompt

    executionMonitorMode: "live" | "historical" = 'historical'

    Mode for the execution monitor component

    hasExecutedRerun: boolean = false

    Whether a re-run has been executed (shows Reset button instead of Re-Run)

    isExecuting: boolean = false

    Whether an agent execution is currently in progress

    liveAgentSteps: MJAIAgentRunStepEntityExtended[] = []

    Tracks agent steps during live execution (deprecated - now using agent run's Steps directly)

    maxTokens: number | null = null

    Maximum tokens for prompt execution

    minimizeRequested: EventEmitter<void> = ...

    Event emitted when the component requests to be minimized (e.g., when navigating to a run)

    mode: TestHarnessMode = 'agent'

    The mode of operation - either 'agent' or 'prompt'

    newConversationName: string = ''

    Name for the new conversation being saved

    originalPromptRunId: string | null = null

    The original prompt run ID when re-running a previous prompt execution

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    responseFormatOptions: { text: string; value: string }[] = ...

    Available response format options

    runOpened: EventEmitter<{ runId: string; runType: "agent" | "prompt" }> = ...

    Emitted when the user navigates to view a run (agent or prompt)

    savedConversations: SavedConversation[] = []

    Array of saved conversation sessions loaded from localStorage

    selectedConfigurationId: string = ''

    Selected AI configuration for prompt execution

    selectedModelId: string = ''

    Selected AI model for prompt execution

    selectedResponseFormat: { text: string; value: string } = ...

    Selected response format for prompt execution

    selectedVendorId: string = ''

    Selected AI vendor for prompt execution

    showJsonDialog: boolean = false

    Flag to control JSON dialog visibility

    showJsonWindow: boolean = false

    Whether the JSON viewer window is visible

    showLoadConfirmDialog: boolean = false

    Whether to show the load confirmation dialog

    showSaveDialog: boolean = false

    Whether to show the save conversation dialog

    showSidebar: boolean = true

    Whether the configuration sidebar is currently visible

    skipValidation: boolean = false

    Whether to skip validation when running prompts

    stopSequencesText: string = ''

    Raw stop sequences input for textarea

    systemPromptOverride: string | null = null

    The system prompt override to use instead of rendering from template

    tempConversationName: string = ''

    Temporary name for the dialog input to avoid binding conflicts

    templateVariables: DataContextVariable[] = []

    Variables for prompt template rendering

    visibilityChange: EventEmitter<boolean> = ...

    Event emitted when the visibility state changes, allowing parent components to react

    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • Automatically detects the content type of a message for appropriate rendering. Uses pattern matching to identify JSON, Markdown, or plain text content.

      Parameters

      • content: string

        Content string to analyze

      Returns "json" | "markdown" | "text"

      Detected content type ('markdown', 'json', or 'text')

    • Formats execution time from milliseconds into a human-readable string. Automatically selects appropriate units (minutes, seconds, or milliseconds).

      Parameters

      • milliseconds: number

        Execution time in milliseconds

      Returns string

      Formatted time string (e.g., "2m 30.5s", "1.23s", "500ms")

    • Saves the current conversation to localStorage with user-provided name. Handles both creating new conversations and updating existing ones. Automatically limits storage to 50 conversations to prevent excessive memory usage.

      Returns void

      // User clicks save button
      this.saveConversation(); // Prompts for name and saves
    • Switches to the specified tab in the configuration sidebar.

      Parameters

      • tab:
            | "agentVariables"
            | "executionMonitor"
            | "agentSettings"
            | "templateVariables"
            | "modelSettings"
            | "savedConversations"

        The tab to activate

      Returns void