* A custom LLM that exposes onTextDelta / onThinkDelta / onToolCallDelta / * onTextPart / onThinkPart so each test can decide what the provider emits.
| 21 | * onTextPart / onThinkPart so each test can decide what the provider emits. |
| 22 | */ |
| 23 | class StreamingLLM implements LLM { |
| 24 | readonly systemPrompt = 'streaming system prompt'; |
| 25 | readonly modelName = 'streaming'; |
| 26 | |
| 27 | readonly responseProvider: (params: LLMChatParams) => Promise<LLMChatResponse>; |
| 28 | |
| 29 | constructor(provider: (params: LLMChatParams) => Promise<LLMChatResponse>) { |
| 30 | this.responseProvider = provider; |
| 31 | } |
| 32 | |
| 33 | async chat(params: LLMChatParams): Promise<LLMChatResponse> { |
| 34 | return this.responseProvider(params); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | async function runWithLLM(llm: LLM): Promise<{ |
| 39 | sink: CollectingSink; |
nothing calls this directly
no outgoing calls
no test coverage detected