npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oratio/oratio

v0.0.10

Published

Conversational interface framework

Downloads

2

Readme

Oratio Build Status

Emergent natural language processing

Getting started

Create a new HiveMind with the HiveMindBuilder:

const mind = HiveMindBuilder.createEmpty()
                  .registerModule(CoreHiveMindModule.CORE_HIVE_MIND_MODULE)
                  .registerModule(MathHiveMindModule.MATH_HIVE_MIND_MODULE)
                  .build();

Give it user input:

const response: Promise<IHiveResponse> = mind.process(input, locale, clientModel)

Show any applicable output to the user in any desired way, the response has the following fields:

{
   responses(): SingleResponse[],
   single(): SingleResponse,
   response(): string
    
}

Where a SingleResponse contains the following:

{
    // message key of the response, the application can translate to any language
    response: string,
    // possible parameters for the output / translation
    params: string[],
    // the certainty, if too low handle accordingly
    certainty: number,
    // a possible action the user wanted to perform, this is especially useful for application specific neurons
    action: () => void,
    // the scope to perform the action on, to allow using injected services in the action
    context: any
}

Adding custom neurons

Create a neuron which implements the following interface:

public process(words: string[], locale: string, context: RequestContext): Promise<INeuronResponse>

Add the neuron in the builder:

const mind = HiveMindBuilder.createEmpty()
        .registerModule(CoreHiveMindModule.CORE_HIVE_MIND_MODULE)
        .registerModule(MathHiveMindModule.MATH_HIVE_MIND_MODULE)
        .registerNeurons([new YourNeuronHere()])
        .build();

The array can obviously contain more neurons, as more custom neurons are created simply add them to the array.

Emergent system

There is no single major intelligence responsible for the system, instead every neuron processes every input and determines whether it can do anything with it. All neurons are collected in the hive, the hive makes sure all neurons receive user input until a response is found.

Neurons

A neuron can easily be added to the hive, all it has to do is implement the following function:

export interface IHiveMindNeuron {
    process(userInput: UserInput,
            context: RequestContext): Promise<INeuronResponse>;
}

then it has to be registered with the hive that manages all neurons.

Hive

The Hive processes all user input, it favors neurons who succesfully process user-input. The hive is constantly changing the order of the neurons to make sure the hive adjusts to what the user is currently doing.

Response

The response always contains a response, which is a code that can be localized by other applications. The response can also include an action (function: () => void) which the neuron thought the user intended. The action can be executed on a certain context, allowing the calling-party to use injected services in the action.