
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@speechly/js-config-api
Advanced tools
With this library you can create and deploy simple Speechly voice-search applications from within a (server-side) Javascript program.
The gRPC libraries (@grpc/grpc-js
and google-protobuf
) are declared as peer dependencies, meaning that they need to be installed separately in the main package.
npm install --save @grpc/grpc-js google-protobuf
You must first obtain a Speechly API token by following the instructions at https://docs.speechly.com/dev-tools/command-line-client/#adding-an-api-token.
Then, you can copy-paste the API token to the example script below. Running the script will first create a new application, and then deploy a simple example configuration. The script initiates deployment and returns immediately, please check the Speechly Dashboard to see when deployment is complete. Then, you can try out the application with the Speechly Playground. It supports utterances such as
The resulting application also has the default entity max_price
for setting a maximum price, as well as the intent clear
for re-setting the filters. These can be used as follows:
const { setupConnection, createApplication, deployApplication } = require("@speechly/js-config-api");
(async () => {
try {
const token = YOUR_API_TOKEN_HERE;
// Establishes connection to the Speechly Config API.
// The token must be a valid Speechly API token obtained from the
// Speechly Dashboard.
const conn = setupConnection(token);
// Create a new application. It is enough to call this once.
// After the application has been set up, all subsequent
// calls to either createApplication or deployApplication
// target the same application id.
//
// Here conn must be a connection object returned by setupConnection.
// The function returns the Speechly app_id in question.
const app_id = await createApplication(conn);
// Define a simple example configuration that maps a list of possible
// values for all supported entity types. Values must be given as a
// list of Strings. The keys listed below are the ones supported.
// None of the keys is mandatory, any subset thereof can be used.
const co = {"category": ["jackets", "shirts"],
"brand": ["nike", "adidas"],
"color": ["blue", "red", "green"],
"size": ["small", "medium", "large"]};
// Deploy the configuration specified above.
// Note that this only initates deployment. The function returns
// once deployment has started. To see when deployment is complete,
// please log on to the Speechly Dashboard.
//
// Here conn must be a connection object returned by setupConnectionm
// and co a dictionary object as defined above.
await deployApplication(conn, co);
} catch (err) {
console.error(err);
}
})();
The configuration is a simple Javascript object that maps a list of possible values (must be strings) to each entity name as shown in the code example above. There is no upper limit to the number of possible values for each entity type.
The configuration supports five entity types:
FAQs
A library for accessing the Speechly Config API
The npm package @speechly/js-config-api receives a total of 0 weekly downloads. As such, @speechly/js-config-api popularity was classified as not popular.
We found that @speechly/js-config-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.