Package org.apache.tika.inference
Class InferenceConfig
java.lang.Object
org.apache.tika.inference.InferenceConfig
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InferenceConfig.RuntimeConfig
Configuration for the inference metadata filters.
Controls both the chunking behaviour (how text is split before inference) and the remote endpoint settings (URL, model, auth, timeout).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRuntime-only config that prevents modification of security-sensitive and cost-sensitive fields (baseUrl,apiKey,model) at parse time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintgetModel()intintbooleanbooleanvoidvoidsetBaseUrl(String baseUrl) voidsetClearContentAfterChunking(boolean clearContentAfterChunking) voidsetContentField(String contentField) voidsetMaxBatchSize(int maxBatchSize) Set the maximum number of chunks per embeddings API request.voidsetMaxChunkChars(int maxChunkChars) voidsetMaxChunks(int maxChunks) Set the maximum number of chunks per document.voidvoidsetOutputField(String outputField) voidsetOverlapChars(int overlapChars) voidsetSkipEmbedding(boolean skipEmbedding) voidsetTimeoutSeconds(int timeoutSeconds)
-
Constructor Details
-
InferenceConfig
public InferenceConfig()
-
-
Method Details
-
getBaseUrl
-
setBaseUrl
- Throws:
TikaConfigException
-
getModel
-
setModel
-
getApiKey
-
setApiKey
- Throws:
TikaConfigException
-
getTimeoutSeconds
public int getTimeoutSeconds() -
setTimeoutSeconds
public void setTimeoutSeconds(int timeoutSeconds) -
getMaxChunkChars
public int getMaxChunkChars() -
setMaxChunkChars
public void setMaxChunkChars(int maxChunkChars) -
getOverlapChars
public int getOverlapChars() -
setOverlapChars
public void setOverlapChars(int overlapChars) -
getContentField
-
setContentField
-
getOutputField
-
setOutputField
-
isSkipEmbedding
public boolean isSkipEmbedding() -
setSkipEmbedding
public void setSkipEmbedding(boolean skipEmbedding) -
isClearContentAfterChunking
public boolean isClearContentAfterChunking() -
setClearContentAfterChunking
public void setClearContentAfterChunking(boolean clearContentAfterChunking) -
getMaxBatchSize
public int getMaxBatchSize() -
setMaxBatchSize
public void setMaxBatchSize(int maxBatchSize) Set the maximum number of chunks per embeddings API request. Must be at least 1. -
getMaxChunks
public int getMaxChunks() -
setMaxChunks
public void setMaxChunks(int maxChunks) Set the maximum number of chunks per document. Set to-1for no limit. Must be-1or at least1.
-