MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / get_files

Method get_files

model/data_connection.py:26–33  ·  view source on GitHub ↗
(path: str, filetype: str = '.pdf')

Source from the content-addressed store, hash-verified

24class DocumentLoader:
25 @staticmethod
26 def get_files(path: str, filetype: str = '.pdf') -> Iterator[str]:
27 try:
28 yield from [
29 file_name for file_name in os.listdir(f'{path}')
30 if file_name.endswith(filetype)
31 ]
32 except FileNotFoundError as e:
33 print(f'\033[31m{e}')
34
35 @staticmethod
36 def load_documents(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected