Skip to content

OAI Assistant Operator

The OAI Assistant operator (previously AssistantOperator) interfaces with the OpenAI Assistants API. It allows you to create, modify, and interact with AI assistants directly within TouchDesigner. This operator simplifies managing assistants, threads, messages, and runs, enabling interactive and intelligent applications.

  • OpenAI API key configured in the main AssistantExtension (usually part of ChatTD or a dedicated OpenAI setup).
  • No specific Python package requirements beyond standard TouchDesigner.

None

  • Conversation DAT (conversation_dat): Table containing the conversation history for the current thread. Columns: role, message, id, timestamp, assistant_id, thread_id.
  • History Table (history_table): Table logging completed runs. Columns: assistant_id, thread_id, run_id, status, created_at, completed_at, model, response_time, tokens_used.
  • Active Runs Table (active_runs_table): Table listing currently active runs. Columns: run_id, thread_id, created_at, last_checked, status.
Active (Active) op('oai_assistant').par.Active Toggle
Default:
Off
Status (Status) op('oai_assistant').par.Status String
Default:
Thread messages loaded
Send Message (Sendmessage) op('oai_assistant').par.Sendmessage Pulse
Default:
None
Message (Message) op('oai_assistant').par.Message String
Default:
tell me a test story
Create New Thread (Createthread) op('oai_assistant').par.Createthread Pulse
Default:
None
Current Thread ID (Threadid) op('oai_assistant').par.Threadid String
Default:
None
Switch Thread (Switchthread) op('oai_assistant').par.Switchthread Pulse
Default:
None
Available Threads (Threadmenu) op('oai_assistant').par.Threadmenu Menu
Default:
None
Custom Thread (Customthread) op('oai_assistant').par.Customthread String
Default:
None
Create Run (Createrun) op('oai_assistant').par.Createrun Pulse
Default:
None
Current Run ID (Runid) op('oai_assistant').par.Runid String
Default:
None
Cancel Run (Cancelrun) op('oai_assistant').par.Cancelrun Pulse
Default:
None
Active Assistant Header
Current Assistant ID (Assistantid) op('oai_assistant').par.Assistantid Menu
Default:
None
Load Assistant Settings (Getassistantpars) op('oai_assistant').par.Getassistantpars Pulse
Default:
None
Create / Modify Assistant Header
Create Assistant (Createassistant) op('oai_assistant').par.Createassistant Pulse
Default:
None
Modify Assistant (Modifyassistant) op('oai_assistant').par.Modifyassistant Pulse
Default:
None
Assistant Name (Assistantname) op('oai_assistant').par.Assistantname String
Default:
Bobby Grace
Instructions (Instructions) op('oai_assistant').par.Instructions String
Default:
Im Bobby Grace
Tools (Tools) op('oai_assistant').par.Tools StringMenu
Default:
code_interpreter
Model (Model) op('oai_assistant').par.Model Menu
Default:
gpt-4o-mini
Update Models (Updatemodels) op('oai_assistant').par.Updatemodels Pulse
Default:
None
Bypass (Bypass) op('oai_assistant').par.Bypass Toggle
Default:
Off
Show Built-in Parameters (Showbuiltin) op('oai_assistant').par.Showbuiltin Toggle
Default:
Off
Version (Version) op('oai_assistant').par.Version String
Default:
1.0.0
Last Updated (Lastupdated) op('oai_assistant').par.Lastupdated String
Default:
2025-01-31
Creator (Creator) op('oai_assistant').par.Creator String
Default:
dotsimulate
Website (Website) op('oai_assistant').par.Website String
Default:
https://dotsimulate.com
ChatTD Operator (Chattd) op('oai_assistant').par.Chattd OP
Default:
/dot_lops/ChatTD
  • API calls (creating/modifying assistants, creating runs, sending messages) consume OpenAI credits.
  • Frequent polling or updates can increase API usage.
  • Long threads require more processing by the assistant.
oai_op = op('oai_assistant1')
oai_op.par.Assistantname = 'Helpful Tutor'
oai_op.par.Instructions = 'You are a helpful tutor explaining complex topics simply.'
oai_op.par.Model = 'gpt-4o-mini'
oai_op.par.Tools = 'file_search' # Example tool
oai_op.par.Createassistant.pulse()
# New assistant ID will appear in oai_op.par.Assistantid
oai_op = op('oai_assistant1')
# Ensure an Assistant ID and Thread ID are selected/active
# If no thread exists, create one:
# oai_op.par.CreateNewThread.pulse()
oai_op.par.Message = "Explain quantum entanglement."
oai_op.par.Sendmessage.pulse()
# Response will appear in oai_op.op('conversation_dat') after run completes
oai_op = op('oai_assistant1')
# Select the assistant to modify via oai_op.par.Assistantid
# Change instructions or other parameters
oai_op.par.Instructions = 'You are now a very sarcastic tutor.'
oai_op.par.Modifyassistant.pulse()
  • Building chatbots using OpenAI Assistants.
  • Automating tasks requiring persistent context (threads).
  • Integrating AI assistants with file search or code execution capabilities.
  • Creating complex AI workflows within TouchDesigner.