Commit 4579dea
Addressing the NPE risk in AnthropicChatModel#getDefaultUsage
When either `usage.inputTokens` or `usage.outputTokens()` is null, `usage.inputTokens() + usage.outputTokens()` will throw an NPE.
Signed-off-by: Forte Scarlet <[email protected]>
Signed-off-by: logan-mac <[email protected]>1 parent d674057 commit 4579dea
File tree
1 file changed
+3
-2
lines changed- models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic
1 file changed
+3
-2
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
0 commit comments