def __init__(
        self,
        llm: Optional[LLM] = None,
        extract_prompt: Optional[Union[str, PromptTemplate]] = None,
        parse_fn: Optional[Callable] = None,
        max_triplets_per_chunk: int = 10,
        num_workers: int = 4,
        allowed_entity_types: Optional[List[str]] = None,
        allowed_entity_props: Optional[Union[List[str], List[Tuple[str, str]]]] = None,
        allowed_relation_types: Optional[List[str]] = None,
        allowed_relation_props: Optional[
            Union[List[str], List[Tuple[str, str]]]
        ] = None,
    ) -> None:
        """
        Initialize the DynamicLLMPathExtractor.

        Args:
            llm (Optional[LLM]): The language model to use. If None, uses the default from Settings.
            extract_prompt (Optional[Union[str, PromptTemplate]]): The prompt template to use.
            parse_fn (Callable): Function to parse LLM output into triplets.
            max_triplets_per_chunk (int): Maximum number of triplets to extract per chunk.
            num_workers (int): Number of workers for parallel processing.
            allowed_entity_types (Optional[List[str]]): List of initial entity types for the ontology.
            allowed_relation_types (Optional[List[str]]): List of initial relation types for the ontology.

        """
        from llama_index.core import Settings

        if isinstance(extract_prompt, str):
            extract_prompt = PromptTemplate(extract_prompt)

        if extract_prompt is None:
            if allowed_entity_props is not None or allowed_relation_props is not None:
                extract_prompt = DEFAULT_DYNAMIC_EXTRACT_PROPS_PROMPT
            else:
                extract_prompt = DEFAULT_DYNAMIC_EXTRACT_PROMPT

        if parse_fn is None:
            if allowed_entity_props is not None or allowed_relation_props is not None:
                parse_fn = default_parse_dynamic_triplets_with_props
            else:
                parse_fn = default_parse_dynamic_triplets

        # convert props to name -> description format if needed
        if allowed_entity_props and isinstance(allowed_entity_props[0], tuple):
            allowed_entity_props = [  # type: ignore
                f"Property `{k}` with description ({v})"
                for k, v in allowed_entity_props  # type: ignore
            ]

        if allowed_relation_props and isinstance(allowed_relation_props[0], tuple):
            allowed_relation_props = [  # type: ignore
                f"Property `{k}` with description ({v})"
                for k, v in allowed_relation_props  # type: ignore
            ]

        super().__init__(
            llm=llm or Settings.llm,
            extract_prompt=extract_prompt,
            parse_fn=parse_fn,
            num_workers=num_workers,
            max_triplets_per_chunk=max_triplets_per_chunk,
            allowed_entity_types=allowed_entity_types or [],
            allowed_entity_props=allowed_entity_props or [],
            allowed_relation_types=allowed_relation_types or [],
            allowed_relation_props=allowed_relation_props or [],
        )

        Initialize the DynamicLLMPathExtractor.

        Args:
            llm (Optional[LLM]): The language model to use. If None, uses the default from Settings.
            extract_prompt (Optional[Union[str, PromptTemplate]]): The prompt template to use.
            parse_fn (Callable): Function to parse LLM output into triplets.
            max_triplets_per_chunk (int): Maximum number of triplets to extract per chunk.
            num_workers (int): Number of workers for parallel processing.
            allowed_entity_types (Optional[List[str]]): List of initial entity types for the ontology.
            allowed_relation_types (Optional[List[str]]): List of initial relation types for the ontology.

        
llama-index-core/llama_index/core/indices/property_graph/transformations/dynamic_llm.py