()
| 75 | } |
| 76 | |
| 77 | async function getApiKey() { |
| 78 | try { |
| 79 | const apiKey = await readFile("./ai-api.key", "utf8"); |
| 80 | return apiKey; |
| 81 | } catch (error) { |
| 82 | console.error( |
| 83 | "Error reading API key, please create 'ai-api.key' file, and put your API key in it." |
| 84 | ); |
| 85 | process.exit(1); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Translate a list of texts to a target language |
no test coverage detected