create_simple_model#

langchain_experimental.graph_transformers.llm.create_simple_model(node_labels: List[str] | None = None, rel_types: List[str] | None = None, node_properties: bool | List[str] = False, llm_type: str | None = None, relationship_properties: bool | List[str] = False) → Type[_Graph][source]#

Create a simple graph model with optional constraints on node and relationship types.

Parameters:
  • node_labels (Optional[List[str]]) – Specifies the allowed node types. Defaults to None, allowing all node types.

  • rel_types (Optional[List[str]]) – Specifies the allowed relationship types. Defaults to None, allowing all relationship types.

  • node_properties (Union[bool, List[str]]) – Specifies if node properties should be included. If a list is provided, only properties with keys in the list will be included. If True, all properties are included. Defaults to False.

  • relationship_properties (Union[bool, List[str]]) – Specifies if relationship properties should be included. If a list is provided, only properties with keys in the list will be included. If True, all properties are included. Defaults to False.

  • llm_type (Optional[str]) – The type of the language model. Defaults to None. Only openai supports enum param: openai-chat.

Returns:

A graph model with the specified constraints.

Return type:

Type[_Graph]

Raises:

ValueError – If ‘id’ is included in the node or relationship properties list.