Repository navigation
feat(extract): add client.extractFile for document and image uploads (3.6.0) - #144
Merged
Merged
Conversation
…cap, and refresh canonical openapi.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
client.extractFile(file, options)to the Node SDK forPOST /api/v1/extract/file(lenzhq/Lenz#1585), keeping the SDK version at3.6.0(3.5.0is the latest published version on npm).client.extractFile(file, options)acceptsBlob | ArrayBuffer | Uint8Arrayfor.docx,.pdf,.png,.jpg,.jpeg, and.webpfiles (up to 10 MB).filename,language(defaults to"auto", the document's own language),focus(up to 300 characters),locate(returns passage text inpositions[i].textwithstart/end: null),idempotency/idempotencyKey, and per-call request options (timeoutMs,maxRetries,signal,headers).EXTRACT_TIMEOUT_MS) withextract(), and preserves/extract/filereview-family error codes insrc/compat.ts.ExtractFileOptionsfrom bothsrc/index.tsandsrc/index.browser.ts.openapi.jsonwith/api/v1/extract/fileand updatesREADME.mdandCHANGELOG.md([3.6.0]).Reviews
codex review --base origin/main): Reviewede97be28; flaggedopenapi.jsonemitted withoutAPI_CANONICAL_ACCOUNTS_FROM(fixed in69b6821).claude -p --model opus): Reviewede97be28; flaggedisReviewFamilymissing/extract/fileinsrc/compat.ts, client-side 20 MB cap inresolveUpload,languagedocstring default, and test assertions (all fixed in69b6821).Post-deploy actions and prod testing
lenzhq/Lenz#1585first soPOST /api/v1/extract/fileis live in production.3.6.0until ready to tagv3.6.0for npm publish).await client.extractFile(pdfBytes, { filename: "sample.pdf", locate: true })againsthttps://lenz.io.