Skip to content

Require prompt and response_format in extract(), release 0.7.0 - #8

Merged
fatwang2 merged 1 commit into
mainfrom
extract-required-fields
Nov 9, 2026
Merged

fatwang2 merged 1 commit into
mainfrom
extract-required-fields

Conversation

@fatwang2

@fatwang2 fatwang2 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Why

POST /extract has always required prompt and response_format ({"type": "json_schema", "json_schema": ...}), but the SDK made both optional and the API docs' own Python sample left response_format out, so copying it failed with 400. Gateway change: fatwang2/search1api#535 — the API now rejects these requests at the gateway with 422 and an errors array.

Changes

  • extract() on Search1API and AsyncSearch1API: prompt and response_format are required keyword arguments; response_format is the new ExtractResponseFormat TypedDict in search1api.types.
  • OpenAPI snapshot synced (extract request schema, request example, code samples, TARGET_BAD_REQUEST in failureCategory).
  • README: an Extract section with a working example.
  • Version 0.7.0 (breaking signature change), CHANGELOG entry.
  • Tests: sync and async extract send both fields; a 422 raises UnprocessableEntityError.

Testing

pip is not available on the machine this was written on, so ruff / mypy / pytest run in CI only (3.9 and 3.12). Local check: python -m py_compile on the changed files.

Release (tag v0.7.0) after fatwang2/search1api#535 is merged.

🤖 Generated with Claude Code

The API never accepted /extract without them; it now rejects such a
request with 422 and an errors array. Type response_format as
ExtractResponseFormat, sync the OpenAPI snapshot, and document extract
in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fatwang2
fatwang2 merged commit da317fd into main Nov 9, 2026
2 checks passed
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