<!-- # hard line break macro for HTML -->

# fiftyone.operators.operator

FiftyOne operators.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Classes:**

| [`OperatorConfig`](#fiftyone.operators.operator.OperatorConfig)(name[, label, description, ...])   | A configuration for an operator.   |
|----------------------------------------------------------------------------------------------------|------------------------------------|
| [`Operator`](#fiftyone.operators.operator.Operator)([_builtin])                                    | A FiftyOne operator.               |
| [`PipelineOperator`](#fiftyone.operators.operator.PipelineOperator)([_builtin])                    | A FiftyOne pipeline operator.      |

### *class* fiftyone.operators.operator.OperatorConfig(name, label=None, description=None, dynamic=False, execute_as_generator=False, unlisted=False, on_startup=False, on_dataset_open=False, disable_schema_validation=False, delegation_target=None, icon=None, light_icon=None, dark_icon=None, allow_immediate_execution=True, allow_delegated_execution=False, default_choice_to_delegated=False, resolve_execution_options_on_change=None, allow_distributed_execution=False, rerunnable=True, risk_level=RiskLevel.DANGEROUS, view_target=True, \*\*kwargs)

Bases: `object`

A configuration for an operator.

* **Parameters:**
  * **name** – the name of the operator
  * **label** ([*name*](fiftyone.core.annotation.attributes.md#fiftyone.core.annotation.attributes.AttributeSpec.name)) – a label for the operator
  * **description** (*None*) – a description of the operator
  * **dynamic** (*False*) – whether the operator inputs and outputs should be
    resolved when the input/output changes
  * **execute_as_generator** (*False*) – whether the operator should be executed
    as a generator
  * **unlisted** (*False*) – whether the operator should be hidden from the
    Operator Browser
  * **on_startup** (*False*) – whether the operator should be executed on startup
  * **on_dataset_open** (*False*) – whether the operator should be executed on
    opening a dataset
  * **disable_schema_validation** (*False*) – whether the operator built-in schema
    validation should be disabled
  * **icon** (*None*) – icon to show for the operator in the Operator Browser
  * **light_icon** (*None*) – icon to show for the operator in the Operator Browser
    when the App is in the light mode
  * **dark_icon** (*None*) – icon to show for the operator in the Operator Browser
    when the App is in the dark mode
  * **allow_immediate_execution** (*True*) – whether the operator should allow
    immediate execution
  * **allow_delegated_execution** (*False*) – whether the operator should allow
    delegated execution
  * **default_choice_to_delegated** (*False*) – whether to default to delegated
    execution, if allowed
  * **resolve_execution_options_on_change** (*None*) – whether to resolve
    execution options dynamically when inputs change. By default, this
    behavior will match the `dynamic` setting
  * **allow_distributed_execution** (*False*) – whether the operator supports
    distributing delegated execution across parallel workers.
  * **rerunnable** (*True*) – whether the operator can be re-run
  * **risk_level** ([*RiskLevel.DANGEROUS*](fiftyone.operators.types.md#fiftyone.operators.types.RiskLevel.DANGEROUS)) – the declared `RiskLevel` for
    this operator is mainly used by guardrail systems of an agent to
    classify tool calls. If `None`, the operator defaults to
    `RiskLevel.DANGEROUS`

**Attributes:**

| [`risk_level`](#fiftyone.operators.operator.OperatorConfig.risk_level)   | The declared `RiskLevel` for this operator.   |
|--------------------------------------------------------------------------|-----------------------------------------------|

**Methods:**

| [`to_json`](#fiftyone.operators.operator.OperatorConfig.to_json)()   |    |
|----------------------------------------------------------------------|----|

#### *property* risk_level

The declared `RiskLevel` for this operator.

#### to_json()

### *class* fiftyone.operators.operator.Operator(\_builtin=False)

Bases: `object`

A FiftyOne operator.

Operators represent an operation and the details of how to execute it.

FiftyOne operators contain enough information for a user interface to
render a form or button allowing a user to execute the operation.

**Attributes:**

| [`name`](#fiftyone.operators.operator.Operator.name)             |                                                                                                                  |
|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [`uri`](#fiftyone.operators.operator.Operator.uri)               | The unique identifier of the operator: `plugin_name/operator_name`.                                              |
| [`builtin`](#fiftyone.operators.operator.Operator.builtin)       | Whether the operator is builtin.                                                                                 |
| [`config`](#fiftyone.operators.operator.Operator.config)         | The [`OperatorConfig`](#fiftyone.operators.operator.OperatorConfig) for the operator.                            |
| [`risk_level`](#fiftyone.operators.operator.Operator.risk_level) | The effective risk level of the operator, which is used by guardrail systems of an agent to classify tool calls. |

**Methods:**

| [`resolve_delegation`](#fiftyone.operators.operator.Operator.resolve_delegation)(ctx)               | Returns the resolved *forced* delegation flag.   |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------|
| [`resolve_execution_options`](#fiftyone.operators.operator.Operator.resolve_execution_options)(ctx) | Returns the resolved execution options.          |
| [`execute`](#fiftyone.operators.operator.Operator.execute)(ctx)                                     | Executes the operator.                           |
| [`resolve_type`](#fiftyone.operators.operator.Operator.resolve_type)(ctx, type)                     | Returns the resolved input or output property.   |
| [`resolve_input`](#fiftyone.operators.operator.Operator.resolve_input)(ctx)                         | Returns the resolved input property.             |
| [`resolve_output`](#fiftyone.operators.operator.Operator.resolve_output)(ctx)                       | Returns the resolved output property.            |
| [`resolve_placement`](#fiftyone.operators.operator.Operator.resolve_placement)(ctx)                 | Returns the resolved placement of the operator.  |
| [`resolve_run_name`](#fiftyone.operators.operator.Operator.resolve_run_name)(ctx)                   | Returns the resolved run name of the operator.   |
| [`method_to_uri`](#fiftyone.operators.operator.Operator.method_to_uri)(method_name)                 | Converts a method name to a URI.                 |
| [`to_json`](#fiftyone.operators.operator.Operator.to_json)()                                        | Returns a JSON representation of the operator.   |
| [`add_secrets`](#fiftyone.operators.operator.Operator.add_secrets)(secrets)                         | Adds secrets to the operator.                    |

#### *property* name

#### *property* uri

The unique identifier of the operator:
`plugin_name/operator_name`.

#### *property* builtin

Whether the operator is builtin.

#### *property* config

The [`OperatorConfig`](#fiftyone.operators.operator.OperatorConfig) for the operator.

#### *property* risk_level

The effective risk level of the operator, which is used by guardrail
systems of an agent to classify tool calls.

#### resolve_delegation(ctx) → [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) | None

Returns the resolved *forced* delegation flag.

Subclasses can implement this method to decide if delegated execution
should be *forced* for the given operation.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  whether the operation should be delegated (True), run immediately
  (False), or None to defer to [`resolve_execution_options()`](#fiftyone.operators.operator.Operator.resolve_execution_options) to
  specify the available options

#### resolve_execution_options(ctx)

Returns the resolved execution options.

Subclasses can implement this method to define the execution options
available for the operation.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### execute(ctx)

Executes the operator.

Subclasses must implement this method.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  JSON serializable data, or None

#### resolve_type(ctx, type)

Returns the resolved input or output property.

* **Parameters:**
  * **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
  * **type** – the type of property to resolve, either `"inputs"` or
    `"outputs"`
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### resolve_input(ctx) → [Property](fiftyone.operators.types.md#fiftyone.operators.types.Property) | None

Returns the resolved input property.

Subclasses can implement this method to define the inputs to the
operator. This method should never be called directly. Instead
use [`resolve_type()`](#fiftyone.operators.operator.Operator.resolve_type).

By default, this method is called once when the operator is created.
If the operator is dynamic, this method is called each time the input
changes.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### resolve_output(ctx)

Returns the resolved output property.

Subclasses can implement this method to define the outputs of the
operator.

By default, this method is called once when the operator is created.
If the operator is dynamic, this method is called after the operator is
executed.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### resolve_placement(ctx)

Returns the resolved placement of the operator.

Subclasses can implement this method to define the placement of the
operator.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](fiftyone.operators.types.md#fiftyone.operators.types.Placement), or None

#### resolve_run_name(ctx)

Returns the resolved run name of the operator.

Subclasses can implement this method to define the run name of the
operator.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a string, or None

#### method_to_uri(method_name)

Converts a method name to a URI.

* **Parameters:**
  **method_name** – the method name
* **Returns:**
  a URI

#### to_json()

Returns a JSON representation of the operator.

* **Returns:**
  a JSON dict

#### add_secrets(secrets)

Adds secrets to the operator.

* **Parameters:**
  **secrets** – a list of secrets

### *class* fiftyone.operators.operator.PipelineOperator(\_builtin=False)

Bases: [`Operator`](#fiftyone.operators.operator.Operator)

A FiftyOne pipeline operator.

A pipeline operator represents a linear composition of other operators,
containing the details of how to create and execute the
[`fiftyone.operators.types.Pipeline`](fiftyone.operators.types.md#fiftyone.operators.types.Pipeline)

FiftyOne pipeline operators contain enough information for a user interface
to render a form or button allowing a user to execute the operation.

**Methods:**

| [`resolve_pipeline`](#fiftyone.operators.operator.PipelineOperator.resolve_pipeline)(ctx)                   | Returns the resolved pipeline of the operator.                     |
|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [`add_secrets`](#fiftyone.operators.operator.PipelineOperator.add_secrets)(secrets)                         | Adds secrets to the operator.                                      |
| [`execute`](#fiftyone.operators.operator.PipelineOperator.execute)(ctx)                                     | Not used for pipeline operators; pipelines are executed via stages |
| [`method_to_uri`](#fiftyone.operators.operator.PipelineOperator.method_to_uri)(method_name)                 | Converts a method name to a URI.                                   |
| [`resolve_delegation`](#fiftyone.operators.operator.PipelineOperator.resolve_delegation)(ctx)               | Returns the resolved *forced* delegation flag.                     |
| [`resolve_execution_options`](#fiftyone.operators.operator.PipelineOperator.resolve_execution_options)(ctx) | Returns the resolved execution options.                            |
| [`resolve_input`](#fiftyone.operators.operator.PipelineOperator.resolve_input)(ctx)                         | Returns the resolved input property.                               |
| [`resolve_output`](#fiftyone.operators.operator.PipelineOperator.resolve_output)(ctx)                       | Returns the resolved output property.                              |
| [`resolve_placement`](#fiftyone.operators.operator.PipelineOperator.resolve_placement)(ctx)                 | Returns the resolved placement of the operator.                    |
| [`resolve_run_name`](#fiftyone.operators.operator.PipelineOperator.resolve_run_name)(ctx)                   | Returns the resolved run name of the operator.                     |
| [`resolve_type`](#fiftyone.operators.operator.PipelineOperator.resolve_type)(ctx, type)                     | Returns the resolved input or output property.                     |
| [`to_json`](#fiftyone.operators.operator.PipelineOperator.to_json)()                                        | Returns a JSON representation of the operator.                     |

**Attributes:**

| [`builtin`](#fiftyone.operators.operator.PipelineOperator.builtin)       | Whether the operator is builtin.                                                                                 |
|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [`config`](#fiftyone.operators.operator.PipelineOperator.config)         | The [`OperatorConfig`](#fiftyone.operators.operator.OperatorConfig) for the operator.                            |
| [`name`](#fiftyone.operators.operator.PipelineOperator.name)             |                                                                                                                  |
| [`risk_level`](#fiftyone.operators.operator.PipelineOperator.risk_level) | The effective risk level of the operator, which is used by guardrail systems of an agent to classify tool calls. |
| [`uri`](#fiftyone.operators.operator.PipelineOperator.uri)               | The unique identifier of the operator: `plugin_name/operator_name`.                                              |

#### resolve_pipeline(ctx)

Returns the resolved pipeline of the operator.

Subclasses can implement this method to define the pipeline of the
operator.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Pipeline`](fiftyone.operators.types.md#fiftyone.operators.types.Pipeline),

#### add_secrets(secrets)

Adds secrets to the operator.

* **Parameters:**
  **secrets** – a list of secrets

#### *property* builtin

Whether the operator is builtin.

#### *property* config

The [`OperatorConfig`](#fiftyone.operators.operator.OperatorConfig) for the operator.

#### execute(ctx)

Not used for pipeline operators; pipelines are executed via stages

#### method_to_uri(method_name)

Converts a method name to a URI.

* **Parameters:**
  **method_name** – the method name
* **Returns:**
  a URI

#### *property* name

#### resolve_delegation(ctx) → [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) | None

Returns the resolved *forced* delegation flag.

Subclasses can implement this method to decide if delegated execution
should be *forced* for the given operation.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  whether the operation should be delegated (True), run immediately
  (False), or None to defer to [`resolve_execution_options()`](#fiftyone.operators.operator.PipelineOperator.resolve_execution_options) to
  specify the available options

#### resolve_execution_options(ctx)

Returns the resolved execution options.

Subclasses can implement this method to define the execution options
available for the operation.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### resolve_input(ctx) → [Property](fiftyone.operators.types.md#fiftyone.operators.types.Property) | None

Returns the resolved input property.

Subclasses can implement this method to define the inputs to the
operator. This method should never be called directly. Instead
use [`resolve_type()`](#fiftyone.operators.operator.PipelineOperator.resolve_type).

By default, this method is called once when the operator is created.
If the operator is dynamic, this method is called each time the input
changes.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### resolve_output(ctx)

Returns the resolved output property.

Subclasses can implement this method to define the outputs of the
operator.

By default, this method is called once when the operator is created.
If the operator is dynamic, this method is called after the operator is
executed.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### resolve_placement(ctx)

Returns the resolved placement of the operator.

Subclasses can implement this method to define the placement of the
operator.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](fiftyone.operators.types.md#fiftyone.operators.types.Placement), or None

#### resolve_run_name(ctx)

Returns the resolved run name of the operator.

Subclasses can implement this method to define the run name of the
operator.

* **Parameters:**
  **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a string, or None

#### resolve_type(ctx, type)

Returns the resolved input or output property.

* **Parameters:**
  * **ctx** – the [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
  * **type** – the type of property to resolve, either `"inputs"` or
    `"outputs"`
* **Returns:**
  a [`fiftyone.operators.types.Property`](fiftyone.operators.types.md#fiftyone.operators.types.Property), or None

#### *property* risk_level

The effective risk level of the operator, which is used by guardrail
systems of an agent to classify tool calls.

#### to_json()

Returns a JSON representation of the operator.

* **Returns:**
  a JSON dict

#### *property* uri

The unique identifier of the operator:
`plugin_name/operator_name`.
