Rasa 3.0: Create a new assistant in Rasa 3.0 (Livecoding)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to today's stream uh we're going to be live coding today so without any further ado let's get into it uh i am starting in a completely blank repository uh also i've just realized that i've covered up the rosa logos if they're up there anyway um i'm starting with a completely blank repository nothing in it and what we're going to do is uh create a chat bot that can play rock paper scissors so if you're not familiar with rock paper scissors it's a game where you can make one of three shapes with your hands rock paper or scissors um rock beats scissors scissors paper paper beats rock um and that's the game we're gonna have a chat bot that plays and i picked this as a demo because it requires resetting slots we're going to use slots to store the information about what the player picked um and use that to figure out whether or not they win based on the computer's random choice uh so let's get into it um i've done a little bit of setup ahead of time uh by which i mean i've installed three uh so you can see here are my uh here is my operating system information rosin three hey amino hi jay um oh thank you yoga it's very sweet um we're in rasa 3.0 raza sdk version 3.0 everything across the board i'm using raza 3.8 if you remember rasa i'm using python 3.8 uh support for python 36 is being deprecated um and support for python 3.9 is not there quite yet so keep that in mind and then of course i am on windows 10 um which has some consequences that i will talk about when they come up so let's kick it off uh by are we in the right uh yes we are all right let's kick it off you doing raza init all right so it's going to be created in our current directory which is this empty directory i've created called rock paper scissors demo uh so let's do that and it's now creating a mood bot if you're familiar with that which is our initialization project and if you haven't used moonbot before it asks you how you're feeling and if you're happy it says nice and if you're sad it shows you a picture of a baby tiger or if you're on the command line gives you a link to a picture of a baby tiger so uh we're gonna train our uh model really quick and then i'm just gonna go through the files and point out the differences from raza 2.x to 3.0 and then we're going to get started on modifying this to be a rock-paper-scissors chatbot coffee hi ray welcome hopefully happy coding so my plan is to start with the core functionality um and if we get done in time play around with markers a little bit um and let's quickly talk to uh mood bot now so you can see where we're starting with and this is what will happen if you train raza in your local environment or in a vm actually anywhere where you initialize ros and this is going to be the same workflow and i will say one of the issues with windows is because of the way windows resolves localhost there is some additional a do i have anything open than that hmm okay so the error i'm getting is that i have something currently on 5005. do i have an action server running somewhere i think that must be what it is all right uh this worked yesterday famous class of that brought the server up and running all right it was a loop until complete only one usage of each socket addressed is normally permitted so i must have something running but where oh do i have a second vs code open yes poop don't save shh that was my work from yesterday all right let's try this one more time um rosachelle this time hopefully it'll work the joys of live code i am in fact doing this live this is not a skill for recording there we go all right um yoga asks i want to ask whether you could today capture more deeply dynamic conditional forms in raza 3 after the migration yesterday it doesn't work as it should anymore that would be fantastic i wasn't planning to get into forms today um i would post about that in the forums to get more assistance there and share your your code and then your specific issues um and if it's a bug i would post about it on a github i'd file a github issue all right uh tim says when will rasa 3.0 be compatible with raza x is there a time scheduled yet um tbd there's some exciting raza x stuff that's happened today so uh keep an eye on it any chance of using google colab um it's been a while since i used colab and i believe that they have pretty strict limitations on um doing uh external calls from within a collab notebook so i guess you could what i'm saying there is i guess you could use it for prototype i would absolutely not use it as a production environment um is is my stance there because it's not really designed to run things and serve as a host unless again it's been a while since i've used collab they might have done some pretty big changes um since the last time i used it all right moodbot let's start by saying hi i'm great i'm having a good day all right and then if i say bye it'll say bye and then i believe if i ask if i say if it's a bot are you a bot uh it'll tell me it's about so this is the functionality of moombot basically yep all right let's stop this conversation um and ruin it so we're gonna create a completely new assistant but first i want to go through and just show you a couple of the differences from 2.0 um so one of the major differences is that we have a new architecture or a new way that the architecture works so it's a graph architecture um and it's very very customizable you don't have to customize anything so if we go to the config you can see that i have this new recipe up here that specifies my model configuration there's a default one it works exactly the same this is new don't delete that you'll hit narrow if you delete that um but you don't have to do anything with it uh and if you did want to you know build a custom model um and change the architecture for your specific needs that's where you would you know point it towards the the recipe and then another thing to know is that the model names now have human readable words at the end of it so they still have the timestamp in the front but the model we just trained is synchronic avocado um so that's another difference and then i believe the domain file for this assistant will look pretty much the same yep because there are no slots in moodbot and that's the biggest change in the domain file um and then we don't have any markers that ship with moodmod i'm pretty sure because that would be in a markers.yaml and i don't see that so those are all the changes that you will see in moodbot let's get started changing this assistant to be a rock paper player a rock paper scissors playing assistant instead um so i want to keep goodbye affirm and deny these two i want to get rid of right now i'm just changing the domain file i'll go back and change the data later if you forget that when you try to change you'll get a little when you try to train you'll get a little um error message um i'm gonna actually change this to play probably and i'm going to say type rock paper or scissors to play so this is uh what the assistant is going to say to us uh to trigger the um the playing of the game um cheer up i don't need that help i don't need utter happy i don't need and i'm going to keep a goodbye and i am a bot and i'm going to add a new thing that our assistant can say so this would be a fourth thing uh i'm gonna say play again so once you've played if you want to play again i want to have a way for the assistant to say hey you can do that we're going to call that text do you want to play again okay so i think that's all the things that i want my assistant to say um you could imagine that we could have additional functionality like how many times you've won or something like that but we're keeping it simple for now because i want to get done in an hour uh session config we are not going to change um the intense uh a firm we're going to use for utter play again deny we're gonna use for utter play again bot challenge views for bot challenge you always want to have a bot challenge greet is what the user's saying so that should all be good um we might also want to have an inform intent so this is going to be a way for a user to just tell me something and i'm going to use it as a way to capture slots so let's add um some slots and by some slots i mean one slots all right and i just have the documentation up open in another page over here so i'm going to double check uh our uh syntax so first i want to say what i want the slot to be called and i'm going to call it choice so this is the slot that i'm going to use to store the thing the user chose so this will be rock paper or scissors um and for type so i have a couple options here one is that i could use a categorical slot that has to be one of three things i could also use a text slot so i just take whatever text the user provided and i think categorical slots make sense for this right because it's going to be one of three things rock paper or scissors uh and let me pull these docs over so i can double check uh the syntax for the slot type so for all the this is the text slot um this would make sense if uh maybe you had a large number of things well it's good still listed not as categorical i'm just talking through my design decisions here so you know what i'm thinking about um so categorical here we just say the type categorical and then the values that we want the slot to have which in our case is going to be one sec i got a spell categorical correct uh and then the values that that slot can take uh and in my case it can be rock it can be paper or it can be scissors all right um how am i going to so this all describes the structure of the information in the slot what i haven't told uh my chat bot yet is how to get that information and we're going to do that using mappings and mappings are now obligatory every slot has to have them um and for this i think it makes sense for me to back to the docs let's look at the mappings um i think it actually makes sense to pull this from an entity uh so this is what would have happened um automatically last time uh i wouldn't have had to have said this mapping that i want to fill this intent with an entity this slot with an entity now i do so i'm going to no it's too big uh well you're just gonna have to see the like a little little bit of the screen there that's okay uh t y p e there we go uh and then we're going to do sorry i am just uh checking the syntax again from entity so that's specifies what the where we're getting it from and then the specific entity that we're going to get it from i'm going to call choice so i'm going to create a new entity and that entity is going to go into this slot and it's going to be rock paper or scissors so we also need to add entities t e n t i t i e s uh and then it should be called choice all right i think that's everything that we need to change in our domain i think we're pretty much good to go there um let me check the chat really quick now that i have finished typing all the things i need to type um yeah uh reynolds says i'm seeing a yellow warning message about the unexpected intent policy uh oh you should be good it's a it's an experimental policy and that's what the warning is about um you can always disable it if you would like so it is in your config it's in here somewhere there we go so you could just remove the unexpected intent policy if you're not expecting to use it if you are going to do that you'd want to uncomment all of this and just delete it so sorry toss hopefully you were not hearing uh that yeah so if you just want to get rid of the warnings and you're not using the policy you can just get rid of the policy it's fine uh dude i use body and box before to test to raz a chatbot i don't think i have no uh yeah and yoga is just saying it they're letting you know that it's an experimental feature uh yeah hey emily all right so we have our domain updated um and this is where probably the biggest change in terms of what you're gonna need to write down is is in the specification of the slots um and now looking at it i'm super paranoid that some of these things are misspelled but we'll find out we'll get a helpful error message if that's the case um other things i want to change are in the data so for the rules um i'm going to keep this goodbye rule i want to say goodbye when my user says goodbye i'm going to keep the bot rule just keep that like it is that should all be good uh for the stories um i want i think two stories so one where somebody plays like and enters the assistant plays rock paper scissors and all of that happens and then one where they play it again um and actually before i do that i need to do an action so i have not done that yet and i will say i uh did a little work off camera and uh have a working rock paper scissors uh action file that i'm just gonna copy from here um and i'll walk through it really quick it is it doesn't matter what the code is right um it's just a placeholder for a custom action you might want to use uh so we have this action play rps rock paper scissors custom action um i have modified the this computer choice and this big section of um if statements uh from the dan elias's uh github repo which is under the mit license you can check it out i was too lazy to write my own if statements that's what that boils down to efficient i was very efficient uh so this is you know the basic syntax you'd have uh with the raza action nothing's really changed here um so we have this action play rock paper scissors it's called action play rock paper scissors we do need to add this to the domain so let's do that right now while i'm thinking about it actions [Music] all right uh i think that's the right number of spaces we'll find out if i'm wrong uh and we have a function in here that generates rock paper or scissors in you know a very explicit way i would say and then we have this action and this is run every time you trigger the action through a story or a rule we're only going to be triggering it through rules um and we have uh this bit here which gets the slot called choice where's my domain there's my domain this slot called choice which is going to be filled with this entity and will be categorical um and sets this variable user choice to be whatever's in there and then we're going to say to the user um through the chatbot you chose whatever their choice was just so they could see that and then we're going to use this function up here to generate the computer choice and then tell the user what the computer choice was um and then this just plays rock paper scissors and if they won they're told that they won and if the computer wins they're told the computer wins uh and if it was a tie they're told it was a tie so that's all that does there's no changing of slots in here it's just looking up the slot running the grain and then printing out the message all together so that's that action and again this could be any code it's you know whatever it is you need it to be uh for your specific project that you're working on uh and i've added it here as an action so i can also add it to my stories a little detour there all right so i'm going to call my first story play rock paper scissors so the user is going to greet and then my chat bot will reply with this utter play telling the user to type rock paper or scissors to play could i do that with buttons yes but they look bad in the command line so i'm not going to um that's why um and then we should trigger this action uh after the user uh informs so this is we haven't written uh examples for this yet but this is going to be what we're going to use to get the information that the user provides and then the assistant is going to run this action play rps um so the user says hi the assistant says um type rock paper scissors to play the user types something in uh this whole action is triggered and it'll just be printed out uh and then after that i think it makes sense to ask if they want to play again so that the interaction doesn't just end so that is the flow for that um and then i'm also going to have a second story for play again i could have this all in one story but i think it's a little bit more modular to have it you know separated out so [Music] if the the action the use of the the chatbot is going to say do you want to play again the user's going to say yes and then we're going to start this over again so we're going to say utter play etc etc and i shouldn't need to um specify all of the stuff from that but also they can say that they don't want to play again uh in which case it's going to be sort of the same the assistant's going to be like hey do you want to play again the user's going to say no i don't want to play again uh and then at that point we should probably we have a goodbye right we should probably just say goodbye because they're they're done and we want to be polite and let them know that something has happened okay so i think we are good for stories here right so this is they greet and then they play they play again they don't play again and i don't think we need to say um i don't think we need to append this to the end right because it'll be a duplication of this flow so i think we should be good to go there um yeah and i don't think a rule makes the sense because after we start playing someone could be like wait a minute are you a bot right so uh i think it makes sense that we don't have a rule here to keep a little bit of extra flexibility so stories check all done uh rules we're good with uh greek we can keep as it is goodbye we can keep as it is and firm and deny we can keep as it is we don't need mood great and we don't need mood unhappy and we are going to keep bot challenge so the only thing we have left is um we want to add an intent called inform and you could call it whatever you want but it's sort of by convention that if you have an intent that you're just using to get information you call it inform within the raza ecosystem it's up to you examples all right can i type no uh so we're gonna have rock which will be an example of our choice entity we're gonna have paper which will be an example of our choice entity and we're going to have scissors which is going to be an example of our choice entity and i could also have something like um scissor uh and have that be um a synonym that i then mapped to scissors but i don't care that much i think it'll be fine um but if i if i were noticing that people were trying to type scissor a lot then i might um add that to to help handle that variation in user input all right take a quick break and check the chat uh yeah uh i mean it says you're going to build buttons or leave the right or do you leave the user to write the input i am going to have them right um we could do buttons but they look bad on the console that's why i'm not doing it um visa says what's new in 3.0 great question so the three big differences are we have a new more flexible graph architecture if you don't want to mess with it you don't have to um it will just reduce training times um we also have um slots are now all explicitly defined so for every slot you have to say how it's being filled um if you have a slot and an entity that share names they don't automatically get filled anymore you can also reset slots which was a big pain point in the past so this is a great example of this if you're playing multiple times we're going to keep resetting this choice slot with whatever your choice was and then the third one is markers which we may not get into uh but basically it is a way for you to say when this event occurs i want you to make a note of it um and then specify what the event is so you can see like how many people you know uh asked about buying a car through your chatbot or whatever it is that you care to track so that should be really helpful for any sort of metrics that you have um that you're keeping track of those are the big differences and then there's a bunch of like smaller things um like general quality of life improvements um perhaps obviously the big architecture change required a lot of refactoring on the back end we paid down a lot of tech debt um and all of our sort of discussion about stuff is in the issues in our github which is all public so if you if you really care you can find out a whole lot more all right so that's what we've got so far and i'm just going to do a quick little checklist for myself actions check nlu data check rules check stories check models we're going to be trained tests i'm not going to deal with quite yet uh config we didn't have to change anything credentials we didn't have any change anything oh endpoints uh i am going to want to do was it controls control backslash i am going to want to do uh this because we're going to be using an action server so i want to make sure that the action endpoint is available and also because of the way that okay a little side note here only do this off here on windows and only do this until um so they're talking about making 127.0.0.1 yeah they're talking about making this url like a url where a website could be at and not localhost so um or the ip address to be like a website ip address and not localhost so don't do this into the future indefinitely but if you're noticing a big lag with an action server this can help if you are running in windows 7 plus um which is i'm assuming not a production environment for most people but you might be prototyping there so fyi uh all right endpoints check domain check all right let's try to train and find out where my typos are they're gonna be somewhere all right uh oh thank you so much emily blinked the blog post about the big uh changes and did i save everything i did not uh cannot access action action play rps as that name is not a registered action for this domain um so i believe what happened there is that i did not in fact save my domain file after i added this action so uh let's save the domain file and try again it wasn't a typo looks good all right um yeah crescent love says could you give us the exact code i'm very new to raza so following uh the tutorial exactly helps me great stuff by the way ah you're welcome um i mean it's not written yet we're writing it right now um i will share it somewhere um i don't know if it'll be on so basically i don't like to share things on the raza um repo unless we've committed to you know supporting them into the future um and i'll just need to like double check and think about where this code goes but yes it'll be up on github somewhere and shared and we'll add that to the youtube link description [Music] train train train um so one of the nice things about the graph architecture redesign that i mentioned is that um because we don't sort of linearly go through everything anymore and instead we only like draw the edges that we need in the graph if you train something that has a dependency only that thing and the thing it's dependent on will be retrained um and everything else won't be so you should see faster training times uh fingers crossed and let us know if you run into any issues with that all right so let's first let's run our action server and find out what typos i made there run actions and if you haven't used raza before the action server can be any server running any code that interfaces with the raza sdk um so here the server is running this um python like single python class um called action play rock paper scissors that plays rock paper scissors but it can be you know as complex as you need it to be for your specific use case um and our sdk and api are documented and open so if you don't want to use python you don't have to that just is the sdk that we have built for you um so i'm going to have this running on port 505.5 and now sorry i don't know when you're really zoomed in in vs code for some reason it um wraps very weirdly and i'm not entirely sure why all right so now i am starting uh my raza server uh this cobalt loop is our most recent model you can see here so if we tried to run this model which was a moodbot model it would fail catastrophically uh because we are referencing a lot of things that i have removed um let's see if it works fingers crossed i expect at least one weird bug i have to go find out what it is ah oh oh for the action class um yeah uh duchamp says can you show me how to use transformers like gpt3 and dolly here uh or give any hand yeah i mean so the easiest way to do that with raza is um using components and we have an integration with hugging face and hugging face you know hosts a lot of models um and um various transformer architectures um you're asking students about gbg3 ibcc i don't think hugging face supports gpt3 i believe you have to use the microsoft api for that um i'm trying to think if i have any good resources off the top of my head and i can't think of anything right now i'm sure you can find some some more information if you dig around but my um caution for you is to really think about be sure that you need a transformer language model before you start spending a lot of time figuring out how to make it work so empirically for folks that have been using raza particularly if you have a smaller data set transformer language models are less effective than other types of models so there's a really nice paper on um from a team that was building a chatbot for vietnamese using raza and they used ember which is a multilingual transformer language model and also i think fast text embeddings and they found that the fast text embeddings were significantly better for their application in terms of accuracy and performance and also just being faster and smaller so um yeah i just be sure that it's something that you really need for your application because i would say that most people don't anyway my little little rant there let's see if it works i'm expecting some sort of awful failure i don't know why something usually goes wrong right all right let's pick rock oh it's thinking nice okay i was right what have i done fail to execute custom actions okay create direct connection raise exceptions couldn't connect the server 55.5 ah that'd do it that's an easy one all right uh do i need to retrain i think i might need to retrain uh let me just try typing rock again and see if that works fine i don't know if it looks it up every time from the endpoints file all right uh so what happened there is i had the wrong address for my server uh let's quickly retrain shouldn't take that long uh crescent love says how safe stable is this version i tried downloading the 2.9 version had so many errors while downloading that i had to downgrade to 2.6 that is a great question so um you need to update pip like red letters underlined um pip has recently changed the way that they do dependencies uh or dependency management and starting with like i think 20.0.1 do not quote me on that i would have to look it up um so if you're not on the most recent version of pip you can get stuck in really nasty dependency resolution loops due to the way that they're handled um so i would first upgrade pip um and then try installing uh you should have a pretty easy time from there um and we're we're working on installation videos um there's i don't know maybe you've noticed we've had a lot of content around this launch uh and it's been a lot of work but yes i definitely hear you so for installing roster 3.0 install pip make sure that you are on raza you are on python 3.8 or no 3.7 or 3.8 not 3.6 not 3.9 um and then i would recommend pip install for raza um and if you are on windows of course maybe not of course you have to make sure that you have c plus available locally as well and you can just download that from um from microsoft so yeah uh sean says i'm thinking to you something that can search and give results uh plus dolly has text image capabilities so i thought to use it good question um i i don't you don't need language models for ir well you don't need like transformer language models for information retrieval and search um i would try doing it without first and see if it's good enough for you and if it's not then maybe spend some time investing in uh in the in the transformers transformer language model specifically all right let's say talking rasa shell start talking to our assistant let's see if it works this time now that i've pointed to an address that exists and not one that doesn't riveting uh and you can also see that the the name of the model has changed i really like this i know it's a small change but it makes it much easier for me uh because all of these numbers look basically identical to me um i know that they're not but all right um yes and this you can completely ignore this morning if you really need it to go away you can remove unexpected um we talked about that a little bit earlier all right let's see mmm fun okay [Music] encountered an exception okay so that's an error with this i'm going to do control c to stop my action server i'm wondering what i've done wrong uh and now i'm going to restart it uh with logging so i've added that dash v tag all right let's try it one more time oh so you might notice here that in response to um do you want to play again i'm just saying rock like i'm saying one of the things i want to play with i'm not saying yes um even though i didn't have that as a story right um i don't have you know we have a a firm here in our story after utter play again i never have utter play again and then in form but because inform is showing up here my assistant's like oh i know what to do when you say inform and you you give me this slot you want to apply rock paper scissors so that's why that works let's check our logging what i do 5055. 505.55 yeah that's right http http fail to execute all right what's up format of the specified network name is invalid all right i'm gonna try replacing this with localhost and see if that helps it might be looking for that it's definitely not looking for localhost and we'll just deal with the latency all right stop our assistant one more time it's always servers it's always server issues uh all right lots of train raza so we train real quick it should be fast because we're not changing much uh yeah john says there is a way i'll try and show thanks rachel yeah no i'd love to hear more um yeah especially if you get it up and running i think that could be uh really helpful so you might have noticed this time it was faster to train because i didn't update much uh all right so i don't know why i'm trying to do slashes around the shell it's launching all right loading models bitter download sounds like someone's having a bad thursday raza and then once it's up we should see uh you don't need to train just restart the server okay i don't know that i necessarily need to restart because it's not going to change where it is right all right let's try it what if i just i'm just going to start by saying rock and see if it works hello welcome to the stream nice it works ah let's say scissors um here's something so if i say something like scissor i believe my slot will not be reset ah okay yeah no way that's happening um so what's happening here is that because this is a categorical slot and this is not one of the options i believe it is being set to none which is the kitten extra category that happens when you have a categorical slot and because uh none is not here for user trace choice we're getting uh bumped down to this else um and we're being told that it was a tie so we could handle that if we wanted to uh but i think that there's something maybe a little bit more interesting to do here we got about 20 minutes so i think we can do it um i want to have a marker that records when we win basically or when we lose so i'm going to have another slot and i'm going to have that slot be set to win or lose every time i run the um the action where it occurs uh yeah john says endpoints and credentials don't need training no thank you hopeful i just that's always my default like if something's gone wrong we train i think it's a good a good raza uh good razor stance all right so we have our um you know foundational uh bits of our assistant working so let's stop this let's make you small uh and let's start by adding a new slot and then interacting with it with a marker so markers whoop this is from the docs um markers or conditions used to describe and mark points of interest in your dialogue uh so they go into a file which is not here in our in our mood bot based example called markers.yaml um and they look like this right so um i have the name of the marker and then all of my conditions that i want to be set for it so here we have some slots and then an action and when all of these are resolved or all true um our marker will be like aha i've noted that and add it to our list of places where the marker was marked i don't know maybe that's not the most eloquent way to say that but you know what i mean uh so we are going to set a new slot um i'm trying to think what would make the most sense so we could have like a slot that's like whether or not we won um we could have a slot that's like or we could have a marker that this hey this person wanted to play again so that could be a useful thing to track like how many times are people playing the assistant are playing rock paper scissors using the assistant or like using it more than once um we could look at how many completed games there are so that could be a good use of markers there's a lot of different ways that we could use them here that might be helpful uh when he says how does the computer choose what to play is it random it is random so it's uh determined in this function called computer choice which again is based on uh dan the dan elias's rock paper scissors python uh repository from github which is under an mit license um uh so it generates a random integer between one and three so one two or three one between one and three inclusive um if it's one it's rock if it's two it's paper if it's three it's scissors uh and it just it stores that and then this is rerun every time the action is run um yes is how the computer decides there's like a surprising number of reinforcement learning for rock paper scissors projects out there that i don't know that i'd recommend as a use of reinforcement learning but maybe helpful to learn the syntax of reinforcement learning yes i think so this is an example for um this is specifically an example for mood bot where you set the marker that the mood is expressed every time uh the intent is unhappy or great um i think let's start by doing a simple marker that just um is triggered every time we run our our play action so we can count how many times people play the game and of course it's just me running it locally here so maybe not the most helpful uh you know maybe not the most helpful thing to do but if you had this in production and you wanted to count like how many times people do a specific action this could be really helpful see you uh we're gonna call it marker played rock paper scissors uh and then we are going to we only really have one do i need to have boolean logic if i only have one uh following operators are supported and or not sequence at least once never yeah okay i don't need to uh so i am going to have it be intent space intent and then the intent nope action sorry uh intents are from users actions are from the assistant the action is action underscore rps is that right action play under action underscore play underscore rps uh so let's make sure that i have that right one space there we go that should be good all right um so i don't know if you can hear that there's a dog barking let's try i'm gonna retrain i don't know that i need to but it makes me feel better if i retrain um and again because of the speed ups if nothing needs to be retrained it won't be um so question from nick oh actually there's some other questions so shawn wants to know can i dynamically set reminders like if the user says remind me to get uh veggies remind me to play with baby etc is this possible yes um what you're probably going to want to do is um do a custom action so um maybe this face is me making me making this face is me thinking about async actions uh yeah because you probably don't want one action to be just like running right while you wait for something to happen um yes you can it's gonna have to be a custom action that's the end of that and then i would um just like send a dispatcher message basically um although i guess my question is are they gonna have the chat open indefinitely um it might make the most sense for an sms spot uh where you then trigger sending a specific sms at you know a certain point when the condition has been fulfilled um yes we do not have it like there's no pre-built way to do it in raza is what i'm saying there but yes it's definitely possible uh yeah uh nick wants to know on the forum there's a lot of issues with integrating raza with raza webchat bot front and the raza widget and issues related to websocket sanic is it updated to 21.9.3 um yes i have not worked on those things also webchat and bot front i believe are not maintained by us so um reaching out to the developers there might be the the best um or at least the speediest course of action all right let's try talking to our assistant and uh yeah see how these markers uh are set i think that i probably got syntax wrong somewhere like probably i have a space where i should have a tab or vice versa we always use spaces probably have a tab where i should have a space or vice versa so we'll find out yeah kind of like that i will integrate with something yeah um yeah i mean if i were building it i might use like heroku you know the one that i mean um i'd probably use a service like that that like triggers something all right scissors so it should now be uh all right what i'm looking for now is the output of markers because i think that i have done it slightly wrong all right let's try it out i honestly did not think we were good all the way to markers today i was hopeful uh but not that hopeful all right uh they are stored in your tracker store all right so let's pull these out to a uh csv there's a button there that says copy i don't know why i'm trying to do things uh and let's do just one more thing [Music] up so we should now have three instances of the marker being triggered in our marker store um which is part of the tracker store and i copied this um let's do it all right so we should now have there we go uh our csv files right here uh extracted markers i don't see any stats overall no i have done i have done a uh i've done a typo somewhere all right what'd i do marker underscore that's right marker configuration file yes a unique identifier at least one event condition also use operands we didn't need any operands unique markers identified yes excellent action action okay i didn't call it actions negated all right marker configuration here's an example i'm pretty sure maybe actions need an operand that could be my issue single operand operated with a list of conditions each marker's unique identifier can provide a single condition no it should be good i think my basic syntax is right but i think i've done something else you cannot reuse an existing name okay i have not done that uh the values assigned must be valid according to your domain they're both intense listed in the mood okay that should be good in a tracker store yes markers.yaml yes i called that right i called that right two summary statistics files and i will say this is an experimental feature um and it has worked for me before so i'm not sure what i've done uh process the tracker store in your bots endpoint.yaml a different endpoint tracker loading [Music] ros evaluate markers each tracker in the tracker store contains multiple sessions the script will process each session individually indexing them by session idx extracted markers okay yes that's what it should like uh it'll only be extracted once we want it extracted every time so i don't think we need that this is what it should look like it looks like this what have i done what what problems have i made um that i save my dialogues in a tracker store i don't think i have that's a great question to to do tracker store are stored in memory no okay so the cache is something else um yeah you know what i think i am uh not storing them at a tracker store there is one locally right so what used to happen i think okay i know what my issue is so what used to happen is we used to store uh the tracker store locally as a sequel light sounds right to me um so this is gonna have to point towards something else all right into tracker stores thank you acl i'm glad that my syntax is right um all right let's dig into this a little bit more we got five minutes we should we could do it all right to the tracker stores [Music] tracker stores in memory tracker store it is used if no track restores configured stores the conversation's history in memory uh the entire history is lost if you restart the raza server no configuration is needed to use in my sql tracker yes all right um i think i know what my issue is uh so i believe what happened is that i need to open a third a third terminal for this to actually work because when i stopped my shell i also killed the sanic server and with it all of my memories of all the conversations so let's try this one more time with my server continuing to run and i have to do command prompt because powershell don't work activate raza 3 8 the 3 8 there is for python 3.8 in case you are wondering and done okay now as long as my server is running and the tracker store exists in the server's memory i should be able to interact with it and i believe it'll point to that by default we'll find out markers will not work on the in-memory tracker i should just uh you should define a tracker store in your endpoint file i'm not gonna be able to do that in four minutes uh thanks acl um all right so the syntax is right um i don't really want to set up a tracker store and i don't think i have time right now because i don't i don't even know that i've read us um on this computer i'd have to uh i'd have to deal with uh figuring that all out but that's the syntax so if you did have this tracker store it would work um cool thanks and i think that is a great note to end on with one of my terminals crashing i mentioned previously markers like not super interesting or helpful if you're just running it locally for prototyping but once you have you know your big um you know system set up you're in production people are using your assistant you want to see what they're doing and that you know the things that are happening that you want to happen are happening or the things that you think that should be happening are happening and the things that you think are should not happen or not happening so negative markers like a whoopsie marker if some particular event that you don't want to happen happens might be a helpful thing to uh keep in mind as well um in a full production setup and not a toy um what would i call this a toy prototype should work perfectly well so that is uh the what we're going to call it today quick review of the things that are different in 3.0 the architecture again really doesn't affect you as a developer unless you want it to and if you have your own uh recipe that you would like to use um you can you know define it and then call it here but if you don't want to you don't have to we have a sensible default for you the slots now all require a explicit mapping so this slot choice is a categorical slot it's set from an entity instead of that happening automatically and silently behind the scenes i specify that it comes from the specific entity um if i had a form i would also not need to specify the mappings in the form i would just need to list i want to get the choice slot i want to get all these other slots because the mappings are defined in the slots which can be really helpful if you have a lot of forms will save you a lot of work and then the markers here's the syntax it's not going to work unless you have a tracker store set up that is not the in memory tracker store which i'm not going to do right now but if you had it that is what it would look like and then to get these csv files to get the csv files uh you run the raza evaluate markers command um and then additional uh information as needed um and this is what i used to generate to these files which if i did have a tracker store would have all my markers in them uh and all of the sort of uh useful information that i would need uh and then um i think the only other thing that would be like visible here would be um nope yep uh the model naming uh format has now changed so those are the big things that are different with raza 3.0 make sure if you are installing razor 3.0 you update pip first if you try to use an older version of pip the likelihood you'll get stuck in a really nasty slow dependency loop is very high so the most recent version of pip that works with your uh your version of python and operating system um python 37 and 38 only we're deprecating support for 36 and 3.9 is not supported yet and i think that's it those are all the big things so we have a bot that plays rock paper scissors just to show you the functionality again um scissors uh we won congratulations uh to all of us for winning against a random number generator that's all i've got today for live coding i hope this was helpful uh sorry about having the markers work i like i said i genuinely did not think that it was going to go as fast as it did um we will be back tomorrow the fabulous emma uh your community manager will be one of your community managers um has a great stream lined up for you we've got some interviews with contributors we got some like cool shout outs so definitely tune in to that um and then next week we will be back to our normal live stream schedule office hours on wednesday tbd on friday uh it'll be something it should be good and yeah we will see you then um if you have any issues with 3.0 please feel free to ask on the forums or to file a github issue if you run into a bug we'd love to help you out with that and make sure that everything's running well also big shout out to all the contributors and community members who helped give us feedback on 3.0 and helped us with testing and making sure that everything worked right very happy about that all right thanks so much for joining everybody good luck um this code will be available somewhere at some point in the future uh and we will talk to you soon so i hope you enjoy 3.0 thanks for joining today and we'll talk to you later bye you
Info
Channel: Rasa
Views: 29,427
Rating: undefined out of 5
Keywords:
Id: PfYBXidENlg
Channel Id: undefined
Length: 61min 59sec (3719 seconds)
Published: Thu Dec 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.