vibe-is-odd
v1.0.3
Published
Check if a number is odd using ai
Downloads
8
Readme
vibe-is-odd
A more powerful is-odd checker using AI! 🤖
Why?
Traditional is-odd functions are limited by their reliance on basic mathematical operations. vibe-is-odd harnesses the power of artificial intelligence to determine if a number is odd, bringing unprecedented sophistication to this fundamental programming task.
Installation
npm install vibe-is-oddSetup
OpenAI (default)
export OPENAI_API_KEY="your-api-key-here"
export AI_MODEL="gpt-4o" # optional, this is the defaultOther Providers
vibe-is-odd uses the AI SDK, so you can use any supported provider! See the AI SDK documentation for setup instructions for Anthropic, Google, Groq, and other providers.
Usage
import { VibeIsOdd } from 'vibe-is-odd';
// Check if a number is odd using AI
const result = await VibeIsOdd(7);
console.log(result); // true
const result2 = await VibeIsOdd(4);
console.log(result2); // falseFeatures
- ✨ AI-powered odd number detection
- 🔧 Configurable AI models via environment variables
- 🚀 Async/await support
- 📦 ES modules ready
- 🧠 Leverages the collective knowledge of large language models
API
VibeIsOdd(number)
Returns a Promise that resolves to a boolean indicating whether the number is odd.
Parameters:
number- The number to check
Returns:
Promise<boolean>- True if the number is odd, false otherwise
Environment Variables
Required (choose one):
OPENAI_API_KEY- Your OpenAI API keyANTHROPIC_API_KEY- Your Anthropic API keyGOOGLE_GENERATIVE_AI_API_KEY- Your Google API keyGROQ_API_KEY- Your Groq API key
Optional:
AI_MODEL- The AI model to use (defaults to "gpt-4o")
License
MIT
