Skip to content

Commit e6a9a3f

Browse files
authored
Merge pull request #364 from sahilds1/345-add-rag-to-the-chatbot
[#345] Enable chatbot to search bipolar research docs
2 parents 50f7cc5 + 871706f commit e6a9a3f

File tree

9 files changed

+771
-360
lines changed

9 files changed

+771
-360
lines changed

frontend/src/api/apiClient.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,20 @@ const updateConversationTitle = async (
267267
}
268268
};
269269

270+
// Assistant API functions
271+
const sendAssistantMessage = async (message: string, previousResponseId?: string) => {
272+
try {
273+
const response = await api.post(`/v1/api/assistant`, {
274+
message,
275+
previous_response_id: previousResponseId,
276+
});
277+
return response.data;
278+
} catch (error) {
279+
console.error("Error(s) during sendAssistantMessage: ", error);
280+
throw error;
281+
}
282+
};
283+
270284
export {
271285
handleSubmitFeedback,
272286
handleSendDrugSummary,
@@ -279,5 +293,6 @@ export {
279293
updateConversationTitle,
280294
handleSendDrugSummaryStream,
281295
handleSendDrugSummaryStreamLegacy,
282-
fetchRiskDataWithSources
296+
fetchRiskDataWithSources,
297+
sendAssistantMessage
283298
};

0 commit comments

Comments
 (0)