Class BailianDocumentConverter

java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianDocumentConverter

public class BailianDocumentConverter extends Object
Converter for transforming Bailian API responses to AgentScope Document objects.

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

  • Method Summary

    Modifier and Type
    Method
    Description
    static io.agentscope.core.rag.model.Document
    fromBailianNode(com.aliyun.bailian20231229.models.RetrieveResponseBody.RetrieveResponseBodyDataNodes node)
    Converts a single Bailian node to a Document.
    static List<io.agentscope.core.rag.model.Document>
    fromBailianResponse(com.aliyun.bailian20231229.models.RetrieveResponseBody response)
    Converts Bailian retrieve response to a list of Documents.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • fromBailianResponse

      public static List<io.agentscope.core.rag.model.Document> fromBailianResponse(com.aliyun.bailian20231229.models.RetrieveResponseBody response)
      Converts Bailian retrieve response to a list of Documents.
      Parameters:
      response - the Bailian retrieve response
      Returns:
      a list of Document objects
    • fromBailianNode

      public static io.agentscope.core.rag.model.Document fromBailianNode(com.aliyun.bailian20231229.models.RetrieveResponseBody.RetrieveResponseBodyDataNodes node)
      Converts a single Bailian node to a Document.
      Parameters:
      node - the Bailian node from retrieve response
      Returns:
      a Document object, or null if conversion fails