Package com.mindee.v2.cli
Class BaseInferenceCommand
- java.lang.Object
-
- com.mindee.v2.cli.BaseInferenceCommand
-
- Direct Known Subclasses:
ClassificationCommand,CropCommand,ExtractionCommand,OcrCommand,SplitCommand
public abstract class BaseInferenceCommand extends Object implements Callable<Integer>
Abstract base class for V2 inference CLI commands. Handles common options (path, model-id, api-key, alias, output) and output formatting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseInferenceCommand.OutputTypeOutput format for the command.
-
Constructor Summary
Constructors Constructor Description BaseInferenceCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Integercall()protected abstract CommonResponseexecuteRequest(MindeeClient client, LocalInputSource inputSource)Executes the inference request and returns the product response.protected StringgetFullOutput(CommonResponse response)Returns the full (inference + options + result) string for the given response.protected abstract StringgetSummary(CommonResponse response)Returns the summary (result-only) string for the given response.
-
-
-
Field Detail
-
file
protected File file
-
modelId
protected String modelId
-
apiKey
protected String apiKey
-
alias
protected String alias
-
output
protected BaseInferenceCommand.OutputType output
-
-
Method Detail
-
executeRequest
protected abstract CommonResponse executeRequest(MindeeClient client, LocalInputSource inputSource) throws Exception
Executes the inference request and returns the product response.- Parameters:
client- the V2 Mindee clientinputSource- the prepared local input source- Returns:
- the product response
- Throws:
Exception- on IO or API error
-
getSummary
protected abstract String getSummary(CommonResponse response)
Returns the summary (result-only) string for the given response. Override in each product command.- Parameters:
response- the product response- Returns:
- the summary string
-
getFullOutput
protected String getFullOutput(CommonResponse response)
Returns the full (inference + options + result) string for the given response. Defaults to the same asgetSummary(com.mindee.v2.parsing.CommonResponse); override for richer output.- Parameters:
response- the product response- Returns:
- the full output string
-
-