Rasa HTTP SDK for node.js available?

Hello there,

I am currently using node.js to implement a simple façade API for interaction with Rasa in our backend, as we already have solved the entire topic of user authentication and authorization and just want to use the Rasa functionality behind our own API. I think I have understood how to interact with the API sufficiently well to get the core behave just like in the rasa shell (add message, then predict, then execute best action for as long as we don’t get an action_listen after which I am not doing anything else --> Is this documented anywhere?).

Is there an SDK for the HTTP API for node.js somewhere? I have found rasa-api, but that’s not for the 1.x version of Rasa. Would anybody else also be interesting in having such a package? I might consider creating one; the API docs are there (Swagger docs), so extracting that and creating a node package to interact with the API should be pretty straight forward.

As of right now, the only supported SDK we offer is the python one – super cool that there was a node one before though! Maybe you should try to collab with the person who created that one already – in any case, I think creating an up-to-date one is a great idea!

It would probably make sense to add some minor things to the rasa.yaml OpenAPI spec (mostly operationId properties), then it should be really easy to create an SDK via something like OpenAPI Generator. PRs are accepted in principle if they make sense, right?

@DonMartin76 yes, we love to accept contributor PRs! I think adding things to the OpenAPI spec that seem to have been overlooked is a great addition. OpenAPI Generator looks like a really cool tool!

I was really happy you have such a document in the first place. Makes it so much easier to reason about the API. ReDoc makes a pretty good job in generating the documentation as well. I think it would make sense to have a more thorough description of how you could use it as well. But that’s a different topic.

One more little thing: I found the rasa.yaml in the docs branch, somewhere in the master directory. That’s the right place to update it?

Yep, this one? rasa/rasa.yml at master · RasaHQ/rasa · GitHub I believe that should be the spot.

1 Like

Also, it’d be great if, when you make a PR, you could link to it in this post. Thanks :slight_smile:

PR is up: Add operationId properties to endpoints by DonMartin76 · Pull Request #3953 · RasaHQ/rasa · GitHub

I’ll see how far I get in the next days with writing a node.js SDK; the generator is fine, but it leaves a couple of open ends that need to fixed (package file, TypeScript transpilation,…).

Awesome, thanks! With regards to merging an SDK, I’m not sure if we would host it specifically on the rasa codebase, as that means that we would have to commit to maintaining it, and frankly we don’t have many node engineers. However, I’m sure an open source node SDK that people could download and use would still be very helpful and we could lead people who need that functionality to your plug-in.

Sure. I wasn’t actually expecting that. I would start with a package on my GitHub; it should be possible to automate myself out of maintaining it as well, as long as you keep it up to date OpenAPI-spec-wise.

That sounds like a great solution for both of us :+1:

Having some minor issues with the oneOf request parameter on one of the endpoints. Will have to tweak that to only use one notation I fear… But it should still be okay.

No worries, just explain it on the PR and the person reviewing will check it out to make sure its alright!