camel-ai / camel

🐫 CAMEL: Finding the Scaling Law of Agents. The first and the best multi-agent framework. https://www.camel-ai.org
https://docs.camel-ai.org/
Apache License 2.0
5.72k stars 696 forks source link

[BUG] The loaders module in the document has a lot of examples that have expired and cannot be used properly. #1208

Open xzjjj opened 5 days ago

xzjjj commented 5 days ago

Required prerequisites

What version of camel are you using?

0.2.9

System information

I recently discovered that a lot of the documentation in this part of the Loader module was unusable while writing code about chunkr and firecrawl. Cookbook also has some code that cannot be used.

Problem description

I recently discovered that a lot of the documentation in this part of the Loader module was unusable while writing code about chunkr and firecrawl. Cookbook also has some code that cannot be used.in camel 0.2.9

Reproducible example code

The Python snippets:

Command lines:

Extra dependencies:

Steps to reproduce:

1. from io import BytesIO from camel.loaders import read_file

Read a pdf file from disk

with open("test.pdf", "rb") as file: file_content = BytesIO(file.read()) file_content.name = "test.pdf"

Use the read_file function to create an object based on the file extension

file_obj = read_file(file_content)

Once you have the File object, you can access its content

print(file_obj.docs[0]["page_content"])

Traceback

No response

Expected behavior

If you have time, I'll help rewrite the example code in the loaders section.

Additional context

If you have time, I'll help rewrite the example code in the loaders section.

Wendong-Fan commented 5 days ago

Thanks @xzjjj ! The documentation for loader is indeed outdated, it would be great if you can contribute to fix this, here is our contribution guideline for your reference: https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md

Could @WHALEEYE also help with this?