(apiKey: string, endPoint: string)
| 147 | * @returns An instance of `TypeChatLanguageModel`. |
| 148 | */ |
| 149 | export function createAzureOpenAILanguageModel(apiKey: string, endPoint: string): TypeChatLanguageModel { |
| 150 | const headers = { |
| 151 | // Needed when using managed identity |
| 152 | "Authorization": `Bearer ${apiKey}`, |
| 153 | // Needed when using regular API key |
| 154 | "api-key": apiKey |
| 155 | }; |
| 156 | return createFetchLanguageModel(endPoint, headers, {}); |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Common OpenAI REST API endpoint encapsulation using the fetch API. |
no test coverage detected