1.4.2 • Published 6 months ago

s.u.a.i v1.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Usage Example

  const AllData = await AI.AI(await answers.question);
  console.log(`\x1b[92m${(JSON.stringify(AllData, null, 2).replaceAll(/\n\n/g, '\n'))}\x1b[0m`);
  /*** @example For example ***/
console.log(`\x1b[93m${AllData.Train}\x1b[0m`);
console.log(`\x1b[93m${AllData.AI}\x1b[0m`);
console.log(`\x1b[93m${AllData.Question}\x1b[0m`);

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. Join my discord group
@faker-js/fakerafinn-165afinn-165-financialmarketnewsagent-baseaggregate-errorajvampamp-messageansi-colorsansi-escapesansi-regexansi-stylesanymatchapparatusargparsearray-eacharray-sliceasn1assert-plusast-typesasyncasynckitaws-sign2aws4axiosaxios-retryb4ababel-code-framebabel-corebabel-generatorbabel-helper-call-delegatebabel-helper-define-mapbabel-helper-function-namebabel-helper-get-function-aritybabel-helper-hoist-variablesbabel-helper-optimise-call-expressionbabel-helper-regexbabel-helper-replace-supersbabel-helpersbabel-messagesbabel-plugin-check-es2015-constantsbabel-plugin-macrosbabel-plugin-transform-es2015-arrow-functionsbabel-plugin-transform-es2015-block-scoped-functionsbabel-plugin-transform-es2015-block-scopingbabel-plugin-transform-es2015-classesbabel-plugin-transform-es2015-computed-propertiesbabel-plugin-transform-es2015-destructuringbabel-plugin-transform-es2015-duplicate-keysbabel-plugin-transform-es2015-for-ofbabel-plugin-transform-es2015-function-namebabel-plugin-transform-es2015-literalsbabel-plugin-transform-es2015-modules-amdbabel-plugin-transform-es2015-modules-commonjsbabel-plugin-transform-es2015-modules-systemjsbabel-plugin-transform-es2015-modules-umdbabel-plugin-transform-es2015-object-superbabel-plugin-transform-es2015-parametersbabel-plugin-transform-es2015-shorthand-propertiesbabel-plugin-transform-es2015-spreadbabel-plugin-transform-es2015-sticky-regexbabel-plugin-transform-es2015-template-literalsbabel-plugin-transform-es2015-typeof-symbolbabel-plugin-transform-es2015-unicode-regexbabel-plugin-transform-regeneratorbabel-plugin-transform-strict-modebabel-preset-es2015babel-registerbabel-runtimebabel-templatebabel-traversebabel-typesbabylonbalanced-matchbare-eventsbare-fsbare-osbare-pathbare-streambase64-jsbasic-authbasic-ftpbcrypt-pbkdfbinary-extensionsblblessedbodecboolbasebrace-expansionbracesbrowser-or-nodebsonbufferbuffer-crc32buffer-fromcall-bindcallsitescamel-casecapital-casecaselesschalkchange-casechardetcharmcheeriochokidarchromium-bidichrono-nodeclean-stackcli-cursorcli-spinnerscli-tableaucli-widthcliuicloneclsxcluster-key-slotcolor-convertcolor-namecombined-streamcommandercompromiseconcat-mapconstant-caseconvert-source-mapcore-jscore-util-iscorsercosmiconfigcronercss-selectcss-whatcsstypeculvertdashdashdata-uri-to-bufferdayjsdebugdeepmergedefaultsdefine-data-propertydegeneratordeldelayed-streamdetect-filedetect-indentdevtools-protocoldir-globdom-helpersdom-serializerdomelementtypedomhandlerdomutilsdot-casedotenvecc-jsbnefrtemoji-regexend-of-streamenquirerentitiesenv-pathserror-exes-define-propertyes-errorsescaladeescape-string-regexpescodegenesprimaestraverseesutilseventemitter2eventemitter3expand-tildeextendexternal-editorextract-zipextrareqp2extsprintffakerfast-deep-equalfast-fifofast-globfast-json-patchfast-json-stable-stringifyfastqfclonefd-slicerfetch-blobfill-rangefind-rootfindup-syncfinedflagged-respawnfollow-redirectsfor-infor-ownforever-agentform-dataformdata-polyfillfs-extrafs.realpathfunction-bindgeneric-poolget-caller-fileget-east-asian-widthget-intrinsicget-streamget-urigetpassgit-node-fsgit-sha1globglob-parentglobal-modulesglobal-prefixglobalsglobbygopdgraceful-fsgrad-schoolhar-schemahar-validatorhas-ansihas-flaghas-property-descriptorshas-protohas-symbolshasownheheader-casehoist-non-react-staticshome-or-tmphomedir-polyfillhtml-encoding-snifferhtml-to-texthtmlparser2http-proxyhttp-proxy-agenthttp-serverhttp-signaturehttps-proxy-agenticonv-liteieee754ignoreimport-freshindent-stringinflightinheritsiniinquirerinterpretinvariantip-addressis-absoluteis-arrayishis-binary-pathis-core-moduleis-extglobis-finiteis-fullwidth-code-pointis-globis-interactiveis-numberis-path-cwdis-path-insideis-plain-objectis-relativeis-retry-allowedis-typedarrayis-unc-pathis-unicode-supportedis-windowsisbinaryfileisexeisobjectisstreamjs-gitjs-tokensjs-yamljsbnjsescjson-parse-even-better-errorsjson-schemajson-schema-traversejson-stringify-safejson5jsonfilejsprimkareemkind-oflazyliftofflines-and-columnsloadshlodashlodash-nodelodash.assigninlodash.bindlodash.defaultslodash.filterlodash.flattenlodash.foreachlodash.getlodash.maplodash.mergelodash.picklodash.reducelodash.rejectlodash.somelog-symbolsloose-envifylower-caselru-cachemake-iteratormap-cachemathjsmemjsmemory-pagermerge2micromatchmimemime-dbmime-typesmimic-fnmimic-functionminimatchminimistmittmkdirpmodule-details-from-pathmongodbmongodb-connection-string-urlmongoosempathmquerymsmute-streamnanoidnaturalneedleneo-asyncnerdamernetmaskno-casenode-cmdnode-domexceptionnode-fetchnode-plopnode-summarynormalize-pathnssocketnth-checkoauth-signobject-assignobject-inspectobject.defaultsobject.mapobject.pickonceonetimeopeneroraos-homediros-tmpdiros-utilsp-mappac-proxy-agentpac-resolverpakoparam-caseparent-moduleparse-filepathparse-jsonparse-passwdparse-srcsetpascal-casepath-casepath-is-absolutepath-parsepath-rootpath-root-regexpath-typependperformance-nowpgpg-cloudflarepg-connection-stringpg-int8pg-poolpg-protocolpg-typespgpasspicocolorspicomatchpidusageploppm2pm2-axonpm2-axon-rpcpm2-deploypm2-multimeterpm2-sysmonitportfinderpostcsspostgres-arraypostgres-byteapostgres-datepostgres-intervalprivateprogresspromptlyprop-typesproxy-agentproxy-from-envpslpumppunycodepuppeteerpuppeteer-coreqsqueue-microtaskqueue-tickreactreact-domreact-isreact-transition-groupreadreadable-streamreaddirprechoirredisregenerateregenerator-runtimeregenerator-transformregexpu-coreregjsgenregjsparserrepeatingrequestrequire-directoryrequire-in-the-middlerequires-portresolveresolve-dirresolve-fromrestore-cursorreusifyrimrafrun-asyncrun-parallelrun-seriesrxjssafe-buffersafe-stable-stringifysafer-buffersanitize-htmlsaxsbdschedulersecure-comparesemversentence-casesentence-tokenizersentimentset-function-lengthshimmerside-channelsiftsignal-exitsimple-statisticsslashsmart-buffersnake-casesockssocks-proxy-agentsource-mapsource-map-jssource-map-supportsparse-bitfieldsplit2sprintf-jssshpkstdin-discarderstopwords-isostreamxstring_decoderstring-similaritystring-widthstrip-ansistylissuffix-thumbsugarsupports-colorsupports-preserve-symlinks-flagsylvestersysteminformationtar-fstar-streamtext-decoderthreethroughtitle-casetldtstldts-coretmpto-fast-propertiesto-regex-rangetough-cookietr46trim-righttslibtunnel-agenttv4tweetnacltx2type-festtyped-query-selectortypescriptuglify-jsunbzip2-streamunc-path-regexunderscoreundici-typesunionuniversalifyupper-caseupper-case-firsturi-jsurl-joinurlpattern-polyfillutil-deprecateuuidv8flagsverrorvizionwcwidthweb-streams-polyfillwebidl-conversionswhatwg-encodingwhatwg-urlwhichwordnet-dbwrap-ansiwrappywsxtendy18nyallistyamlyargsyargs-parseryauzlyoctocolors-cjszod
1.4.2

6 months ago

1.4.1

7 months ago

1.4.0

7 months ago

1.3.5

7 months ago

1.3.4

7 months ago

1.3.3

7 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.2.0

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago