🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: string representation of `ModelType` (#1106)
Isaac Jine87211b77fea
diff --git a/camel/types/enums.py b/camel/types/enums.pyindex 680830bde..12274583d 100644--- a/camel/types/enums.py+++ b/camel/types/enums.py@@ -85,6 +85,9 @@ class ModelType(UnifiedModelType, Enum):REKA_FLASH = "reka-flash"REKA_EDGE = "reka-edge"+ def __str__(self):+ return self.value+def __new__(cls, value) -> "ModelType":return cast("ModelType", UnifiedModelType.__new__(cls, value))diff --git a/camel/types/unified_model_type.py b/camel/types/unified_model_type.pyindex 880b31f97..369d2cce5 100644--- a/camel/types/unified_model_type.py+++ b/camel/types/unified_model_type.py@@ -75,7 +75,7 @@ class UnifiedModelType(str):@propertydef is_groq(self) -> bool:- r"""Returns whether the model is an Groq served model."""+ r"""Returns whether the model is a Groq served model."""return True@propertydiff --git a/test/models/test_model_type.py b/test/models/test_model_type.pyindex b495a9428..364763907 100644--- a/test/models/test_model_type.py+++ b/test/models/test_model_type.py@@ -17,12 +17,14 @@ from camel.types import ModelType, UnifiedModelTypedef test_predefined_model():model_type = UnifiedModelType("gpt-4o-mini")assert model_type == ModelType.GPT_4O_MINI+ assert f"test_prefix/{model_type}" == "test_prefix/gpt-4o-mini"def test_duplicated_model_types():model_type_1 = UnifiedModelType("random-open-source")model_type_2 = UnifiedModelType("random-open-source")assert id(model_type_1) == id(model_type_2)+ assert f"test_prefix/{model_type_1}" == "test_prefix/random-open-source"model_type_3 = UnifiedModelType(ModelType.GPT_4O_MINI)model_type_4 = UnifiedModelType("gpt-4o-mini")