Skip to main content

Notifications

Calling Actions from Copilot Studio
Answered

Intergating ChatGPT OpenAI with HTTP request in PVA

Posted on by 18

I am setting up the OpenAI ChatGPT configuration using the API through an HTTP request but encountered this error. The parameters have been set up and successfully tested on Postman; however, when trying on PVA (Power Virtual Agents),
I get the error "Sorry, something went wrong. Error code: SystemError. Conversation ID: 6a2e80ed-0616-481c-a90d-f57a0df49cd8. Time (UTC): 11/9/2023 4:08:20 AM." I will provide the HTTP configuration image below.

Sonnt_0-1699513800044.png

 

Sonnt_0-1699503268165.png

Categories:
  • jpiabrantes Profile Picture
    jpiabrantes 23 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    I am also trying to call OpenAI API from CoPilot Studio. Is there a way to use the user message in Body (JSON) of the HTTP Request?

  • Verified answer
    Sonnt Profile Picture
    Sonnt 18 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Dear @Damian2@HenryJammes 
    You should be change response data type as "Get from sample data" 
    and Go to Test and select a value variable.
    Thank you!
    Best,
    Sonnt

    Sonnt_3-1699689168696.png

    Sonnt_4-1699689250113.png

    Sonnt_5-1699689264713.png

     

  • Sonnt Profile Picture
    Sonnt 18 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Hi @HenryJammes 
    Thank for you suggestion,
    I changed the "Content-Type" key in my header, it is the same original OpenAI header (figure 1), but the same issue (figure 2-3). 
    I have an ideal about my issues, can you suggest me about 'Save response as' in HTTP request
    based on Open AI responses. 
    {
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "model": "gpt-3.5-turbo-0613",
    "system_fingerprint": "fp_44709d6fcb",
    "choices": [{
    "index": 0,
    "message": {
    "role": "assistant",
    "content": "\n\nHello there, how may I assist you today?",
    },
    "finish_reason": "stop"
    }],
    "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
    }
    }
    Thanks you so much!
    Best,
    Sonnt,

    Sonnt_0-1699685084761.png

    Sonnt_1-1699685341297.pngSonnt_2-1699685358008.png

     


     

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Question: can you check how you wrote the "Content-Type" key in your header?
    API Reference - OpenAI API

  • Sonnt Profile Picture
    Sonnt 18 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Dear @HenryJammes ,
    I already converted the content to Formula (Power Fx) as your suggestion, but the same this issue. 
    If you tested for succession, please to share for us, 
    Thank you so much!
    Best, 
    Sonnt 

    Sonnt_0-1699584800230.png

     



  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Hi @Sonnt@Damian2,

     

    Not 100% sure it's the same issue, but there is one known issue for which a fix is coming.

    The error occurs when you use JSON in your request's body.

     

    As a workaround, instead of JSON, can you convert the content to Formula (Power Fx) and try again?

     

    Henry

  • Sonnt Profile Picture
    Sonnt 18 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Dear Damian,
    We are waiting for this issue from Microsoft experts.
    Thank you

  • DamianSu Profile Picture
    DamianSu 8 on at
    Re: Intergating ChatGPT OpenAI with HTTP request in PVA

    Hello, I have the same problem. I'm trying to integrate Language Studio Custom Question Answering but it's not working. From Postman and even in Bot Framework Composer it works normally. I tried every possible option to do it...
    Screenshot 2023-11-09 094109.jpgScreenshot 2023-11-09 094202.png

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,997

#3
Expiscornovus Profile Picture

Expiscornovus 1,708

Leaderboard

Featured topics