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

dialogflow-helper

v0.0.10

Published

bunch of dialogflow helper functions such as for making developer entity and session entity and many more using dialogflow v2 rest api

Downloads

3

Readme

dilogflow-helper

bunch of dialogflow helper functions such as for making developer entity and session entity and many more using dialogflow v2 rest api

Install:

npm i dialogflow-helper

contribute:

Feel free to fork and make pull requests Or if you are passionate and want to have direct access to the repo Just let me know I will add you as collaborator after signing a simple agreement document

install

npm i dialogflow-helper

if you wanted to install the latest nightly version npm i https://github.com/malikasinger1/dialogflow-helper.git

Warning: latest nightly version may have bugs, open issue in repo if you notice any bug in any version

initialize

init(cert: object, debug: boolean)

debug parameter is optional, default value is false, enabling debug will give extra logs

To run example quickly:

install ts-node: https://www.npmjs.com/package/ts-node clone this repository goto example folder, run command ts-node test.ts dont forget to replace credentials before running example

Usage (es6/typescript):

import {init, nodejsClient, agent, entityEntryInterface, entityv1, userEntityv2 } from 'dialogflow-helper'

initialize the helper library replace this json with your own service account

init({
    "type": "service_account",
    "project_id": "abc-project id",
    "client_email": "[email protected]",
    "private_key": "adfadfsdfsdfsdfsdf"
}, true)

to talk with chatbot through nodejs

nodejsClient.detectIntent("abcSession123", "hey chatbot read surah fatiha", {}).then((response: any) => {
    console.log("response: ", response.fulfillmentText)
})

to read intent list make sure you have enough IAM permission goto https://console.cloud.google.com/iam-admin/iam?authuser=0&project= look for service account you are using and make sure it is set to "Dialogflow API Admin" anything less then admin will not work

agent.getAllIntents().then(allIntents => {
    console.log("allIntents: ", allIntents)
})
agent.getIntent("ed90f12e-0391-475c-bf43-c13cfb363f7f").then(intent=>{
    console.log("intent: ", intent);
}) 

when you get all intents look last part of each intent name is id of that intent

// {
//     "name": "projects/bilal-assistant/agent/intents/ed90f12e-0391-475c-bf43-c13cfb363f7f",
//     "displayName": "quranAction.readSurah",
//     "priority": 500000,
//     "webhookState": "WEBHOOK_STATE_ENABLED",
//     "parameters": ...
//      ...
//   }

there are some other functions, I will put the full examples later sometime, pull request are most welcome

Best, M.Inzamam Malik, [email protected].