3 ms·
It also seems to jeopardize their own ChatGPT Pro offering. It's a matter of time before someone makes a 1:1 clone for either half the money or a usage-based pr
by NiekvdMaas 4y ago
It also seems to jeopardize their own ChatGPT Pro offering. It's a matter of time before someone makes a 1:1 clone for either half the money or a usage-based pricing model.
- drusepth 4y agoGiven how strict OpenAI has been about what you can do with their API in the past and how hard it was to get some legitimate apps through approval, I would imagine they'd just shut this competitor's API access down.
- reset-password 4y agoHopefully there will be a plug-in-your-own-API-key open source thing then. Even better.
- b5n 4y agoThe future is now: gptask() { data=$(jq -n \ --arg message "$1" \ '{model: "gpt-3.5-turbo", max_tokens: 4000, messages: [{role: "user", content: $message}]}') response=$(curl -s https://api.openai.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OAIKEY" \ -d "$data") message=$(echo "$response" \ | jq '.choices[].message.content' \ | sed 's/^\"\\n\\n//;s/\"$//') echo -e "$message" } export OAIKEY=<YOUR_KEY> gptask "what is the url for hackernews"
- comment_ran 4y agoNot to sure how to make it one section, aka, one session mode, so chatgpi can understand the previous talk.
- _just7_ 4y agoJust use iteration where you continuously update the prompt to include previous messages
- _andrei_ 4y agoquick script #!/usr/bin/env bash set -uf -o pipefail IFS=$'\n\t' BOT='\033[33m' NC='\033[0m' messages=() trim() { local var="$*" var="${var#"${var%%[![:space:]]*}"}" var="${var%"${var##*[![:space:]]}"}" printf '%s' "$var" } function complete { local message="$1" local data messages+=("{\"role\": \"user\", \"content\": $(echo "$message" | jq -R -s '.')}") processed_messages=$(printf '%s,' "${messages[@]}") processed_messages="[${processed_messages::-1}]" data=$(jq -n \ --arg model "gpt-3.5-turbo" \ --argjson messages "$processed_messages" \ '{ model: $model, messages: $messages }' \ | sed 's/\]\[/,/g') response=$(curl -s https://api.openai.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d "$data") message=$(echo "$response" | jq '.choices[].message.content') printable_message=$(echo "$response" | jq -r '.choices[].message.content') printable_message=$(trim "$printable_message") echo -e "${BOT}Bot:${NC} $printable_message" messages+=("{\"role\": \"assistant\", \"content\": $message}") } while true; do read -r -p $'\e[35mYou:\e[0m ' message complete "$message" done
- ilaksh 4y agoIs it really a lot of jeopardy though? We have to assume that they are pricing the API so that the more it is used, the more money they make. So actually to me that is arguably a better business model. Because with a flat rate, you just have to hope that users don't exceed a certain amount of usage. And the ones that don't, are not getting a great deal. So it has that risk and also kind of a slightly antagonistic relationship with the customer actually using the product.