feat(rag): git-based import sources — BOR_GIT_SOURCES repos cloned (first run, --depth 1) or pulled (--ff-only) into BOR_SOURCES_DIR/<repo>/ then indexed; --source still wins; a failed sync aborts before importing anything
This commit is contained in:
@@ -105,6 +105,15 @@ class Settings(BaseSettings):
|
||||
# via :py:meth:`import_extension_set`. ``mode="after"`` validation runs
|
||||
# against the raw string so a typo fails loudly at startup.
|
||||
import_extensions: str = "md,markdown,txt,yaml,yml,json,py"
|
||||
#: List of git repo URLs to clone/pull into ``sources_dir`` before
|
||||
#: indexing (phase 28); comma-separated, stored raw. Empty means no git
|
||||
#: sources — ``import_docs`` then falls back to ``--source`` / the old
|
||||
#: ``DEFAULT_SOURCES``.
|
||||
git_sources: str = ""
|
||||
#: Where ``import_docs`` clones/pulls the ``git_sources`` repos (phase
|
||||
#: 28). Stored as a raw string — ``Path.expanduser()`` is applied in
|
||||
#: the import script, not here.
|
||||
sources_dir: str = "~/bor-sources"
|
||||
|
||||
@field_validator("import_extensions")
|
||||
@classmethod
|
||||
@@ -139,6 +148,16 @@ class Settings(BaseSettings):
|
||||
if part.strip()
|
||||
)
|
||||
|
||||
@property
|
||||
def git_source_list(self) -> list[str]:
|
||||
"""Non-empty, stripped git URLs from :py:attr:`git_sources` (phase 28).
|
||||
|
||||
Whitespace around each entry is trimmed and empty entries dropped;
|
||||
an unset/empty value yields ``[]`` (the import script then uses its
|
||||
legacy local-directory defaults).
|
||||
"""
|
||||
return [part.strip() for part in self.git_sources.split(",") if part.strip()]
|
||||
|
||||
@property
|
||||
def effective_api_key(self) -> str:
|
||||
"""API key for aipi: explicit setting, then $AIPI_KEY, then a placeholder."""
|
||||
|
||||
Reference in New Issue
Block a user