-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add follow-up questions feature to AI chat #14354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implement automatic generation of follow-up questions after AI responses in the chat interface. Users can click suggested questions to continue the conversation naturally. Changes: - Add Generate follow-up questions setting in AI preferences - Create FollowUpQuestionGenerator to generate questions via AI - Update AiChatLogic to generate questions after each response - Display clickable follow-up question links in chat UI - Clear questions when new message is sent
Implement automatic generation of follow-up questions after AI responses in the chat interface. Users can click suggested questions to continue the conversation naturally. Changes: - Add Generate follow-up questions setting in AI preferences - Create FollowUpQuestionGenerator to generate questions via AI - Update AiChatLogic to generate questions after each response - Display clickable follow-up question links in chat UI - Clear questions when new message is sent # Conflicts: # jablib/src/main/resources/csl-styles
…bref into fix-for-issue-12243
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
What would anyone think about this: I think there are too many buttons for questions. What if we could hide "Try these examples" as soon as there are follow up questions? |
CHANGELOG.md
Outdated
| - We added the possibility to configure the email provided to unpaywall. [#14340](https://github.com/JabRef/jabref/pull/14340) | ||
| - We added a "Regenerate" button for the AI chat allowing the user to make the language model reformulate its response to the previous prompt. [#12191](https://github.com/JabRef/jabref/issues/12191) | ||
| - We added support for transliteration of fields to English and automatic transliteration of generated citation key. [#11377](https://github.com/JabRef/jabref/issues/11377) | ||
| - We added a "Generate follow-up questions" feature to AI chat that suggests relevant questions after each AI response. [#12243](https://github.com/JabRef/jabref/issues/12243) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove "Generate . So maybe "we added the generation of follow-up questions in AI chat"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will update the CHANGELOG.md
| public static final boolean ENABLE_CHAT = false; | ||
| public static final boolean AUTO_GENERATE_EMBEDDINGS = false; | ||
| public static final boolean AUTO_GENERATE_SUMMARIES = false; | ||
| public static final boolean GENERATE_FOLLOW_UP_QUESTIONS = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it can be true by default? Because I think users could miss this feature if it's turned off.
However, on the other hand, users interested in AI features will always open AI preferences at least once in order to add API key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I set it as true by default or leave it as false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to know other people's opinions, but for now you can leave false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options:
- nagging after some weeks: "Did you know?" -- I don't like this
- have it turned on - and enable quick turn off (we have this at user comment field)
- have it turned off - and have a quick-turn on possibility (as we do at Mr. DLib)
I would vote for option 3 - but as follow-up PR to have the PRs reviewable and get finished parts in main fast.
|
Okay, good! But the follow up questions template must be an |
I will limit the number of generated follow-up questions to three by default and will try to add the preference for users too.
I would be happy to look into adding this in a follow-up PR. |
Thanks, I will update the follow-up questions to use an |
…mplate - Default follow-up questions at 3 - New user preference to configure maximum number - Converted prompt to AiTemplate for consistency
…bref into fix-for-issue-12243
|
I have implemented these changes:
I have not worked on this part yet. If you would like me to include it in this PR, please let me know and I will be happy to update it. |
Very OK for me to do that in a separate PR. |
| // Get the current questions (this is thread-safe) | ||
| List<String> questions = new ArrayList<>(aiChatLogic.getFollowUpQuestions()); | ||
|
|
||
| // Update UI on the JavaFX Application Thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Update UI on the JavaFX Application Thread |
| } | ||
|
|
||
| private void updateFollowUpQuestions() { | ||
| // Get the current questions (this is thread-safe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Get the current questions (this is thread-safe) |
| autoGenerateEmbeddings.selectedProperty().bindBidirectional(viewModel.autoGenerateEmbeddings()); | ||
| autoGenerateEmbeddings.disableProperty().bind(viewModel.disableAutoGenerateEmbeddings()); | ||
| generateFollowUpQuestions.selectedProperty().bindBidirectional(viewModel.generateFollowUpQuestions()); | ||
| followUpQuestionsCountTextField.valueProperty().addListener((observable, oldValue, newValue) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for unused varialbes, use _.
Didn't that IntelliJ show to you - or do you use another IDE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, IntelliJ did highlight it. I will replace the unused variables with _ to follow the convention.
| line = line.trim(); | ||
| line = line.replaceAll("^[-*•]\\s*", ""); | ||
| line = line.replaceAll("^\\d+\\.\\s*", ""); | ||
| line = line.replaceAll("^[\"']|[\"']$", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chain these calls instead of assignments to the same variable
Yes, I think there is JavaFX
I will also update it to include “Automatically” for consistency with the other bullet points. |
| List<String> questions = new ArrayList<>(aiChatLogic.getFollowUpQuestions()); | ||
|
|
||
| // Update UI on the JavaFX Application Thread | ||
| Platform.runLater(() -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use UiTaskExecutor.runInJavaFXThread( () ->




Closes #12243
This PR implements a follow-up questions feature to AI chat. After the AI responds to a user's question, the system automatically generates 3-5 relevant follow-up questions that appear as clickable links below the chat.
Changes:
FollowUpQuestionGeneratorclass to generate questions via AIAiChatLogicafter each AI responseSteps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)