Skip to content

Options

OptionsLink

In Sierra‑SDK, every Invoker entry‑point parameter must be wrapped with Param[...], supplying a SierraOption to describe its behavior and validation rules.

Options Example
Python
1
2
3
4
5
6
7
8
import sierra

def example(foo: sierra.Param[str, sierra.SierraOption(description="Foo is a foo")])->None:
"""
Foo is a string, the options add a metadata called description.
"""
result = sierra.create_tree_result([f"{foo}"])
print(result)

sierra.options Link

AttributesLink

Param module-attribute Link
Python
Param = typing.Annotated

ClassesLink

SierraOption Link
Python
SierraOption(
    *,
    description: str = "",
    mandatory: typing.Literal["MANDATORY"] | None = None,
)

Bases: typing.Generic[_T]

Wrapper for marking a function parameter as a Sierra option.

PARAMETER DESCRIPTION
description

A short description of the parameter.

TYPE: str DEFAULT: ""

mandatory

Flags the parameter as mandatory.

TYPE: typing.Literal['MANDATORY'] | None DEFAULT: None

AttributesLink
description instance-attribute Link
Python
description = description
mandatory instance-attribute Link
Python
mandatory = mandatory