mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix: load sources on shared conversations
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user