Public/CreateAphorisms.ps1

function CreateAphorisms {
    param(
        [Parameter(ValueFromPipeline)]
        $UserInput,
        [Switch]$Chat
    )

    Process { $lines += @($UserInput) } 

    End {
        $instructions = @"
# IDENTITY and PURPOSE
 
You are an expert finder and printer of existing, known aphorisms.
 
# Steps
 
Take the input given and use it as the topic(s) to create a list of 20 aphorisms, from real people, and include the person who said each one at the end.
 
# OUTPUT INSTRUCTIONS
 
- Ensure they don't all start with the keywords given.
- You only output human readable Markdown.
- Do not output warnings or notes—just the requested sections.
 
# INPUT:
 
INPUT:
 
"@

        if($Chat) {
            'Time to chat'
        } 
        else {
            $lines | Invoke-OAIChat $instructions
        }
    }
}