🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/ai

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/ai

Provider-agnostic LLM helpers (OpenAI, Anthropic, OpenRouter, or any OpenAI-compatible endpoint). Uses the encrypted credential vault.

latest
npmnpm
Version
0.3.0
Version published
Maintainers
4
Created
Source

@robinpath/ai

LLM integration: chat, complete, summarize, extract, classify, translate, sentiment analysis, and embeddings

Category Functions Auth License

Why use this module?

The ai module lets you:

  • Send a chat message and get a response
  • Get a simple text completion (returns just the text)
  • Summarize text using AI
  • Extract structured data from text using AI
  • Classify text into one of given categories

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

robinpath add @robinpath/ai

Quick Start

1. Set up credentials

ai.configure "openai" {"provider": "openai", "apiKey": $key}

2. Send a chat message and get a response

ai.chat "openai" "Explain quantum computing" {"system": "You are a teacher"}

Available Functions

FunctionDescription
ai.configureConfigure an AI provider (OpenAI, Anthropic, or custom)
ai.chatSend a chat message and get a response
ai.completeGet a simple text completion (returns just the text)
ai.summarizeSummarize text using AI
ai.extractExtract structured data from text using AI
ai.classifyClassify text into one of given categories
ai.translateTranslate text to a target language
ai.sentimentAnalyze the sentiment of text
ai.generateJsonGenerate structured JSON from a prompt
ai.embeddingGenerate text embeddings (OpenAI only)

Examples

Send a chat message and get a response

ai.chat "openai" "Explain quantum computing" {"system": "You are a teacher"}

Get a simple text completion (returns just the text)

ai.complete "openai" "Write a haiku about automation"

Summarize text using AI

ai.summarize "openai" $longText {"maxLength": 100}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/ai";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  ai.configure "openai" {"provider": "openai", "apiKey": $key}
  ai.chat "openai" "Explain quantum computing" {"system": "You are a teacher"}
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

License

MIT

Keywords

ai

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts