Skip to content

Commit 4c6ceb8

Browse files
authored
[hotfix] Update ollam4j version to resolve tool call exception. (#324)
1 parent b4b5a65 commit 4c6ceb8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

integrations/chat-models/ollama/src/main/java/org/apache/flink/agents/integrations/chatmodels/ollama/OllamaChatModelConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.github.ollama4j.exceptions.RoleNotFoundException;
2424
import io.github.ollama4j.models.chat.*;
2525
import io.github.ollama4j.models.request.OllamaChatEndpointCaller;
26+
import io.github.ollama4j.models.request.ThinkMode;
2627
import io.github.ollama4j.tools.Tools;
2728
import org.apache.flink.agents.api.chat.messages.ChatMessage;
2829
import org.apache.flink.agents.api.chat.messages.MessageRole;
@@ -192,7 +193,7 @@ public ChatMessage chat(
192193
OllamaChatRequest.builder()
193194
.withMessages(ollamaChatMessages)
194195
.withModel((String) arguments.get("model"))
195-
.withThinking(extractReasoning)
196+
.withThinking(extractReasoning ? ThinkMode.ENABLED : ThinkMode.DISABLED)
196197
.withUseTools(false)
197198
.build();
198199

integrations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ under the License.
3131
<packaging>pom</packaging>
3232

3333
<properties>
34-
<ollama4j.version>1.1.2</ollama4j.version>
34+
<ollama4j.version>1.1.5</ollama4j.version>
3535
</properties>
3636

3737
<modules>

0 commit comments

Comments
 (0)