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

# plugins.panels.similarity_search.operators

Similarity search operators.

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

**Classes:**

| [`SimilaritySearchOperator`](#plugins.panels.similarity_search.operators.SimilaritySearchOperator)([_builtin])                         | Operator that executes a similarity search query.                     |
|----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [`InitSimilarityRunOperator`](#plugins.panels.similarity_search.operators.InitSimilarityRunOperator)([_builtin])                       | Creates a run record for a delegated similarity search.               |
| [`ListSimilarityRunsOperator`](#plugins.panels.similarity_search.operators.ListSimilarityRunsOperator)([_builtin])                     | Returns similarity search runs for the current dataset.               |
| [`SimilaritySearchSubscriptionOperator`](#plugins.panels.similarity_search.operators.SimilaritySearchSubscriptionOperator)([_builtin]) | Operator that provides SSE notifications for execution store changes. |

### *class* plugins.panels.similarity_search.operators.SimilaritySearchOperator(\_builtin=False)

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

Operator that executes a similarity search query.

Supports both immediate execution (runs on the app server) and
delegated execution (runs on a worker pod). The user chooses via
the OperatorExecutionButton in the frontend.

Flow:
1. Creates or updates a run record in the execution store
2. Calls sort_by_similarity() with the provided query
3. Stores the sorted result IDs in the run record

**Attributes:**

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

**Methods:**

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

#### *property* config

The `OperatorConfig` for the operator.

#### execute(ctx)

Executes the operator.

Subclasses must implement this method.

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

#### add_secrets(secrets)

Adds secrets to the operator.

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

#### *property* builtin

Whether the operator is builtin.

#### 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](../../api/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`](../../api/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()`](#plugins.panels.similarity_search.operators.SimilaritySearchOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### resolve_input(ctx) → [Property](../../api/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()`](#plugins.panels.similarity_search.operators.SimilaritySearchOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](../../api/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`](../../api/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`](../../api/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`](../../api/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`.

### *class* plugins.panels.similarity_search.operators.InitSimilarityRunOperator(\_builtin=False)

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

Creates a run record for a delegated similarity search.

Called by the frontend after a delegated operation is queued, so
the run appears in the panel’s list immediately while the DO is
pending/running on a worker.

**Attributes:**

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

**Methods:**

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

#### *property* config

The `OperatorConfig` for the operator.

#### execute(ctx)

Executes the operator.

Subclasses must implement this method.

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

#### add_secrets(secrets)

Adds secrets to the operator.

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

#### *property* builtin

Whether the operator is builtin.

#### 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](../../api/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`](../../api/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()`](#plugins.panels.similarity_search.operators.InitSimilarityRunOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### resolve_input(ctx) → [Property](../../api/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()`](#plugins.panels.similarity_search.operators.InitSimilarityRunOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](../../api/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`](../../api/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`](../../api/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`](../../api/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`.

### *class* plugins.panels.similarity_search.operators.ListSimilarityRunsOperator(\_builtin=False)

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

Returns similarity search runs for the current dataset.

Accepts an optional `owner` param:

- `"mine"` — only runs created by the current user
- `"all"` or missing — every run

**Attributes:**

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

**Methods:**

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

#### *property* config

The `OperatorConfig` for the operator.

#### execute(ctx)

Executes the operator.

Subclasses must implement this method.

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

#### add_secrets(secrets)

Adds secrets to the operator.

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

#### *property* builtin

Whether the operator is builtin.

#### 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](../../api/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`](../../api/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()`](#plugins.panels.similarity_search.operators.ListSimilarityRunsOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### resolve_input(ctx) → [Property](../../api/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()`](#plugins.panels.similarity_search.operators.ListSimilarityRunsOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](../../api/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`](../../api/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`](../../api/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`](../../api/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`.

### *class* plugins.panels.similarity_search.operators.SimilaritySearchSubscriptionOperator(\_builtin=False)

Bases: [`SseOperator`](../../api/fiftyone.operators.sse.md#fiftyone.operators.sse.SseOperator)

Operator that provides SSE notifications for execution store changes.

**Attributes:**

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

**Methods:**

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

#### *property* subscription_config

#### IS_SSE_OPERATOR *= True*

#### 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` for the operator.

#### *async* execute(ctx: [ExecutionContext](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext))

Executes the operator.

Subclasses must implement this method.

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

#### 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](../../api/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`](../../api/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()`](#plugins.panels.similarity_search.operators.SimilaritySearchSubscriptionOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.executor.ExecutionOptions`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionOptions) instance

#### resolve_input(ctx) → [Property](../../api/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()`](#plugins.panels.similarity_search.operators.SimilaritySearchSubscriptionOperator.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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Property`](../../api/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`](../../api/fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)
* **Returns:**
  a [`fiftyone.operators.types.Placement`](../../api/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`](../../api/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`](../../api/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`](../../api/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`.
