Package com.articulate.sigma.nlg
Class OllamaClient
java.lang.Object
com.articulate.sigma.nlg.OllamaClient
-
Constructor Summary
ConstructorsConstructorDescriptionOllamaClient(String baseUrl) OllamaClient(String baseUrl, int connectTimeoutMs, int readTimeoutMs) -
Method Summary
Modifier and TypeMethodDescriptionBackwards-compatible convenience wrapper.One-shot text generation via /api/generate (no conversation state).booleanstatic void
-
Constructor Details
-
OllamaClient
-
OllamaClient
-
-
Method Details
-
generate
Backwards-compatible convenience wrapper.- Throws:
IOException
-
generate
public String generate(String model, String prompt, Map<String, Object> options, boolean requestJsonFormat) throws IOExceptionOne-shot text generation via /api/generate (no conversation state).- Parameters:
model- e.g., "llama3.2"prompt- promptoptions- Ollama options (e.g., temperature, top_p, num_predict, seed)requestJsonFormat- if true, requests JSON-mode output when supported by Ollama/model- Throws:
IOException
-
chat
public String chat(String model, String prompt, Map<String, Object> options, boolean requestJsonFormat) throws IOException- Throws:
IOException
-
isHealthy
public boolean isHealthy() -
main
- Throws:
Exception
-