spring-projects / spring-projects/spring-ai
How to get this assitantMessage in the streaming response
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
desc:
It's easy to get an assitantMessage from the result in a non-streaming response, but there doesn't seem to be a straightforward way to get an assitantMessage in a streaming response, so I need to manually implement a complex logic to accomplish this. I'm wondering if there's a relatively simple and straightforward way to accomplish this?
Minimal:
chatClient.prompt().stream().chatClientResponse(); ...-> AssistentMessage
env:
java 17
1.1.0-snapshot
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the streaming entry point shown in chatClient.prompt().stream().chatClientResponse() and compare it with the non-streaming response path that already exposes an AssistantMessage. Determine the supported way to obtain that message from a streaming response; done means the behavior is straightforward and documented or otherwise demonstrated for Java 17 and the stated version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100