🐫 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
feat: Add support for Gemini-Exp-1114 model (#1187) (#1189)
Xiaotian Jind4e2356ac41d
diff --git a/camel/types/enums.py b/camel/types/enums.pyindex adcf3bc9a..61fc21b90 100644--- a/camel/types/enums.py+++ b/camel/types/enums.py@@ -70,6 +70,7 @@ class ModelType(UnifiedModelType, Enum):# Gemini modelsGEMINI_1_5_FLASH = "gemini-1.5-flash"GEMINI_1_5_PRO = "gemini-1.5-pro"+ GEMINI_EXP_1114 = "gemini-exp-1114"# Mistral AI modelsMISTRAL_3B = "ministral-3b-latest"@@ -232,6 +233,7 @@ class ModelType(UnifiedModelType, Enum):return self in {ModelType.GEMINI_1_5_FLASH,ModelType.GEMINI_1_5_PRO,+ ModelType.GEMINI_EXP_1114,}@property@@ -384,6 +386,7 @@ class ModelType(UnifiedModelType, Enum):elif self in {ModelType.GEMINI_1_5_FLASH,ModelType.GEMINI_1_5_PRO,+ ModelType.GEMINI_EXP_1114, # Not given in docs, assuming the same}:return 1_048_576elif self in {diff --git a/docs/key_modules/models.md b/docs/key_modules/models.mdindex 95b395443..2a2fd710c 100644--- a/docs/key_modules/models.md+++ b/docs/key_modules/models.md@@ -40,7 +40,8 @@ The following table lists currently supported model platforms by CAMEL.| Anthropic | claude-3-opus-20240229 | Y || Anthropic | claude-2.0 | N || Gemini | gemini-1.5-pro | Y |-| Gemini | ggemini-1.5-flash | Y |+| Gemini | gemini-1.5-flash | Y |+| Gemini | gemini-exp-1114 | Y || Lingyiwanwu | yi-lightning | N || Lingyiwanwu | yi-large | N || Lingyiwanwu | yi-medium | N |diff --git a/examples/models/gemini_model_example.py b/examples/models/gemini_model_example.pyindex 21c71a0b7..c95a890a5 100644--- a/examples/models/gemini_model_example.py+++ b/examples/models/gemini_model_example.py@@ -43,3 +43,33 @@ and communicative agents. I'm excited to see what groundbreaking work you'redoing in this area. Keep up the great work! 🤖==============================================================================='''+++# Example of using the newest Gemini-Exp-1114 model+model_exp = ModelFactory.create(+ model_platform=ModelPlatformType.GEMINI,+ model_type=ModelType.GEMINI_EXP_1114,+ model_config_dict=GeminiConfig(temperature=0.2).as_dict(),+)+camel_agent_exp = ChatAgent(system_message=sys_msg, model=model_exp)+response_exp = camel_agent_exp.step(user_msg)+print(response_exp.msgs[0].content)++'''+===============================================================================+Hi CAMEL AI! It's great to connect with you, an open-source community+dedicated to the fascinating study of autonomous and communicative agents.++Your work sounds incredibly exciting and important. The potential of+autonomous agents to collaborate and communicate effectively is truly+transformative. I'm eager to see the advancements and breakthroughs that come+from your community.++Keep up the fantastic work! If there's anything I can assist with, please+don't hesitate to ask. Perhaps I can help with brainstorming ideas,+summarizing information, or even generating creative content related to your+research.++Let me know how I can be of service!+===============================================================================+'''diff --git a/test/models/test_gemini_model.py b/test/models/test_gemini_model.pyindex 97d6f458e..4a56c0950 100644--- a/test/models/test_gemini_model.py+++ b/test/models/test_gemini_model.py@@ -27,6 +27,7 @@ from camel.utils import GeminiTokenCounter[ModelType.GEMINI_1_5_FLASH,ModelType.GEMINI_1_5_PRO,+ ModelType.GEMINI_EXP_1114,],)def test_gemini_model(model_type: ModelType):