Skip to content

Chatbot with structured output to drive forms for input #2074

Answered by anupsajjan
snscaimito asked this question in Q&A
Discussion options

You must be logged in to vote

What I don't get so far is how to keep track of the details provided by the user

If you want to track the conversations with user, you can simply use a table to capture all the chat history and use an advisor to stuff the prompt with chat memory. To start with, you can use InMemoryChatMemory and understand the flow, and later switch to a DB based chatMemory.

Something like this
`

@Bean
public ChatMemory chatMemory() {
    return new InMemoryChatMemory();
}

@Bean
public ChatClient chatClient(ChatModel chatModel) {
    return ChatClient.builder(chatModel)
            .defaultAdvisors(
                    new SimpleLoggerAdvisor(),
                    new PromptChatMemoryAdvisor(chatMemor…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by snscaimito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants