def _apply_alias_generator(self, alias_generator: Callable[[str], str] | AliasGenerator, name: str) -> None:
        """Apply an alias generator to aliases if appropriate.

        Args:
            alias_generator: A callable that takes a string and returns a string, or an `AliasGenerator` instance.
            name: The name of the computed field from which to generate the alias.
        """
        # Apply an alias_generator if
        # 1. An alias is not specified
        # 2. An alias is specified, but the priority is <= 1

        if self.alias_priority is None or self.alias_priority <= 1 or self.alias is None:
            alias, _, serialization_alias = None, None, None

            if isinstance(alias_generator, AliasGenerator):
                alias, _, serialization_alias = alias_generator.generate_aliases(name)
            elif callable(alias_generator):
                alias = alias_generator(name)

            # if priority is not set, we set to 1
            # which supports the case where the alias_generator from a child class is used
            # to generate an alias for a field in a parent class
            if self.alias_priority is None or self.alias_priority <= 1:
                self.alias_priority = 1

            # if the priority is 1, then we set the aliases to the generated alias
            # note that we use the serialization_alias with priority over alias, as computed_field
            # aliases are used for serialization only (not validation)
            if self.alias_priority == 1:
                self.alias = _utils.get_first_not_none(serialization_alias, alias)
Apply an alias generator to aliases if appropriate.

        Args:
            alias_generator: A callable that takes a string and returns a string, or an `AliasGenerator` instance.
            name: The name of the computed field from which to generate the alias.
        
pydantic/fields.py