spring-projects / spring-projects/spring-ai

AnthropicChatModel exposes `internalStream` method publicly

Open Beginner friendly
#6,700 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

While doing some API mapping of the Spring AI project for my job (I work in security research @ Veracode) I noticed that the Anthropic implementation of ChatModel appears to expose a method that has a naming prefix that would indicate it probably is not intended to have public access:

https://github.com/spring-projects/spring-ai/blob/9b76ba9efca3fd07633d3d90b6163a79f0c05acc/models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java#L307

Checking other implementations, and just perusing the code a bit It seems that this was mentioned in an update guide:

https://github.com/spring-projects/spring-ai/blob/9b76ba9efca3fd07633d3d90b6163a79f0c05acc/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc#the-access-level-of-model-internal-methods-changed-to-private

I was going to open a PR, but the guide says to avoid opening a PR for straightforward changes, and this looks like it meets that criteria.

Cheers!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AnthropicChatModel.java at the referenced internalStream method and compare it with the access-level guidance in spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc. Done means AnthropicChatModel no longer exposes internalStream publicly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.