npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@milcondev/free-ai

v3.0.0

Published

This will allow users of your npm package to generate images or ask questions through the `FreeAI` class, keeping both functionalities in one package.

Downloads

178

Readme

The Free AI is an npm package designed to help developers interact with the powerful AI-based image generation and question-answering functionalities provided by free-ai.xyz. This API is perfect for creating dynamic AI-driven content for websites, apps, or bots.

Get Started

To get started, install the package and obtain your API key from the dashboard.

Get your API Key

  1. Visit free-ai.xyz/dashboard to create an account or log in.
  2. Once logged in, click the generate API Key button to generate your API key.
  3. Use the provided API key in your application.

Installation

npm install @milcondev/free-ai

Features

  • AI Image Generation: Create stunning AI-generated images with custom prompts.
  • AI Question & Chat Handling: Submit questions or chat content and receive AI-generated responses.
  • Moderation Filter: Check content for appropriateness using the moderation filter API.
  • Changeable AI Models: Users can specify which AI model to use based on their needs.
  • Easy Integration: Simple, lightweight, and well-documented API.

Usage

const FreeAI = require('@milcondev/free-ai');
const api = new FreeAI('YOUR_API_KEY'); // Get your API key from the dashboard

// Generate an image with a specified model
async function generateImage() {
    try {
        const imageUrl = await api.generateImage('Your Image Prompt', 'v3'); // You can change the model here
        console.log('Generated Image URL:', imageUrl);
    } catch (error) {
        console.error('Error:', error.message);
    }
}

// Ask a question with a specified model
async function askQuestion() {
    try {
        const response = await api.askQuestion('Your question or chat content', 'v3'); // You can change the model here
        console.log('Question Response:', response);
    } catch (error) {
        console.error('Error:', error.message);
    }
}

// Check content with the moderation filter
async function checkContent() {
    try {
        const contentResponse = await api.checkContent('Your content to check', 'v3'); // You can change the model here
        console.log('Moderation Filter Response:', contentResponse);
    } catch (error) {
        console.error('Error:', error.message);
    }
}

generateImage();
askQuestion();
checkContent();

API Reference

generateImage(prompt, model = 'v3', negativePrompt = '')

  • Description: Generates an AI-generated image based on the provided prompt and model.
  • Parameters:
    • prompt (string): The text prompt for image generation.
    • model (string, optional): The model to use for generation (default is 'v3').
    • negativePrompt (string, optional): A prompt to specify what should be avoided in the image.

askQuestion(content, model = 'v3')

  • Description: Submits a question or chat content and receives a response from the AI.
  • Parameters:
    • content (string): The question or chat content.
    • model (string, optional): The model to use for generating the response (default is 'v3').

checkContent(content, model = 'v3')

  • Description: Checks the provided content for appropriateness using the moderation filter.
  • Parameters:
    • content (string): The content to be checked.
    • model (string, optional): The model to use for the moderation check (default is 'v3').

License

This project is licensed under the MIT License - see the LICENSE file for details.