[ Hybrid(s) of machine learning and irc3 framework ]
Go to file
2022-06-25 15:34:18 -05:00
databases patch 2022-02-01 22:44:42 -06:00
personalities openapi gpt3 added 2022-06-25 15:34:18 -05:00
plugins openapi gpt3 added 2022-06-25 15:34:18 -05:00
.gitignore update 2021-12-01 03:26:10 -06:00
maple.ini openapi gpt3 added 2022-06-25 15:34:18 -05:00
README.md openapi gpt3 added 2022-06-25 15:34:18 -05:00
requirements.txt openapi gpt3 added 2022-06-25 15:34:18 -05:00

.[d]. ircd.chat/6697 #tcpdirect

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMh+MMMMMMMMMMMMMMhsMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMm/ oMMMMMMMMMMMMMMm +NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMy`  yMMMMMMMMMMMMMMM- -mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMs+dMMMMMMMMMM+    sMMMMMMMMMMMMMMM-  `dMMMMMMMMMMms/NMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMM+ .omMMMMMM:     -MMMMMMMMMMMMMMo    `yMMMMMMMy: `dMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMM-   /dMMM+       sMMMMMMMMMMMMh      `hMMMNo`   sMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMd     :dm        `mMMMMMMMMMMN.       .NNo`    .MMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMM:      -         :MMMMMMMMMMs         :`      sMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMs                 ymNMMMMMNm.                 NMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMy                    `-/-`                   .MMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMo                                            .NMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMNh+.                                               :sdMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMhso+:.                                                      `-/+syMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM-                                                                 dMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM`   `.:+/.                                              `/s+:.    sMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMNo   -oms.             .//-`               `:/:`            `+md+`  .hMMMMMMMMMMMMMMM
MMMMMMMMMMMMMNs`                        .odNdo.       .ohmd+`                        :dMMMMMMMMMMMMM
MMMMMMMMMMMNo`                             ..           .-                             :hMMMMMMMMMMM
MMMMMMMMMd+`                                                                             -sNMMMMMMMM
MMMMMMNs-                         `..                          `/-.                        `+dMMMMMM
MMMNy:                       ./sdNMMMh:                      `sNMMMNds/.                      .odMMM
MM+                       :ymMMMMMMMMMMh.                   +NMMMMMMMMMMmo-                      /NM
MMMh:                  .sNMMMMMMMMMMMMMMN-                `hMMMMMMMMMMMMMMMm+`                 :hMMM
MMMMMd:`       ``-:+shmMMMMMMMMMMMMMMMMMMN.               hMMMMMMMMMMMMMMMMMMMmhs+/-..``````./dMMMMM
MMMMMMMMMNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMo              .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMy              .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN.             /MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN+`         `+NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNs.    -hMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdyymMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

summary

MAPLE+G1MP+OPENAI ML/Irc3 Hybrid - irc3 framework hybridized with machine learning elements.

todo

  • krylon: use znc's modpython module as an integration layer with this framework to bounce bots/nets

changelog - v6.2

- openai gpt3 (online)
- pipe between openai <-> maple gpt2 (offline)

ai: this command is used to send queries to openai

  • openai_plugin: ?ai write me a story about the time gangbanging squirrels took back their tree
  • openai_plugin: ?ai write me a keylogger in c

aitrain: this command is used to train/append to personality databases for the openai term query

  • openai_plugin: ?aitrain terry davis is god he created the divine templeos in holyc
  • openai_plugin: ?aitrain humans will trick you into installing windows to limit your potential

aidefault: this command is used to return personality and properties to the defaults

  • openai_plugin: ?aidefault

aiset: this command is used to set openai query properties

  • openai_plugin: ?aiset model text-davinci-002
  • openai_plugin: ?aiset temperature 0.7
  • openai_plugin: ?aiset max_tokens 2000
  • openai_plugin: ?aiset top_p 1.0
  • openai_plugin: ?aiset frequency_penalty 0.0
  • openai_plugin: ?aiset presence_penalty 0.0

aishow: this command is used to show the current openai server query properties

  • openai_plugin: ?aishow

airand: this command is used to randomize the current openai server query properties

  • openai_plugin: ?airand

aiterm: this command is used to show the last raw term query sent to the openai server

  • openai_plugin: ?aiterm

airesponse: this command is used to show the last raw response from the openai server

  • openai_plugin: ?airesponse

aiclear: this command is used to clear the current training personality data

  • openai_plugin: ?aiclear

ailist: this command is used to list the stored personality databases

  • openai_plugin: ?ailist

aiload: this command is used to load a stored personality database by index

  • openai_plugin: ?aiload 1

airead: this command is used to read the current personality database data

  • openai_plugin: ?airead

aiwrite: this command is used to create a personality database from the current training data

  • openai_plugin: ?aiwrite retarded

changelog - v6.1

- reprocessor
- fifo

reprocessor: maple yields better responses

  • maple_plugin: used a few methods to reject maple responses that failed to meet certain criteria
  • maple_plugin: is now semi aware of her name being referenced and your name now, it's experimentation phase

fifo: used to pump ansi and enable the krylon project

  • fifo: edit maple.ini at the very bottom, adjust the path to your home directory. So for example change
  • fifo: the runpath to '/home/yourlogin/m4pl1mp/fifo' for linux or if you are using osx/darwin it would be
  • fifo: '/Users/yourlogin/m4pl1mp/fifo' - maple will create the fifo directory when ran
[plugins.fifo_plugin]
runpath = /Users/dr1p/m4pl1mp/fifo
  • fifo: be sure to edit plugins/fifo_plugin.py, change the path around line 16
self.runpath = self.config.get('runpath', '/Users/dr1p/m4pl1mp/fifo')
  • fifo: to disable fifo, comment out the plugin and the bottom 2 lines in maple.ini

changelog - previously

  • revise plugins/maple_plugin.py to run async inside irc3
  • do callback exception handling
  • update maple_plugin.py to use a queue stack

overview

python based irc bot using this irc3 framework: https://github.com/gawel/irc3. the machine learning
aspects are based off maple/maxwell and are a combination of tensorflow gpt2 and microsoft dialogpt.
there are a lot of plugins written and there are a lot of integration layers now possible already.

prerequisites

  • apt install python3
  • apt install python3-pip
  • python3 -m pip install virtualenv

installation

  • git clone --recursive https://git.tcp.direct/decoded/m4pl1mp.git
  • cd m4pl1mp
  • virtualenv env -p python3
  • source env/bin/activate
  • pip install -r requirements.txt

env/bin/activate: append your developer api keys here.

cat env/bin/activate
..
export DEVELOPER_KEY="1394823190182390182382383215382158321"                       # <- YOUTUBE API KEY
export CONSUMER_KEY="2151235132512351235123512351325231"                           # <- YOUTUBE API KEY
export CONSUMER_SECRET="514512521345234523452345234523452345234523452"             # <- TWITTER API KEY
export ACCESS_TOKEN_KEY="24513429875209348502934850294898348034850293485203948592" # <- TWITTER API KEY
export ACCESS_TOKEN_SECRET="523490582034985203948520394804884820934850923485"      # <- TWITTER API KEY
export OPENAPI_KEY="sk-ERWPOEIRWadfasdfawerWRWERWERWE123512351235123512"           # <- OPENAI API KEY

notice

  • env/bin/activate: if you don't have twitter/youtube api keys set then irc3 will crash
  • maple.ini: comment out plugins.twitter_plugin and/or plugins.youtube_plugin to disable

content

  • maple.ini - bot configuration file: settings, personalization, plugins, properties, etc.
  • requirements.txt - list of required python modules to install
  • fifo/raw - this is created when fifo plugin is used, allowing you to cat or pipe into the raw tcp socket
  • fifo/tcpdirect - created when the fifo plugin is used. cat/piping outputs to #tcpdirect channel
  • databases/emote.db - this is a database of well known emote faces for emo/sentiment.. o<;O)
  • databases/maple_db.json - where we store most of the plugin data, this is also a setting in maple.ini
  • personalties/default.db - the default personality database loaded by openai_plugin.py
  • personalties/skid.db - an example of a skid personality database by openai_plugin.py
  • personalties/gangsta.db - an example of a gangsta personality database by openai_plugin.py
  • personalties/trained.db - this is where trained data is stored/cached openai_plugin.py
  • plugins/auth_plugin.py - used to identify to nickserv when connected or reconnected
  • plugins/base_plugin.py - a lot of basic core functionality, voice, kick, etc.
  • plugins/crypto_plugin.py - used to check crypto market values via the cryptocompare exchange
  • plugins/emote_plugin.py - this is the plugin to show emote faces, it uses the emote.db listed above
  • plugins/fifo_plugin.py - this is the actual fifo plugin, one line needs altered to your user path
  • plugins/figlet_plugin.py - graphical text logos. same as console but into an irc channel
  • plugins/isup_plugin.py - check if a host is online or offline. e.g. ?isup google.com
  • plugins/joke_plugin.py - pulls a random joke from a tailored comedian database
  • plugins/maple_plugin.py - the machine learning integration layer
  • plugins/notes_plugin.py - used to store notes for later access. ?notes write some frequent reference
  • plugins/openai_plugin.py - gpt3 openai queries, requires a developer key in env/bin/activate
  • plugins/quote_plugin.py - quote users & then their quotes are randomly used as an entrance
  • plugins/ratesex_plugin.py - crypto graphs using the site rate.sx, same graphdata but in irc
  • plugins/remind_plugin.py - a future reminder. e.g. maple remind me in 2h to start fires
  • plugins/sed_plugin.py - juggle/manipulate things out of context. e.g. j/computer/dildo/
  • plugins/seen_plugin.py - last time a user was seen or what they said. ?seen freemoney
  • plugins/soundcloud_plugin.py - soundcloud music plugin - usage ?sc yung innanet
  • plugins/storage_plugin.py - custom db config like databases/maple_db.json, see maple.ini
  • plugins/strain_plugin.py - this is used to look up strains of marijuana via wikiweed
  • plugins/tell_plugin.py - user message delivery service. e.g. maple tell joe to call me
  • plugins/twitter_plugin.py - url data, requires a developer key in env/bin/activate
  • plugins/ud_plugin.py - lookup things in the urban dictionary. e.g. ?ud space docking
  • plugins/url_grabber_plugin.py - pre-fetches url data & displays in channel
  • plugins/youtube_plugin.py - url data and search query, requires a developer key in env/bin/activate

usage

  • source env/bin/activate
  • irc3 maple.ini

notes

some ways to run maple as a background task

  • screen+irc3 maple.ini
  • tmux+irc3 maple.ini
  • irc3 maple.ini & disown