"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 17:59:06.625077
"""

```python
from typing import List


class ReasoningEngine:
    """
    A basic reasoning engine designed to handle simple rule-based decision making.
    """

    def __init__(self, rules: List[dict]):
        """
        Initialize the reasoning engine with a set of rules.

        :param rules: A list of dictionaries defining rules. Each dictionary should have 'condition' and 'action'.
                      Example: [{'condition': lambda x: x > 10, 'action': lambda x: f"Value {x} is greater than 10"}, ...]
        """
        self.rules = rules

    def apply_rules(self, data: dict) -> str:
        """
        Apply the defined rules to the input data and return the action based on the first matching rule.

        :param data: A dictionary containing the context in which rules are applied.
        :return: The action string from the matched rule's 'action' field.
        """
        for rule in self.rules:
            if rule['condition'](data):
                return rule['action'](data)
        return "No matching rule found."

# Example usage
if __name__ == "__main__":
    # Define some simple rules
    rules = [
        {'condition': lambda x: 'fruit' in x, 'action': lambda x: f"{x} is a fruit."},
        {'condition': lambda x: len(x) > 5, 'action': lambda x: f"String '{x}' has more than five characters."}
    ]
    
    # Create an instance of ReasoningEngine
    engine = ReasoningEngine(rules)
    
    # Test the engine with different data points
    print(engine.apply_rules({'item': 'apple'}))  # Output: apple is a fruit.
    print(engine.apply_rules({'name': 'JohnDoe'}))  # Output: String 'JohnDoe' has more than five characters.
    print(engine.apply_rules({'number': 2}))  # Output: No matching rule found.
```