fix for sending sources + azure embeddings issue

This commit is contained in:
Alex
2023-06-15 11:35:21 +01:00
parent 39024ce2ac
commit 94cc18bd71
6 changed files with 20 additions and 24 deletions

View File

@@ -28,6 +28,10 @@ export function fetchAnswerApi(
selectedDocs.model +
'/';
}
//in history array remove all keys except prompt and response
history = history.map((item) => {
return { prompt: item.prompt, response: item.response };
});
return fetch(apiHost + '/api/answer', {
method: 'POST',
@@ -82,6 +86,10 @@ export function fetchAnswerSteaming(
'/';
}
history = history.map((item) => {
return { prompt: item.prompt, response: item.response };
});
return new Promise<Answer>((resolve, reject) => {
const url = new URL(apiHost + '/stream');
url.searchParams.append('question', question);