Class OllamaLoginClientHelper
java.lang.Object
com.developer.nefarious.zjoule.plugin.login.api.OllamaLoginClientHelper
- All Implemented Interfaces:
IOllamaLoginClientHelper
A helper class for handling API requests and responses related to Ollama login.
The OllamaLoginClientHelper
provides utility methods for creating URIs
and parsing JSON responses from the Ollama API.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anOllamaLoginClientHelper
and initializes aGson
instance. -
Method Summary
Modifier and TypeMethodDescriptionCreates aURI
from the given endpoint string.parseOllamaModelsResponseToObject
(String responseBody) Parses the JSON response body into aGetOllamaModelsResponse
object.
-
Constructor Details
-
OllamaLoginClientHelper
public OllamaLoginClientHelper()Constructs anOllamaLoginClientHelper
and initializes aGson
instance.
-
-
Method Details
-
createUri
Creates aURI
from the given endpoint string.- Specified by:
createUri
in interfaceIOllamaLoginClientHelper
- Parameters:
endpoint
- the API endpoint as aString
.- Returns:
- the corresponding
URI
.
-
parseOllamaModelsResponseToObject
Parses the JSON response body into aGetOllamaModelsResponse
object.- Specified by:
parseOllamaModelsResponseToObject
in interfaceIOllamaLoginClientHelper
- Parameters:
responseBody
- the JSON response from the API.- Returns:
- a
GetOllamaModelsResponse
containing the list of available Ollama models.
-