Module de.seggebaeing.sqlanalyzer
Class AbstractLLMHandler
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.promptable.impl.llm.AbstractLLMHandler
- All Implemented Interfaces:
Promptable
- Direct Known Subclasses:
ClaudePromptHandler
,DeepSeekPromptHandler
,GeminiPromptHandler
,OpenAIPromptHandler
Abstract base class for all LLM (Large Language Model) handler implementations.
Provides shared infrastructure for concrete Promptable
implementations:
- A reusable
HttpClient
for communicating with external APIs. - A
Gson
instance for JSON serialization and deserialization.
By implementing Promptable
, this class enforces the contract that all
subclasses must provide their own de.seggebaeing.sqlanalyzer.logic for handling prompts and returning
responses from the underlying LLM.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HttpClient
Reusable HTTP client for sending requests to external LLM APIs.protected final com.google.gson.Gson
Gson instance used for serializing requests and deserializing responses when communicating with LLM APIs. -
Constructor Summary
ConstructorsConstructorDescriptionInitializes the HTTP client and Gson instance for use in subclasses. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.seggebaeing.sqlanalyzer.logic.promptable.Promptable
prompt
-
Field Details
-
client
Reusable HTTP client for sending requests to external LLM APIs. Initialized once in the constructor to optimize resource usage and connection handling. -
gson
protected final com.google.gson.Gson gsonGson instance used for serializing requests and deserializing responses when communicating with LLM APIs.
-
-
Constructor Details
-
AbstractLLMHandler
public AbstractLLMHandler()Initializes the HTTP client and Gson instance for use in subclasses. Provides the necessary tools for sending requests and processing JSON responses from LLM APIs.
-