2023-06-30 13:15:50 +03:00
|
|
|
from langchain.document_loaders import CSVLoader
|
2023-08-21 13:25:16 +03:00
|
|
|
from models import File
|
2023-05-31 14:51:23 +03:00
|
|
|
|
|
|
|
from .common import process_file
|
2023-05-13 00:05:31 +03:00
|
|
|
|
2023-05-22 09:39:55 +03:00
|
|
|
|
2023-06-20 10:54:23 +03:00
|
|
|
def process_csv(
|
2023-06-28 20:39:27 +03:00
|
|
|
file: File,
|
2023-06-20 10:54:23 +03:00
|
|
|
enable_summarization,
|
2023-06-28 20:39:27 +03:00
|
|
|
brain_id,
|
2023-06-20 10:54:23 +03:00
|
|
|
user_openai_api_key,
|
|
|
|
):
|
|
|
|
return process_file(
|
2023-08-03 21:24:42 +03:00
|
|
|
file=file,
|
|
|
|
loader_class=CSVLoader,
|
|
|
|
enable_summarization=enable_summarization,
|
|
|
|
brain_id=brain_id,
|
|
|
|
user_openai_api_key=user_openai_api_key,
|
2023-06-20 10:54:23 +03:00
|
|
|
)
|