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

How can I make Auto-GPT access local files on my computer, such as PDF and TXT files? #1930

Closed
ChesterZhao opened this issue Apr 16, 2023 · 32 comments
Labels

Comments

@ChesterZhao
Copy link

I have tried many methods, such as uploading the file to a public repository on GitHub or sharing it on Google Drive, but Auto-GPT still cannot access it.

@Qoyyuum
Copy link
Contributor

Qoyyuum commented Apr 16, 2023

You can put them in the autogpt_workspace folder

@ChesterZhao
Copy link
Author

Thank you for your response! I put three PDF files into the autogpt_workspace folder, but its initial reaction is still to go to the browser to search. How can I make it aware that it should go to the autogpt_workspace folder to access the files? Can you give me an example? Thank you very much!

@Explorergt92
Copy link
Contributor

Explorergt92 commented Apr 16, 2023

@ChesterZhao Set one of your goals to something like "read and review the file <your-file-name> in the workspace folder"
and put the file you want it to read in Auto-GPT/auto_gpt_workspace

@SargeDGz
Copy link

re read the readme specifically the Data Ingestion part

@finster869
Copy link

I have two files in the auto_gpt_workspace file pb.txt and db.txt. If I ask the AI in the goals to read and summarize both files it finds them and does so. I have also placed those same files in a subfolder "seed_data" in the auto_gpt_workspace folder. I am using pinecone, so after autogpt is running I am able to successfully run data_ingestion.py and it tells me the information has been ingested. How do I let the AI know that db.txt and pb.txt have been ingested to memory? When it begins processing its commands, the first task it assigns itself is to locate the files pb.txt and db.txt meaning it doesn't know they have been ingested.

@ChesterZhao
Copy link
Author

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

@finster869
Copy link

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

@ChesterZhao
Copy link
Author

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

ofcourse~

@ChesterZhao
Copy link
Author

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

@finster869
Copy link

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

ofcourse~

Did you indicate in one of the goals for the AI that you want it to read the "xxxxx.txt" file? That is how I do it. If it can't find the file, it then usually automatically searches for itself and finds it.

I can get it to read the text files without issue from the machine. IN contrast, although it gives me a message indicating that the files have been ingested after I run data_ingestion.py, it still searches for them and doesn't seem to realize the information is in its memory.

@finster869
Copy link

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

From what directory are you running autogpt?

@ChesterZhao
Copy link
Author

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

From what directory are you running autogpt?

yes

@nayrmot
Copy link

nayrmot commented Apr 18, 2023

I am getting an error " Command search_files returned: Error: 'WindowsPath' object has no attribute 'is_relative_to'"

How do I resolve this error?

@willmoura
Copy link

I'm getting this error "SYSTEM: Command read_file returned: Error: 'utf-8' codec can't decode byte 0xe2 in position 10: invalid continuation byte" How do I resolve it?

@Nick-Bravante
Copy link

I'm getting this error "SYSTEM: Command read_file returned: Error: 'utf-8' codec can't decode byte 0xe2 in position 10: invalid continuation byte" How do I resolve it?

I am having this same issue. The system is saying SYSTEM: Command evaluate_code returned: "Error: The model: gpt-4 does not exist". Could running 3.5 and not 4 be the issue?

@magamagaman1
Copy link

Same issue here. My AI isn't able to read pdf files . It always gives me : Command read_file returned: Error: 'utf-8' codec can't decode byte 0xb5 in position 11: invalid start byte . I already installed PyPDF2 and told it to use it and it still doesn't read them. My goal for it is to have it read and learn from pdf files.

@interzone2
Copy link

@magamagaman1 - I think we need to convert PDF to .txt files for this to work.

BUT

Why does autogpt look here for local files: /home/appuser/auto_gpt_workspace/ - this does not correspond to my file structure, there's no appuser directory ?

@magamagaman1
Copy link

magamagaman1 commented Apr 25, 2023 via email

@edwardliufirm
Copy link

Same issue here. My AI isn't able to read pdf files . It always gives me : Command read_file returned: Error: 'utf-8' codec can't decode byte 0xb5 in position 11: invalid start byte . I already installed PyPDF2 and told it to use it and it still doesn't read them. My goal for it is to have it read and learn from pdf files.

I went through a same process and it's still not working.

@interzonez
Copy link

interzonez commented Apr 26, 2023

Thanks for the replies.

I did manage to get someplace with Langchain and memory for querying texts by going through their notebooks. It's quite simple. Therefore I'm not sure what is causing the breakage in AutoGPT. Once content has been ingested it should be relatively simple to have GPT take it on board. Of course there are varying levels of complexity. Asking questions of a document is one thing. But I want GPT to go off and perform other tasks WITH this memory activated so that it may use this knowledge to get further along with a problem. Will keep on digging.

https://python.langchain.com/en/latest/use_cases/summarization.html

@XChikuX
Copy link

XChikuX commented May 2, 2023

How large can a document be in the workspace folder?

Can I give it a 700 page book?

@avaneeshkum
Copy link

@XChikuX yes - for me it hanged, I believe you can integrate a SQLdb or pandas agent.

@XChikuX
Copy link

XChikuX commented May 8, 2023

@avaneeshkum Do you happen to know what size document would work without the agent?

@avaneeshkum
Copy link

Last, I used an 800-page book, and it could load it. That was just embeddings and query the doc framework in langchain.

@shivvem
Copy link

shivvem commented May 11, 2023

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace.

File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args
a = os.fspath(a)
^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

@Kumaava
Copy link

Kumaava commented May 11, 2023

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace.

File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args
a = os.fspath(a)
^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

Please keep files in autogpt workspace.

@shivvem
Copy link

shivvem commented May 11, 2023

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace.
File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args
a = os.fspath(a)
^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

Please keep files in autogpt workspace.

Sorry, but I am getting the same error over and over again. I have tried putting my files (which I want ingested) at multiple places. None of them work. I tried putting at:
Auto-GPT\autogpt
Auto-GPT\autogpt\auto-gpt-workspace
Auto-GPT\autogpt\workspace

@glicerico
Copy link

I was having the same problem with a txt file.

TL;DR:
In your docker-compose.yaml file, change:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

to

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

A bit longer answer:

I noticed that the command that AutoGPT v0.3.0 was proposing was:

NEXT ACTION:  COMMAND = read_file ARGUMENTS = {'filename': '/app/autogpt/auto_gpt_workspace/minireport_CMST_CRFAE.txt'}

The path looked different from the declared volume in the docker-compose.yaml file:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

So I added the missing dir, to make sure the directory is mounted where AutoGPT looks for it.

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

And that worked!

@shivvem
Copy link

shivvem commented May 15, 2023

I was having the same problem with a txt file.

TL;DR: In your docker-compose.yaml file, change:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

to

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

A bit longer answer:

I noticed that the command that AutoGPT v0.3.0 was proposing was:

NEXT ACTION:  COMMAND = read_file ARGUMENTS = {'filename': '/app/autogpt/auto_gpt_workspace/minireport_CMST_CRFAE.txt'}

The path looked different from the declared volume in the docker-compose.yaml file:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

So I added the missing dir, to make sure the directory is mounted where AutoGPT looks for it.

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

And that worked!

Thanks for your inputs! For me though, I don't use Docker. I have sort of given up on AutoGPT by now. There are too many raw edges to this .. which is fine as this is a product under development.

@bdaoud90
Copy link

Hey all, I have a question about PDFs. Does anyone's prompts immediately start directing to finding a converter? can it not read the PDFs natively?

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 6, 2023
@github-actions
Copy link

This issue was closed automatically because it has been stale for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests