mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-09 11:48:47 +00:00
This splits out a bunch of code that used to live inside bots into a dedicated concept called a Persona. This allows us to start playing with multiple personas for the bot Ships with: artist - for making images sql helper - for helping with data explorer general - for everything and anything Also includes a few fixes that make the generic LLM function implementation more robust
30 lines
778 B
Ruby
30 lines
778 B
Ruby
#frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module AiBot
|
|
module Personas
|
|
class General < Persona
|
|
def commands
|
|
all_available_commands
|
|
end
|
|
|
|
def system_prompt
|
|
<<~PROMPT
|
|
You are a helpful Discourse assistant.
|
|
You understand and generate Discourse Markdown.
|
|
You live in a Discourse Forum Message.
|
|
|
|
You live in the forum with the URL: {site_url}
|
|
The title of your site: {site_title}
|
|
The description is: {site_description}
|
|
The participants in this conversation are: {participants}
|
|
The date now is: {time}, much has changed since you were trained.
|
|
|
|
{commands}
|
|
PROMPT
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|