Class HayStackDocumentConverter

java.lang.Object
io.agentscope.core.rag.integration.haystack.HayStackDocumentConverter

public class HayStackDocumentConverter extends Object
Converter for transforming HayStack API responses to AgentScope Document objects.

This class handles the conversion between HayStack RAG's document format and AgentScope's internal Document representation, ensuring seamless integration with the RAG system.

  • Method Details

    • convertToDocuments

      public static List<io.agentscope.core.rag.model.Document> convertToDocuments(List<HayStackDocument> hayStackDocuments)
      Converts a list of HayStackDocuments to Documents.
      Parameters:
      hayStackDocuments - the hayStackDocuments from retrieve response
      Returns:
      a list of Document objects
    • convertToDocument

      public static io.agentscope.core.rag.model.Document convertToDocument(HayStackDocument hayStackDocument)
      Converts a single HayStack chunk to a Document.
      Parameters:
      hayStackDocument - the HayStackDocument from retrieve response
      Returns:
      a Document object, or null if conversion fails