🔧 chore(llms.py): add method to add extra base classes to improve extensibility

The `add_extra_base_classes` method is added to the `LLMFrontendNode` class. This method checks if the "BaseLLM" class is already present in the `base_classes` list and appends it if not. This change allows for easier extensibility by providing a way to add additional base classes to the `LLMFrontendNode` class.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-29 11:18:19 -03:00
commit 549a8dedc5

View file

@ -21,6 +21,10 @@ class LLMFrontendNode(FrontendNode):
if field.name == "openai_api_base":
field.info = OPENAI_API_BASE_INFO
def add_extra_base_classes(self) -> None:
if "BaseLLM" not in self.base_classes:
self.base_classes.append("BaseLLM")
@staticmethod
def format_azure_field(field: TemplateField):
if field.name == "model_name":