Skip to content

MessageChatMemoryAdvisor adds empty user messageΒ #1601

@fmunch

Description

@fmunch

Bug description
When calling

ChatClient.builder(chatModel)
        .defaultAdvisors(new MessageChatMemoryAdvisor(chatMemory))
        .build()
        .prompt()
        .call()
        .chatResponse()

MessageChatMemoryAdvisor adds an empty UserMessage in the chat memory (see line 94).

In our use case we send the user message in a POST, store it in the conversation, then send a GET to benefit from SseEmitter. Hence the empty call to prompt().

Environment
1.0.0-M3

Expected behavior
When using an empty prompt MessageChatMemoryAdvisor should probably not add an empty UserMessage in the chat memory.

Metadata

Metadata

Assignees

Labels

advisorsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions