optional_enum_field#

langchain_experimental.graph_transformers.llm.optional_enum_field(enum_values: List[str] | None = None, description: str = '', input_type: str = 'node', llm_type: str | None = None, **field_kwargs: Any) Any[source]#

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

Parameters:
  • enum_values (List[str] | None) –

  • description (str) –

  • input_type (str) –

  • llm_type (str | None) –

  • field_kwargs (Any) –

Return type:

Any