fix: load sources on shared conversations

This commit is contained in:
ManishMadan2882
2024-09-11 17:55:31 +05:30
parent 14ab950a6c
commit 919a87bf47
5 changed files with 52 additions and 3 deletions

View File

@@ -190,6 +190,27 @@ export function handleSearch(
.catch((err) => console.log(err));
}
export function handleSearchViaApiKey(
question: string,
api_key: string,
history: Array<any> = [],
) {
history = history.map((item) => {
return { prompt: item.prompt, response: item.response };
});
return conversationService
.search({
question: question,
history: JSON.stringify(history),
api_key: api_key,
})
.then((response) => response.json())
.then((data) => {
return data;
})
.catch((err) => console.log(err));
}
export function handleSendFeedback(
prompt: string,
response: string,