Bug description
When calling the Anthropic chat model in a blocking way, the final completion comes with an "end_turn" finish reason. The same is not true when using the streaming mode (the finishReason field is null
).
Environment Spring AI 1.0.0-SNAPSHOT
Steps to reproduce See this auto-tests which demonstrate the difference: https://github.com/spring-projects/spring-ai/blob/6c32c828477c032f6d295c10711fc0abe177278c/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/AnthropicChatModelObservationIT.java#L146
Expected behavior The same finish reason ("end_turn") is returned both when using the blocking and streaming option.