All products

Validate Python settings with AI

Give local settings explicit types and limits, then connect a display or callback to changes in their values.

Validate Python settings with AI when the same value is edited in a form and read by the rest of an application. Take a lighting preview with a brightness dial. The display might open at forty per cent, accept zero through one hundred, and refresh a label when the dial moves. Your agent can use param to put those rules on the underlying Python object.

Think about how the application should react as well as what it should accept. A label derived from a value can simply return its text. Saving a preset is a side effect that should run on a deliberate event. Keeping those behaviours separate helps when two controls change together.

What it does

  • Set firm limits on the brightness value independently of the suggested slider range.
  • Choose a fixed list of lamp presets and reject values outside it.
  • Derive a preview label from the current setting.
  • Update several related values together when someone loads a preset.
  • Keep each new object’s editable list independent of earlier objects.

Install and use

  1. Use Python with Param installed, adding Panel if the settings belong to its widgets.
  2. Give the agent valid and invalid values together with the desired response.
  3. Check the boundary values and confirm a preset refreshes each dependent display as intended.

FAQ

Source

Made by HoloViz Dev. Original skill: param, published on GitHub under the BSD-3-Clause licence.

View on GitHub