update ChatGPT-App with new ChatGPT-3.5-Turbo API

This commit is contained in:
João Mendes 2023-03-02 19:33:52 +00:00
parent 5dd0a074a0
commit a27cb05c46
2 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ export const useChatGpt = (context: BaseComponentContext, appId: string, AzureFu
const response = await (await client()).post(AzureFunctionUrl, AadHttpClient.configurations.v1, options);
const answer = await response.json();
if (response.status === 200) {
return answer?.choices[0].text;
return answer.choices[0].message.content;
} else {
console.log("[getCompletion] error:", answer);
throw new Error("Error on executing the request, please try again later.");