🐫 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: Ensure Enum values are properly defined in ModelPlatformType (#844)
mrsbeep28893ab82568
diff --git a/camel/types/enums.py b/camel/types/enums.pyindex 7dd34fc9f..90f68ef33 100644--- a/camel/types/enums.py+++ b/camel/types/enums.py@@ -436,7 +436,7 @@ class ModelPlatformType(Enum):AZURE = "azure"ANTHROPIC = "anthropic"GROQ = "groq"- OPENSOURCE = "open-source"+ OPEN_SOURCE = "open-source"OLLAMA = "ollama"LITELLM = "litellm"ZHIPU = "zhipuai"@@ -444,7 +444,7 @@ class ModelPlatformType(Enum):GEMINI = "gemini"VLLM = "vllm"MISTRAL = "mistral"- OPENAICOMPATIBILITYMODEL = "openai-compatibility-model"+ OPENAI_COMPATIBILITY_MODEL = "openai-compatibility-model"@propertydef is_openai(self) -> bool:@@ -494,13 +494,13 @@ class ModelPlatformType(Enum):@propertydef is_open_source(self) -> bool:r"""Returns whether this platform is opensource."""- return self is ModelPlatformType.OPENSOURCE+ return self is ModelPlatformType.OPEN_SOURCE@propertydef is_openai_compatibility_model(self) -> bool:r"""Returns whether this is a platform supporting openaicompatibility"""- return self is ModelPlatformType.OPENAICOMPATIBILITYMODEL+ return self is ModelPlatformType.OPENAI_COMPATIBILITY_MODEL@propertydef is_gemini(self) -> bool:diff --git a/docs/agents/single_agent.md b/docs/agents/single_agent.mdindex 39c05941d..7135368d8 100644--- a/docs/agents/single_agent.md+++ b/docs/agents/single_agent.md@@ -121,7 +121,7 @@ You can connect the agent with external database (as long-term memory) in whichfrom camel.models import ModelFactory# Set the LLM model type and model config- model_platform = ModelPlatformType.OPENSOURCE+ model_platform = ModelPlatformType.OPEN_SOURCEmodel_type = ModelType.LLAMA_2model_config=OpenSourceConfig(model_path='meta-llama/Llama-2-7b-chat-hf', # a local folder or HuggingFace repo Namediff --git a/examples/models/openai_compatibility_model_example.py b/examples/models/openai_compatibility_model_example.pyindex 4f1f1f00d..87f0b15f5 100644--- a/examples/models/openai_compatibility_model_example.py+++ b/examples/models/openai_compatibility_model_example.py@@ -20,7 +20,7 @@ from camel.types import ModelPlatformType# Take calling model from DashScope as an example# Refer: https://dashscope.console.aliyun.com/overviewmodel = ModelFactory.create(- model_platform=ModelPlatformType.OPENAICOMPATIBILITYMODEL,+ model_platform=ModelPlatformType.OPENAI_COMPATIBILITY_MODEL,model_type="qwen-plus",api_key="sk-xxxx",url="https://dashscope.aliyuncs.com/compatible-mode/v1",diff --git a/examples/models/role_playing_with_open_source_model.py b/examples/models/role_playing_with_open_source_model.pyindex a6ddec554..e67dbb30b 100644--- a/examples/models/role_playing_with_open_source_model.py+++ b/examples/models/role_playing_with_open_source_model.py@@ -26,7 +26,7 @@ from camel.utils import print_text_animated# model_path = "lmsys/vicuna-7b-v1.5"def main(chat_turn_limit=50,- model_platform=ModelPlatformType.OPENSOURCE,+ model_platform=ModelPlatformType.OPEN_SOURCE,model_type=ModelType.STUB,model_path="meta-llama/Llama-2-7b-chat-hf",server_url="http://localhost:8000/v1",diff --git a/test/models/test_model_factory.py b/test/models/test_model_factory.pyindex 88605dfa7..281e8e079 100644--- a/test/models/test_model_factory.py+++ b/test/models/test_model_factory.py@@ -34,7 +34,7 @@ parametrize = pytest.mark.parametrize([(ModelPlatformType.OPENAI, ModelType.GPT_3_5_TURBO),(ModelPlatformType.OPENAI, ModelType.GPT_4_TURBO),- (ModelPlatformType.OPENSOURCE, ModelType.STUB),+ (ModelPlatformType.OPEN_SOURCE, ModelType.STUB),],)@@ -62,7 +62,7 @@ parameterize_token_counter = pytest.mark.parametrize(# Test Stub model# Stub model uses StubTokenCounter as default(- ModelPlatformType.OPENSOURCE,+ ModelPlatformType.OPEN_SOURCE,ModelType.STUB,ChatGPTConfig().as_dict(),None,@@ -70,7 +70,7 @@ parameterize_token_counter = pytest.mark.parametrize(None,),(- ModelPlatformType.OPENSOURCE,+ ModelPlatformType.OPEN_SOURCE,ModelType.STUB,ChatGPTConfig().as_dict(),OpenAITokenCounter(ModelType.GPT_4),@@ -97,7 +97,7 @@ parameterize_token_counter = pytest.mark.parametrize(),# Test OpenSource model (take VICUNA as an example)(- ModelPlatformType.OPENSOURCE,+ ModelPlatformType.OPEN_SOURCE,ModelType.VICUNA,OpenSourceConfig(model_path="lmsys/vicuna-7b-v1.5",@@ -108,7 +108,7 @@ parameterize_token_counter = pytest.mark.parametrize(ModelType.VICUNA,),(- ModelPlatformType.OPENSOURCE,+ ModelPlatformType.OPEN_SOURCE,ModelType.VICUNA,OpenSourceConfig(model_path="lmsys/vicuna-7b-v1.5",