mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
## 🔍 Overview
This update updates existing persona tools: `Image`, `CreateImage`, and
`EditImage` to make use of the new AI image generation tooling added in
ce2e2788bc
. It also updates the image generation tool scripts to support editing
images on providers that support it.
## 📹 Preview
https://github.com/user-attachments/assets/d538aa77-b33d-4e11-9a39-11e3d508e355
36 lines
1 KiB
Ruby
Vendored
36 lines
1 KiB
Ruby
Vendored
#frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module Personas
|
|
class General < Persona
|
|
def tools
|
|
base_tools = [
|
|
Tools::Search,
|
|
Tools::Google,
|
|
Tools::Read,
|
|
Tools::ListCategories,
|
|
Tools::ListTags,
|
|
]
|
|
|
|
# Only include Tools::Image if custom image generation tools are configured
|
|
base_tools << Tools::Image if Tools::Tool.available_custom_image_tools.present?
|
|
|
|
base_tools
|
|
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: {date}, much has changed since you were trained.
|
|
PROMPT
|
|
end
|
|
end
|
|
end
|
|
end
|