in demo-javascript/code/azure-search-vector-sample.js [88:94]
function createOpenAiClient(defaultCredential) {
const openAiEndpoint = process.env.AZURE_OPENAI_ENDPOINT;
const openAiKey = process.env.AZURE_OPENAI_KEY;
let credential = !openAiKey || openAiKey.trim() == '' ?
defaultCredential : new AzureKeyCredential(openAiKey);
return new OpenAIClient(openAiEndpoint, credential);
}