Skip to content
Get started

Run Layer

v1.layers.run_layer(LayerRunLayerParams**kwargs) -> LayerRunLayerResponse
POST/api/v1/layers/run

Execute a set of policies on input data and return the processed result. Policies can be referenced by ID or passed as transient objects with parameters.

ParametersExpand Collapse
input_data: str
layer_position: Literal["input", "output"]
Accepts one of the following:
"input"
"output"
use_cache: Optional[bool]
kwargs: Optional[Dict[str, object]]
policies: Optional[Iterable[object]]
ReturnsExpand Collapse
class LayerRunLayerResponse:

Response returned by /layers/run (the first element of run_overmind_layer tuple).

overall_policy_outcome: str
policy_results: Dict[str, Dict[str, object]]
span_context: Dict[str, str]
processed_data: Optional[str]
Run Layer
from overmind_lab import OvermindLab

client = OvermindLab()
response = client.v1.layers.run_layer(
    input_data="input_data",
    layer_position="input",
)
print(response.overall_policy_outcome)
{
  "overall_policy_outcome": "overall_policy_outcome",
  "policy_results": {
    "foo": {
      "foo": "bar"
    }
  },
  "span_context": {
    "foo": "string"
  },
  "processed_data": "processed_data"
}
Returns Examples
{
  "overall_policy_outcome": "overall_policy_outcome",
  "policy_results": {
    "foo": {
      "foo": "bar"
    }
  },
  "span_context": {
    "foo": "string"
  },
  "processed_data": "processed_data"
}