[TIPS] Create Power Automate Flow to integrate with ChatGPT

 [TIPS] Create Power Automate Flow to integrate with ChatGPT

Step 1: Create an Instant cloud flow.



 Step 2:   Choose "PowerApps".


Step 3:   Add HTTP action



Step 4:  Set up the parameters:

             Method: POST

             URI: https://api.openai.com/v1/completions

             Headers:

                      Authorization            Bearer Your API KEY

                     Content-Type             application/json



Step 5: Add "Parse JSON" action. 

           Set the content to   body('HTTP').choices[0]


  Click "Generate from sample" button, add sample code below:

  {
      "text""I am doing well. How are you doing?",
      "index"0,
      "logprobs"null,
      "finish_reason""stop"
    }



Step 6: Add action "Respond to a PowerApp or flow"
   


   Click "Add an output", choose Text.


   Set a name for the output parameter, set its value to text of Parse JSON step.


Done.




No comments:

Post a Comment