mirror of
https://github.com/StanGirard/quivr.git
synced 2024-09-11 13:15:41 +03:00
fix: 🐛 brain
changes when selected
This commit is contained in:
parent
29aea3457f
commit
3375c0f0b9
@ -72,11 +72,18 @@ class BrainfulChat(ChatInterface):
|
||||
history = chat_service.get_chat_history(chat_id)
|
||||
if history:
|
||||
question = history[0].user_message
|
||||
list_brains = vector_store.find_brain_closest_query(user_id, question)
|
||||
if list_brains:
|
||||
brain_id_to_use = list_brains[0]["id"]
|
||||
brain_id_to_use = history[0].brain_id
|
||||
|
||||
list_brains = []
|
||||
if history:
|
||||
list_brains = vector_store.find_brain_closest_query(user_id, question)
|
||||
metadata["close_brains"] = list_brains
|
||||
else:
|
||||
brain_id_to_use = None
|
||||
list_brains = vector_store.find_brain_closest_query(user_id, question)
|
||||
if list_brains:
|
||||
brain_id_to_use = list_brains[0]["id"]
|
||||
else:
|
||||
brain_id_to_use = None
|
||||
# Add to metadata close_brains and close_brains_similarity
|
||||
metadata["close_brains"] = list_brains
|
||||
|
||||
|
@ -20,7 +20,7 @@ export const SearchBar = (): JSX.Element => {
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentBrainId(null);
|
||||
});
|
||||
}, [setCurrentBrainId]);
|
||||
|
||||
const submit = async (): Promise<void> => {
|
||||
setSearching(true);
|
||||
|
Loading…
Reference in New Issue
Block a user