Skip to content
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

AI chatting functionality #11430

Open
wants to merge 189 commits into
base: main
Choose a base branch
from
Open

AI chatting functionality #11430

wants to merge 189 commits into from

Conversation

InAnYan
Copy link
Collaborator

@InAnYan InAnYan commented Jun 26, 2024

Screenshots of the UI changes

изображение

изображение

TODOs

(Update by koppor)

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@koppor
Copy link
Member

koppor commented Jul 8, 2024


@Override
public String add(Embedding embedding) {
String id = String.valueOf(UUID.randomUUID());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the parent class seems to demand some identifies for the embeddings, it should be explained somewhere in this class how this works. Maybe, at the maps above - or as general @implNote at the JavaDoc of the whole class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment there, but those id thing - is a detail of implementation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am reviewing the implementation, thus I want to understand the thing.

We in JabRef aim for code that is maintainable by more than one person. A Software Engineering principle is that the code belongs to the product, not to the code owner. The aim should be that the product improves and can improved in the future. (Side store: Therefore, I dislike the term "code owners" used by GitHub - or the IDE feature showing who authored the code. In utopia, one cannot "see" who authored the code, because there is the same style used in a proejct).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the comment in the new commit.

Id is used to identify embeddings as a key to Map<String, ...>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By detail of implementation I meant: the programmers that use this class don't have to look or manipulate with ID's

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By detail of implementation I meant: the programmers that use this class don't have to look or manipulate with ID's

Oh, I did not mention "maintenance", but only described it like "code that is maintainable".

With maintenance, I mean that a class itself (!) could be updated. Meaning: Updates on MVStoreEmbeddingStore. Maybe migrating to a new version, updating to a more modern Java style (who knows what will be there in 2030 in Java).

Thus, it IS important to understand the inner workings of a class.

/**
* A custom implementation of langchain4j's {@link EmbeddingStore} that uses a {@link MVStore} as an embedded database.
*/
public class MVStoreEmbeddingStore implements EmbeddingStore<TextSegment> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole class could be contributed back to langchain4j? Maybe at the end of GSoC (where whopefully a new release of langchain4j is made)

@InAnYan
Copy link
Collaborator Author

InAnYan commented Jul 8, 2024

#11430 (comment)

@koppor, you mean JabRef can detect if new files are added from the filesystem and then link it?

@koppor
Copy link
Member

koppor commented Jul 8, 2024

#11430 (comment)

@koppor, you mean JabRef can detect if new files are added from the filesystem and then link it?

Link doesn't work in mobile... 🙈 Maybe cite the text? Use >.

But I didn't mean that. One can trigger it from the menu. Lookup "Search for unlinked files".

@koppor
Copy link
Member

koppor commented Jul 9, 2024

#11430 (comment)
@koppor, you mean JabRef can detect if new files are added from the filesystem and then link it?

Text on the issue:

To reproduce: Use BibTeX from above. Open JabRef. Check indexing. Then copy test.pdf to a folder where JabRef can find the PDF.

@InAnYan Yes. Please check for yourself. 😅

Preferences are image

Field in the entry editor:

image

Update There is even documentation for that: https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#auto-linking-files

@InAnYan
Copy link
Collaborator Author

InAnYan commented Jul 10, 2024

I'm asking because I'm impressed of that feature :)

InAnYan and others added 2 commits July 10, 2024 10:53
# Conflicts:
#	src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java
#	src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
#	src/main/java/org/jabref/gui/entryeditor/RequiredFieldsTab.java
#	src/main/java/org/jabref/gui/entryeditor/UserDefinedFieldsTab.java
@koppor
Copy link
Member

koppor commented Jul 10, 2024

Wrong message parameters can lead to IOB exceptions at LangChain4J - see langchain4j/langchain4j#1436 and my quick fix 861da12 (#11430).

Copy link
Contributor

The build of this PR is available at https://builds.jabref.org/pull/11430/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants