memwal 0.1.12.dev0__tar.gz → 0.1.12.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/CHANGELOG.md +1 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/PKG-INFO +4 -4
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/README.md +3 -3
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/__init__.py +1 -1
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/client.py +4 -4
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/middleware.py +2 -2
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/types.py +12 -12
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/pyproject.toml +1 -1
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_client.py +4 -3
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_env_presets.py +5 -6
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/.gitignore +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/examples/.env.example +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/examples/.gitignore +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/examples/async_remember_demo.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/examples/interactive_demo.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/examples/verify_credentials.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/compatibility.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/mock.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/memwal/utils.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/notebooks/walrus_memory_python_sdk.ipynb +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/run_tests.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/__init__.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_auth_rejected_message.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_blank_text.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_integration.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_list_namespaces.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_middleware.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_mock.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_normalize_server_url.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_polling_delay.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_recall_weights.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_remember_derived_key.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_retry_after_http_date.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_signing.py +0 -0
- {memwal-0.1.12.dev0 → memwal-0.1.12.dev1}/tests/test_transport_retry.py +0 -0
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
- The default `server_url` is `https://relayer.memory.walrus.xyz`, matching the TypeScript SDK. `env="local"` still selects `http://127.0.0.1:8000`. (#1064)
|
|
13
14
|
- `remember` derives an idempotency key from the namespace and text inside a 30-minute bucket, matching the TypeScript SDK. A retry inside that window reuses the job. An explicit `idempotency_key` still wins. `remember_bulk_async` still sends no key. (#1094)
|
|
14
15
|
- `get_remember_status` and `wait_for_remember_job` reject a job id outside `[A-Za-z0-9_-]+` before the request. `.`, `..`, a backslash, and encoded dot-dot used to pass a denylist and be rewritten after signing. An empty id used to call `GET /api/remember/` and raise `json.JSONDecodeError`. An unparseable 404 is `not_found` / `MemWalRememberJobNotFound`, not a JSON error. `uuid.UUID` is coerced with `str()`. Valid UUID job ids are unchanged. (WALM-833, #1100, #1216)
|
|
15
16
|
- `remember`, `remember_bulk`, `analyze`, and `embed` reject whitespace-only text before the request. A blank body used to be accepted and then sit until the caller timed out. (#1129)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: memwal
|
|
3
|
-
Version: 0.1.12.
|
|
3
|
+
Version: 0.1.12.dev1
|
|
4
4
|
Summary: Python SDK for Walrus Memory — Privacy-first AI memory with Ed25519 signing
|
|
5
5
|
Project-URL: Homepage, https://memory.walrus.xyz
|
|
6
6
|
Project-URL: Documentation, https://memory.walrus.xyz
|
|
@@ -179,9 +179,9 @@ memwal = MemWal.create(
|
|
|
179
179
|
| `dev` | `https://relayer.dev.memwal.ai` |
|
|
180
180
|
| `staging` | `https://relayer-staging.memory.walrus.xyz` |
|
|
181
181
|
|
|
182
|
-
Precedence:
|
|
183
|
-
|
|
184
|
-
by `MemWalSync.create`, `with_memwal_langchain`, and `with_memwal_openai`.
|
|
182
|
+
Precedence: any explicit **`server_url` wins over `env`**, including the hosted
|
|
183
|
+
default. `env` applies only when `server_url` is omitted (`None`). An unknown
|
|
184
|
+
preset raises `ValueError`. `env` is also accepted by `MemWalSync.create`, `with_memwal_langchain`, and `with_memwal_openai`.
|
|
185
185
|
|
|
186
186
|
## AI Middleware
|
|
187
187
|
|
|
@@ -140,9 +140,9 @@ memwal = MemWal.create(
|
|
|
140
140
|
| `dev` | `https://relayer.dev.memwal.ai` |
|
|
141
141
|
| `staging` | `https://relayer-staging.memory.walrus.xyz` |
|
|
142
142
|
|
|
143
|
-
Precedence:
|
|
144
|
-
|
|
145
|
-
by `MemWalSync.create`, `with_memwal_langchain`, and `with_memwal_openai`.
|
|
143
|
+
Precedence: any explicit **`server_url` wins over `env`**, including the hosted
|
|
144
|
+
default. `env` applies only when `server_url` is omitted (`None`). An unknown
|
|
145
|
+
preset raises `ValueError`. `env` is also accepted by `MemWalSync.create`, `with_memwal_langchain`, and `with_memwal_openai`.
|
|
146
146
|
|
|
147
147
|
## AI Middleware
|
|
148
148
|
|
|
@@ -440,7 +440,7 @@ class MemWal:
|
|
|
440
440
|
cls,
|
|
441
441
|
key: str,
|
|
442
442
|
account_id: str,
|
|
443
|
-
server_url: str =
|
|
443
|
+
server_url: Optional[str] = None,
|
|
444
444
|
namespace: str = "default",
|
|
445
445
|
env: Optional[str] = None,
|
|
446
446
|
) -> "MemWal":
|
|
@@ -449,11 +449,11 @@ class MemWal:
|
|
|
449
449
|
Args:
|
|
450
450
|
key: Ed25519 private key hex string (the delegate key).
|
|
451
451
|
account_id: Walrus Memory account object ID on Sui.
|
|
452
|
-
server_url: Server URL (default: ``
|
|
452
|
+
server_url: Server URL (default: ``https://relayer.memory.walrus.xyz``).
|
|
453
453
|
namespace: Default namespace for memory isolation (default: ``"default"``).
|
|
454
454
|
env: Optional relayer preset — ``"prod"``, ``"dev"``, ``"staging"``,
|
|
455
455
|
or ``"local"``. Resolves ``server_url`` to the matching hosted
|
|
456
|
-
relayer unless an explicit
|
|
456
|
+
relayer unless an explicit ``server_url`` is given.
|
|
457
457
|
Precedence: explicit ``server_url`` > ``env`` > default.
|
|
458
458
|
|
|
459
459
|
Returns:
|
|
@@ -2008,7 +2008,7 @@ class MemWalSync:
|
|
|
2008
2008
|
cls,
|
|
2009
2009
|
key: str,
|
|
2010
2010
|
account_id: str,
|
|
2011
|
-
server_url: str =
|
|
2011
|
+
server_url: Optional[str] = None,
|
|
2012
2012
|
namespace: str = "default",
|
|
2013
2013
|
env: Optional[str] = None,
|
|
2014
2014
|
) -> "MemWalSync":
|
|
@@ -412,7 +412,7 @@ def with_memwal_langchain(
|
|
|
412
412
|
llm: "BaseChatModel",
|
|
413
413
|
key: str,
|
|
414
414
|
account_id: str,
|
|
415
|
-
server_url: str =
|
|
415
|
+
server_url: Optional[str] = None,
|
|
416
416
|
namespace: str = "default",
|
|
417
417
|
max_memories: int = 5,
|
|
418
418
|
auto_save: bool = True,
|
|
@@ -600,7 +600,7 @@ def with_memwal_openai(
|
|
|
600
600
|
client: Any,
|
|
601
601
|
key: str,
|
|
602
602
|
account_id: str,
|
|
603
|
-
server_url: str =
|
|
603
|
+
server_url: Optional[str] = None,
|
|
604
604
|
namespace: str = "default",
|
|
605
605
|
max_memories: int = 5,
|
|
606
606
|
auto_save: bool = True,
|
|
@@ -16,9 +16,9 @@ from typing import Any, Dict, List, Optional
|
|
|
16
16
|
# ============================================================
|
|
17
17
|
|
|
18
18
|
#: Default ``server_url`` when neither an explicit URL nor an ``env`` preset
|
|
19
|
-
#: is supplied.
|
|
20
|
-
#:
|
|
21
|
-
DEFAULT_SERVER_URL = "
|
|
19
|
+
#: is supplied. ``None`` means the caller omitted it. An explicit URL, including
|
|
20
|
+
#: this hosted default, wins over ``env``.
|
|
21
|
+
DEFAULT_SERVER_URL = "https://relayer.memory.walrus.xyz"
|
|
22
22
|
|
|
23
23
|
#: Named relayer environments for the public Walrus Memory deployments.
|
|
24
24
|
ENV_PRESETS = {
|
|
@@ -37,18 +37,18 @@ class MemWalConfig:
|
|
|
37
37
|
key: Ed25519 private key (hex string). This is the delegate key from the
|
|
38
38
|
Walrus Memory dashboard.
|
|
39
39
|
account_id: Walrus Memory account object ID on Sui.
|
|
40
|
-
server_url: Server URL
|
|
41
|
-
|
|
40
|
+
server_url: Server URL. ``None`` means omitted. Any explicit URL,
|
|
41
|
+
including the hosted default, wins over ``env``.
|
|
42
42
|
namespace: Default namespace for memory isolation (default: "default").
|
|
43
43
|
env: Optional relayer preset — one of ``"prod"``, ``"dev"``,
|
|
44
|
-
``"staging"``, ``"local"``.
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
``"staging"``, ``"local"``. Used only when ``server_url`` is
|
|
45
|
+
omitted (``None``). Precedence: explicit ``server_url`` > ``env``
|
|
46
|
+
> ``DEFAULT_SERVER_URL``.
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
key: str
|
|
50
50
|
account_id: str
|
|
51
|
-
server_url: str =
|
|
51
|
+
server_url: Optional[str] = None
|
|
52
52
|
namespace: str = "default"
|
|
53
53
|
env: Optional[str] = None
|
|
54
54
|
|
|
@@ -60,10 +60,10 @@ class MemWalConfig:
|
|
|
60
60
|
raise ValueError(
|
|
61
61
|
f"Unknown env preset {self.env!r}. Valid presets: {valid}"
|
|
62
62
|
)
|
|
63
|
-
|
|
64
|
-
# preset; only fill from the preset when server_url is untouched.
|
|
65
|
-
if self.server_url == DEFAULT_SERVER_URL:
|
|
63
|
+
if self.server_url is None:
|
|
66
64
|
self.server_url = preset
|
|
65
|
+
if self.server_url is None:
|
|
66
|
+
self.server_url = DEFAULT_SERVER_URL
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
# ============================================================
|
|
@@ -508,9 +508,10 @@ class TestBulkWaitUnderRateLimit:
|
|
|
508
508
|
start = time.monotonic()
|
|
509
509
|
|
|
510
510
|
async def probe_answers(job_ids: Sequence[str]) -> RememberBulkStatusResult:
|
|
511
|
-
#
|
|
512
|
-
# the
|
|
513
|
-
|
|
511
|
+
# Refuse during the wait. The confirming read runs after the
|
|
512
|
+
# 250ms deadline, so the refusal window has to end before that
|
|
513
|
+
# or a slow CI clock still counts the probe as a refusal.
|
|
514
|
+
if time.monotonic() - start < 0.20:
|
|
514
515
|
raise _HttpStatusError(429, "{}")
|
|
515
516
|
return RememberBulkStatusResult(
|
|
516
517
|
results=[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Tests for the relayer environment presets (prod/dev/staging/local).
|
|
2
2
|
|
|
3
|
-
Pure config resolution — no network.
|
|
4
|
-
|
|
3
|
+
Pure config resolution — no network. Any explicit ``server_url`` wins,
|
|
4
|
+
including the hosted default. ``env`` applies only when ``server_url`` is ``None``.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
@@ -41,6 +41,7 @@ def test_explicit_server_url_overrides_env():
|
|
|
41
41
|
|
|
42
42
|
def test_no_env_keeps_default():
|
|
43
43
|
cfg = MemWalConfig(key=KEY, account_id=ACCOUNT)
|
|
44
|
+
assert cfg.server_url == "https://relayer.memory.walrus.xyz"
|
|
44
45
|
assert cfg.server_url == DEFAULT_SERVER_URL
|
|
45
46
|
|
|
46
47
|
|
|
@@ -59,13 +60,11 @@ def test_sync_create_threads_env_through():
|
|
|
59
60
|
assert client._inner._server_url == "https://relayer.memory.walrus.xyz"
|
|
60
61
|
|
|
61
62
|
|
|
62
|
-
def
|
|
63
|
-
# Passing the default URL explicitly is indistinguishable from not
|
|
64
|
-
# passing it — documented edge: the preset still applies.
|
|
63
|
+
def test_explicit_hosted_url_wins_over_env():
|
|
65
64
|
cfg = MemWalConfig(
|
|
66
65
|
key=KEY,
|
|
67
66
|
account_id=ACCOUNT,
|
|
68
67
|
server_url=DEFAULT_SERVER_URL,
|
|
69
|
-
env="
|
|
68
|
+
env="local",
|
|
70
69
|
)
|
|
71
70
|
assert cfg.server_url == "https://relayer.memory.walrus.xyz"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|