diff options
Diffstat (limited to 'src/gizmo')
| -rw-r--r-- | src/gizmo/wasp-clone2.el | 93 | ||||
| -rw-r--r-- | src/gizmo/wasp-dna.el | 10 |
2 files changed, 89 insertions, 14 deletions
diff --git a/src/gizmo/wasp-clone2.el b/src/gizmo/wasp-clone2.el index f99a5c99..3b76900f 100644 --- a/src/gizmo/wasp-clone2.el +++ b/src/gizmo/wasp-clone2.el @@ -4,6 +4,7 @@ (require 'wasp-utils) (require 'wasp-twitch) +(require 'wasp-dna) (w/defstruct w/c2-clone @@ -47,7 +48,7 @@ ,prompt))) (w/c2-gen-evaluate typingstyle - "Given the provided chatroom logs for a Twitch user, perform a forensic stylometry analysis of the form of the text. Try to identify key features of the text such as usage of abnormal punctuation/capitalization that would uniquely identify the user. Only describe the things that differ from a typical Twitch user. Your analysis should be summarized in at most two brief sentences. Do not provide any examples please. Please be brief and do not use unnecessary adjectives or adverbs! Be as short as possible! I am trying to mimic this user; present the information in a way that makes such mimicry easy!") + "Given the provided chatroom logs for a Twitch user, perform a forensic stylometry analysis of the form of the text. Try to identify key features of the text such as usage of abnormal punctuation/capitalization that would uniquely identify the user. Your analysis should be summarized in at most two brief sentences. Do not provide any examples please. Please be brief and do not use unnecessary adjectives or adverbs! Be as short as possible! I am trying to mimic this user; present the information in a way that makes such mimicry easy!") (w/c2-gen-evaluate zodiac "Given the provided chatroom logs for a Twitch user, determine that user's zodiac sign according to conventional astrology. Output only the zodiac sign and nothing else.") @@ -70,16 +71,86 @@ (w/c2-gen-evaluate kikibouba "Given the provided chatroom logs for a Twitch user, determine whether that user is more \"kiki\" or more \"bouba\". Output only kiki or bouba and nothing else.") -(defun w/c2-new (name k) - "Build a new (randomized) clone for NAME based on their DNA and profile. -Pass the resulting clone to K." - (w/twitch-get-user-id name - (lambda (userid) - (let ( (clone - (w/make-c2-clone - :userid userid - :name name))) - (funcall k clone))))) +(defun w/c2-new (name disposition biography) + "Build a new (randomized) clone for NAME with DISPOSITION based on their DNA. +The clone has a BIOGRAPHY describing it." + (let ( (clone + (w/make-c2-clone + :name name + :disposition disposition + :favoriteword "aardvark" + :biography biography + :class (w/pick-random (list "Fighter" "Magic-user" "Cleric" "Thief")) + :stack (w/pick-random (list "LAMP" "MEAN" "MERN" "MEVN" "JAM" "CLONK")) + :element (w/pick-random (list "fire" "water" "wind" "earth" "lightning" "heart")) + :faction (w/pick-random (list "nate" "lever" "tony")) + :quality (w/pick-random (list "F" "D" "C" "B" "A" "A+" "S-" "S+" "S++" "S+++")) + :narcissism (w/random-probability) + :machiavellianism (w/random-probability) + :psychopathy (w/random-probability) + :head + (w/encode-string + (f-read-bytes + (if (f-exists? (w/twitch-user-avatar-path name)) + (w/twitch-user-avatar-path name) + (w/twitch-user-avatar-path "default")))) + :thorax (w/random-color) + :abdomen (w/random-color))) + (total 0) + (timeout 0) + (logs (w/c2-take-random 30 (w/dna-user-log name))) + (fields '(typingstyle zodiac mbti enneagram humor bloodtype alignment kikibouba))) + (w/twitch-get-user-id name + (lambda (userid) + (setf (w/c2-clone-userid clone) userid) + (cl-incf total))) + (cl-decf total) + (--each fields + (funcall (intern (format "w/c2-evaluate-%s" it)) + logs + (lambda (x) + (setf (eieio-oref clone it) x) + (cl-incf total))) + (cl-decf total)) + (while (and (not (= total 0)) (< timeout 20)) + (message "Generating%s" (s-repeat timeout ".")) + (sleep-for 0.5) + (cl-incf timeout)) + clone)) + +(defun w/c2-upload (c) + "Upload the clone C to the database." + (let ((countkey (format "c2_count:%s" (w/c2-clone-userid c)))) + (w/db-get countkey + (lambda (old) + (let* ( (idx (if (s-present? old) (string-to-number old) 0)) + (key (format "c2_clone:%s:%s" (w/c2-clone-userid c) idx))) + (w/db-hmset key + "userid" (w/c2-clone-userid c) + "name" (w/c2-clone-name c) + "disposition" (w/c2-clone-disposition c) + "typingstyle" (w/c2-clone-typingstyle c) + "favoriteword" (w/c2-clone-favoriteword c) + "biography" (w/c2-clone-biography c) + "zodiac" (w/c2-clone-zodiac c) + "mbti" (w/c2-clone-mbti c) + "enneagram" (w/c2-clone-enneagram c) + "humor" (w/c2-clone-humor c) + "bloodtype" (w/c2-clone-bloodtype c) + "alignment" (w/c2-clone-alignment c) + "kikibouba" (w/c2-clone-kikibouba c) + "class" (w/c2-clone-class c) + "stack" (w/c2-clone-stack c) + "element" (w/c2-clone-element c) + "faction" (w/c2-clone-faction c) + "machiavellianism" (format "%s" (w/c2-clone-machiavellianism c)) + "narcissism" (format "%s" (w/c2-clone-narcissism c)) + "psychopathy" (format "%s" (w/c2-clone-psychopathy c)) + "quality" (w/c2-clone-quality c) + "head" (w/c2-clone-head c) + "thorax" (w/c2-clone-thorax c) + "abdomen" (w/c2-clone-abdomen c)) + (w/db-set countkey (format "%s" (+ idx 1)))))))) (provide 'wasp-clone2) ;;; wasp-clone2.el ends here diff --git a/src/gizmo/wasp-dna.el b/src/gizmo/wasp-dna.el index 4418e3ab..5c8f19a5 100644 --- a/src/gizmo/wasp-dna.el +++ b/src/gizmo/wasp-dna.el @@ -32,9 +32,13 @@ (defun w/dna-user-log (user) "Return a complete log of every message sent by USER." - (--filter - (s-equals? (s-downcase (car it)) user) - (w/dna-complete-log))) + (cond + ((s-equals? user "fake_test_user") + (-repeat 100 (cons "fake_test_user" "hello i'm the test user haha i love apples and oranges"))) + (t + (--filter + (s-equals? (s-downcase (car it)) (s-downcase user)) + (w/dna-complete-log))))) (defun w/dna-generate-from-logs (user) "Generate DNA from historical logs for USER. |
