Skip to content

Commit 9b8cf6c

Browse files
feat: compress context even more to 54k token
1 parent bfb9792 commit 9b8cf6c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/app/services/vcelldb_service.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,16 @@ async def fetch_publications() -> List[dict]:
345345
sanitized_pub.pop('wittid', None)
346346
sanitized_pub.pop('date', None)
347347
sanitized_pub.pop('url', None)
348+
sanitized_pub.pop('pubKey', None)
348349
sanitized_pub.pop('endnoteid', None)
350+
351+
# Clean up author arrays - remove empty strings and combine
352+
authors = pub.get('authors', [])
353+
if authors:
354+
# Remove empty strings and separators, combine into single string
355+
clean_authors = [a.strip() for a in authors if a.strip() and a.strip() not in ['&', ',']]
356+
sanitized_pub['authors'] = ', '.join(clean_authors)
357+
349358
sanitized_publications.append(sanitized_pub)
350359
else:
351360
# If not a dict, keep as is but log warning

0 commit comments

Comments
 (0)