codegen / services /model_visitor.py
AP\VivekIsh
codegen: Stage the code
6fadbbc
raw
history blame
794 Bytes
from abc import ABC, abstractmethod
class ModelVisitor(ABC):
"""
Abstract base class for model visitors.
This class defines the interface for visiting a model generator.
Subclasses must implement the visit method to define
specific behaviors for different types of model generators.
Methods:
visit(generator, *args, **kwargs):
Abstract method to visit the model generator. Subclasses
must override this method to provide specific functionality.
Example:
class IbmTextGenerator(ModelVisitor):
def visit(self, model_generator, *args, **kwargs):
# Implement specific behavior here
pass
"""
@abstractmethod
def visit(self, generator, *args, **kwargs):
pass