juzeon / poe-openai-proxy

A wrapper that lets you use the reverse-engineered Python library poe-api library as if it was the OpenAI API for ChatGPT. You can connect your favorite OpenAI API based apps to this proxy and enjoy the ChatGPT API for free!
GNU General Public License v3.0
434 stars 97 forks source link

Issue with third step #8

Open Maelstrom602 opened 1 year ago

Maelstrom602 commented 1 year ago

vim config.toml doesn't seem to be a valid command in powershell, command prompt, or python. I tried installing Vim but I couldn't figure out how to use it. How do I make this config.toml file?

juzeon commented 1 year ago

Hello. If you are using Windows, you can use text editors like notepad++ or sublime text to edit the configuration. It's not necessary to use vim in Windows.

Maelstrom602 commented 1 year ago

Oh, I used notepad to put down the various lines- but for some reason I wasn't able to make it a toml file. Currently using Windows 11.

I'm a bit of a newbie.

juzeon commented 1 year ago

You can enable the display of file extension first, and then create a txt file and rename it to toml. Google for 'show file extension windows 11'.

Maelstrom602 commented 1 year ago

Changed it to tmol file. Fired up the python external/api.py command.

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\xxxx\poe-openai-proxy\external\..\config.toml'

(I copypasted the code lines individually instead of copying the entire prompt while making it.)

juzeon commented 1 year ago

This means that the program cannot find the configuration file. Did you put it in the right folder (in the same folder as go.mod) and ensure the file name is correct?

Maelstrom602 commented 1 year ago

I think I got it running. Must've typed in the file name wrong.

Do I still need to build the go backend?

juzeon commented 1 year ago

Yes you need. The go backend will call apis of the python backend.

Maelstrom602 commented 1 year ago

"'chmod' is not recognized as an internal or external command, operable program or batch file."

juzeon commented 1 year ago

On Windows you don't need the chmod step.

Maelstrom602 commented 1 year ago

Oh damn. Which parts do I keep in? It says go isn't recognized as a command.

Maelstrom602 commented 1 year ago

Thanks for your patience btw. I sometimes have trouble interpreting instructions.

juzeon commented 1 year ago

Never mind. You should install golang the programming language first.

Maelstrom602 commented 1 year ago

Alright, I resolved step 5. Will I be able to recieve an api at this point? Or do I have to fetch one for the curl command.

juzeon commented 1 year ago

Something like 'register... ok' in the output of the go backend should indicate the successful start of the program. After that you can use curl to do a test referring to the openai document or connect other apps to it by changing the openai endpoint of the corresponding app.

Maelstrom602 commented 1 year ago

It says it's running, but I didn't get "register...ok"

Tried to redo the go build command and it didn't work for some reason. It worked initially, but now I'm getting a blank response, and errors if I pair the top line with "./poe-openai-proxy"

juzeon commented 1 year ago

Did you fill in your poe tokens? The tokens written in the README are for demostration purposes only and invalid.

Maelstrom602 commented 1 year ago

Yes. Though I could only fill in one. I removed the other. Couldn't get two separate tokens.

juzeon commented 1 year ago

Could you provide the full output of the python and the go backend?

Maelstrom602 commented 1 year ago

C:\Users\xxxx\poe-openai-proxy>python external/api.py # Running on port 5000

juzeon commented 1 year ago

Seems that the go program cannot be compile normally. Are this error main module (test3) does not contain package test3/poe-openai-proxy occured when you ran go build? The code do not have a package named test3. Weired. Try to run go mod tidy and re-run go build.

Maelstrom602 commented 1 year ago

Ran -go mod tidy- and got this:

"test3/go/pkg/mod/github.com/op/go-logging@v0.0.0-20160315200505-970db520ece7: import path "test3/go/pkg/mod/github.com/op/go-logging@v0.0.0-20160315200505-970db520ece7" should not have @version test3/go/pkg/mod/github.com/op/go-logging@v0.0.0-20160315200505-970db520ece7/examples: import path "test3/go/pkg/mod/github.com/op/go-logging@v0.0.0-20160315200505-970db520ece7/examples" should not have @version"

juzeon commented 1 year ago

I've not seen this type of error before. Please do a git pull as I have just commited a new go mod file. Also could you please run go version and provide the version of your go installation?

If this does not help, try this pre-compiled executable file: https://wormhole.app/0WJMP#wMVd6O-jIxQYgy9CSyTujA (for Windows x86_64, downloadable in 24 hours)