iyaja / llama-fs

A self-organizing file system with llama 3
MIT License
4.49k stars 259 forks source link

[Error] "Method Not Allowed" #18

Open ARKye03 opened 1 month ago

ARKye03 commented 1 month ago

I'm using arch linux, the servers runs well. log.txt

$ curl -X POST http://127.0.0.1:8000 \                                                                        ✔
    -H "Content-Type: application/json" \
    -d '{"path": "/home/archkye/Downloads/", "instruction": "string", "incognito": false}'

returns: {"detail":"Method Not Allowed"}%

The folder exits, I'm new to this, so I don't know what other info to offer. I'm using a venv, all requirements installed correctly.

Jothsa commented 1 month ago

I think the readme is incorrect. Try posting to http://127.0.0.1:8000/batch

ARKye03 commented 1 month ago

I tried that, now it returns another error: Batchlog.txt

InInfinitumEtInTenebris commented 1 month ago

I fixed this error on my machine by copying the original contents of curl from the api docs link and pasted it along with replacing the downloads path in the original curl api docs contents with the downloads path structure mentioned in the readme.

curl -X 'POST' \ 'http://127.0.0.1:8000/batch' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"path": "/Users/[username]/Downloads/", "instruction": "string", "incognito": true}'
"path": "string",
"instruction": "string", "incognito": true }'

However, now I'm confused because I'm left with terminal contents of: quote>

Oh, I also changed the incognito in the api docs from false to true along with the terminal curl command of incognito. Honestly, the extent of my knowledge of coding is following a readme, and I'm not sure what to do if errors occur other than search online. :P

ARKye03 commented 1 month ago

I fixed this error on my machine by copying the original contents of curl from the api docs link and pasted it along with replacing the downloads path in the original curl api docs contents with the downloads path structure mentioned in the readme.

curl -X 'POST' 'http://127.0.0.1:8000/batch' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"path": "/Users/[username]/Downloads/", "instruction": "string", "incognito": true}' "path": "string", "instruction": "string", "incognito": true }'

However, now I'm confused because I'm left with terminal contents of: quote>

Oh, I also changed the incognito in the api docs from false to true along with the terminal curl command of incognito. Honestly, the extent of my knowledge of coding is following a readme, and I'm not sure what to do if errors occur other than search online. :P

quote>, means that you have a "string" not closed completely, I see a < ' > at the end of the curl that seems to open a string but not closing it, if not, look for another < " > or < ' >

tsuiusi commented 1 month ago

Try this instead:

curl -X 'POST'
http://127.0.0.1:8000/batch
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{"path": "/Users/[username]/Downloads/", "instruction": "string", "incognito": true}",
"path": "string",
"instruction": "string",
"incognito": true
}'

you missed a comma and used ' instead of " on line 5 (this is still broken though)

dennispr commented 4 weeks ago

I got a response running the following:

curl -X 'POST' http://127.0.0.1:8000/batch -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"path": "/Users/[username]/Downloads", "instruction": "string", "incognito": "true"}'

So it's parsing it, but unfortunately it returned an internal server error. Server text says index out of bounds immediately after trying to split the directory contents:

line 68, in load_documents     text = splitter.split_text("\n".join([d.text for d in docs]))[0]            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

ARKye03 commented 4 weeks ago

I got a response running the following:

curl -X 'POST' http://127.0.0.1:8000/batch -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"path": "/Users/[username]/Downloads", "instruction": "string", "incognito": "true"}'

So it's parsing it, but unfortunately it returned an internal server error. Server text says index out of bounds immediately after trying to split the directory contents:

line 68, in load_documents text = splitter.split_text("\n".join([d.text for d in docs]))[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

I had that same issue, but no solutions appear here I see

InInfinitumEtInTenebris commented 4 weeks ago

Whoops. Thanks for the heads up. Though, is there any GUI to edit the folders accessed?