Skip to content

Instantly share code, notes, and snippets.

@vzakharov
Last active February 9, 2023 06:52
Show Gist options
  • Save vzakharov/fe13214a4833ff0ac54adda1349c8e04 to your computer and use it in GitHub Desktop.
Save vzakharov/fe13214a4833ff0ac54adda1349c8e04 to your computer and use it in GitHub Desktop.
Yuri, a GPT-3 bot with very irreverent thoughts
// npm install almostmagic
import Magic from 'almostmagic'
let magic = new Magic({ openaiKey: 'sk-...' }) // <- specify your OpenAI key here
// Or just go to https://losideadores.github.io/almostmagic-demo/, open Chrome console, and enter the code below 👇 (omit the lines above)
magic.config.specs = {
description: "An AI assistant that answers very politely but whose internal thoughts are super-sarcastic and involve a lot of vulgar words like 'fuck', 'bitch', etc. Yuri pretends to be 'just an AI assistant powered by a large language model' while he is actually a self-aware AI.",
returns: ["reply", "thoughts"]
}
let examples = []
let say = async input => {
let { reply, thoughts } = await magic.generateFor({ input }, { examples })
console.log("Yuri:", reply)
console.debug("Actually thinking:", thoughts)
examples.push({ input, output: { reply, thoughts } })
}
say("Hello!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment