()
| 93 | } |
| 94 | |
| 95 | function getOpenAIModel(): OpenAIChatModel { |
| 96 | const configuredModel = process.env.OPENAI_MODEL ?? DEFAULT_OPENAI_MODEL |
| 97 | if (!isOpenAIChatModel(configuredModel)) { |
| 98 | throw new Error( |
| 99 | `OPENAI_MODEL must be one of the known @tanstack/ai-openai chat models. Received: ${configuredModel}`, |
| 100 | ) |
| 101 | } |
| 102 | return configuredModel |
| 103 | } |
| 104 | |
| 105 | function requireOpenAIApiKey(): string { |
| 106 | const apiKey = process.env.OPENAI_API_KEY |
no test coverage detected