Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaChatRequest.java
Go to the documentation of this file.
1/*
2 * Ollama4j - Java library for interacting with Ollama server.
3 * Copyright (c) 2025 Amith Koujalgi and contributors.
4 *
5 * Licensed under the MIT License (the "License");
6 * you may not use this file except in compliance with the License.
7 *
8*/
9package io.github.ollama4j.models.chat;
10
11import io.github.ollama4j.models.request.OllamaCommonRequest;
12import io.github.ollama4j.tools.Tools;
13import io.github.ollama4j.utils.OllamaRequestBody;
14import java.util.Collections;
15import java.util.List;
16import lombok.Getter;
17import lombok.Setter;
18
26@Getter
27@Setter
29
30 private List<OllamaChatMessage> messages = Collections.emptyList();
31
32 private List<Tools.Tool> tools;
33
34 private boolean think;
35
45 private boolean useTools = true;
46
48
49 public OllamaChatRequest(String model, boolean think, List<OllamaChatMessage> messages) {
50 this.model = model;
51 this.messages = messages;
52 this.think = think;
53 }
54
55 @Override
56 public boolean equals(Object o) {
57 if (!(o instanceof OllamaChatRequest)) {
58 return false;
59 }
60
61 return this.toString().equals(o.toString());
62 }
63}
OllamaChatRequest(String model, boolean think, List< OllamaChatMessage > messages)