OpenAI ChatGPT and GPT-4 models are both optimized for conversational interfaces. This means they accept input formatted as a conversation. The main benefit is retaining the conversation context (i.e. the history of past questions and answers), so that any new follow up question is made in the context of past interactions.
Example in ChatGPT, where the question "Who was it before?" only makes sense in the context of the previous questions and answers:
To replicate this behavior in Power Virtual Agents, you integrate with the Azure OpenAI Service APIs using a Power Automate cloud flow.
For each of the requests you make to Azure OpenAI, you need to retain the context of previous questions and answers.
The Chat Completion API is a new dedicated API for interacting with the ChatGPT and GPT-4 models in conversational manner.
Chat Completion is optimized and will lead to better results than the previous Chat Markup Language (ChatML) format.
The format allows you to set the system prompt (with instructions, rules, data, etc.) as well as a format for the following question and answers, between the bot and the user. It's formatted in JSON.
Below is an example of the above example conversation:
[
{
"role": "system",
"content": "You are an AI assistant that helps people find information."
},
{
"role": "user",
"content": "Who was Microsoft CEO in 2020?"
},
{
"role": "assistant",
"content": "In 2020, the CEO of Microsoft was Satya Nadella. He has been the CEO of Microsoft since 2014."
},
{
"role": "user",
"content": "Who was it before?"
},
{
"role": "assistant",
"content": "Before Satya Nadella, Steve Ballmer was the CEO of Microsoft. He served as the CEO from 2000 to 2014, following Bill Gates who co-founded Microsoft and served as CEO for many years."
}
]
You can learn more about Chat Completion API here:
How to work with the ChatGPT and GPT-4 models (preview) - Azure OpenAI Service | Microsoft Learn
You cannot keep an infinitely large history of past interactions. Each model has a token limit.
You can learn more on how to remain the thoken limit here.
In the below example, I show how to integrate Power Virtual Agents with Azure OpenAI with Power Automate, and use the Chat Completion API to retain conversation context.
Important note:
Prerequisites for the below articles:
How can you make it include the URL references on the answers?
If you want to use the GPT model's internal knowledge you can use a power automate flow to call the "create text using GPT" action (from AI builder) and send your question to the model and the answer back to your Copilot just like a ChatGPT
Hello @remidyon,
Thank you for the training links, I have completed them, and I have also created a chatbot!
My chatbot has multiple topics as per my requirement. I have also added multiple public websites in it so that generative answers work properly, but there is limitation on how many websites I can add. Thus, I was wondering if I can integrate ChatGPT with my chatbot so that it can answer complex questions easily with help of ChatGPT.
If this is possible, can you please tell me how I can achieve this? I would like to keep my existing topics, files and websites as primary source of information.
Hello @HenryJammes,
Thank you very much for the amazing solution.
I am working on an internal team chatbot which will help team in 2 scenarios:
1. Information and doubt solving with internal documentation and processes, which i have uploaded in chatbot as word and excel files.
2. General Procurement and negotiation related queries, which can be answered by chatbot like ChatGPT.
how can i make this happen?
Hello @HenryJammes ,
Thanks a lot for your sharing. I got a ActionResponseSkipped at the last step. Do you have any idea about this ? thanks in advance.
Hello there @HenryJammes I've followed your tutorial with wonderful results. Thanks for the succinct explanation.
I'd like to know the changes needed for creating a dedicated Azure OpenAI ChatGPT topic though, since the method described replies on every question being appended to FullDialog since it's an UnrecognizedTriggerPhrase.
This is what I got in mind but it obviously can't parse every follow up question by the user.
Any suggestions would be helpful. TIA.
Hi Henry!
Is there a fix for this error? I think that the "" are getting appended ..
@HenryJammes Thanks for the response. How do I set up expressions in Power Automate?
stampcoin
6
Artur Stepniak
5
Super User 2025 Season 1
Michael E. Gernaey
4
Super User 2025 Season 1