Skip to content

Commit 551931d

Browse files
authored
fix: backend environment variable trumps default (#165)
1 parent e22b5b0 commit 551931d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/deepset_mcp/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def main(
9696
),
9797
] = TransportEnum.STDIO,
9898
object_store_backend: Annotated[
99-
str,
99+
str | None,
100100
typer.Option(
101101
"--object-store-backend",
102102
help="Object store backend type: 'memory' or 'redis'. "
103-
"Can also be set via DEEPSET_OBJECT_STORE_BACKEND environment variable.",
103+
"Can also be set via DEEPSET_OBJECT_STORE_BACKEND environment variable. Default is 'memory'.",
104104
),
105-
] = "memory",
105+
] = None,
106106
redis_url: Annotated[
107107
str | None,
108108
typer.Option(
@@ -153,7 +153,7 @@ def main(
153153
docs_share_url = docs_share_url or os.getenv("DEEPSET_DOCS_SHARE_URL", DEEPSET_DOCS_DEFAULT_SHARE_URL)
154154

155155
# ObjectStore configuration
156-
backend = object_store_backend or os.getenv("DEEPSET_OBJECT_STORE_BACKEND", "memory")
156+
backend = str(object_store_backend or os.getenv("DEEPSET_OBJECT_STORE_BACKEND", "memory"))
157157
redis_url = redis_url or os.getenv("DEEPSET_REDIS_URL")
158158
ttl = int(os.getenv("DEEPSET_OBJECT_STORE_TTL", str(object_store_ttl)))
159159

src/deepset_mcp/tools/tokonomics/explorer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ def _make_header(self, obj_id: str, path: str, obj: Any) -> str:
288288
if hasattr(obj, "__module__") and obj.__module__ not in ("builtins", "__main__"):
289289
type_name = f"{obj.__module__}.{type_name}"
290290

291-
location = f"@{obj_id}" + (f".{path}" if path else "")
291+
location = "@" if not obj_id.startswith("@") else ""
292+
location += obj_id + (f".{path}" if path else "")
292293

293294
# Add size info for sized objects
294295
size_info = ""

0 commit comments

Comments
 (0)