I'm building a job search chatbot using Dialogflow. I want to ask user for the location, and return latest 10 jobs in that location. On clicking a job, I want to save that job id in context. How can I get the selected card id?
Have you tried using Google's location JSON object? You can find the docs here: https://developers.google.com/actions/reference/rest/Shared.Types/Location
Related
I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.
With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.
Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:
open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)
create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"
for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)
post a summary in a specific ms teams channel
I got Step 4 already working fine.
Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:
There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.
My big problem is, how am I supposed to get the calendar ID of a specific user?
Is there a way to get the specific calendarID for a username or a userid?
And then what can I do about Step 3?
Thank you a lot for your help.
greets Vulnin
Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar
Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values.
For point 3 Only the organizer can cancel the meeting. Please refer to this document.
You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.
I need to gather the name and mob number of the user before he starts interacting with the Chatbot. How can I do that?
You will need to create 2 parameters - name and phoneNumber to capture name and phone numbers.
Using the #sys.phone-number you can capture phone numbers from the user.
Using the #sys.given-name or #sys.last-name you can capture user's name.
Please note: currently only US English names are supported by the system entities in Dialogflow. So there may be some cases where you may not be able to capture all the names.
gather user information like name and mobile number before Chatbot
In your case, you need to use events
Step 1. trigger an event when your app initialize like from nodejs server and angular
Events are another way to trigger the intent without user interaction
when you intent trigger you can ask information
Twilio provides some documentation that explains how to create interactive voice experiences, for example, how to prompt for key-press from the caller and offer different menus or perform actions based on it.
However I cannot find any information on how I might be able to fetch data from a third-party service based on user input.
For example, suppose a user enters his zipcode into the keypad, I would like to fetch the weather from a weather API and return it to the user in speech form.
Is this possible? And if yes, how?
Very possible. You can take a look at the documentation below but the key widget is the HTTP Request Widget.
Studio Widget Library
https://www.twilio.com/docs/studio/widget-library#http-request
The relevant line is:
"JSON: If your HTTP Widget returns valid JSON, you should be able to access it via widgets.MY_WIDGET_NAME.parsed" variable.
Studio User Guide - Working with Variables
https://www.twilio.com/docs/studio/user-guide#working-with-variables
I am trying to create a chatbot application where user can create their own bot like Botengine. After going through google I saw I need some NLP api to process user's query. As per wit.ai basic example I can set and get data. Now I am confused, How I am going to create a botengine?
So as far I understand the flow, Here is an example for pizza delivery:-
User will enter a welcome message i.e - Hi, Hello ...
Welcome reply will be saved by bot owner in my database.
User will enter some query, then I will hit wit.ai API to process that query. Example :- Users query is "What kind of pizza's available in your store" and wit.ai will respond with the details of intent "pizza_type"
Then I will search for the intent return by wit in my database.
So, is that the right flow to create a chatbot? Am I in the right direction? Could anyone give me some link or some example so I can go through it. I want to create this application using nodejs. I have also found some example in node-wit, but can't find how I will implement this.
Thanks
What you need is webhook. You need to call different API's based on the user intent. I believe you can distinguish between different intents using parameters available in request. Check this out - Creating nodejs webhook for dialogflow
Is there a way to get the Dialogflow agent's conversation history programmatically?
I made a chatbot using Dialogflow. Now I need to get the conversation history of my agent programmatically.
That feature (an important one) is not available yet.
Since there is not an API call to retrieve a history of conversation So, the only way I know how is to
Go to the Training tab and see the conversations that way, although it only gives the reply in the form of the intent, and not what the bot actually replied.
But if you want to access all conversations history then don't go for one-click integration make your own login system with Outh2 and integrate using Detect Intent Api and store your conversations by logs.
Then you can get conversation history programmatically.
You need to log all the requests by writing your own code if you want
to get the history.
Depends on what history u meant to fetch.
You can easily integrate your agent with google chatbase and you can get the conversation history pretty simple.
You don't need to write any programs and all.
Chatbase Automatically keeps track of history and user messages.
But it can only store history of past 30 days. :)
If you are using the NodeJS library, aling with Dialogflow, one option for you would be to save your conversation inside the user object. That way the data /conversation can be accessed by the user in future sessions.
Here's how I'll go about implementing this:
function saveConv(conv){
Conv.user.storage.convToSave = 'conversation_object'.
}
To access it I'll do:
function getSavedConv(conv){
var savedConv = conv.user.storage.convToSave.
}
Please let me know if this amswered your question.