mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-06-12 19:55:17 +02:00
fix(filesystem): label semantic search paths in cli output
This commit is contained in:
parent
7104602a70
commit
4a158f9e5f
2 changed files with 3 additions and 2 deletions
|
|
@ -1204,7 +1204,7 @@ class PIFSCommandExecutor:
|
|||
return f"# no matches for: {data.get('query', '')}"
|
||||
lines: list[str] = []
|
||||
for item in data.get("data", []):
|
||||
lines.append(str(item.get("path") or "-"))
|
||||
lines.append(f"path: {item.get('path') or '-'}")
|
||||
lines.append(f"summary: {self._one_line_value(item.get('summary') or '')}")
|
||||
if "entity" in item:
|
||||
lines.append(f"entity: {self._one_line_value(item.get('entity') or '')}")
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ def test_semantic_search_scope_keeps_ordinary_folders_out_of_source_type_filters
|
|||
|
||||
executor.json_output = False
|
||||
rendered = executor.execute('search-summary "Federal Reserve annual report" /documents')
|
||||
assert "/documents/report.pdf" in rendered
|
||||
assert "path: /documents/report.pdf" in rendered
|
||||
assert "summary: Federal Reserve annual report summary" in rendered
|
||||
assert "line_text: 1: Federal Reserve supervision and regulation annual report." in rendered
|
||||
assert "id=dsid_report" not in rendered
|
||||
|
|
@ -150,6 +150,7 @@ def test_entity_relation_search_return_minimal_fields_with_summary(tmp_path):
|
|||
|
||||
executor.json_output = False
|
||||
rendered = executor.execute('search-entity "Federal Reserve" /documents')
|
||||
assert "path: /documents/market-note.pdf" in rendered
|
||||
assert "summary: Risk and compliance summary" in rendered
|
||||
assert "entity: Federal Reserve; Disney" in rendered
|
||||
assert "file_ref=" not in rendered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue