Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 1.68 KB

File metadata and controls

47 lines (28 loc) · 1.68 KB

Next.js Emotional Language Example

API Models Framework
batch language Next.js (TypeScript)

Open in StackBlitz

Cover

Overview

This is an example of how to add Hume AI's Emotional Language model to your full stack Next.js application.

This project uses API Routes to call the Hume API. without revealing your API key to the client-side code.

It's important to note that while this hides the API key from the client side code, you would likely want to include authentication middleware so that your API key isn't widely useable by anyone who knows the URL.

Getting Started

First, create an .env file with your Hume API Key.

echo "HUME_API_KEY=your api key here" > .env

Next, install the required dependencies:

npm install

Then, run the development server:

npm run dev

Using the App

Open http://localhost:3000 with your browser.

You should now be able to enter a path to a text file in the input field and see the results of the Emotional Language endpoint.

If fetching results is successful, you can view the results in the panel to the right.

Switch between the different emotions using the dropdown selector to see how the text is analyzed.