Class SarifPluginLLMCodemod

java.lang.Object
io.codemodder.RawFileChanger
io.codemodder.SarifPluginRawFileChanger
io.codemodder.plugins.llm.SarifPluginLLMCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger
Direct Known Subclasses:
SarifToLLMForBinaryVerificationAndFixingCodemod, SarifToLLMForMultiOutcomeCodemod

public abstract class SarifPluginLLMCodemod extends io.codemodder.SarifPluginRawFileChanger
A base class for LLM codemods that process SARIF and use the OpenAI service.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final OpenAIService
     

    Fields inherited from class io.codemodder.RawFileChanger

    reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    SarifPluginLLMCodemod(io.codemodder.RuleSarif sarif, OpenAIService openAI)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the codemod should run.

    Methods inherited from class io.codemodder.SarifPluginRawFileChanger

    onFileFound, supports, visitFile

    Methods inherited from class io.codemodder.RawFileChanger

    getDescription, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.codemodder.CodeChanger

    getIncludesExcludesPattern
  • Field Details

  • Constructor Details

    • SarifPluginLLMCodemod

      public SarifPluginLLMCodemod(io.codemodder.RuleSarif sarif, OpenAIService openAI)
  • Method Details

    • shouldRun

      public boolean shouldRun()
      Indicates whether the codemod should run.

      Subclasses can override this method to add additional hecks but should call super.shouldRun() to ensure the OpenAI service is available.