Chat Session Operator
The Chat Session LOP facilitates the creation, management, and control of multi-agent chat conversations within TouchDesigner. It allows users to define agent roles, set conversation rules, inject system or user messages, and monitor the flow of dialogue. This operator is particularly useful for prototyping conversational AI applications, testing agent interactions, and creating controlled chat environments.
Requirements
Section titled “Requirements”- Properly configured Agent LOPs connected within the network.
- No additional Python packages required.
Input/Output
Section titled “Input/Output”Inputs
Section titled “Inputs”None
Outputs
Section titled “Outputs”- Conversation Log (DAT): Stores complete chat history (roles, messages, agent IDs, timestamps, round numbers).
- Event History (DAT): Records session events (start, agent additions, round advancements).
- Agent States (DAT): Tracks the status of each agent (IDLE, READY, ACTIVE, COMPLETE, ERROR).
- Configuration (DAT): Stores session configuration parameters as JSON.
Parameters
Section titled “Parameters”Session Page
Section titled “Session Page” Status (Status)
op('chat_session').par.Status
String - Default:
None
Chat is Active (Active)
op('chat_session').par.Active
Toggle - Default:
None
Current Round (Currentround)
op('chat_session').par.Currentround
Integer - Default:
None
Agent Count (Agentcount)
op('chat_session').par.Agentcount
Integer - Default:
None
Template Name (Template)
op('chat_session').par.Template
String - Default:
None
Max Rounds (Maxrounds)
op('chat_session').par.Maxrounds
Integer - Default:
None
Max Empty Retries (Maxretries)
op('chat_session').par.Maxretries
Integer - Default:
None
Set Pars From Python (Setpars)
op('chat_session').par.Setpars
Toggle - Default:
On
Controls Page
Section titled “Controls Page” Begin / Restart Session (Beginsession)
op('chat_session').par.Beginsession
Pulse - Default:
None
Extend Session (+1 round) (Extendsession)
op('chat_session').par.Extendsession
Pulse - Default:
None
End Session (Endsession)
op('chat_session').par.Endsession
Pulse - Default:
None
Pause Session (Pausesession)
op('chat_session').par.Pausesession
Pulse - Default:
None
Play Session (Playsession)
op('chat_session').par.Playsession
Pulse - Default:
None
Clear Conversation (Clearconversation)
op('chat_session').par.Clearconversation
Pulse - Default:
None
Chat System Message (Systemmessage)
op('chat_session').par.Systemmessage
String - Default:
None
Send User Message (Usermessage)
op('chat_session').par.Usermessage
Pulse - Default:
None
Message (Message)
op('chat_session').par.Message
String - Default:
None
Add Single Agent (Addsingleagent)
op('chat_session').par.Addsingleagent
Pulse - Default:
None
Agent OP (Agentop)
op('chat_session').par.Agentop
OP - Default:
None
Reset / Remove Agents (Resetsession)
op('chat_session').par.Resetsession
Pulse - Default:
None
About Page
Section titled “About Page” Bypass (Bypass)
op('chat_session').par.Bypass
Toggle - Default:
Off
Show Built-in Parameters (Showbuiltin)
op('chat_session').par.Showbuiltin
Toggle - Default:
Off
Version (Version)
op('chat_session').par.Version
String - Default:
None
Last Updated (Lastupdated)
op('chat_session').par.Lastupdated
String - Default:
None
Creator (Creator)
op('chat_session').par.Creator
String - Default:
None
Website (Website)
op('chat_session').par.Website
String - Default:
None
ChatTD Operator (Chattd)
op('chat_session').par.Chattd
OP - Default:
None
Performance Considerations
Section titled “Performance Considerations”- Performance depends on agent complexity and conversation length.
structured
role mode adds JSON parsing overhead.- Monitor the Agent States output DAT for agent responsiveness.
Usage Examples
Section titled “Usage Examples”Setting up a Basic Session
Section titled “Setting up a Basic Session”- Create a
chat_session
LOP. - Create two or more
agent
LOPs and configure them. - On the
chat_session
LOP, go to the “Controls” page. - Drag and drop each
agent
LOP onto theAgent OP
parameter and pulseAdd Single Agent
for each one. - Set the
Chat System Message
to give the agents a topic to discuss. - Set the
Max Rounds
to the desired number of rounds. - Pulse the
Begin / Restart Session
parameter to start the chat.
Injecting a User Message
Section titled “Injecting a User Message”- During an active session, pulse the
Pause Session
parameter. - Enter your message in the
Message
parameter. - Pulse the
Send User Message
parameter. - Pulse the
Play Session
parameter to resume the chat.
Common Use Cases
Section titled “Common Use Cases”- Prototyping multi-agent conversational AI.
- Testing agent interactions and responses.
- Creating controlled chat environments for research.
- Building interactive narratives with multiple characters.
- Generating sample multi-agent conversations.