mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(fix:edit-query)delete following queries
This commit is contained in:
@@ -130,6 +130,18 @@ def save_conversation(conversation_id, question, response, source_log_docs, llm,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
##remove following queries from the array
|
||||||
|
conversations_collection.update_one(
|
||||||
|
{"_id": ObjectId(conversation_id), f"queries.{index}": {"$exists": True}},
|
||||||
|
{
|
||||||
|
"$push":{
|
||||||
|
"queries":{
|
||||||
|
"$each":[],
|
||||||
|
"$slice":index+1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
elif conversation_id is not None and conversation_id != "None":
|
elif conversation_id is not None and conversation_id != "None":
|
||||||
conversations_collection.update_one(
|
conversations_collection.update_one(
|
||||||
{"_id": ObjectId(conversation_id)},
|
{"_id": ObjectId(conversation_id)},
|
||||||
|
|||||||
@@ -337,9 +337,7 @@ const ConversationBubble = forwardRef<
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<code className="whitespace-pre-line" {...props}>
|
<code className="whitespace-pre-line">{children}</code>
|
||||||
{children}
|
|
||||||
</code>
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
ul({ children }) {
|
ul({ children }) {
|
||||||
|
|||||||
@@ -173,7 +173,10 @@ export const conversationSlice = createSlice({
|
|||||||
state,
|
state,
|
||||||
action: PayloadAction<{ index: number; prompt: string; query?: Query }>,
|
action: PayloadAction<{ index: number; prompt: string; query?: Query }>,
|
||||||
) {
|
) {
|
||||||
state.queries[action.payload.index] = action.payload;
|
state.queries = [
|
||||||
|
...state.queries.splice(0, action.payload.index),
|
||||||
|
action.payload,
|
||||||
|
];
|
||||||
},
|
},
|
||||||
updateStreamingQuery(
|
updateStreamingQuery(
|
||||||
state,
|
state,
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const Documents: React.FC<DocumentsProps> = ({
|
|||||||
setSortField(newSortField);
|
setSortField(newSortField);
|
||||||
setSortOrder(newSortOrder);
|
setSortOrder(newSortOrder);
|
||||||
}
|
}
|
||||||
|
setLoading(true);
|
||||||
getDocsWithPagination(
|
getDocsWithPagination(
|
||||||
newSortField,
|
newSortField,
|
||||||
newSortOrder,
|
newSortOrder,
|
||||||
|
|||||||
Reference in New Issue
Block a user