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: support gemini 3 (#3433)

Wendong-Fan863887089337
diff --git a/camel/types/enums.py b/camel/types/enums.py
index ab30d8c4a..79d41ecc7 100644
--- a/camel/types/enums.py
+++ b/camel/types/enums.py
@@ -240,6 +240,7 @@ class ModelType(UnifiedModelType, Enum):
NVIDIA_LLAMA3_3_70B_INSTRUCT = "meta/llama-3.3-70b-instruct"
# Gemini models
+ GEMINI_3_PRO = "gemini-3-pro-preview"
GEMINI_2_5_FLASH = "gemini-2.5-flash"
GEMINI_2_5_PRO = "gemini-2.5-pro"
GEMINI_2_0_FLASH = "gemini-2.0-flash"
@@ -835,6 +836,7 @@ class ModelType(UnifiedModelType, Enum):
bool: Whether this type of models is gemini.
"""
return self in {
+ ModelType.GEMINI_3_PRO,
ModelType.GEMINI_2_5_FLASH,
ModelType.GEMINI_2_5_PRO,
ModelType.GEMINI_2_0_FLASH,
@@ -1529,6 +1531,7 @@ class ModelType(UnifiedModelType, Enum):
}:
return 512_000
elif self in {
+ ModelType.GEMINI_3_PRO,
ModelType.GEMINI_2_5_FLASH,
ModelType.GEMINI_2_5_PRO,
ModelType.GEMINI_2_0_FLASH,
diff --git a/examples/models/gemini_model_example.py b/examples/models/gemini_model_example.py
index 0cc178358..aff7c44bd 100644
--- a/examples/models/gemini_model_example.py
+++ b/examples/models/gemini_model_example.py
@@ -19,122 +19,49 @@ 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-preview-06-05 model
-model_2_5_pro_pre = ModelFactory.create(
+# Example of using the gemini-3-pro-preview model
+model_3_pro_pre = ModelFactory.create(
model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_2_5_PRO,
+ model_type=ModelType.GEMINI_3_PRO,
model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
)
-camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_2_5_pro_pre)
+camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_3_pro_pre)
response_pro = camel_agent_pro.step(user_msg)
print(response_pro.msgs[0].content)
-
-'''
-===============================================================================
-Hello and a big hi to the entire CAMEL AI community!
-
-It's fantastic to acknowledge your dedication to
-the important and fascinating study of autonomous and communicative agents.
-Open-source collaboration is the engine of innovation,
-and your work is pushing the boundaries of what's possible in AI.
-
-Keep up the brilliant research and community building
-===============================================================================
-'''
-
-
-# Example of using the gemini-1.5-pro model
-model = ModelFactory.create(
- model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_1_5_PRO,
- model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
-)
-
-# Set agent
-camel_agent = ChatAgent(system_message=sys_msg, model=model)
-
-# Get response information
-response = camel_agent.step(user_msg)
-print(response.msgs[0].content)
'''
===============================================================================
Hi CAMEL AI! 👋
-It's great to see a community dedicated to the fascinating field of autonomous
-and communicative agents. I'm excited to see what groundbreaking work you're
-doing in this area. Keep up the great work! 🤖
-===============================================================================
-'''
-
-# Example of using the gemini-2.0-flash-exp model
-model_2_0_flash = ModelFactory.create(
- model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_2_0_FLASH_EXP,
- model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
-)
-camel_agent_flash = ChatAgent(system_message=sys_msg, model=model_2_0_flash)
-response_flash = camel_agent_flash.step(user_msg)
-print(response_flash.msgs[0].content)
-
-'''
-===============================================================================
-Hello! I'm happy to say hi to CAMEL AI, one open-source community dedicated to
-the study of autonomous and communicative agents. It sounds like a fascinating
-community!
+It is a pleasure to greet a community so dedicated to the fascinating world of
+**autonomous and communicative agents**. Keep up the amazing work pushing the
+boundaries of multi-agent collaboration and role-playing frameworks! 🐫🤖
===============================================================================
'''
-# Example of using the gemini-2.0-flash-thinking model
-model_2_0_flash_thinking = ModelFactory.create(
- model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_2_0_FLASH_THINKING,
- model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
-)
-camel_agent_thinking = ChatAgent(
- system_message=sys_msg, model=model_2_0_flash_thinking
-)
-response_thinking = camel_agent_thinking.step(
- "How many rs are there in 'starrary'?"
-)
-print(response_thinking.msgs[0].content)
-'''
-===============================================================================
-Let's count them out!
-s - no r
-t - no r
-a - no r
-r - yes, that's one!
-r - yes, that's two!
-a - no r
-r - yes, that's three!
-y - no r
-
-There are **three** rs in "starrary".
-===============================================================================
-'''
-
-
-# Example of using the gemini-2.0-pro model
-model_2_0_pro = ModelFactory.create(
+# Example of using the gemini-2.5-pro model
+model_2_5_pro_pre = ModelFactory.create(
model_platform=ModelPlatformType.GEMINI,
- model_type=ModelType.GEMINI_2_0_PRO_EXP,
+ model_type=ModelType.GEMINI_2_5_PRO,
model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
)
-camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_2_0_pro)
+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 connect with an open-source community focused on
-the exciting field of autonomous and communicative agents. I'm very interested
-in learning more about your work and contributions to this area of research.
-Best of luck with your endeavors!
+Hello and a big hi to the entire CAMEL AI community!
+
+It's fantastic to acknowledge your dedication to
+the important and fascinating study of autonomous and communicative agents.
+Open-source collaboration is the engine of innovation,
+and your work is pushing the boundaries of what's possible in AI.
+
+Keep up the brilliant research and community building
===============================================================================
'''