Model API

Conrad Slimmer · Friday Demos · January 10, 2025 · 6:12

Unveiling a new API for model building

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. I've got a quick easy version of something to demo this morning find the appropriate screen I think it's this guy um let's see actually do this one all right here we go that is just so pleasant all right so request came into uh some customers are wanting to basically be able to build or enhance their models dynamically uh and Via API so I built out a few apis to support that this week so here we have a an API to modify the yaml for um a model and I've already prepopulated things I could also if I wanted it defaults to editing in Combined mode but just so that people know we could also do the edit in single model mode uh by adding a mode

  2. parameter to the form data so um just to show this isn't smoke and mirrors although it it's going to take a little bit of clean up before it gets into the product there's nothing here I just refreshed I'm going to go ahead and hit this API uh I got the result back it all worked if we come over to uh the same model you can see that Tada we just added this view with the yammo that I had in the post body but wait that's not all uh maybe I actually want to uh make these changes in a branch so I've also added a create Branch API once again I prepopulated everything to keep the demo running smoothly uh New Branch name demo Branch API

  3. go ahead and do that oh yep there's this and uh just so that uh and then of course after creating the branch this did give me the response I could parse and get the ID out of it but maybe I also just want the list of existing branches for part of my API scripting so you can see that this demo Branch API uh shows up I've got the API I've got there's another branch in here as well there should be another branch in oh yeah I've got test branch and I've got demo Branch API uh you can see if I jump into the oh I'll have to refresh because this browser doesn't have context on that so you can see I've got demo Branch API

  4. and you know just to kind of complete the cycle here um oh we want first to take take a look at the branch ID that we just created we're going to need that I'm over here over here and I've got uh add the branch parameter to this and you know when I was in here I realized well this is weird I actually want this in in a schema and so oh let's do schema public and we'll save this hopefully that worked oh yep and it came back and it actually told me the the new file name for this because now I've added it to a schema so worth noting that the name of the file may change when you modify it in the API uh

  5. come in here yeah oh no we're still not going to see the schema yet because we're not in the branch but I'll go into my branch and you can see that I've added the schema to it and it now properly shows up within that schema um one other I did also add a commit API so you can create a branch and commit which would get you all the way to where you could then go into GitHub and create a poll request uh but there's something a little off on that so I'll have to tweak that in order to be able to demo it but we're uh we're getting to where we could kind of automate some model modification stuff with these APS so there you

  6. have it it's really cool uh Conrad quick question about it what happens if you put bad or invalid yemo with like our validation uh I mean you'll get the same we're basically just hitting the back end AP we're just passing through to the backend API so you'll get the syntax error uh explained to you by the that you would if you were like the same syntax warning that you get in the IDE if you were to put in bad yaml uh as a error response in the API nice and is it uh you might have said this is it just view file is it all uh files in the model you could any any file you want and you know there's obviously some more work

  7. we need to add the ability to delete files and do you know list the the read all mostly what I did was the the C of the crud uh but you know we need to do the the rest of it well C and youu um we need to do the rest of it to to Really flush it out but it's kind of a proof of concept to sort of get the ball rolling on a couple of uh opportunity proof of Concepts as it were awesome for