4 ms·
I had success using curl alias to query GPT for any command. gpt=curl -s https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "A
by smusamashah 3y ago
I had success using curl alias to query GPT for any command.
gpt=curl -s https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer <YOUR_API_KEY>" -d "{\"model\": \"gpt-3.5-turbo\", \"messages\": [{\"role\": \"system\", \"content\": \"Give short single line answer.\"}, {\"role\": \"user\", \"content\": \" $\* \"}]}" --insecure | rg -o "content\":(.\*)" -r $$1
Updated it to use your prompt instead and should give much nicer results now.