Prefer node-fetch instead of native
| @@ -1,4 +1,5 @@ | |||
| 1 | import express from 'express'; | 1 | import express from 'express'; |
| 2 | import fetch from 'node-fetch'; | ||
| 2 | 3 | ||
| 3 | export const router = express.Router(); | 4 | export const router = express.Router(); |
| 4 | const API_OPENROUTER = 'https://openrouter.ai/api/v1'; | 5 | const API_OPENROUTER = 'https://openrouter.ai/api/v1'; |
| @@ -3,6 +3,7 @@ import path from 'node:path'; | |||
| 3 | import { Buffer } from 'node:buffer'; | 3 | import { Buffer } from 'node:buffer'; |
| 4 | 4 | ||
| 5 | import express from 'express'; | 5 | import express from 'express'; |
| 6 | import fetch from 'node-fetch'; | ||
| 6 | import { sync as writeFileAtomicSync } from 'write-file-atomic'; | 7 | import { sync as writeFileAtomicSync } from 'write-file-atomic'; |
| 7 | 8 | ||
| 8 | import { Tokenizer } from '@agnai/web-tokenizers'; | 9 | import { Tokenizer } from '@agnai/web-tokenizers'; |