UNPKG

@aristech-org/nlp-client

Version:

A Node.js client library for the Aristech NLP Service

19 lines (16 loc) 533 B
import 'dotenv/config' import { NlpClient } from '@aristech-org/nlp-client' const auth = process.env.TOKEN && process.env.SECRET ? { token: process.env.TOKEN, secret: process.env.SECRET } : undefined const client = new NlpClient({ host: process.env.HOST, ssl: Boolean(auth) || Boolean(process.env.ROOT_CERT) || process.env.SSL === 'true', rootCert: process.env.ROOT_CERT, auth, }) const response = await client.runFunctions({ input: 'hello world', functions: [ { id: 'spellcheck-de' }, ] }) console.log(response)