0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.05k stars 151 forks source link

--init-prompt-from-file, invalid_request_error #120

Closed JackDinn closed 1 year ago

JackDinn commented 1 year ago
chat --init-prompt-from-file fred.txt
Welcome to chatgpt. You can quit with 'exit' or 'q'.

Enter a prompt:
test

Your request to Open AI API failed: invalid_request_error
We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what wassent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)
1

This is the text i am wanting to initiate with. (fred.txt)

events {
    worker_connections  1024;
}

http {
    upstream nextcloud {
        server test.co.uk;
    }
    upstream plex {
        server test.co.uk:32400;
    }

    server {
        listen 8000;
        #listen 443 ssl;
        server_name test.co.uk plex.test.co.uk;

        #ssl_certificate /path/to/your/certificate.pem;
        #ssl_certificate_key /path/to/your/private_key.pem;

        location / {
            if ($http_host = "test.co.uk") {
                proxy_pass https://nextcloud;
            }
            if ($http_host = "plex.test.co.uk") {
                proxy_pass http://plex;
            }

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
}

Iv seen it do this with all the text iv tried, but it will read a text file as a standard prompt without crashing. (--prompt-from-file), but i would really like to continue the conversation after initiating with a text file.

Version : 0.3-3 aur/chatgpt-shell-cli 0.3-3 https://aur.archlinux.org/packages/chatgpt-shell-cli

Maybe im confused between chatgpt-shell-cli & chatgpt-shell-cli-git. I think they both point here.

JackDinn commented 1 year ago

I found that i should just use your git directly instead of through Arch repos. Sorry i had not been able to figure this a few days ago.