![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
api-ai-speech-context
Advanced tools
Generates a Google Cloud Speech API
SpeechContext
for your
API.AI agent.
generateSpeechContext
takes two parameters:
summary
: An API.AI agent summary object with the keys name
, entities
, and intents
.*blacklist
: An array of words to blacklist from the context.api-ai-agent-downloader
.It returns an array containing words and phrases based on your agent's entities and intents. Non-blacklisted single words are given highest priority, then phrases that contain at least one non-blacklisted word. Entities within intent templates (e.g. '@sys.any') are removed.
The array comports with the Google Cloud Speech API's SpeechContext usage limits.
const agentDownloader = require('api-ai-agent-downloader');
const { generateSpeechContext } = require('api-ai-speech-context');
const fs = require('fs');
const agentName = 'agent_foo';
const developerToken = 'abc123';
const blacklist = ['bad', 'words', 'and phrases'];
const removeCommonWords = true; // true by default
agentDownloader.getSummary(agentName, developerToken)
.then(summary => {
const context = generateSpeechContext(summary, blacklist, removeCommonWords);
fs.writeFileSync('./speechContext.json', JSON.stringify(context));
})
.catch(error => console.error(error));
FAQs
Generates a Google Cloud Speech API SpeechContext for an API.AI agent.
The npm package api-ai-speech-context receives a total of 2 weekly downloads. As such, api-ai-speech-context popularity was classified as not popular.
We found that api-ai-speech-context demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.