java.lang.Object
de.seggebaeing.sqlanalyzer.logic.promptable.impl.dummy.SQLDummy
de.seggebaeing.sqlanalyzer.logic.promptable.impl.dummy.RateLimitedSQLDummy
All Implemented Interfaces:
Promptable

public class RateLimitedSQLDummy extends SQLDummy
A dummy Promptable implementation that simulates an LLM being occasionally rate-limited.

This class delegates to SQLDummy for generating a mock SQL query but introduces random rate-limiting behavior via an internal RateLimiter. If a rate limit is active, a RateLimitException is thrown instead of returning a result.

  • Constructor Details

    • RateLimitedSQLDummy

      public RateLimitedSQLDummy()
  • Method Details

    • prompt

      public String prompt(String input, String model, String apiKey, double temperature) throws LLMException
      Simulates prompting an LLM while enforcing random rate limits.

      Before delegating to SQLDummy.prompt(String, String, String, double), this method checks whether a rate limit is currently active using the RateLimiter. If so, it throws a RateLimitException. Otherwise, it returns the dummy SQL response from the superclass.

      Specified by:
      prompt in interface Promptable
      Overrides:
      prompt in class SQLDummy
      Parameters:
      input - the input prompt text
      model - the (unused) model identifier
      apiKey - the (unused) API key
      temperature - the (unused) sampling temperature
      Returns:
      a dummy SQL query string
      Throws:
      LLMException - if a rate limit is active or another error occurs