Verified Owner
Top Fields Constructors Methods
org.jabref.logic.importer.plaincitation

public Class LlmPlainCitationParser

extends PdfImporterWithPlainCitationParser
implements PlainCitationParser
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.plaincitation.PlainCitationParser
Annotations
@NullMarked
Imports
java.io.IOException, .Reader, java.util.List, .Optional, org.jabref.logic.ai.chatting.ChatModel, org.jabref.logic.ai.templates.AiTemplateRenderer, org.jabref.logic.ai.util.LlmResponseCleaner, org.jabref.logic.cleanup.EprintCleanup, org.jabref.logic.importer.FetcherException, .ImportFormatPreferences, .ParseException, .ParserResult, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.importer.fileformat.pdf.PdfImporterWithPlainCitationParser, org.jabref.logic.l10n.Localization, org.jabref.model.entry.BibEntry, dev.langchain4j.data.message.SystemMessage, dev.langchain4j.data.message.UserMessage, org.jspecify.annotations.NullMarked

Field Summary

Modifier and TypeField and Description
private final ChatModel
private final String
private final EprintCleanup
private final ImportFormatPreferences

Constructor Summary

AccessConstructor and Description
public
LlmPlainCitationParser(ImportFormatPreferences importFormatPreferences, String citationParsingSystemMessageTemplate, ChatModel chatModel)

Method Summary

Modifier and TypeMethod and Description
public String
getDescription()

Implements abstract org.jabref.logic.importer.Importer.getDescription.

Returns the description of the import format.

public String
getId()

Implements abstract org.jabref.logic.importer.Importer.getId.

Returns a slug, which identifies this importer.

private String
public String
getName()

Implements abstract org.jabref.logic.importer.Importer.getName.

Returns the name of this import format.

private List<BibEntry>
public List<BibEntry>
public Optional<BibEntry>
Inherited from org.jabref.logic.importer.fileformat.pdf.PdfImporterWithPlainCitationParser:
importDatabase

Field Detail

chatModelback to summary
private final ChatModel chatModel
citationParsingSystemMessageTemplateback to summary
private final String citationParsingSystemMessageTemplate
eprintCleanupback to summary
private final EprintCleanup eprintCleanup
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences

Constructor Detail

LlmPlainCitationParserback to summary
public LlmPlainCitationParser(ImportFormatPreferences importFormatPreferences, String citationParsingSystemMessageTemplate, ChatModel chatModel)

Method Detail

getDescriptionback to summary
public String getDescription()

Implements abstract org.jabref.logic.importer.Importer.getDescription.

Doc from org.jabref.logic.importer.Importer.getDescription.

Returns the description of the import format.

The description should specify
what kind of entries from what sources and based on what specification it is able to import

by what criteria it isRecognizedFormat(BufferedReader) recognizes an import format

Annotations
@Override
getIdback to summary
public String getId()

Implements abstract org.jabref.logic.importer.Importer.getId.

Doc from org.jabref.logic.importer.Importer.getId.

Returns a slug, which identifies this importer. Used, for example, to identify the importer in CLI.

Typically, this name should be short, in English, and should not contain special characters like #, %, etc.

Annotations
@Override
getLlmResponseback to summary
private String getLlmResponse(String text)
getNameback to summary
public String getName()

Implements abstract org.jabref.logic.importer.Importer.getName.

Doc from org.jabref.logic.importer.Importer.getName.

Returns the name of this import format. Typically, this is a string that denotes file type or format. It can also be localized, like "XMP-annotated PDF".

Annotations
@Override
parseBibEntryStringback to summary
private List<BibEntry> parseBibEntryString(String text) throws IOException
parseMultiplePlainCitationsback to summary
public List<BibEntry> parseMultiplePlainCitations(String text) throws FetcherException

Overrides default org.jabref.logic.importer.plaincitation.PlainCitationParser.parseMultiplePlainCitations.

Doc from org.jabref.logic.importer.plaincitation.PlainCitationParser.parseMultiplePlainCitations.

Note that this is similar to importDatabase

Annotations
@Override
parsePlainCitationback to summary
public Optional<BibEntry> parsePlainCitation(String text) throws FetcherException

Implements org.jabref.logic.importer.plaincitation.PlainCitationParser.parsePlainCitation.

Annotations
@Override