Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prague

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prague

EDSL for rules

  • 0.18.0
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by275%
Maintainers
1
Weekly downloads
 
Created
Source

Prague

An experimental rule system handy for intepreting user input, great for adding conversational features to apps. I thought of it as I walked around Prague on a sunny Spring day. This is not an official Microsoft project.

Major features of Prague:

  • strongly-typed when using TypeScript
  • deeply asynchronous via RxJS

Some types of applications you could build with Prague:

  • OS shell
  • Chat bot
  • Games

Building Prague

  • clone or fork this repo
  • cd recipes\fluent
  • npm install
  • npm run build (or npm run watch to build on file changes)

To add to your app

npm install -S prague-fluent

A guide to Prague

A note about terminology: Routes and Routers

Past versions of Prague were based on the network message router pattern. Messages were routed through rules, resulting in a route. As Prague has evolved (or pragueressed, if you will), the message has disappeared as a first class object, and so Router and Route are legacy terminology. I am extremely open to suggestions for replacements.

Overview

A Router is a rule in the form of a function that produces an output called a Route.

Routes

There are several types of Routes:

No

A NoRoute is the failure output of a rule.

Do

A DoRoute contains asynchronous code to run (do$ or do, depending if you prefer Observables or Promises).

The ultimate goal of a Prague rule system is either a DoRoute (run some code) or a NoRoute (don't do anything).

Match

A MatchRoute contains information extracted out of the system, such as an intent and/or entities. It contains a typed value such as a string or an array of entities, and a score, which is a floating-point number between 0 and 1 representing confidence in this information.

A MatchRoute is not an end into itself.

Template

A TemplateRoute contains a schemetized description of code to run, in the form action (name of action) and args (arguments to that function). The Templates class allows you to define a dictionary of such actions.

FAQs

Package last updated on 17 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc