Skip to content

[api-sync 2026-07-22] gradientlabs-python: sync to OpenAPI spec - #135

Open
jafrog wants to merge 3 commits into
mainfrom
api-client-sync/2026-07-22
Open

[api-sync 2026-07-22] gradientlabs-python: sync to OpenAPI spec#135
jafrog wants to merge 3 commits into
mainfrom
api-client-sync/2026-07-22

Conversation

@jafrog

@jafrog jafrog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Syncs the Python SDK to the reworked public API. The previously-added (unreleased)
conversation-scoped bulk-upload memories endpoint is replaced by the new
customer-scoped batch-create endpoint.

What changed

  • Removed the old conversation-scoped endpoint: Client.bulk_upload_conversation_memories,
    BulkUploadMemoriesParams, BulkUploadMemoriesResponse, and _conversation_memories_upload.py.
    Gone with it: idempotency_key, created_at_keys, and the upload_id / memories_inserted
    response.

  • Added the new customer-scoped endpoint backing POST /customers/{customer_id}/memories:

    def batch_create_customer_memories(
        self, *, customer_id: str, memories: List[CustomerMemory]
    ) -> None: ...
    • New CustomerMemory dataclass: external_id (str, required), created_at
      (datetime, required), data (Dict[str, Any], required), custom_type (str, optional).
    • The call is asynchronous ("fire and forget") and returns nothing — no upload id
      or inserted count. It surfaces a 409 Conflict through the existing generic error
      handling when a batch is already being created for the same customer.
    • Wire naming is snake_case, matching the rest of the SDK; datetimes are serialised
      via the existing HttpClient.localize helper.
  • Updated the unit test (tests/test_customer_memories_batch_create.py) and the
    examples/memories/run.py example to the new endpoint.

Version stays at 0.13.0 (first release to include this endpoint).

Testing

  • uv run --frozen pytest tests/test_customer_memories_batch_create.py — 2 passed.
  • uv run --frozen ruff check — all checks passed; uv run ruff format clean.
  • The ~4 pre-existing time-based webhook signature tests fail on the untouched base
    (expired hardcoded timestamps) and are unrelated to this change.

jafrog and others added 3 commits July 22, 2026 13:25
Adds POST /conversations/{id}/memories to upload a batch of memories
scoped to a conversation for the agent to search over on demand.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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