Skip to content

OcrOptions ​

Import from: @xbbg/xnews

Defined in: src/ocr.ts (declaration: ocr.d.ts:37)

Extends ​

Properties ​

allowCrossOriginRedirects? ​

readonly optional allowCrossOriginRedirects?: boolean

Defined in: src/types.ts (declaration: types.d.ts:105)

Allows a redirect to leave the requested origin even when a caller User-Agent, sensitive query parameter, request body, or extra header would otherwise refuse it. File downloads need this: catalogs mint a short-lived token on their own host and redirect to a CDN. A redirect into a private network address is still refused.

Inherited from ​

SourceFetchOptions.allowCrossOriginRedirects


apiKey? ​

readonly optional apiKey?: string

Defined in: src/ocr.ts (declaration: ocr.d.ts:48)

Bearer token, when the server requires one.


baseUrl ​

readonly baseUrl: string

Defined in: src/ocr.ts (declaration: ocr.d.ts:44)

Server origin, including any path prefix — http://127.0.0.1:10000 for a local SGLang/vLLM server, or https://openrouter.ai/api for OpenRouter. /v1/chat/completions is appended. Required: this package ships no endpoint and starts no server.


customLogitProcessor? ​

readonly optional customLogitProcessor?: string

Defined in: src/ocr.ts (declaration: ocr.d.ts:62)

SGLang's serialized DeepseekOCRNoRepeatNGramLogitProcessor, which the recipe pairs with ngram_size: 35 to stop the decoder looping on dense pages. vLLM does not accept it; leave unset there.


extraBody? ​

readonly optional extraBody?: Readonly<Record<string, unknown>>

Defined in: src/ocr.ts (declaration: ocr.d.ts:69)

Extra body fields merged last, so they win over every default above.


fetch? ​

readonly optional fetch?: SourceFetch

Defined in: src/types.ts (declaration: types.d.ts:88)

Inherited from ​

SourceFetchOptions.fetch


imageMode? ​

readonly optional imageMode?: "base" | "gundam"

Defined in: src/ocr.ts (declaration: ocr.d.ts:56)

Unlimited-OCR's two image configurations. gundam crops at 640px and is for a single image; base runs at 1024px and is the only mode its recipe supports for multi-page requests. Defaults by batch size.


limit? ​

readonly optional limit?: number

Defined in: src/types.ts (declaration: types.d.ts:115)

Inherited from ​

SourceFetchOptions.limit


maxResponseBytes? ​

readonly optional maxResponseBytes?: number

Defined in: src/types.ts (declaration: types.d.ts:92)

Maximum response body size in bytes; defaults to 32 MiB.

Inherited from ​

SourceFetchOptions.maxResponseBytes


model? ​

readonly optional model?: string

Defined in: src/ocr.ts (declaration: ocr.d.ts:46)

Served model name; defaults to Unlimited-OCR.


msrbAcceptTermsOfUse? ​

readonly optional msrbAcceptTermsOfUse?: boolean

Defined in: src/types.ts (declaration: types.d.ts:114)

MSRB EMMA gates data behind a Terms-of-Use acceptance cookie. Accepting those terms (https://emma.msrb.org) is the caller's act: without this flag, EMMA requests fail closed with a config error instead of the library accepting on the caller's behalf.

Inherited from ​

SourceFetchOptions.msrbAcceptTermsOfUse


pagesPerRequest? ​

readonly optional pagesPerRequest?: number

Defined in: src/ocr.ts (declaration: ocr.d.ts:67)

Pages per request. The recipe sends a whole document at once, but a long book overruns the 32k context, so this batches. Defaults to 8.


prompt? ​

readonly optional prompt?: string

Defined in: src/ocr.ts (declaration: ocr.d.ts:50)

Overrides the task prompt.


redirect? ​

readonly optional redirect?: RequestRedirect

Defined in: src/types.ts (declaration: types.d.ts:97)

Redirect semantics enforced by xnews. "follow" (default) revalidates policy on at most ten hops; the injected fetch receives "manual".

Inherited from ​

SourceFetchOptions.redirect


secUserAgent? ​

readonly optional secUserAgent?: string

Defined in: src/types.ts (declaration: types.d.ts:107)

Inherited from ​

SourceFetchOptions.secUserAgent


signal? ​

readonly optional signal?: AbortSignal

Defined in: src/types.ts (declaration: types.d.ts:89)

Inherited from ​

SourceFetchOptions.signal


since? ​

readonly optional since?: string | Date

Defined in: src/types.ts (declaration: types.d.ts:116)

Inherited from ​

SourceFetchOptions.since


timeoutMs? ​

readonly optional timeoutMs?: number

Defined in: src/types.ts (declaration: types.d.ts:90)

Inherited from ​

SourceFetchOptions.timeoutMs


until? ​

readonly optional until?: string | Date

Defined in: src/types.ts (declaration: types.d.ts:117)

Inherited from ​

SourceFetchOptions.until


userAgent? ​

readonly optional userAgent?: string

Defined in: src/types.ts (declaration: types.d.ts:106)

Inherited from ​

SourceFetchOptions.userAgent

Last updated:

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.