Class NoneProvider

java.lang.Object
org.machanism.machai.process.provider.NoneProvider
All Implemented Interfaces:
ProcessProvider

public class NoneProvider extends Object implements ProcessProvider
No-op implementation of ProcessProvider that performs no AI processing.

Every method is a deliberate no-op: prompts, instructions, tools, prompt/resource 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.

When initialized with the "log" model, initialization, prompt, instruction, tool, project-directory, error-handling, clear, and perform calls log an INFO-level message so callers can verify that this no-op provider is active. Prompt and resource registration remain silent. All other model values leave diagnostic logging disabled.

Since:
1.3.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
    Logger used when diagnostic logging is enabled with the log model.
    private boolean
    Whether provider calls should be logged at INFO level.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Does nothing; no prompt tools are registered.
    void
    Does nothing; no resource tools are registered.
    void
    addTools(FunctionTools tools, String[] enabledTools)
    Does nothing; no function tools are registered.
    void
    Does nothing because this provider does not retain prompts or other request state.
    Returns the empty tool-name list because this provider never registers tools.
    void
    init(String model, Configurator conf)
    Does nothing; the given model and configurator are discarded.
    void
    instructions(String instructions)
    Does nothing; the given instructions are discarded.
    Performs no AI processing.
    void
    prompt(String text)
    Does nothing; the given prompt text is discarded.
    void
    setErrorHandling(boolean errorHandling)
    Does nothing; the given error-handling flag is discarded.
    void
    setProjectDir(File projectDir)
    Does nothing; the given project directory is discarded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
      Logger used when diagnostic logging is enabled with the log model.
    • loggingOn

      private boolean loggingOn
      Whether provider calls should be logged at INFO level.
  • Constructor Details

    • NoneProvider

      public NoneProvider()
  • Method Details

    • init

      public void init(String model, Configurator conf)
      Does nothing; the given model and configurator are discarded.
      Specified by:
      init in interface ProcessProvider
      Parameters:
      model - model/provider identifier; ignored
      conf - configuration source; ignored
    • prompt

      public void prompt(String text)
      Does nothing; the given prompt text is discarded.
      Specified by:
      prompt in interface ProcessProvider
      Parameters:
      text - prompt text; ignored
    • clear

      public void clear()
      Does nothing because this provider does not retain prompts or other request state.
      Specified by:
      clear in interface ProcessProvider
    • instructions

      public void instructions(String instructions)
      Does nothing; the given instructions are discarded.
      Specified by:
      instructions in interface ProcessProvider
      Parameters:
      instructions - system-level instructions; ignored
    • perform

      public String perform()
      Performs no AI processing.
      Specified by:
      perform in interface ProcessProvider
      Returns:
      always null
    • addTools

      public void addTools(FunctionTools tools, String[] enabledTools)
      Does nothing; no function tools are registered.
      Specified by:
      addTools in interface ProcessProvider
      Parameters:
      tools - function tools to register; ignored
      enabledTools - names of enabled tools; ignored
    • addPrompts

      public void addPrompts(FunctionTools tools)
      Does nothing; no prompt tools are registered.
      Specified by:
      addPrompts in interface ProcessProvider
      Parameters:
      tools - prompt definitions to register; ignored
    • addResources

      public void addResources(FunctionTools tools)
      Does nothing; no resource tools are registered.
      Specified by:
      addResources in interface ProcessProvider
      Parameters:
      tools - resource definitions to register; ignored
    • setProjectDir

      public void setProjectDir(File projectDir)
      Does nothing; the given project directory is discarded.
      Specified by:
      setProjectDir in interface ProcessProvider
      Parameters:
      projectDir - project root directory; ignored
    • setErrorHandling

      public void setErrorHandling(boolean errorHandling)
      Does nothing; the given error-handling flag is discarded.
      Specified by:
      setErrorHandling in interface ProcessProvider
      Parameters:
      errorHandling - whether error handling should be enabled; ignored
    • getToolNames

      public List<String> getToolNames()
      Returns the empty tool-name list because this provider never registers tools.
      Specified by:
      getToolNames in interface ProcessProvider
      Returns:
      an immutable empty list