Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

feat:add gemini-2.5-pro-preview-05-06 in GEMINI (#2345)

Yifeng Wang(正经人王同学)178ed8c8b609
diff --git a/camel/types/enums.py b/camel/types/enums.py
index 35f15554b..e2fb87c35 100644
--- a/camel/types/enums.py
+++ b/camel/types/enums.py
@@ -180,7 +180,7 @@ class ModelType(UnifiedModelType, Enum):
NVIDIA_LLAMA3_3_70B_INSTRUCT = "meta/llama-3.3-70b-instruct"
# Gemini models
- GEMINI_2_5_PRO_EXP = "gemini-2.5-pro-exp-03-25"
+ GEMINI_2_5_PRO_PREVIEW = "gemini-2.5-pro-preview-05-06"
GEMINI_2_0_FLASH = "gemini-2.0-flash-exp"
GEMINI_2_0_FLASH_THINKING = "gemini-2.0-flash-thinking-exp"
GEMINI_2_0_PRO_EXP = "gemini-2.0-pro-exp-02-05"
@@ -629,7 +629,7 @@ class ModelType(UnifiedModelType, Enum):
bool: Whether this type of models is gemini.
"""
return self in {
- ModelType.GEMINI_2_5_PRO_EXP,
+ ModelType.GEMINI_2_5_PRO_PREVIEW,
ModelType.GEMINI_2_0_FLASH,
ModelType.GEMINI_1_5_FLASH,
ModelType.GEMINI_1_5_PRO,
@@ -1181,7 +1181,7 @@ class ModelType(UnifiedModelType, Enum):
}:
return 512_000
elif self in {
- ModelType.GEMINI_2_5_PRO_EXP,
+ ModelType.GEMINI_2_5_PRO_PREVIEW,
ModelType.GEMINI_2_0_FLASH,
ModelType.GEMINI_1_5_FLASH,
ModelType.GEMINI_1_5_PRO,
diff --git a/examples/models/gemini_model_example.py b/examples/models/gemini_model_example.py
index 955b2526b..db62f80a2 100644
--- a/examples/models/gemini_model_example.py
+++ b/examples/models/gemini_model_example.py
@@ -19,30 +19,35 @@ from camel.types import ModelPlatformType, ModelType
# Define system message
sys_msg = "You are a helpful assistant."
+
# User message
user_msg = """Say hi to CAMEL AI, one open-source community dedicated to the
study of autonomous and communicative agents."""
-# Example of using the gemini-2.5-pro-exp model
-model_2_5_pro_exp = ModelFactory.create(
+
+# Example of using the gemini-2.5-pro-preview-05-06 model
+model_2_5_pro_pre = ModelFactory.create(
model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_2_5_PRO_EXP,
+ model_type=ModelType.GEMINI_2_5_PRO_PREVIEW,
model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
)
-camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_2_5_pro_exp)
+camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_2_5_pro_pre)
response_pro = camel_agent_pro.step(user_msg)
print(response_pro.msgs[0].content)
+
'''
===============================================================================
Hello CAMEL AI! 👋
-It's great to acknowledge your open-source community and your important
-dedication to the study of autonomous and communicative agents. That's a
-fascinating and crucial area of research! Wishing you all the best in your
-endeavors.
+A big, warm greeting to your fantastic open-source community!
+It's wonderful to hear about your dedication to
+the study of autonomous and communicative agents.
+That's a truly exciting and important field.
+Keep up the great work, and best of luck with all your endeavors!
===============================================================================
'''
+
# Example of using the gemini-1.5-pro model
model = ModelFactory.create(
model_platform=ModelPlatformType.GEMINI,
diff --git a/test/models/test_gemini_model.py b/test/models/test_gemini_model.py
index 2146a6932..80259d89c 100644
--- a/test/models/test_gemini_model.py
+++ b/test/models/test_gemini_model.py
@@ -25,7 +25,7 @@ from camel.utils import OpenAITokenCounter
@pytest.mark.parametrize(
"model_type",
[
- ModelType.GEMINI_2_5_PRO_EXP,
+ ModelType.GEMINI_2_5_PRO_PREVIEW,
ModelType.GEMINI_2_0_FLASH,
ModelType.GEMINI_1_5_FLASH,
ModelType.GEMINI_1_5_PRO,