Skip to content

Return deferred search content in Node SDK - #196

Closed
chruffins wants to merge 1 commit into
mainfrom
hypeship/search-content-retrieval
Closed

chruffins wants to merge 1 commit into
mainfrom
hypeship/search-content-retrieval

Conversation

@chruffins

@chruffins chruffins commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • return the generated search contents response from search.contents.fetch
  • update generated request and response docs to match the current API contract

Testing

  • ./scripts/build
  • targeted Jest suite collected; its only mock-server test is skipped by repository configuration

Note

Medium Risk
Changing search.contents.fetch from void to Response is a public TypeScript breaking change for callers that assumed no body, though it aligns the SDK with the API.

Overview
Deferred search content fetch is now typed and documented as a real endpoint: client.search.contents.fetch returns Response (contents, search_id, usage, warnings) instead of void, and api.md reflects that.

The fetch implementation drops the custom Accept: '*/*' header so the client uses normal JSON parsing for the body. JSDoc and generated field comments are rewritten to match the current contract—retained-search retrieval, source / max_age_hours / browser behavior, per-result outcomes, and cache semantics—replacing the prior “not available / 404” placeholder. The same content-option documentation is synced on inline search create/request types in search.ts, plus small tweaks to Usage.content_fetches and deferred Response.Content fields (e.g. format, truncated, fetched_at).

Reviewed by Cursor Bugbot for commit d08a150. Configure here.

@chruffins

Copy link
Copy Markdown
Contributor Author

Superseded by the Stainless-generated release PR #197, which includes this SDK update.

@chruffins chruffins closed this Sep 30, 2026
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