mirror of
https://github.com/SillyTavern/SillyTavern-Extras.git
synced 2026-03-02 18:10:04 +00:00
Merge pull request #60 from johnbenac/main
This commit is contained in:
@@ -809,7 +809,7 @@ def chromadb_export():
|
||||
ids = collection_content.get('ids', [])
|
||||
metadatas = collection_content.get('metadatas', [])
|
||||
|
||||
content = [
|
||||
unsorted_content = [
|
||||
{
|
||||
"id": ids[i],
|
||||
"metadata": metadatas[i],
|
||||
@@ -817,13 +817,14 @@ def chromadb_export():
|
||||
}
|
||||
for i in range(len(ids))
|
||||
]
|
||||
|
||||
sorted_content = sorted(unsorted_content, key=lambda x: x['metadata']['date'])
|
||||
|
||||
export = {
|
||||
"chat_id": data["chat_id"],
|
||||
"content": content
|
||||
"chat_id": data["chat_id"],
|
||||
"content": sorted_content
|
||||
}
|
||||
|
||||
|
||||
return jsonify(export)
|
||||
|
||||
@app.route("/api/chromadb/import", methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user