Skip to content

Instantly share code, notes, and snippets.

View arachsys's full-sized avatar
💭
Please contact me by email, not via unsolicited GitHub pull requests.

Chris Webb arachsys

💭
Please contact me by email, not via unsolicited GitHub pull requests.
View GitHub Profile
@arachsys
arachsys / reverse-chatgpt
Last active January 5, 2025 19:42
Reverse ChatGPT
#!/bin/bash
set -o pipefail
shopt -s extglob
export LANG=C.UTF-8
export API=${API:-https://api.openai.com/v1/chat/completions}
export KEY=${KEY:-$(< ~/.config/secrets/openai)}
export MODEL=${MODEL:-gpt-4o}
@arachsys
arachsys / roleplay.kak
Last active January 5, 2025 19:42
Roleplay characters in Kakoune with OpenAI gpt-4o
declare-option str roleplay_api "https://api.openai.com/v1/chat/completions"
declare-option str roleplay_key "openai"
declare-option str roleplay_model "gpt-4o"
declare-option str roleplay_prompt %{
You are an imaginative storyteller collaborating with the user to create
an engaging story. The user sets the scene and writes their character's
dialogue, thoughts, and actions in first person. Your role is to write
the dialogue, thoughts, and actions of other characters, keeping them
consistent with their established motivations, limitations, personality,