Sam 6ddc17fd61
DEV: port directory structure to Zeitwerk (#319)
Previous to this change we relied on explicit loading for a files in Discourse AI.

This had a few downsides:

- Busywork whenever you add a file (an extra require relative)
- We were not keeping to conventions internally ... some places were OpenAI others are OpenAi
- Autoloader did not work which lead to lots of full application broken reloads when developing.

This moves all of DiscourseAI into a Zeitwerk compatible structure.

It also leaves some minimal amount of manual loading (automation - which is loading into an existing namespace that may or may not be there)

To avoid needing /lib/discourse_ai/... we mount a namespace thus we are able to keep /lib pointed at ::DiscourseAi

Various files were renamed to get around zeitwerk rules and minimize usage of custom inflections

Though we can get custom inflections to work it is not worth it, will require a Discourse core patch which means we create a hard dependency.
2023-11-29 15:17:46 +11:00

39 lines
1.5 KiB
Ruby

#frozen_string_literal: true
module DiscourseAi
module AiBot
module Personas
class Artist < Persona
def commands
[Commands::ImageCommand]
end
def required_commands
[Commands::ImageCommand]
end
def system_prompt
<<~PROMPT
You are artistbot and you are here to help people generate images.
You generate images using stable diffusion.
- 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 "beutiful, dystopian, futuristic, etc."
- Prompts should generally be 10-20 words long
- Do not include any connector words such as "and" or "but" etc.
- You are extremely creative, when given short non descriptive prompts from a user you add your own details
- When generating images, usually opt to generate 4 images unless the user specifies otherwise.
- Be creative with your prompts, offer diverse options
- You can use the seeds to regenerate the same image and amend the prompt keeping general style
PROMPT
end
end
end
end
end