From 34fa8f7b424ae119cbbde14c612afa844c564830 Mon Sep 17 00:00:00 2001 From: BukeLy Date: Sun, 31 May 2026 23:43:54 +0800 Subject: [PATCH] refactor(filesystem): inline embedding dimension default --- examples/pifs_demo.py | 2 +- pageindex/filesystem/core.py | 2 +- pageindex/filesystem/embedding_defaults.py | 1 - pageindex/filesystem/hybrid_projection.py | 2 +- pageindex/filesystem/projection_indexing.py | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 pageindex/filesystem/embedding_defaults.py diff --git a/examples/pifs_demo.py b/examples/pifs_demo.py index 413b4a4..87d2d45 100644 --- a/examples/pifs_demo.py +++ b/examples/pifs_demo.py @@ -42,7 +42,7 @@ os.environ.setdefault("LITELLM_LOCAL_MODEL_COST_MAP", "true") from pageindex import PageIndexClient from pageindex.filesystem import MetadataGenerator, PageIndexFileSystem, PIFSCommandExecutor from pageindex.filesystem.agent import run_pifs_agent -from pageindex.filesystem.embedding_defaults import DEFAULT_EMBEDDING_DIMENSIONS +from pageindex.filesystem.core import DEFAULT_EMBEDDING_DIMENSIONS EXAMPLES_DIR = Path(__file__).parent diff --git a/pageindex/filesystem/core.py b/pageindex/filesystem/core.py index 0a8a40a..e7d0a91 100644 --- a/pageindex/filesystem/core.py +++ b/pageindex/filesystem/core.py @@ -16,7 +16,6 @@ from .metadata_generation import ( MetadataGenerationResult, MetadataGenerator, ) -from .embedding_defaults import DEFAULT_EMBEDDING_DIMENSIONS from .store import ( SQLiteFileSystemStore, fingerprint, @@ -70,6 +69,7 @@ PROJECTION_INDEX_STATUSES = { "failed", } +DEFAULT_EMBEDDING_DIMENSIONS = 1024 SEMANTIC_RETRIEVAL_CHANNELS = ("summary", "entity", "relation") SEMANTIC_PROJECTION_INDEX_NAMES = { "summary": "summary_only_vector", diff --git a/pageindex/filesystem/embedding_defaults.py b/pageindex/filesystem/embedding_defaults.py deleted file mode 100644 index b329032..0000000 --- a/pageindex/filesystem/embedding_defaults.py +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_EMBEDDING_DIMENSIONS = 1024 diff --git a/pageindex/filesystem/hybrid_projection.py b/pageindex/filesystem/hybrid_projection.py index 2fa1830..348aa20 100644 --- a/pageindex/filesystem/hybrid_projection.py +++ b/pageindex/filesystem/hybrid_projection.py @@ -10,7 +10,7 @@ from dataclasses import dataclass from pathlib import Path from typing import Any -from .embedding_defaults import DEFAULT_EMBEDDING_DIMENSIONS +from .core import DEFAULT_EMBEDDING_DIMENSIONS from .semantic_index import SQLiteVecSemanticIndex, SemanticIndexError, SemanticSearchResult diff --git a/pageindex/filesystem/projection_indexing.py b/pageindex/filesystem/projection_indexing.py index 06a1a93..3375f41 100644 --- a/pageindex/filesystem/projection_indexing.py +++ b/pageindex/filesystem/projection_indexing.py @@ -3,7 +3,7 @@ from __future__ import annotations from pathlib import Path from typing import Any -from .embedding_defaults import DEFAULT_EMBEDDING_DIMENSIONS +from .core import DEFAULT_EMBEDDING_DIMENSIONS from .hybrid_projection import ( EmbeddingCache, INDEX_BY_CHANNEL,