Closed
Description
When trying to implement ChatMemory with PromptUserSpec messages, only the template is saved in history, without the actual parameters being replaced.
Example:
private ChatClient.ChatClientRequestSpec buildChatClientRequestSpecRAGAdvisor(Question question, String conversationId) {
return chatClient.prompt()
.user(userSpec -> userSpec
.text("{question} (error: '{error}')?")
.param("question", question.question())
.param("error", question.error()!=null?question.error():""))
.advisors( advisorSpec -> advisorSpec.param(AbstractChatMemoryAdvisor.CHAT_MEMORY_CONVERSATION_ID_KEY, conversationId)) ;
}
In the history a user message like this is saved: "{question} (error: {error})", without the actual values being used.
I have tested with all types of ChatMemory. The problems comes from the advisor code (eg. PromptChatMemoryAdvisor), method before:
this.getChatMemoryStore().add(this.doGetConversationId(request.adviseContext()), userMessage);
Metadata
Metadata
Assignees
Labels
No labels