@memberjunction/ng-ai-test-harness
Version:
MemberJunction AI Test Harness - A reusable component for testing AI agents and prompts with beautiful UX
74 lines • 2.51 kB
TypeScript
import { ViewContainerRef } from '@angular/core';
import { WindowService } from '@progress/kendo-angular-dialog';
import { AIAgentEntityExtended, AIPromptEntityExtended } from '@memberjunction/core-entities';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export interface TestResult {
success: boolean;
result?: any;
error?: string;
executionTime?: number;
tokensUsed?: number;
cost?: number;
}
/**
* Service for managing test harness windows for AI Agents and AI Prompts.
* Uses Kendo Window component which provides maximize and close functionality.
*
* Note: Kendo Window created via WindowService does not include a minimize button
* in the titlebar. The window supports maximize/restore and close actions only.
* To add minimize functionality, a custom window component with custom titlebar
* would need to be implemented.
*/
export declare class TestHarnessWindowService {
private windowService;
private openWindows;
private windowCounter;
constructor(windowService: WindowService);
/**
* Opens the AI Agent Test Harness in a window
*/
openAgentTestHarness(options: {
agentId?: string;
agent?: AIAgentEntityExtended;
title?: string;
width?: string | number;
height?: string | number;
initialDataContext?: Record<string, any>;
initialTemplateData?: Record<string, any>;
viewContainerRef?: ViewContainerRef;
}): Observable<TestResult>;
/**
* Opens the AI Prompt Test Harness in a window
*/
openPromptTestHarness(options: {
promptId?: string;
prompt?: AIPromptEntityExtended;
title?: string;
width?: string | number;
height?: string | number;
initialTemplateVariables?: Record<string, any>;
selectedModelId?: string;
promptRunId?: string;
viewContainerRef?: ViewContainerRef;
}): Observable<TestResult>;
/**
* Opens a test harness window
*/
private openWindow;
/**
* Closes a specific window
*/
private closeWindow;
/**
* Closes all open windows
*/
closeAllWindows(): void;
/**
* Helper method to convert string dimensions to pixel numbers
*/
private convertToNumber;
static ɵfac: i0.ɵɵFactoryDeclaration<TestHarnessWindowService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TestHarnessWindowService>;
}
//# sourceMappingURL=test-harness-window.service.d.ts.map