async def _load_prompts_from_yaml_directory(
        self, default_overwrite_on_diff: bool = False
    ) -> None:
        """Load prompts from YAML files in the specified directory.

        :param default_overwrite_on_diff: If a YAML prompt does not specify
            'overwrite_on_diff', we use this default.
        """
        if not self.prompt_directory.is_dir():
            logger.warning(
                f"Prompt directory not found: {self.prompt_directory}"
            )
            return

        logger.info(f"Loading prompts from {self.prompt_directory}")
        for yaml_file in self.prompt_directory.glob("*.yaml"):
            logger.debug(f"Processing {yaml_file}")
            try:
                with open(yaml_file, "r", encoding="utf-8") as file:
                    data = yaml.safe_load(file)
                    if not isinstance(data, dict):
                        raise ValueError(
                            f"Invalid format in YAML file {yaml_file}"
                        )

                    for name, prompt_data in data.items():
                        # Attempt to parse the relevant prompt fields
                        template = prompt_data.get("template")
                        input_types = prompt_data.get("input_types", {})

                        # Decide on per-prompt overwrite behavior (or fallback)
                        overwrite_on_diff = prompt_data.get(
                            "overwrite_on_diff", default_overwrite_on_diff
                        )
                        # Some logic to determine if we *should* modify
                        # For instance, preserve only if it has never been updated
                        # (i.e., created_at == updated_at).
                        should_modify = True
                        if name in self.prompts:
                            existing = self.prompts[name]
                            should_modify = (
                                existing["created_at"]
                                == existing["updated_at"]
                            )

                        # If should_modify is True, the default logic is
                        #   preserve_existing = False,
                        # so we can pass that in. Otherwise, preserve_existing=True
                        # effectively means we skip the update.
                        logger.info(
                            f"Loading default prompt: {name} from {yaml_file}."
                        )

                        await self.add_prompt(
                            name=name,
                            template=template,
                            input_types=input_types,
                            preserve_existing=False,
                            overwrite_on_diff=overwrite_on_diff,
                        )
            except Exception as e:
                logger.error(f"Error loading {yaml_file}: {e}")
                continue
Load prompts from YAML files in the specified directory.

        :param default_overwrite_on_diff: If a YAML prompt does not specify
            'overwrite_on_diff', we use this default.
        
py/core/providers/database/prompts_handler.py