All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codemodder.plugins.llm.SarifPluginLLMCodemod Maven / Gradle / Ivy

There is a newer version: 0.97.6
Show newest version
package io.codemodder.plugins.llm;

import io.codemodder.RuleSarif;
import io.codemodder.SarifPluginRawFileChanger;
import java.util.Objects;

/** A base class for LLM codemods that process SARIF and use the OpenAI service. */
public abstract class SarifPluginLLMCodemod extends SarifPluginRawFileChanger {
  protected final OpenAIService openAI;

  public SarifPluginLLMCodemod(RuleSarif sarif, final OpenAIService openAI) {
    super(sarif);
    this.openAI = Objects.requireNonNull(openAI);
  }

  /**
   * 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. */ @Override public boolean shouldRun() { return openAI.isServiceAvailable(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy