|
@ -6,8 +6,7 @@ from deepsearcher.utils.message_stream import send_info, send_answer |
|
|
from deepsearcher.vector_db import RetrievalResult |
|
|
from deepsearcher.vector_db import RetrievalResult |
|
|
from deepsearcher.vector_db.base import BaseVectorDB, deduplicate |
|
|
from deepsearcher.vector_db.base import BaseVectorDB, deduplicate |
|
|
from collections import defaultdict |
|
|
from collections import defaultdict |
|
|
import os |
|
|
from pathlib import Path |
|
|
import urllib.parse |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -435,7 +434,7 @@ class DeepSearch(BaseAgent): |
|
|
print(formated_chunk) |
|
|
print(formated_chunk) |
|
|
formated_chunks.append(formated_chunk) |
|
|
formated_chunks.append(formated_chunk) |
|
|
chunk_count += len(ref_dict[reference]) |
|
|
chunk_count += len(ref_dict[reference]) |
|
|
formated_refs.append(f"[^{i + 1}]: " + str(urllib.parse.quote_plus('file://' + str(os.path.abspath(reference)))) + "\n") |
|
|
formated_refs.append(f"[^{i + 1}]: " + Path(str(Path(reference).resolve())).as_uri() + "\n") |
|
|
formated_chunks = "".join(formated_chunks) |
|
|
formated_chunks = "".join(formated_chunks) |
|
|
formated_refs = "".join(formated_refs) |
|
|
formated_refs = "".join(formated_refs) |
|
|
return formated_chunks, formated_refs |
|
|
return formated_chunks, formated_refs |
|
|