Increase security and reformat
This commit is contained in:
@@ -59,7 +59,11 @@ def retrieve_memories_for_prompt(
|
||||
limit=safe_limit,
|
||||
include_statuses=statuses,
|
||||
)
|
||||
ids = [str(hit.memory_id or "").strip() for hit in hits if str(hit.memory_id or "").strip()]
|
||||
ids = [
|
||||
str(hit.memory_id or "").strip()
|
||||
for hit in hits
|
||||
if str(hit.memory_id or "").strip()
|
||||
]
|
||||
scoped = _base_queryset(
|
||||
user_id=int(user_id),
|
||||
person_id=person_id,
|
||||
@@ -82,11 +86,17 @@ def retrieve_memories_for_prompt(
|
||||
"content": item.content or {},
|
||||
"provenance": item.provenance or {},
|
||||
"confidence_score": float(item.confidence_score or 0.0),
|
||||
"expires_at": item.expires_at.isoformat() if item.expires_at else "",
|
||||
"last_verified_at": (
|
||||
item.last_verified_at.isoformat() if item.last_verified_at else ""
|
||||
"expires_at": (
|
||||
item.expires_at.isoformat() if item.expires_at else ""
|
||||
),
|
||||
"last_verified_at": (
|
||||
item.last_verified_at.isoformat()
|
||||
if item.last_verified_at
|
||||
else ""
|
||||
),
|
||||
"updated_at": (
|
||||
item.updated_at.isoformat() if item.updated_at else ""
|
||||
),
|
||||
"updated_at": item.updated_at.isoformat() if item.updated_at else "",
|
||||
"search_score": float(hit.score or 0.0),
|
||||
"search_summary": str(hit.summary or ""),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user