Skip to content

Commit ac2630c

Browse files
feat: add gemini 3 flash (#3585)
Co-authored-by: Wendong-Fan <[email protected]> Co-authored-by: Wendong-Fan <[email protected]>
1 parent 8e26f5a commit ac2630c

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

camel/types/enums.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class ModelType(UnifiedModelType, Enum):
245245

246246
# Gemini models
247247
GEMINI_3_PRO = "gemini-3-pro-preview"
248+
GEMINI_3_FLASH = "gemini-3-flash-preview"
248249
GEMINI_2_5_FLASH = "gemini-2.5-flash"
249250
GEMINI_2_5_PRO = "gemini-2.5-pro"
250251
GEMINI_2_0_FLASH = "gemini-2.0-flash"
@@ -853,6 +854,7 @@ def is_gemini(self) -> bool:
853854
"""
854855
return self in {
855856
ModelType.GEMINI_3_PRO,
857+
ModelType.GEMINI_3_FLASH,
856858
ModelType.GEMINI_2_5_FLASH,
857859
ModelType.GEMINI_2_5_PRO,
858860
ModelType.GEMINI_2_0_FLASH,
@@ -1557,6 +1559,7 @@ def token_limit(self) -> int:
15571559
return 512_000
15581560
elif self in {
15591561
ModelType.GEMINI_3_PRO,
1562+
ModelType.GEMINI_3_FLASH,
15601563
ModelType.GEMINI_2_5_FLASH,
15611564
ModelType.GEMINI_2_5_PRO,
15621565
ModelType.GEMINI_2_0_FLASH,

examples/models/gemini_model_example.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,33 @@
6969
'''
7070

7171

72-
# Example of using the gemini-2.5-pro model
73-
model_2_5_pro_pre = ModelFactory.create(
72+
# Example of using the gemini-3-flash model
73+
model_3_flash = ModelFactory.create(
7474
model_platform=ModelPlatformType.GEMINI,
75-
model_type=ModelType.GEMINI_2_5_PRO,
75+
model_type=ModelType.GEMINI_3_FLASH,
7676
model_config_dict=GeminiConfig(temperature=0.2).as_dict(),
7777
)
78-
camel_agent_pro = ChatAgent(system_message=sys_msg, model=model_2_5_pro_pre)
79-
response_pro = camel_agent_pro.step(user_msg)
80-
print(response_pro.msgs[0].content)
78+
camel_agent_flash = ChatAgent(system_message=sys_msg, model=model_3_flash)
79+
user_msg = """
80+
Explain how Generative AI works in short language.
81+
"""
82+
response_flash = camel_agent_flash.step(user_msg)
83+
print(response_flash.msgs[0].content)
8184

8285
'''
8386
===============================================================================
84-
Hello and a big hi to the entire CAMEL AI community!
87+
Generative AI works in three simple steps:
8588
86-
It's fantastic to acknowledge your dedication to
87-
the important and fascinating study of autonomous and communicative agents.
88-
Open-source collaboration is the engine of innovation,
89-
and your work is pushing the boundaries of what's possible in AI.
89+
1. **Training:** It "reads" or "looks at" massive amounts of existing data
90+
(like books, code, or images) to learn patterns, styles, and structures.
91+
2. **Prediction:** When you give it a prompt, it doesn't "think"—it
92+
calculates probability. It predicts what word, pixel, or note should come next
93+
based on the patterns it learned.
94+
3. **Creation:** By repeating these predictions millions of times per second,
95+
it generates entirely new content that looks or sounds like it was made by a
96+
human.
9097
91-
Keep up the brilliant research and community building
98+
**In short:** It is a super-powered version of **autocomplete** that uses math
99+
to guess the most likely next piece of information.
92100
===============================================================================
93101
'''

0 commit comments

Comments
 (0)