1

I have the following shortcut based on this Youtube video that I adapted so it can save a conversation in Notes in a folder called ChatGPT (if you want to be able to use the shortcut, you must generate an API key (login required) and replace INSERT API KEY HERE in step 1 with the generated key:

  1. Text INSERT API KEY HERE
  2. If Text contains ADD API KEY HERE
    1. Show alert Edit this shortcut and paste in your API Key
    2. Stop this shortcut
  3. Otherwise
  4. End If
  5. Ask for Text with What can I do for you?
  6. Set variable inputVar to Provided Input
  7. Get contents of https://api.openai.com/v1/completions
    1. Method: POST
    2. Headers
      • (Key) Content-Type (Value) application/json
      • (Key) Authorization (Value) Bearer Text
    3. Request Body: JSON
      • (Key) model (Type) Text (Value) text-davinci-003
      • (Key) prompt (Type) Text (Value) Provided Input
      • (Key) max_tokens (Type) Number (Value) 2000
  8. Get text from Contents of URL
  9. Get Value for choices in Text
  10. Get Value for text in Dictionary Value
  11. Text Dictionary Value
  12. Show Text
  13. Set variable outputVar to Text
  14. Choose form menu with Would you like to save your query and the answer
    • Yes
  15. Yes
    • Create note with inputVar outputVar in ChatGPT
    • Open When Run: (checked)
  16. End Menu

Here below is the shortcut in (2) pictures:

enter image description here enter image description here

I credited my ChatGPT account with 10.- USD because I would like to use ChatGPT 4 (instead of ChatGPT 3) as a pay-as-you-go service.

I tried to adapt the Get contents of portion of the code, as follows, but without success (all the rest of the shortcut being equal to the one above):

  1. Get contents of https://api.openai.com/v1/chat/completions
    1. Method: POST
    2. Headers
      • (Key) Content-Type (Value) application/json
      • (Key) Authorization (Value) Bearer Text
    3. Request Body: JSON
      • (Key) model (Type) Text (Value) gpt-4
      • (Key) message (Type) Array (Value) 1 item
        • (Key) Item 1 (Type) Dictionary (Value) 2 items
          • (Key) role (Type) Text (Value) user
          • (Key) content (Type) Text (Value) Provided Input

The modified portion of the shortcut in picture:

enter image description here

But when I try to use it, it does not seem to pass through.

My question:

  • How must the Get contents of portion of the shortcut be modified in order to communicate with ChatGPT 4 and make the shortcut to work?

P.S.: Obviously I tried asking ChatGPT, but model 3 does not know about the existence of model 4 and therefore could not help me...

0

You must log in to answer this question.

Browse other questions tagged .