0.1.1 • Published 5 months ago

prompt-mana v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Prompt Mana

Template management for AI prompts with versioning support.

Installation

bun add prompt-mana

Quick Start

import { PromptMana } from 'prompt-mana'

// Initialize with your API endpoint
const promptMana = new PromptMana({
  baseUrl: 'https://your-api-url.com'
})

// Fetch a prompt template
const prompt = await promptMana.getPrompt('greeting-template')

// Compile with variables
const compiled = await promptMana.compile(prompt, {
  name: 'AI Assistant'
})

// Use with OpenAI
const completion = await openai.chat.completions.create({
  ...compiled,
  messages: compiled.messages
})

Development

# Install dependencies
bun install

# Run development server
bun run dev

# Build package
bun run build

# Deploy to Cloudflare Workers
bun run deploy

Database Setup

Create a D1 database:

bun run wrangler d1 create prompt-mana

License

MIT