From 6fa8c3641709075f7f90d9bbfb08c23980f1973a Mon Sep 17 00:00:00 2001 From: arimu1 <19286898+arimu1@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:37:12 +0700 Subject: [PATCH] Make AnthropicChatModel internal methods private Align AnthropicChatModel with the upgrade notes and other chat model implementations by restricting internalCall and internalStream to private access. Callers should use call() and stream() instead. Fixes #6700 Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com> --- .../org/springframework/ai/anthropic/AnthropicChatModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java b/models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java index 6b3ea00ec7..76fcc02ee1 100644 --- a/models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java +++ b/models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java @@ -304,7 +304,7 @@ public Flux stream(Prompt prompt) { * chunks and the final response with tool call information or the model's final * answer. */ - public Flux internalStream(Prompt prompt, @Nullable ChatResponse previousChatResponse) { + private Flux internalStream(Prompt prompt, @Nullable ChatResponse previousChatResponse) { return Flux.deferContextual(contextView -> { MessageCreateParams request = createRequest(prompt, true); @@ -541,7 +541,7 @@ else if (streamingState.isTrackingThinking()) { * turn. * @return The final {@link ChatResponse} after all tool calls (if any) are resolved. */ - public ChatResponse internalCall(Prompt prompt, @Nullable ChatResponse previousChatResponse) { + private ChatResponse internalCall(Prompt prompt, @Nullable ChatResponse previousChatResponse) { MessageCreateParams request = createRequest(prompt, false);