Development
Get started with Undrstnd Developers by setting up your development environment. This guide will help you integrate our AI models, whether you’re using Node.js, Python, or Next.js.
@undrstnd/ai-engine
is still in beta.Setting up Your Development Environment
Install Dependencies
To begin, ensure you have the required dependencies installed:
- Node.js (v18 or higher)
- npm (v7 or higher) or Yarn (v1.22 or higher) or pnpm (v6 or higher) for package management
- AI Engine SDK (v3.0.0 or higher) for AI models
API Key Configuration
You get 3 EUR free credit when you sign up. You can use this credit to test our AI models.
Before making any API calls, you need an API key.
- Sign up for an account.
- Go to the API key page and create a new API key.
- Copy the API key and save it in a secure location. Store the API key securely in your environment variables. Here’s an example for Node.js:
API Usage for Specific Frameworks
Next.js users can make use of API routes:
Authorization
The API key to authenticate the request.
Response fields
A boolean value that indicates whether the response is a stream.
The model ID to use for the AI model.
The max_tokens field specifies the maximum number of tokens that the AI model can generate in a single response. This helps control the length of the output. If not provided, the model will default to 512 tokens. Adjust this value based on the desired length of the response or the constraints of your application.
An array of messages to send to the AI model.