Rating
Rating LOP
Section titled “Rating LOP”The Rating LOP provides a standardized way to rate items within a TouchDesigner project. It can be used manually by developers or programmatically by AI agents like Agent
or Gemini Live
. Ratings are saved to a JSON file, making it easy to track preferences, evaluate generated content, or collect feedback.
How It Works
Section titled “How It Works”The operator takes an “Item to Rate” (a string identifier) and a “Rating” (a float between 0.0 and 1.0). When the “Rate Item” pulse is triggered, it saves the item and its corresponding rating to a specified JSON file. This process can also be automated.
Parameters
Section titled “Parameters”Page: Rating
Section titled “Page: Rating”op('rating').par.Item
Str - Default:
"" (Empty String)
op('rating').par.Rating
Float - Default:
0.0
op('rating').par.Autorate
Toggle - Default:
Off
op('rating').par.Rateitem
Pulse - Default:
None
op('rating').par.Ratingfolder
Folder - Default:
"" (Empty String)
op('rating').par.Ratingfile
Str - Default:
ratings
op('rating').par.Lastratingfile
Str - Default:
"" (Empty String)
op('rating').par.Lastrateditem
Str - Default:
"" (Empty String)
op('rating').par.Outputdisplay
Str - Default:
"" (Empty String)
op('rating').par.Undolastrating
Pulse - Default:
None
Page: GetTool
Section titled “Page: GetTool”op('rating').par.Enabletools
Toggle - Default:
On
op('rating').par.Toolinfo
Str - Default:
"" (Empty String)
op('rating').par.Agentselectsitem
Toggle - Default:
Off
Page: About
Section titled “Page: About”op('rating').par.Bypass
Toggle - Default:
Off
op('rating').par.Showbuiltin
Toggle - Default:
Off
Agent Tool Integration
Section titled “Agent Tool Integration”This operator exposes 2 tools that allow Agent and Gemini Live LOPs to rate items and retrieve ratings for AI-driven evaluation and quality assessment workflows.
Use the Tool Debugger operator to inspect exact tool definitions, schemas, and parameters.
The most powerful feature of the Rating LOP is its ability to be used as a “Tool” by AI agents. When Enable Tools
is on, the Rating LOP exposes its functionality to operators like Agent
or Gemini Live
, allowing the AI to programmatically rate items based on its own evaluation.
How the GetTool Works
Section titled “How the GetTool Works”The GetTool
method in the Rating LOP dynamically generates two tools for an AI agent:
rate_item
: This tool allows the agent to assign a rating to an item.get_ratings
: This tool lets the agent retrieve a list of all previously rated items.
This is especially useful in generative workflows where an AI creates content (e.g., images, text, or music) and then evaluates its own output.
Usage with Agent and Gemini Live
Section titled “Usage with Agent and Gemini Live”To let an AI agent use the Rating LOP, you assign it as a tool in the agent’s parameters. This allows the AI to call the rate_item
and get_ratings
functions programmatically.
-
Select the Agent: Click on the
Agent
orGemini Live
operator in your network to open its parameters. -
Navigate to the Tools Page: Go to the Tools page in the parameter window.
-
Enable LOP Tools: Turn the Use LOP Tools toggle On.
-
Assign the Rating LOP: The External Op Tools parameter is a sequence of blocks for adding tools. Find an empty block (e.g., the first one, which has an OP parameter labeled
Tool 0 OP
). -
Drag and Drop: Drag your
rating
LOP from the network editor and drop it directly onto the OP parameter field.Drag / drop the Rating LOP here! -
Activate the Tool: Ensure the Mode menu for that tool block is set to
enabled
.
Once assigned, the agent will have access to the Rating LOP’s functions. You can then instruct it in your prompt to use these tools.
Example Prompt:
“You are an art critic. The user will provide you with an image. Your task is to analyze it and rate it on a scale from 0.0 to 1.0 based on its composition and color harmony. Use the
rate_item
tool to submit your rating.”
This workflow creates a powerful feedback loop where an AI can generate, evaluate, and record its own performance, enabling more complex and autonomous systems.