@hydra.ai/hydra-client
v0.2.1
Published
hydra.ai makes it easy to use A.I. inside workflows and your apps. You can use hydra.ai for text classification, named entity recognition and senitment analysis. You can create your own A.I. models or use some of our pre-built models.
Downloads
1
Readme
@hydra.ai/hydra-client
hydra.ai makes it easy to use A.I. inside workflows and your apps. You can use hydra.ai for text classification, named entity recognition and senitment analysis. You can create your own A.I. models or use some of our pre-built models.
Installation
npm
npm install @hydra.ai/hydra-client --save
Getting Started
- If you haven't already, create your free hydra account.
- Follow this guide to build your first model. It covers the steps for creating a pre-trained sentiment analysis model.
- Copy your API key, workspace ID, and model ID
import hydra from '@hydra.ai/hydra-client'
const { ApiClient, ModelService, PredictionRequest } = hydra
const client = new ApiClient('YOUR_API_KEY')
const model = new ModelService(client)
let workspaceId = 'YOUR_WORKSPACE_ID'
let modelId = 'YOUR_MODEL_ID'
let predictionRequest = new PredictionRequest('YOUR_TEXT_INPUT_FOR_SENTIMENT_ANALYSIS')
model.predict(workspaceId, modelId, predictionRequest, (error, data, response) => {
if (error) {
console.error(error)
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
console.log(response.status)
}
});