spring-projects / spring-projects/spring-ai

How to get this assitantMessage in the streaming response

Open
#3,845 2 comments 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

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.