|
19 | 19 | package org.apache.flink.agents.integrations.chatmodels.ollama; |
20 | 20 |
|
21 | 21 | import com.fasterxml.jackson.core.type.TypeReference; |
| 22 | +import com.fasterxml.jackson.databind.DeserializationFeature; |
22 | 23 | import com.fasterxml.jackson.databind.ObjectMapper; |
23 | 24 | import io.github.ollama4j.OllamaAPI; |
24 | 25 | import io.github.ollama4j.exceptions.RoleNotFoundException; |
25 | 26 | import io.github.ollama4j.models.chat.OllamaChatMessage; |
26 | 27 | import io.github.ollama4j.models.chat.OllamaChatMessageRole; |
27 | 28 | import io.github.ollama4j.models.chat.OllamaChatResult; |
28 | 29 | import io.github.ollama4j.tools.Tools; |
| 30 | +import io.github.ollama4j.utils.Utils; |
29 | 31 | import org.apache.flink.agents.api.chat.messages.ChatMessage; |
30 | 32 | import org.apache.flink.agents.api.chat.messages.MessageRole; |
31 | 33 | import org.apache.flink.agents.api.chat.model.BaseChatModelConnection; |
@@ -79,6 +81,7 @@ public class OllamaChatModelConnection extends BaseChatModelConnection { |
79 | 81 | public OllamaChatModelConnection( |
80 | 82 | ResourceDescriptor descriptor, BiFunction<String, ResourceType, Resource> getResource) { |
81 | 83 | super(descriptor, getResource); |
| 84 | + Utils.getObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); |
82 | 85 | String endpoint = descriptor.getArgument("endpoint"); |
83 | 86 | if (endpoint == null || endpoint.isEmpty()) { |
84 | 87 | throw new IllegalArgumentException("endpoint should not be null or empty."); |
|
0 commit comments