PersonaStore.h header
#include <ew/app/PersonaStore.h>
Namespace ew::app
Persona struct
struct ew::app::Persona
A named AI persona: a display name and the system prompt that shapes the assistant's voice and role (a line editor, a brainstorming partner, a continuity checker, and so on). A persona is applied by using its system prompt as the leading system message of a request.
Members
QString ew::app::Persona::name
The persona's display name.
QString ew::app::Persona::systemPrompt
The system prompt that defines the persona's behaviour.
bool operator==(const Persona &, const Persona &)=default
Personas compare equal when both fields match.
Functions
std::vector< Persona > ew::app::builtInPersonas()
The personas offered out of the box (a general assistant, a line editor, a brainstorming partner, and a continuity checker), used when the user has not defined their own.
std::vector< Persona > ew::app::loadPersonas(const Settings &settings)
Loads the user's saved personas from a Settings store; returns builtInPersonas() when none are saved or the stored value is malformed. Pure with respect to the store, so it is unit-testable with an in-memory Settings.
void ew::app::savePersonas(Settings &settings, const std::vector< Persona > &personas)
Saves personas to settings (as a JSON array under the "ai/personas" key), replacing any existing list. Saving an empty list clears the key, so the built-ins return on the next load.