There are two straightforward ways to use generative AI from Copilot Studio:
Generative responses
Prompt actions (AI Builder)
While it’s also possible to connect to AI services like Azure OpenAI through custom connectors or Power Automate, starting with these two methods is probably the best approach.
In this article, I’ll explain how to use AI Builder’s “AI Prompts” from Copilot Studio actions (Prompt actions).
For information about generative responses, see here
Prompt actions are a feature that allows you to call AI Builder’s “AI Prompts” from Copilot Studio,
They make it easy to use GPT-based AI (4o or 4o-mini) as actions.
You can easily create simple question-answer interactions with AI from Copilot Studio,
And by passing conversation history, you can enable context-aware conversations that consider previous interactions.
Basic Usage
First, let’s try a simple example where we have the AI answer a user’s question. After the “Question” node, select [Call an action] and then [Create a prompt].
Add a text input by clicking [Add] in the top right,
Set the input name (argument name),
Click [Save custom prompt] to complete the basic prompt action setup.
Now simply pass the user input content obtained from Copilot Studio’s “Question” node directly to the prompt’s argument,
The AI’s response will be stored in a variable (res.text), so just display that in a message to complete the implementation.
This enables easy conversation with AI.
By the way, you can easily change the model from [Settings]. Choose the model that balances the accuracy required for your action with cost considerations to be budget-friendly.
Generating Responses with Data Retrieved from Other Nodes
Using prompt actions, you can quickly build simple RAG implementations. For example, if you create a topic about asking for weather,
Add a “Get today’s forecast” connector,
Retrieve the weather forecast using the city name obtained through slot filling.
*For more information about slot filling, see here
Pass the return values from the weather forecast connector (morning and afternoon weather forecast summaries) to the prompt action.
This easily creates a topic that provides the latest weather forecast.
Generating Responses with Data Retrieved from Dataverse
AI prompts can also integrate with Dataverse. For example, if you have a table like this,
Prepare arguments like “cat name (cat_name)” and “today’s date (today)”, and create a prompt integrated with the cat table.
When you call the prompt action with user input and the Today function as arguments, it retrieves information from Dataverse and generates responses like this.
コメント