Class OllamaService

java.lang.Object
com.example.cab302project.OllamaService

public class OllamaService extends Object
Small helper for requesting crime summaries from a local Ollama model.
  • Constructor Details

    • OllamaService

      public OllamaService()
  • Method Details

    • generateSummary

      public String generateSummary(String prompt) throws IOException, InterruptedException
      Sends a prompt to Ollama and returns the generated response text.
      Parameters:
      prompt - the complete prompt to send to the local model
      Returns:
      the model response text
      Throws:
      IOException - if Ollama is not running or the response cannot be read
      InterruptedException - if the request is interrupted