Skip to content

feat: ergonomic EverOS client wrapper - #11

Merged
dani1005 merged 1 commit into
v1from
feat/v1-ergonomic-client
Jul 31, 2026
Merged

feat: ergonomic EverOS client wrapper#11
dani1005 merged 1 commit into
v1from
feat/v1-ergonomic-client

Conversation

@dani1005

Copy link
Copy Markdown
Collaborator

Adds a thin, hand-maintained ergonomic facade over the generated MemoryApi / StorageApi, so users get from everos_cloud import EverOS with plain kwargs/dicts instead of assembling typed models by hand.

from everos_cloud import EverOS

with EverOS(api_key="sk-...") as client:
    client.add(session_id="s1", messages=[{"role": "user", "content": "I love hiking"}])
    hits = client.search("outdoor hobbies")
    key = client.upload("photo.jpg")     # presign + direct-to-S3, returns object_key

What's in it

  • everos_cloud/client.pyEverOS with add / search / get / flush / edit / delete, end-to-end upload() (presign + S3 POST) and presign(), plus close() / context-manager.
    • Unified EverOSError hierarchy (EverOSAPIError wraps the SDK's ApiException; EverOSStorageError).
    • Default request timeout (60s, configurable) on every call.
    • flush uses a getattr fallback, so it keeps working across the flush_api_v2_memory_flush_postflush_memory rename.
    • Low-level client.memory / client.storage stay exposed as escape hatches.
  • everos_cloud/__init__.py — exports EverOS (guarded try/except so the factory's bare generated tree, which has no client.py, still imports).
  • tests/test_client.py — 18 offline unit tests (API layer mocked).
  • ci.yml — runs the wrapper tests and asserts the top-level EverOS export.

Validation

  • 18 unit tests green.
  • Direct-to-S3 upload mechanics verified against real S3 (HTTP 204, including the presigned Content-Type policy condition) via the storage sign endpoint.
  • A real close() bug (the generated ApiClient has no .close()) was caught by live testing and fixed.
  • ⏳ Pending: a live v2 memory round-trip (add→flush→search returning 2xx) — blocked because available test accounts are v1-only (v2 returns VERSION_NOT_ALLOWED). Low residual risk; will smoke once a v2 account exists.

Requires factory change

client.py and tests/ are hand-maintained; the SDK factory must preserve them across regeneration and keep the __init__ export. Companion factory MR to follow.

🤖 Generated with Claude Code

Hand-maintained facade over the generated MemoryApi/StorageApi — plain
kwargs/dicts in, response .data out — exported as `from everos_cloud import EverOS`.

- everos_cloud/client.py: EverOS with add/search/get/flush/edit/delete +
  end-to-end upload() (presign + direct-to-S3) and presign(); unified
  EverOSError hierarchy; default request timeout; flush getattr-fallback so
  it survives the flush_api_v2_memory_flush_post -> flush_memory rename.
- everos_cloud/__init__.py: export EverOS (guarded try/except so a bare
  generated tree without client.py still imports).
- tests/test_client.py: 18 offline unit tests (API layer mocked).
- ci.yml: run the wrapper tests + assert the top-level EverOS export.

Validated: 18 unit tests green; the direct-to-S3 upload mechanics verified
against real S3 (204, incl. the presigned Content-Type condition) via the
storage sign endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dani1005
dani1005 merged commit 60a0755 into v1 Jul 31, 2026
1 check passed
@dani1005
dani1005 deleted the feat/v1-ergonomic-client branch July 31, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant