Package org.apache.tika.parser.vlm
Class VLMOCRConfig.RuntimeConfig
java.lang.Object
org.apache.tika.parser.vlm.VLMOCRConfig
org.apache.tika.parser.vlm.VLMOCRConfig.RuntimeConfig
- All Implemented Interfaces:
Serializable
- Enclosing class:
- VLMOCRConfig
Runtime-only config that prevents modification of security-sensitive
and cost-sensitive fields at parse time.
Always blocked: baseUrl, apiKey, model,
maxTokens, allowRuntimePrompt.
Blocked by default (opt-in): prompt — set
allowRuntimePrompt=true at initialization time to permit
per-request prompt overrides.
The model field is unconditionally blocked because there is
no legitimate reason to swap models per-request; if a different model
is needed, configure a separate parser instance.
The maxTokens field cannot be raised above the init-time
value at runtime to prevent cost attacks on paid API endpoints.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tika.parser.vlm.VLMOCRConfig
VLMOCRConfig.RuntimeConfig -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeConfig(VLMOCRConfig initConfig) Creates a RuntimeConfig that inherits the init-timeallowRuntimePromptsetting and themaxTokensceiling from the given parent config. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAllowRuntimePrompt(boolean allowRuntimePrompt) voidvoidsetBaseUrl(String baseUrl) voidsetMaxImagePixels(long maxImagePixels) Set the maximum total pixels (width × height) for an image.voidsetMaxTokens(int maxTokens) voidvoidMethods inherited from class org.apache.tika.parser.vlm.VLMOCRConfig
getApiKey, getBaseUrl, getCompletionsPath, getMaxFileSizeToOcr, getMaxImagePixels, getMaxTokens, getMinFileSizeToOcr, getModel, getPrompt, getTimeoutSeconds, isAllowRuntimePrompt, isInlineContent, isSkipOcr, setCompletionsPath, setInlineContent, setMaxFileSizeToOcr, setMinFileSizeToOcr, setSkipOcr, setTimeoutSeconds
-
Constructor Details
-
RuntimeConfig
public RuntimeConfig() -
RuntimeConfig
Creates a RuntimeConfig that inherits the init-timeallowRuntimePromptsetting and themaxTokensceiling from the given parent config.
-
-
Method Details
-
setBaseUrl
- Overrides:
setBaseUrlin classVLMOCRConfig- Throws:
TikaConfigException
-
setApiKey
- Overrides:
setApiKeyin classVLMOCRConfig- Throws:
TikaConfigException
-
setModel
- Overrides:
setModelin classVLMOCRConfig
-
setPrompt
- Overrides:
setPromptin classVLMOCRConfig
-
setMaxTokens
public void setMaxTokens(int maxTokens) - Overrides:
setMaxTokensin classVLMOCRConfig
-
setAllowRuntimePrompt
public void setAllowRuntimePrompt(boolean allowRuntimePrompt) - Overrides:
setAllowRuntimePromptin classVLMOCRConfig
-
setMaxImagePixels
public void setMaxImagePixels(long maxImagePixels) Description copied from class:VLMOCRConfigSet the maximum total pixels (width × height) for an image. Default is 100,000,000. Set to-1for no limit (not recommended).- Overrides:
setMaxImagePixelsin classVLMOCRConfig
-