Be specific. The model is not able to guess what you would like to achieve, so you need to state it directly.
Instruct the model to adopt a persona – it helps in receiving more relevant responses.
Use delimiters like “*”, newline etc. to indicate distinct parts of the input.
Split big tasks into smaller subtasks.
Provide examples of what response you would like to receive.
Write clear instructions and avoid using ambiguous words.
Carefully test the prompt to ensure that the outcome is always correct.
Use the model to make your prompt better – just ask it: “Help me make this prompt better for you: *YOUR PROMPT*”.
Example:
Good prompt: Prepare me an analysis of sales data for year 2024. Include this columns only: ColumnA, ColumnB, ColumnC. Use formal tone and refer to the data provided only.
Bad prompt: Prepare me an analysis of sales data.
The main rule is:
The more details you include, the more tailored outcome you’ll receive.
what’s Azure Application Insights and how to use it in context of Copilot Studio,
how to effectively query Log Workspace connected to Application Insights to monitor chatbots,
how to setup a connection between chatbots and App Insights,
other nice tips. 😁
Many times I’ve heard about a problem that it’s not possible to monitor multiple chatbots at once. If you’re just starting your journey with Copilot Studio – you probably don’t think about monitoring and troubleshooting, as it’s quite easy to just perform few clicks in Copilot Studio and check the analytics. But what if you’ll have more chatbots?
5? It’s manageable.
15? With more effort, but still manageable.
55? You’re not going to manage it. 😉
So what to do to monitor them all in one place? Let’s check out what Azure Application Insights can give us!
Azure, help!
First thing that you need to do is to create Azure Application Insights resource as it’s going to be the place, where all agents logs will land. I’m not going to explain it in detail as it’s a topic for a separate post. You can read more about how to create this resource here. After creation you should see something like this:
This is a view from the resource group. When you click on the violet bulb icon – it’s our app insights resource, you’ll see this screen:
You need to copy the connection string – it’ll be needed in Copilot Studio. What we’re going to use to check our chatbots is Logs tab. When we navigate to it, we’ll have this:
All our logs are going to land to customEvents table. From Azure perspective we have everything, let’s see what we need to do in Copilot Studio!
How to Copilot?
Do we have our Connection String from App Insights copied? If yes, we can navigate to Copilot Studio and to the chatbot settings here:
Then we just need to simply paste the string and save. We can also think about what logs we would like to send – thinking especially about Log sensitive activity properties. That’s something we need to decide on, depending on the solution requirements. After that we can engage in to a chat in our test window. Let’s see what happens then!
Logs love!
After few chats in the test window, we can navigate back to our Azure resource, to Logs tab. When we’re back, we can simply query the resource to check the logs. But wait! It’s not that simple, right? 🤔 Yes, so the thing is that for App Insights the special query language is used to query the dataset – it’s called KQL (Kusto Query Language). Don’t worry! It’s quite easy to grasp. What you could start is just a simple query to retrieve all records. In case of Copilot Studio logs, we need to query customEvents table. When we perform a query, we should see something like this:
In the logs you have almost everything – from the user data to what topic has been invoked, what message has been sent etc. With this resource you can do almost anything with this data:
query for only certain bots,
check for any errors,
view how many conversations are for a given date range,
debug any potential problems, especially with generative answers node
and many more! Just as an example: here’s a query where I’m checking only one specific chatbot:
customEvents
| where cloud_RoleInstance == "YOUR CHATBOT NAME"
But there’s even more. With App Insights you can define:
alerts for each query, so that you’ll get informed when something wrong happens,
dashboards to monitor all the chatbots in one place,
etc.
Regarding alerts: you can read more about thenhere. There’s a lot of options here to monitor anything, so keep in mind to not get lost. 😉
Summary
Did you like the monitoring possibilities for chatbots? Personally, I really like them, because you can easily get everything in one place, without much effort. I’m going to use them frequently with my deployments in order to monitor all the chatbots easily!
Liked the post? Tell me in the comments section. 😉
how to use Generative answers action as a fallback to the Question action.
Hello! I’ve recently found out that quite a lot of people would like to configure a Question action with Generative answers as a fallback. The idea to do it is quite easy, although you need to perform some changes in the system topics. Want to know more? Let’s check it out!
1. Configure a Question action
First thing that you need to perform is to configure properly the Question action. By default it repeats the question 2 times, until it’ll receive an answer which’s available on the choices list. We need to disable it, so that it won’t repeat by choosing “Don’t repeat” option in the question behavior:
2. Configure the Escalate topic
Now when you try to input a different option than the ones that are defined, it should immediately redirect your chat to Escalate topic, which’s used when the chatbot is unable to answer the question. The idea here is quite simple: you can create a generative answers action here, in Escalate topic, and it’ll always use it, when someone would enter an unexpected input. Here I’ve configured it in my topic:
I’ve used following input in the action:
"Try to help the user based on the message from the user: " & System.LastMessage.Text
But you can try anything that’ll fulfill your needs.
Summary
In this short article, we’ve learned on how to use Generative answers action as a fallback for a question. I hope you liked it and it’ll help you create the best chatbot ever. 😉
Usually, when we’re chatting with the bot in Copilot Studio, we’re receiving just plain text messages. Did you know that there’s a possibility to tweak them a bit by using an adaptive card? Check out below, where I’m going to describe what is it.
Adaptive card – what’s that?
An adaptive card is a form of sending messages that can, as the name suggests, adapt to your needs. It’s based on the framework prepared by Microsoft. The design is based on the JSON syntax with a proper schema definition. An example adaptive card JSON looks like this:
What you need to consider when creating an adaptive card in Copilot Studio is:
make sure that you’re using a correct schema version:
When you enter the adaptive card designer, you should quickly notice a warning message. Don’t ignore it:
It states that selected host app (see the top of the screenshot) doesn’t support the schema version that was choosen in the upper right corner. Make sure to choose both the correct host app and the target version to avoid any errors.
make sure that you’ve choosen a proper host app:
In the dropdown you have, I assume, two options to choose, which apply to Copilot Studio – Bot Framework WebChat and Microsoft Teams:
Option that you’d choose depends on your needs – for a chatbot used in MS Teams the choice is obvious. What you’d need to make sure is that card you’ve designed is supported by all the channels that you’re going to publish to. The best way to check it is to verify what controls are not available for an app here: https://learn.microsoft.com/en-us/adaptive-cards/resources/partners
Unfortunately, Copilot Studio is not mentioned on the Host App list, so sometimes you’d need to try if it works on the test chat, before publishing to production. 😉
Formatting issues
Recently, a lot of people were asking about how to format an adaptive card, so that it can take dynamic values. It’s a very easy task! Let me explain it step by step:
1. Open an adaptive card action’s properties:
2. Select the button Edit JSON and choose Edit formula – that way the adaptive card JSON is being converted to a Power Fx Record type. This enables you to put dynamic values:
3. Type any expression or place a variable as a value of the field that you’d like to edit:
Here I’ve used string interpolation ($”{EXPRESSION}”), which’s a nice feature in Power Fx to make the string look more elegant. 😎 But you could also format it like: Today(). Always make sure though that the result from an expression is of correct type that’s expected by the field.
Summary
Isn’t the feature nice? It gives a lot more freedom in how your messages would look, when chatting with a chatbot. Of course, for simple cases I’d stick to the simple Question action, but if you need to prepare something more fancy, then an adaptive card is definitely a way to go!