Toggle Menu
Prev Up Next

# `langchain_experimental.graph_transformers.llm`.optional_enum_field

langchain_experimental.graph_transformers.llm.optional_enum_field(enum_values: Optional[List[str]] = None, description: str = '', is_rel: bool = False, **field_kwargs: Any) → Any

  Utility function to conditionally create a field with an enum constraint.

  Parameters

    - enum_values (Optional[List[str]]) –

    - description (str) –

    - is_rel (bool) –

    - field_kwargs (Any) –

  Return type

    Any