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

s.u.a.i

v1.1.4

Published

You can train Prompts AI with either function or user data or get Unique and Emotional Responses.

Downloads

582

Readme

const AI = new SUPER_USER_AI;
console.log(await AI.AI('How are you'));

This project is designed to create unique, context-based responses to user queries using AI. The AI generates personalized answers based on its trained data and can respond to a wide range of user inputs.

Example usage:

import { SUPER_USER_AI } from "s.u.a.i";
const AI = new SUPER_USER_AI;
console.log(await AI.AI('My name is john! How are you')); 

Note: English parameters and questions only.

The core functionality includes:

  • Training: The system trains the AI based on user input and predefined responses, storing these in memory files.
  • Data Removal: It allows for the removal of specific training data based on query parameters.
  • Batch Training: The system can process and train the AI using bulk data, handling different types of responses (positive, adversarial, random).
  • Updating Files: The system can fetch and update essential project files from a GitHub repository.

The code is structured to efficiently manage training data and ensure the AI continuously learns and improves.

Example usage of the Train class:

import { SUPER_USER_AI } from "s.u.a.i";
const trainInstance = new SUPER_USER_AI;

// Example 1: Training the AI with a query and response
const result = await trainInstance.Train('How are you?', 'I am fine!', 'Happy');
/** 
 * functions,data and usage example 
 * Please read the note at the bottom.
 * @example await trainInstance.Train('what is a', 'I found match .:functions:. ::<userdata>::', 'Happy');
 * Useable function
 * .:search:. 
 * @description In-depth research from Google and summarized data for the question
 * .:weather:.
 * @description It gives location information of the user or weather data of the place mentioned in the sentence.
 * .:file:.
 * @description Returns the requested file links
 * .:summarize:.
 * @description summarize sentences
 * .:time:.
 * Returns the time data
 * ::<userdata>::
 * @description usable data 
 * @example const knownParams=["name","age","job","location","hobby","email","gender","education","phone","socialMedia","maritalStatus","languages","skills","favoriteFood","travelExperience","pets","goals","favoriteColor","diet","music","fitness"];
 **/
console.log(result); // Output: 'Trained!'

// Example 2: Removing a specific query's data from memory
const removalResult = await trainInstance.Remove('How are you?');
console.log(removalResult); // Output: 'OK!'

// Example 4: Performing batch training with data from a JSON file
await trainInstance.ALLTRAIN('memoryFile.json');

Example usage of the Update function:

import { SUPER_USER_AI } from "s.u.a.i";
// Assuming Code_Edit_Used class is in the same directory
const codeEditor = new SUPER_USER_AI;

// Example: Updating files from the GitHub repository
await codeEditor.Update(); 
// This will fetch and update the listed files from GitHub

Other Functions

import { SUPER_USER_AI } from "s.u.a.i";
const getData = new SUPER_USER_AI;
await getData.readData(username); //return example User name
//or...
await getData.writeData('username', 'john');//username => john

Note When getting data from the internet, you may need a search engine id with Google Search API. Write these values ​​with writeData.

import { SUPER_USER_AI } from "s.u.a.i";
const getData = new SUPER_USER_AI;
await getData.writeData('apikey', 'apikey');
await getData.writeData('searchengineid', 'id');

The Update function is responsible for fetching the latest versions of project files from a GitHub repository and saving them locally. Here's a breakdown:

  1. It defines a list of files to update.
  2. For each file, it fetches the data from the GitHub repository using the fetchFileFromGitHub function.
  3. If the file is successfully fetched, it writes the updated content to the local file system.
  4. After all files are updated, it triggers a restart of the system with a short delay.

In this example:

  • filelist contains a list of files that need to be updated from the GitHub repository.
  • fetchFileFromGitHub is called to retrieve the latest content for each file.
  • If the file is successfully fetched, it's written to the local system using fsp.writeFile.
  • If all files are updated successfully, the system is restarted after a delay.