// Mock for ollama-client for testing import type { OllamaMessage, OllamaTool } from '../src/types'; export class OllamaClient { private url: string; private model: string; // Mock fetch function for testing private fetchFn: typeof fetch; constructor(url: string, model: string, fetchFn?: typeof fetch) { this.url = url; this.model = model; this.fetchFn = fetchFn ?? (jest.fn() as typeof fetch); } async *streamChat( _messages: OllamaMessage[], _tools: OllamaTool[] = [] ): AsyncGenerator { // Mock implementation - simulate streaming response const mockMessages: OllamaMessage[] = [ { role: 'assistant', content: 'Part 1', tool_calls: [] }, { role: 'assistant', content: 'Part 2', tool_calls: [] }, ]; for (const message of mockMessages) { yield message; await new Promise((resolve) => setTimeout(resolve, 10)); } } async chat(_messages: OllamaMessage[], _tools: OllamaTool[] = []): Promise { return { role: 'assistant', content: 'Mock response', tool_calls: [], }; } cancelStream(): void { // No-op in mock } }