| 1 | // Minimal mock for LLM API (just enough to prevent errors) |
| 2 | export class MockLlmApi { |
| 3 | async chatCompletionStream(): Promise<AsyncIterable<any>> { |
| 4 | return (async function* () { |
| 5 | yield { choices: [{ delta: {}, index: 0, finish_reason: "stop" }] }; |
| 6 | })(); |
| 7 | } |
| 8 | async chatCompletionNonStream() { |
| 9 | throw new Error("Not implemented"); |
| 10 | } |
| 11 | async completionStream() { |
| 12 | throw new Error("Not implemented"); |
| 13 | } |
| 14 | async completionNonStream() { |
| 15 | throw new Error("Not implemented"); |
| 16 | } |
| 17 | async streamChat() { |
| 18 | return this.chatCompletionStream(); |
| 19 | } |
| 20 | async completions() { |
| 21 | throw new Error("Not implemented"); |
| 22 | } |
| 23 | async streamCompletion() { |
| 24 | throw new Error("Not implemented"); |
| 25 | } |
| 26 | async chat() { |
| 27 | throw new Error("Not implemented"); |
| 28 | } |
| 29 | async rerank() { |
| 30 | return { results: [] }; |
| 31 | } |
| 32 | async embed() { |
| 33 | return { data: [], usage: {} }; |
| 34 | } |
| 35 | async fimComplete() { |
| 36 | throw new Error("Not implemented"); |
| 37 | } |
| 38 | } |