mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
add property sync and etc ... to align with original source
This commit is contained in:
@@ -465,10 +465,17 @@ class PaginatedSources(Resource):
|
|||||||
|
|
||||||
paginated_docs = []
|
paginated_docs = []
|
||||||
for doc in documents:
|
for doc in documents:
|
||||||
print(doc)
|
doc_data = {
|
||||||
doc["id"] = str(doc["_id"])
|
"id": str(doc["_id"]),
|
||||||
del doc["_id"]
|
"name": doc.get("name", ""),
|
||||||
paginated_docs.append(doc)
|
"date": doc.get("date", ""),
|
||||||
|
"model": settings.EMBEDDINGS_NAME,
|
||||||
|
"location": "local",
|
||||||
|
"tokens": doc.get("tokens", ""),
|
||||||
|
"retriever": doc.get("retriever", "classic"),
|
||||||
|
"syncFrequency": doc.get("sync_frequency", ""),
|
||||||
|
}
|
||||||
|
paginated_docs.append(doc_data)
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
"total": total_documents,
|
"total": total_documents,
|
||||||
@@ -499,9 +506,7 @@ class CombinedJson(Resource):
|
|||||||
]
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for index in sources_collection.find({"user": user}).sort(
|
for index in sources_collection.find({"user": user}).sort("date", -1):
|
||||||
"date", -1
|
|
||||||
):
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"id": str(index["_id"]),
|
"id": str(index["_id"]),
|
||||||
|
|||||||
Reference in New Issue
Block a user