Skip to content

Can't get complete content by Message:getText() in ChatMemory #3134

@zero3h

Description

@zero3h

Bug description
Can't get complete content by Message:getText() in ChatMemory.

Environment
1.0.0-SNAPSHOT(1.0.0-20250512.234548-238)

Steps to reproduce
Call streaming API(OpenApiChatModel).

Expected behavior
Store the answer content.

Minimal Complete Reproducible example

  1. pom.xml
<dependency>
	<groupId>org.springframework.ai</groupId>
	<artifactId>spring-ai-starter-model-openai</artifactId>
</dependency>
  1. code
chatClient.prompt()
.user(userInput).advisors(MessageChatMemoryAdvisor.builder(chatService).protectFromBlocking(true).build()).advisors(advisorSpec -> advisorSpec.param(ChatMemory.CONVERSATION_ID, conversationId))
				.stream().chatResponse();

The chatService is used for storing content.

Run, and I have identified an issue, the ChatMemory.add(String conversationId, List messages) parameter in Message:getText has no content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions