Package org.apache.tika.inference
Class InferenceConfig.RuntimeConfig
java.lang.Object
org.apache.tika.inference.InferenceConfig
org.apache.tika.inference.InferenceConfig.RuntimeConfig
- All Implemented Interfaces:
Serializable
- Enclosing class:
- InferenceConfig
Runtime-only config that prevents modification of security-sensitive
and cost-sensitive fields (
baseUrl, apiKey,
model) at parse time.
These fields must be set at initialization via the config file.
If a runtime ParseContext JSON config attempts to set them,
the overridden setters throw TikaConfigException.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tika.inference.InferenceConfig
InferenceConfig.RuntimeConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetBaseUrl(String baseUrl) voidsetMaxBatchSize(int maxBatchSize) Set the maximum number of chunks per embeddings API request.voidsetMaxChunks(int maxChunks) Set the maximum number of chunks per document.voidMethods inherited from class org.apache.tika.inference.InferenceConfig
getApiKey, getBaseUrl, getContentField, getMaxBatchSize, getMaxChunkChars, getMaxChunks, getModel, getOutputField, getOverlapChars, getTimeoutSeconds, isClearContentAfterChunking, isSkipEmbedding, setClearContentAfterChunking, setContentField, setMaxChunkChars, setOutputField, setOverlapChars, setSkipEmbedding, setTimeoutSeconds
-
Constructor Details
-
RuntimeConfig
public RuntimeConfig()
-
-
Method Details
-
setBaseUrl
- Overrides:
setBaseUrlin classInferenceConfig- Throws:
TikaConfigException
-
setApiKey
- Overrides:
setApiKeyin classInferenceConfig- Throws:
TikaConfigException
-
setModel
- Overrides:
setModelin classInferenceConfig
-
setMaxBatchSize
public void setMaxBatchSize(int maxBatchSize) Description copied from class:InferenceConfigSet the maximum number of chunks per embeddings API request. Must be at least 1.- Overrides:
setMaxBatchSizein classInferenceConfig
-
setMaxChunks
public void setMaxChunks(int maxChunks) Description copied from class:InferenceConfigSet the maximum number of chunks per document. Set to-1for no limit. Must be-1or at least1.- Overrides:
setMaxChunksin classInferenceConfig
-