🐫 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 kimi k2 model (#2852)
Yifeng Wang(正经人王同学)100c3cd12b56
diff --git a/camel/models/cohere_model.py b/camel/models/cohere_model.pyindex 10cd4b397..aa752f24d 100644--- a/camel/models/cohere_model.py+++ b/camel/models/cohere_model.py@@ -21,7 +21,10 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, Unionfrom pydantic import BaseModelif TYPE_CHECKING:- from cohere.types import ChatMessageV2, ChatResponse+ from cohere.types import ( # type: ignore[attr-defined]+ ChatMessageV2,+ ChatResponse,+ )from camel.configs import COHERE_API_PARAMS, CohereConfigfrom camel.messages import OpenAIMessagediff --git a/camel/types/enums.py b/camel/types/enums.pyindex 5f2ebe06a..2a935a1bd 100644--- a/camel/types/enums.py+++ b/camel/types/enums.py@@ -270,6 +270,7 @@ class ModelType(UnifiedModelType, Enum):MOONSHOT_V1_8K = "moonshot-v1-8k"MOONSHOT_V1_32K = "moonshot-v1-32k"MOONSHOT_V1_128K = "moonshot-v1-128k"+ MOONSHOT_KIMI_K2 = "kimi-k2-0711-preview"# SiliconFlow models support tool callingSILICONFLOW_DEEPSEEK_V2_5 = "deepseek-ai/DeepSeek-V2.5"@@ -833,6 +834,7 @@ class ModelType(UnifiedModelType, Enum):ModelType.MOONSHOT_V1_8K,ModelType.MOONSHOT_V1_32K,ModelType.MOONSHOT_V1_128K,+ ModelType.MOONSHOT_KIMI_K2,}@property@@ -1205,6 +1207,7 @@ class ModelType(UnifiedModelType, Enum):ModelType.MISTRAL_MEDIUM_3,ModelType.ERNIE_4_5_TURBO_128K,ModelType.DEEPSEEK_V3,+ ModelType.MOONSHOT_KIMI_K2,}:return 128_000elif self in {diff --git a/examples/models/moonshot_model_example.py b/examples/models/moonshot_model_example.pyindex 88c905123..9a47f8fff 100644--- a/examples/models/moonshot_model_example.py+++ b/examples/models/moonshot_model_example.py@@ -19,7 +19,7 @@ from camel.types import ModelPlatformType, ModelTypemodel = ModelFactory.create(model_platform=ModelPlatformType.MOONSHOT,- model_type=ModelType.MOONSHOT_V1_8K,+ model_type=ModelType.MOONSHOT_KIMI_K2,model_config_dict=MoonshotConfig(temperature=0.2).as_dict(),)@@ -38,9 +38,11 @@ print(response.msgs[0].content)'''===============================================================================-Hi CAMEL AI! It's great to hear about your open-source community dedicated to-the study of autonomous and communicative agents. I'm here to help and support-you in any way I can. If you have any questions or need assistance with your-research, feel free to ask!+Hi CAMEL AI! 🐪+It's great to meet a community that's pushing the frontier of autonomous+and communicative agents.Your open-source spirit and focus on scalable,+multi-agent systems are exactly what the field needs.+Keep up the amazing work! Looking forward to seeing+what breakthroughs come next==============================================================================='''