def model_field_info()

in function_app/src/components/speech.py [0:0]


    def model_field_info(self) -> dict[str, str]:
        """
        Returns a dictionary of field names and their descriptions.
        """
        output = dict()
        for field, info_dict in self.model_json_schema(mode="serialization")[
            "properties"
        ].items():
            if "anyOf" in info_dict:
                type = " | ".join(
                    get_type_from_pydantic_type_dict(t) for t in info_dict["anyOf"]
                )
            elif "allOf" in info_dict:
                type = " & ".join(
                    get_type_from_pydantic_type_dict(t) for t in info_dict["allOf"]
                )
            elif "type" in info_dict:
                type = get_type_from_pydantic_type_dict(info_dict)
            else:
                raise ValueError("Field type could not be processed.")
            output[field] = "[{}] - {}".format(type, info_dict["description"])
        return output