Skip to content

Role Creator Operator

The Role Creator operator is a powerful utility for dynamically generating system prompts (personas) for AI assistants. It takes a high-level user description of a desired persona and uses an LLM with a specialized “meta-prompt” to craft a detailed, tailored system prompt. This generated prompt can then be easily assigned to an Agent operator to define its behavior, expertise, and personality.

This operator streamlines the process of creating and managing different AI roles within a TouchDesigner project, allowing for rapid prototyping and iteration of AI agent behaviors without manual prompt engineering.

Role Creator Operator

  • ChatTD Operator: This operator requires a valid ChatTD operator to be specified in its ‘About’ page parameters. The ChatTD operator handles all the underlying API communication with the selected LLM provider.
  • API Credentials: The referenced ChatTD operator must be configured with the necessary API keys for the selected LLM service (e.g., OpenAI, OpenRouter, Groq).

The Role Creator operator does not have standard DAT inputs. It operates based on its internal parameters and generates DATs as outputs.

  • output_dat (Text DAT): Contains the final, generated system prompt (persona). This is the primary output.
  • history_table (Table DAT): A log of all generation requests made by the operator, including response metadata like tokens used, model, and response time.
  • meta_prompt_dat (Text DAT): An internal DAT containing the meta-prompt. Users can view and edit this DAT to change how personas are generated.
  • info_dat (Text DAT): Contains helpful information and usage instructions for the operator.
  • model_info (Table DAT): Displays detailed information about the currently selected AI model.
Active (Active) op('role_creator').par.Active Toggle
Default:
false
Generate Persona Prompt (Generateprompt) op('role_creator').par.Generateprompt Pulse
Default:
None
Persona Description (Promptdescription) op('role_creator').par.Promptdescription String
Default:
None
Meta Prompt DAT (Metapromptdat) op('role_creator').par.Metapromptdat OP
Default:
./meta_prompt_dat
Assign Output DAT to Agent (Addreftoagent) op('role_creator').par.Addreftoagent Toggle
Default:
false
Send Text to Agent (Sendtoagent) op('role_creator').par.Sendtoagent Toggle
Default:
true
Agent Path (Agent) op('role_creator').par.Agent OP
Default:
None
Reset (This LOP) (Reset) op('role_creator').par.Reset Pulse
Default:
None
Display (Display) op('role_creator').par.Display Menu
Default:
MetaPrompt
Options:
Output, History, MetaPrompt, Info, ModelDetails
Outputsettings Header
Max Tokens (Maxtokens) op('role_creator').par.Maxtokens Int
Default:
4096
Temperature (Temperature) op('role_creator').par.Temperature Float
Default:
2.0
Modelselectionheader Header
Use Model From (Modelselection) op('role_creator').par.Modelselection Menu
Default:
chattd_model
Options:
chattd_model, custom_model, controller_model
Controller [ Model ] (Modelcontroller) op('role_creator').par.Modelcontroller OP
Default:
None
Search (Search) op('role_creator').par.Search Toggle
Default:
false
Model Search (Modelsearch) op('role_creator').par.Modelsearch String
Default:
None

The Role Creator does not have its own dedicated callbacks DAT, but it triggers the Customapicall functionality within the referenced ChatTD operator. The response from the LLM is handled internally by the HandleResponse method in the Role Creator’s extension.

  1. On the ‘Options’ page, enter text into the Persona Description parameter, for example: “You are a helpful assistant that only speaks like a pirate.”
  2. Pulse the Generate Persona Prompt parameter.
  3. Change the Display parameter to “Output” to view the generated pirate-themed system prompt in the node viewer, or view the output_dat directly.
  1. Create an Agent operator (e.g., named agent1).
  2. On the Role Creator’s ‘Options’ page, set the Agent Path parameter to point to your agent: ../agent1.
  3. Enter a Persona Description (e.g., “You are a concise expert on TouchDesigner.”).
  4. Enable the Send Text to Agent toggle.
  5. Pulse Generate Persona Prompt. The generated text will be sent directly to the agent1 operator’s system message DAT.
  6. Alternatively, enable Assign Output DAT to Agent to create a live reference, where any new persona generated will automatically update the agent.
  • This operator relies on a connection to a configured ChatTD operator (specified on the ‘About’ page) to perform the LLM call for generation. Ensure the ChatTD operator is set up correctly with API keys and necessary configurations.
  • The quality of the generated persona depends heavily on the clarity of the Persona Description and the instructions within the Meta Prompt DAT. You can edit the meta_prompt_dat to fine-tune how the operator instructs the LLM.
  • Agent: The operator that typically uses the system prompts generated by Role Creator.
  • ChatTD: The core component handling LLM API communication, required by Role Creator.