Taskade ChatGPT

186 bookmarks
Custom sorting
A Gentle Introduction to Prompt Engineering - MachineLearningMastery.com
A Gentle Introduction to Prompt Engineering - MachineLearningMastery.com
ChatGPT is a service provided by OpenAI that is a conversational large language model. It is widespread, and it is found to be very useful. Behind the scene, it is a large language model. Unlike the other LLMs that generate continuing text from the leading sentence you provided, ChatGPT enables you to ask questions or provide instructions, and the model will…
·machinelearningmastery.com·
A Gentle Introduction to Prompt Engineering - MachineLearningMastery.com
Understanding OpenAI Function Calling | by Wei-Meng Lee | Level Up Coding
Understanding OpenAI Function Calling | by Wei-Meng Lee | Level Up Coding
In my earlier article on using the OpenAI API, I talked about using the ChatCompletion API to communicate with OpenAI models: While this is one of the nice features of generative AI where the AI is…
·levelup.gitconnected.com·
Understanding OpenAI Function Calling | by Wei-Meng Lee | Level Up Coding
ChatGPT Conversation Action - Actions - Share Wha…
ChatGPT Conversation Action - Actions - Share Wha…
Since the release of ChatGPT API on March 1st, I see the possibility that it can be a replacement for ChatGPT web for everyday use. So here I am, presenting to you the ChatGPT Conversation Action: ChatGPT Conversation | Drafts Directory Features Conversational chat in a draft, just like what ChatGPT web does Define the system role message to clarify the usage of the conversation for better results. This is made possible through the role property in the new API docs. Update or delete the histo...
·forums.getdrafts.com·
ChatGPT Conversation Action - Actions - Share Wha…
ChatGPT
ChatGPT

To create a shortcut that helps with chatting with an AI, particularly if you're thinking of integrating it with something like ChatGPT, here’s a comprehensive guide. This shortcut will allow you to input a query and receive a response from an AI via a REST API, like the one provided by OpenAI.

Step 1: Create the Basic Structure of the Shortcut

  1. Open the Shortcuts app on your iOS device.
  2. Tap the "+" button in the top right corner to create a new shortcut.
  3. Tap "Add Action" to start building your shortcut.

Step 2: Set Up User Input

  1. Search for "Ask for Input" in the Actions list.
  2. Add the "Ask for Input" action.
    • Set the Prompt to something like "What would you like to ask the AI?".
    • Optionally, set the Input Type to "Text".

Step 3: Prepare the API Request

  1. Add the "Get Contents of URL" action (Search for it if necessary).
  2. In the URL field, enter the endpoint for the AI’s API (for example, https://api.openai.com/v1/chat/completions for OpenAI’s API).
  3. Tap on "Method" and set it to POST since you'll be sending data to the API.

Step 4: Configure API Headers

  1. Tap "Add New Field" under the "Get Contents of URL" action.
  2. Select "Headers".
  3. Add a header for "Authorization".
    • Set the Value to your API key, formatted as Bearer YOUR_API_KEY.

Step 5: Configure the API Body

  1. Tap "Add New Field" again, this time select "Request Body".
  2. Change the Body Type to "JSON".
  3. Set the following keys and values in the JSON body:
    • "model": "gpt-4", or whatever model you are using.
    • "messages": A dictionary containing your input.
      • "role": "user".
      • "content": Magic Variable from Ask for Input (Use this to insert the user’s question into the API request).

Step 6: Extract the AI's Response

  1. After the "Get Contents of URL" action, add the "Get Dictionary Value" action.
    • Set "Get Value for Key" to "choices".
  2. Add "Get Dictionary Value" again to drill down into the first response choice.
    • Set "Get Value for Key" to "message".
  3. Add "Get Dictionary Value" again to get the actual text.
    • Set "Get Value for Key" to "content".

Step 7: Display the AI’s Response

  1. Add "Show Result" action.
    • Set the Text to the Magic Variable representing the AI’s response content.

Step 8: Optional - Logging the Conversation

  1. If you want to keep a log of all your conversations, add an "Append to Note" or "Save File" action.
    • You could format the entry as: You asked: [Your Question] AI responded: [AI’s Response]
    • Store the log in a specific note or a file in iCloud.

Step 9: Run and Test the Shortcut

  1. Name your shortcut something intuitive like "Chat with AI".
  2. Test it by entering a question when prompted.
  3. The shortcut should display the AI's response and optionally log the interaction.

This shortcut gives you a robust tool for interacting with AI directly from your device, integrating API calls, and handling responses, all within the iOS Shortcuts framework. If desired, you can extend it by adding more options like choosing the AI model, setting temperature parameters, or managing API tokens.

·chatgpt.com·
ChatGPT