Skip to content

Commit 5869bee

Browse files
committed
Fix duplicate keys in ChatResponseMetadata for OllamaApi.ChatResponse metadata
Signed-off-by: jitokim <[email protected]>
1 parent bf66415 commit 5869bee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaChatModel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
* @author Christian Tzolov
7575
* @author luocongqiu
7676
* @author Thomas Vitale
77+
* @author Jihoon Kim
7778
* @since 1.0.0
7879
*/
7980
public class OllamaChatModel extends AbstractToolCallSupport implements ChatModel {
@@ -118,8 +119,8 @@ public static ChatResponseMetadata from(OllamaApi.ChatResponse response) {
118119
.withKeyValue("eval-duration", response.evalDuration())
119120
.withKeyValue("eval-count", response.evalCount())
120121
.withKeyValue("load-duration", response.loadDuration())
121-
.withKeyValue("eval-duration", response.promptEvalDuration())
122-
.withKeyValue("eval-count", response.promptEvalCount())
122+
.withKeyValue("prompt-eval-duration", response.promptEvalDuration())
123+
.withKeyValue("prompt-eval-count", response.promptEvalCount())
123124
.withKeyValue("total-duration", response.totalDuration())
124125
.withKeyValue("done", response.done())
125126
.build();

0 commit comments

Comments
 (0)