mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
chore: linting
This commit is contained in:
parent
11915df97b
commit
73a57589ac
25 changed files with 184 additions and 181 deletions
|
|
@ -48,10 +48,12 @@ def format_surfsense_docs_results(results: list[tuple]) -> str:
|
|||
"metadata": {"source": doc.source},
|
||||
"chunks": [],
|
||||
}
|
||||
grouped[doc.id]["chunks"].append({
|
||||
"chunk_id": f"doc-{chunk.id}",
|
||||
"content": chunk.content,
|
||||
})
|
||||
grouped[doc.id]["chunks"].append(
|
||||
{
|
||||
"chunk_id": f"doc-{chunk.id}",
|
||||
"content": chunk.content,
|
||||
}
|
||||
)
|
||||
|
||||
# Render XML matching format_documents_for_context structure
|
||||
parts: list[str] = []
|
||||
|
|
@ -70,7 +72,9 @@ def format_surfsense_docs_results(results: list[tuple]) -> str:
|
|||
parts.append("<document_content>")
|
||||
|
||||
for ch in g["chunks"]:
|
||||
parts.append(f" <chunk id='{ch['chunk_id']}'><![CDATA[{ch['content']}]]></chunk>")
|
||||
parts.append(
|
||||
f" <chunk id='{ch['chunk_id']}'><![CDATA[{ch['content']}]]></chunk>"
|
||||
)
|
||||
|
||||
parts.append("</document_content>")
|
||||
parts.append("</document>")
|
||||
|
|
@ -157,4 +161,3 @@ def create_search_surfsense_docs_tool(db_session: AsyncSession):
|
|||
)
|
||||
|
||||
return search_surfsense_docs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue