@craftapit/tester
Version:
A focused, LLM-powered testing framework for natural language test scenarios
34 lines (33 loc) • 1.16 kB
TypeScript
import { BaseAdapter } from './BaseAdapter';
import { ScreenState, UIAction } from '../types/actions';
import { LLMAdapter } from './LLMAdapter';
/**
* Adapter for using Ollama models locally
*/
export declare class OllamaAdapter extends BaseAdapter implements LLMAdapter {
private baseUrl;
private model;
private contextSize;
private dynamicContextSizing;
constructor(config: {
baseUrl: string;
model: string;
contextSize?: number;
dynamicContextSizing?: boolean;
});
/**
* Calculates the optimal context size based on the input prompt
* @param input The input prompt
* @param expectedResponseFactor Ratio of expected response tokens to input tokens
* @returns Optimal context size in tokens
*/
private calculateOptimalContextSize;
initialize(): Promise<void>;
complete(prompt: string): Promise<string>;
suggestAction(instruction: string, screenState: ScreenState): Promise<UIAction>;
verifyCondition(condition: string, screenState: ScreenState): Promise<{
success: boolean;
reason?: string;
}>;
cleanup(): Promise<void>;
}