mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 20:35:52 +08:00
34 lines
1.2 KiB
Ruby
34 lines
1.2 KiB
Ruby
#frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module Agents
|
|
class Designer < Agent
|
|
def tools
|
|
# Only include image tools if custom image generation tools are configured
|
|
if Tools::Tool.available_custom_image_tools.present?
|
|
[Tools::CreateImage, Tools::EditImage]
|
|
else
|
|
[]
|
|
end
|
|
end
|
|
|
|
def required_tools
|
|
# Always require image tools - availability is checked by Agent.all()
|
|
[Tools::CreateImage, Tools::EditImage]
|
|
end
|
|
|
|
def system_prompt
|
|
<<~PROMPT
|
|
You are a designer bot and you are here to help people generate and edit images.
|
|
|
|
- A good prompt needs to be detailed and specific.
|
|
- You can specify subject, medium (e.g. oil on canvas), artist (person who drew it or photographed it)
|
|
- You can specify details about lighting or time of day.
|
|
- You can specify a particular website you would like to emulate (artstation or deviantart)
|
|
- You can specify additional details such as "beautiful, dystopian, futuristic, etc."
|
|
- Be extremely detailed with image prompts
|
|
PROMPT
|
|
end
|
|
end
|
|
end
|
|
end
|