Spaces:
Runtime error
Runtime error
File size: 526 Bytes
b699122 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
"""Node parser interface."""
from typing import List, Sequence
from abc import ABC, abstractmethod
from gpt_index.data_structs.node_v2 import Node
from gpt_index.readers.schema.base import Document
class NodeParser(ABC):
"""Base interface for node parser."""
@abstractmethod
def get_nodes_from_documents(
self,
documents: Sequence[Document],
) -> List[Node]:
"""Parse documents into nodes.
Args:
documents (Sequence[Document]): documents to parse
"""
|