Hi It is VMS
Yes, Agreed with Shivaprasad's inputs
Found the code snippet in chat.js
body = JSON.stringify({
dataSources: dataSources,
messages: messages,
stream: true
})
}
Can be replaced with
let body = JSON.stringify({
messages: messages,
stream: true,
temperature: 0.7 // or any value between 0 and 2
})
let url = "{AOAIEndpoint}/openai/deployments/{AOAIDeployment}/chat/completions?api-version=2023-06-01-preview".replace("{AOAIEndpoint}", azureOpenAIEndpoint).replace("{AOAIDeployment}", azureOpenAIDeploymentName)
let body = JSON.stringify({
messages: messages,
stream: true
})
if (dataSources.length > 0) {
url = "{AOAIEndpoint}/openai/deployments/{AOAIDeployment}/extensions/chat/completions?api-version=2023-06-01-preview".replace("{AOAIEndpoint}", azureOpenAIEndpoint).replace("{AOAIDeployment}", azureOpenAIDeploymentName)
body = JSON.stringify({
dataSources: dataSources,
messages: messages,
stream: true
})
}
let assistantReply = ''
let toolContent = ''
let spokenSentence = ''
let displaySentence = ''
fetch(url, {
method: 'POST',
headers: {
'api-key': azureOpenAIApiKey,
'Content-Type': 'application/json'
},
body: body
})
Hope it helps.
Thank you.