intelligent
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

intelligent

license latest

A library to simplify the usage of AI models.

Supported services:

  • Gemini
  • OpenAI
  • Claude
  • Ollama
  • HuggingFace
  • Grok

Introduction

intelligent is a simplistic and clean utility library to simplify the usage of AI services for Node.js applications and libraries, intelligent is useful for AI-related Node.js applications, AI-related JavaScript libraries, etc.

intelligent supports multiple artificial intelligence services and offers model configuration.

Configuration

intelligent offers multiple configuration options to customize your model.

apiKey (string)

intelligent does not provide API keys/secrets already, you need to have your own. You can set the API key/secret using the code below

const ai = new GeminiService("YOUR-API-KEY");

Use the imported service not just GeminiService!

model (string)

The model parameter has an already set default value.

Service Default value Module name
Gemini gemini-1.5-flash GeminiService
OpenAI gpt-4o-mini OpenAIService
Claude claude-3-5-sonnet-20241022 ClaudeService
Ollama llava OllamaService
HuggingFace gpt2 HuggingFaceService
Grok grok-2-1212 GrokService

You can customize the model parameter using the code below

const ai = new GeminiService("YOUR-API-KEY", "PROVIDE-MODEL-HERE");

Use the imported service not just GeminiService!

Example

const { GeminiService } = require("intelligent");

const ai = new GeminiService("API-KEY");

ai.response("Why is the sky blue?").then((res) => {
  console.log(res);
});

Using default model value.

const { GeminiService } = require("intelligent");

const ai = new GeminiService("API-KEY", "gemini-1.5-pro");

ai.response("Why is the sky blue?").then((res) => {
  console.log(res);
});

Using gemini-1.5-pro as model value.

Readme

Keywords

Package Sidebar

Install

npm i intelligent

Weekly Downloads

6

Version

1.1.1

License

Apache-2.0

Unpacked Size

45.9 kB

Total Files

38

Last publish

Collaborators

  • myfer