How can ChatGPT be used to reply to text messages?
Should the "Shell Command" block be used? Or the "HTTP Request" block?
It would be very helpful if someone could provide an example.
I've included code below for an API call for chat gpt. All help and guidance is appreciated. Thank you.
API_KEY="your_api_key_here"
API_URL="
https://api.openai.com/v1/chat/completions"
curl -X POST $API_URL \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Tell me a joke."}
]
}'