UNPKG

@just-every/task

Version:

Task - A Thoughtful Task Loop

90 lines 2.33 kB
/** * Test utilities for Mind tests * Simplifies mocking of ensemble's request */ export interface MockToolCall { name: string; arguments: Record<string, any>; } export interface MockResponse { message?: string; toolCalls?: MockToolCall[]; error?: Error; } /** * Creates a mock request implementation for ensembleRequest */ export declare function createMockEnhancedRequest(responses: MockResponse | MockResponse[]): import("vitest").Mock<(_messages: any, agent: any) => AsyncGenerator<{ type: string; content: string; tool_calls?: undefined; } | { type: string; tool_calls: { id: string; type: "function"; function: { name: string; arguments: string; }; }[]; content?: undefined; }, void, unknown>>; /** * Creates a simple success response mock */ export declare function mockSuccessResponse(message?: string, result?: string): import("vitest").Mock<(_messages: any, agent: any) => AsyncGenerator<{ type: string; content: string; tool_calls?: undefined; } | { type: string; tool_calls: { id: string; type: "function"; function: { name: string; arguments: string; }; }[]; content?: undefined; }, void, unknown>>; /** * Creates a simple error response mock */ export declare function mockErrorResponse(message?: string, error?: string): import("vitest").Mock<(_messages: any, agent: any) => AsyncGenerator<{ type: string; content: string; tool_calls?: undefined; } | { type: string; tool_calls: { id: string; type: "function"; function: { name: string; arguments: string; }; }[]; content?: undefined; }, void, unknown>>; /** * Creates a mock that throws an error */ export declare function mockThrowingResponse(error: Error | string): import("vitest").Mock<(_messages: any, agent: any) => AsyncGenerator<{ type: string; content: string; tool_calls?: undefined; } | { type: string; tool_calls: { id: string; type: "function"; function: { name: string; arguments: string; }; }[]; content?: undefined; }, void, unknown>>; //# sourceMappingURL=test-utils.d.ts.map