Class NoneProvider
java.lang.Object
org.machanism.machai.ai.provider.impl.NoneProvider
- All Implemented Interfaces:
Genai
No-op implementation of
Genai that performs no AI processing.
Every method is a deliberate no-op: prompts, instructions, tools,
prompts/resources registration, project directory, error handling, and
enabled-tool configuration are all accepted and silently ignored, and
perform() always returns null.
This provider is typically used as a placeholder or "disabled" AI provider — for example, to run Ghostwriter without configuring a real GenAI provider/model, to skip AI calls during testing, or as a safe default when no provider has been selected.
Every method logs an INFO-level message identifying the call, so callers can verify (e.g., in logs) that this no-op provider is active.
- Since:
- 1.3.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrompts(FunctionTools tools) Does nothing; no prompt tools are registered.voidaddResources(FunctionTools tools) Does nothing; no resource tools are registered.voidaddTools(FunctionTools tools) Does nothing; no function tools are registered.voidclear()Clears the accumulated prompt buffer.voidinit(String model, Configurator conf) Does nothing; the given model and configurator are discarded.voidinstructions(String instructions) Does nothing; the given instructions are discarded.perform()Performs no AI processing.voidDoes nothing; the given prompt text is discarded.voidsetEnabledTools(String[] tools) Does nothing; the given enabled-tools list is discarded.voidsetErrorHandling(boolean errorHandling) Does nothing; the given error-handling flag is discarded.voidsetProjectDir(File projectDir) Does nothing; the given project directory is discarded.
-
Field Details
-
logger
private static final org.slf4j.Logger loggerLogger used when diagnostic logging is enabled with thelogmodel. -
loggingOn
private boolean loggingOnWhether provider calls should be logged at INFO level.
-
-
Constructor Details
-
NoneProvider
public NoneProvider()
-
-
Method Details
-
init
Does nothing; the given model and configurator are discarded. -
prompt
Does nothing; the given prompt text is discarded. -
clear
public void clear()Clears the accumulated prompt buffer. -
instructions
Does nothing; the given instructions are discarded.- Specified by:
instructionsin interfaceGenai- Parameters:
instructions- system-level instructions; ignored
-
perform
Performs no AI processing. -
addTools
Does nothing; no function tools are registered. -
addPrompts
Does nothing; no prompt tools are registered.- Specified by:
addPromptsin interfaceGenai- Parameters:
tools- function tools to register; ignored
-
addResources
Does nothing; no resource tools are registered.- Specified by:
addResourcesin interfaceGenai- Parameters:
tools- function tools to register; ignored
-
setProjectDir
Does nothing; the given project directory is discarded.- Specified by:
setProjectDirin interfaceGenai- Parameters:
projectDir- project root directory; ignored
-
setErrorHandling
public void setErrorHandling(boolean errorHandling) Does nothing; the given error-handling flag is discarded.- Specified by:
setErrorHandlingin interfaceGenai- Parameters:
errorHandling- whether error handling should be enabled; ignored
-
setEnabledTools
Does nothing; the given enabled-tools list is discarded.- Specified by:
setEnabledToolsin interfaceGenai- Parameters:
tools- names of tools to enable; ignored
-