Skip to content

[api-sync 2026-07-22] gradientlabs-dotnet: sync to OpenAPI spec - #11

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

[api-sync 2026-07-22] gradientlabs-dotnet: sync to OpenAPI spec#11
jafrog wants to merge 4 commits into
mainfrom
api-client-sync/2026-07-22

Conversation

@jafrog

@jafrog jafrog commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Adds Customers.BatchCreateMemoriesAsync to the Integration client for batch-creating customer-scoped memories that the agent can search over on demand.

Task BatchCreateMemoriesAsync(
    string customerId,
    BatchCreateMemoriesRequest request,
    CancellationToken cancellationToken = default)
  • Endpoint: POST /customers/{customer_id}/memories (Integration role).
  • Customer-scoped, not conversation-scoped — the path param is the customer id.
  • Request (BatchCreateMemoriesRequest): Memories, a non-empty IReadOnlyList<Memory>. Each Memory carries:
    • ExternalId (required, wire external_id) — the caller's own id for the memory
    • CustomType (optional, wire custom_type, omitted when null) — free-form label
    • CreatedAt (required, wire created_at) — RFC3339 timestamp
    • Data (required, JsonElement, wire data) — arbitrary JSON object stored verbatim
  • Response: none. The call is asynchronous (fire-and-forget) and returns a plain Task with no body — it does not return an upload id or an inserted count.
  • Errors: propagated through the existing GradientLabsApiException. In particular the endpoint returns 409 Conflict when a batch is already being created for the same customer; no special client handling is needed beyond the generic error propagation.

Why the rework

This PR previously added the conversation-scoped bulk-upload endpoint (Conversations.BulkUploadMemoriesAsync, BulkUploadMemoriesRequest/BulkUploadMemoriesResponse, with idempotency_key / *_keys fields and an upload_id / memories_inserted response). That endpoint was never released and has been replaced server-side by the customer-scoped batch-create above. The old method and its request/response types are removed.

Changes

  • Add CustomersClient resource group on GradientLabsIntegrationClient (client.Customers).
  • Add BatchCreateMemoriesRequest and Memory models.
  • Remove Conversations.BulkUploadMemoriesAsync and the old request/response types.
  • Update MemoriesTests: path/method assertions (POST /customers/{id}/memories), snake_case body, custom_type omitted when null, and API error propagation including 409 Conflict.

Version stays at 0.2.0 (first release of this endpoint; minor bump). dotnet build, dotnet test (75 passed on net8.0 and net10.0), and dotnet format --verify-no-changes all pass.

jafrog and others added 2 commits July 22, 2026 13:30
Add Conversations.BulkUploadMemoriesAsync (POST /conversations/{id}/memories)
for uploading a batch of conversation-scoped memories the agent can search
over on demand. Includes request/response models and tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New endpoint (bulk upload conversation memories) -> minor bump.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jafrog
jafrog requested review from a team as code owners July 22, 2026 12:31
jafrog and others added 2 commits July 27, 2026 16:46
Rework the still-unreleased memories endpoint from the conversation-scoped
bulk-upload to the new customer-scoped batch-create:
Customers.BatchCreateMemoriesAsync (POST /customers/{id}/memories). The call
is fire-and-forget and returns no body. Removes the old
Conversations.BulkUploadMemoriesAsync method and its request/response types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dotnet format enforces CRLF (via .editorconfig); the new files were
committed with LF, failing format verification on Linux/macOS CI.
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