quivr/backend/parsers/txt.py

10 lines
377 B
Python
Raw Normal View History

2023-05-18 02:22:13 +03:00
from fastapi import UploadFile
from langchain.document_loaders import TextLoader
from utils.common import CommonsDep
from .common import process_file
2023-05-18 02:22:13 +03:00
2023-05-22 09:39:55 +03:00
async def process_txt(commons: CommonsDep, file: UploadFile, enable_summarization, user, user_openai_api_key):
return await process_file(commons, file, TextLoader, ".txt", enable_summarization, user,user_openai_api_key)