langchain_experimental.graph_transformers.llm.create_simple_modelΒΆ

langchain_experimental.graph_transformers.llm.create_simple_model(node_labels: Optional[List[str]] = None, rel_types: Optional[List[str]] = None, node_properties: Union[bool, List[str]] = False, llm_type: Optional[str] = None, relationship_properties: Union[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.