# optional_enum_field

> **Function** in `langchain_neo4j`

📖 [View in docs](https://reference.langchain.com/python/langchain-neo4j/graph_transformers/llm/optional_enum_field)

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

## Signature

```python
optional_enum_field(
    enum_values: Optional[Union[List[str], List[Tuple[str, str, str]]]] = None,
    description: str = '',
    input_type: str = 'node',
    llm_type: Optional[str] = None,
    relationship_type: Optional[str] = None,
    **field_kwargs: Any = {},
) -> Any
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-neo4j/blob/887064c6bea53318f3507ed07120ea68bfe6a36b/libs/neo4j/langchain_neo4j/graph_transformers/llm.py#L153)