JSPM

aryai

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q14926F
    • License MIT

    Lightweight wrapper for Aryan Chauhan's AI APIs (gpt5, deepseek, gemini-proxy, llama, lenna, brave, etc.)

    Package Exports

    • aryai
    • aryai/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aryai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    aryai

    A lightweight Node.js wrapper for Aryan Chauhan's AI APIs, providing easy access to multiple AI services including GPT-5, DeepSeek, Gemini, Llama, and more.

    🚀 Features

    • Multiple AI Models: Access to GPT-5, DeepSeek, Gemini, Llama-4, and more
    • Simple API: Clean, promise-based interface
    • Lightweight: Zero dependencies (uses Node.js built-in fetch)
    • Image Analysis: Support for image analysis through Gemini Proxy
    • Web Search: Brave search integration
    • TypeScript Ready: Works great with TypeScript projects

    📦 Installation

    Using npm:

    npm install aryai

    Using yarn:

    yarn add aryai

    Using pnpm:

    pnpm add aryai

    🔧 Requirements

    • Node.js 18+ (required for global fetch API)
    • If using Node.js < 18, you'll need to install and configure node-fetch

    📖 Usage

    Basic Import

    const { gpt5, deepseek, geminiProxy2, lenna, brave } = require('aryai');
    
    // Or import specific functions
    const { gpt5 } = require('aryai');

    GPT-5

    const { gpt5 } = require('aryai');
    
    async function askGPT5() {
      try {
        const response = await gpt5("What is artificial intelligence?", 1, false);
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askGPT5();

    Parameters:

    • prompt (string): Your question or prompt
    • uid (string|number, optional): User ID (default: 1)
    • reset (boolean, optional): Reset conversation context (default: false)

    DeepSeek

    const { deepseek } = require('aryai');
    
    async function askDeepSeek() {
      try {
        const response = await deepseek("Explain quantum computing in simple terms");
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askDeepSeek();

    Gemini Proxy (Image Analysis)

    const { geminiProxy } = require('aryai');
    
    async function analyzeImage() {
      try {
        const imageUrl = "https://example.com/image.jpg";
        const response = await geminiProxy("What do you see in this image?", imageUrl);
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    analyzeImage();

    Gemini Proxy 2 (Text Only)

    const { geminiProxy2 } = require('aryai');
    
    async function askGemini() {
      try {
        const response = await geminiProxy2("Write a short story about a robot");
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askGemini();

    GPT-3.5 Turbo

    const { gpt35Turbo } = require('aryai');
    
    async function askGPT35() {
      try {
        const response = await gpt35Turbo("What are the benefits of renewable energy?", 1);
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askGPT35();

    Llama-4

    const { llama4 } = require('aryai');
    
    async function askLlama() {
      try {
        const response = await llama4("Explain machine learning algorithms", 123);
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askLlama();

    Lenna AI

    const { lenna } = require('aryai');
    
    async function askLenna() {
      try {
        const response = await lenna("How does blockchain technology work?");
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    askLenna();
    const { brave } = require('aryai');
    
    async function searchBrave() {
      try {
        const response = await brave("latest news about artificial intelligence");
        console.log(response);
      } catch (error) {
        console.error('Error:', error.message);
      }
    }
    
    searchBrave();

    🎯 Complete Example

    const { gpt5, deepseek, geminiProxy2, lenna, brave } = require('aryai');
    
    async function aiComparison() {
      const prompt = "What is the future of artificial intelligence?";
      
      console.log("🤖 Asking multiple AI services the same question...\n");
      
      try {
        // GPT-5 Response
        console.log("🔵 GPT-5 Response:");
        const gpt5Response = await gpt5(prompt);
        console.log(gpt5Response);
        console.log("\n" + "─".repeat(50) + "\n");
        
        // DeepSeek Response
        console.log("🔴 DeepSeek Response:");
        const deepseekResponse = await deepseek(prompt);
        console.log(deepseekResponse);
        console.log("\n" + "─".repeat(50) + "\n");
        
        // Gemini Response
        console.log("🟢 Gemini Response:");
        const geminiResponse = await geminiProxy2(prompt);
        console.log(geminiResponse);
        console.log("\n" + "─".repeat(50) + "\n");
        
        // Lenna Response
        console.log("🟡 Lenna AI Response:");
        const lennaResponse = await lenna(prompt);
        console.log(lennaResponse);
        
      } catch (error) {
        console.error("❌ Error:", error.message);
      }
    }
    
    aiComparison();

    📝 API Reference

    Available Functions

    Function Description Parameters
    gpt5(prompt, uid, reset) GPT-5 API wrapper prompt, uid (optional), reset (optional)
    deepseek(prompt) DeepSeek API wrapper prompt
    geminiProxy(prompt, imgUrl) Gemini image analysis prompt, imgUrl
    geminiProxy2(prompt) Gemini text-only prompt
    gpt35Turbo(prompt, uid, reset) GPT-3.5 Turbo wrapper prompt, uid (optional), reset (optional)
    llama4(prompt, uid, url) Llama-4 Maverick prompt, uid (optional), url (optional)
    lenna(prompt) Lenna AI wrapper prompt
    brave(prompt) Brave search prompt

    Error Handling

    All functions return promises and should be used with async/await or .then()/.catch() for proper error handling:

    // Using async/await (recommended)
    try {
      const response = await gpt5("Your prompt here");
      console.log(response);
    } catch (error) {
      console.error("API Error:", error.message);
    }
    
    // Using .then()/.catch()
    gpt5("Your prompt here")
      .then(response => console.log(response))
      .catch(error => console.error("API Error:", error.message));

    🔧 TypeScript Support

    This package works great with TypeScript. Here's an example:

    import { gpt5, deepseek, geminiProxy2 } from 'aryai';
    
    interface AIResponse {
      status: boolean | string;
      message?: string;
      error?: string;
      [key: string]: any;
    }
    
    async function getAIResponse(prompt: string): Promise<AIResponse> {
      try {
        const response: AIResponse = await gpt5(prompt, 1, false);
        return response;
      } catch (error) {
        throw new Error(`AI API Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }

    🚀 Deployment on Replit

    This package is perfect for Replit projects! Simply install it in your Replit project:

    1. Open the Shell in your Replit project
    2. Run: npm install aryai
    3. Import and use in your code

    📊 Rate Limits & Best Practices

    • Be mindful of API rate limits
    • Implement proper error handling
    • Use appropriate uid values for session management
    • Cache responses when possible to reduce API calls

    🤝 Contributing

    Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

    📄 License

    MIT License - see the LICENSE file for details.

    🙋‍♂️ Support

    If you encounter any issues or have questions:

    1. Check the examples above
    2. Review the error messages (they're descriptive)
    3. Open an issue on the repository

    Made with ❤️ by Aryan Chauhan