Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for custom filesystem #117

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

thiagosalvatore
Copy link

Custom FileSystems that are now available on llama-index were not available on llama-parse. We can now use it to download files using any reader like S3Reader.

Fixes #116

@thiagosalvatore
Copy link
Author

@logan-markewich can you take a look at this when you have some time, please?

fs = fs or get_default_fs()
with fs.open(file_path, "rb") as f:
mime_type = mimetypes.guess_type(str_file_path)[0]
files = {"file": (self.__get_filename(f), f, mime_type)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works, at least locally, it doesn't work for me

Since we already have the path, can't we use that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using it in production right now and it is working properly. What is the error that you are getting locally?

The issue with the path is that I've seen situations in production where people upload a file with .txt but the file is actually a .csv and it doesn't work.

@sheresaidon
Copy link

@logan-markewich whenever you have a chance could you please review, currently llama parse is giving me the fs error when trying to use it with GCS Reader

parser = LlamaParse(result_type="markdown", api_key=LLAMA_PARSE_API_KEY,verbose=True, show_progress=True)

reader = GCSReader(
    bucket=bucket_name,
    key=file_path,  # Use the extracted file path
    file_extractor={".pdf": parser, ".docx": parser, ".txt": parser},
    service_account_key=service_account_key_dict
)

LlamaParse.load_data() got an unexpected keyword argument 'fs'. Skipping...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New FS not supported by llama-parse
3 participants