MCPcopy
hub / github.com/langroid/langroid / __init__

Method __init__

langroid/parsing/document_parser.py:185–198  ·  view source on GitHub ↗

Args: source (str|bytes): The source, which could be a path, a URL or a bytes object.

(self, source: str | bytes, config: ParsingConfig)

Source from the content-addressed store, hash-verified

183 raise ValueError(f"Unsupported document type: {source_name}")
184
185 def __init__(self, source: str | bytes, config: ParsingConfig):
186 """
187 Args:
188 source (str|bytes): The source, which could be
189 a path, a URL or a bytes object.
190 """
191 super().__init__(config)
192 self.config = config
193 if isinstance(source, bytes):
194 self.source = "bytes"
195 self.doc_bytes = BytesIO(source)
196 else:
197 self.source = source
198 self.doc_bytes = self._load_doc_as_bytesio()
199
200 @staticmethod
201 def _document_type(

Callers

nothing calls this directly

Calls 2

_load_doc_as_bytesioMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected