| 3 | |
| 4 | // Minimal stubs — we only care about the warm-up decision + that complete() fires for local. |
| 5 | function makeRouter(opts: { isLocal: boolean; resolves?: boolean; onComplete?: () => void }) { |
| 6 | return { |
| 7 | resolveModel(_id: string) { |
| 8 | if (opts.resolves === false) return null; |
| 9 | return { |
| 10 | resolvedId: 'test-model', |
| 11 | modelInfo: {} as any, |
| 12 | provider: { |
| 13 | isLocal: opts.isLocal, |
| 14 | async *complete(_req: any) { |
| 15 | opts.onComplete?.(); |
| 16 | yield { type: 'text', text: 'x' } as any; |
| 17 | }, |
| 18 | } as any, |
| 19 | }; |
| 20 | }, |
| 21 | } as any; |
| 22 | } |
| 23 | |
| 24 | const cfg = (model = 'test-model') => ({ defaults: { model } }) as any; |
| 25 | |