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

fix: pre commit issue with aihubmix model integration (#3358)

Wendong-Fan81303504b896
diff --git a/camel/configs/__init__.py b/camel/configs/__init__.py
index ffb7bc451..f6856ab5b 100644
--- a/camel/configs/__init__.py
+++ b/camel/configs/__init__.py
@@ -11,8 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
-from .aiml_config import AIML_API_PARAMS, AIMLConfig
from .aihubmix_config import AIHUBMIX_API_PARAMS, AihubMixConfig
+from .aiml_config import AIML_API_PARAMS, AIMLConfig
from .amd_config import AMD_API_PARAMS, AMDConfig
from .anthropic_config import ANTHROPIC_API_PARAMS, AnthropicConfig
from .base_config import BaseConfig
@@ -130,4 +130,4 @@ __all__ = [
'QIANFAN_API_PARAMS',
'CrynuxConfig',
'CRYNUX_API_PARAMS',
-]
\ No newline at end of file
+]
diff --git a/camel/configs/aihubmix_config.py b/camel/configs/aihubmix_config.py
index 23d4005f3..4dabd5c9d 100644
--- a/camel/configs/aihubmix_config.py
+++ b/camel/configs/aihubmix_config.py
@@ -13,9 +13,7 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
from __future__ import annotations
-from typing import Dict, Optional, Sequence, Type, Union
-
-from pydantic import BaseModel
+from typing import Dict, Optional, Union
from camel.configs.base_config import BaseConfig
@@ -41,7 +39,7 @@ class AihubMixConfig(BaseConfig):
frequency_penalty (float, optional): Number between :obj:`-2.0` and
:obj:`2.0`. Positive values penalize new tokens based on their
existing frequency in the text so far, decreasing the model's
- likelihood to repeat the same line verbatim.
+ likelihood to repeat the same line verbatim.
(default: :obj:`0`)
presence_penalty (float, optional): Number between :obj:`-2.0` and
:obj:`2.0`. Positive values penalize new tokens based on whether
@@ -87,4 +85,4 @@ class AihubMixConfig(BaseConfig):
extra_headers: Optional[Dict[str, str]] = None
-AIHUBMIX_API_PARAMS = {param for param in AihubMixConfig.model_fields.keys()}
\ No newline at end of file
+AIHUBMIX_API_PARAMS = {param for param in AihubMixConfig.model_fields.keys()}
diff --git a/camel/models/model_factory.py b/camel/models/model_factory.py
index f2f83ed15..736052324 100644
--- a/camel/models/model_factory.py
+++ b/camel/models/model_factory.py
@@ -15,6 +15,7 @@ import json
import os
from typing import Any, ClassVar, Dict, Optional, Type, Union
+from camel.models.aihubmix_model import AihubMixModel
from camel.models.aiml_model import AIMLModel
from camel.models.amd_model import AMDModel
from camel.models.anthropic_model import AnthropicModel
@@ -23,7 +24,6 @@ from camel.models.azure_openai_model import AzureOpenAIModel
from camel.models.base_model import BaseModelBackend
from camel.models.cohere_model import CohereModel
from camel.models.cometapi_model import CometAPIModel
-from camel.models.aihubmix_model import AihubMixModel
from camel.models.crynux_model import CrynuxModel
from camel.models.deepseek_model import DeepSeekModel
from camel.models.gemini_model import GeminiModel
diff --git a/examples/models/aihubmix_model_example.py b/examples/models/aihubmix_model_example.py
index 430e084fd..43e816d96 100644
--- a/examples/models/aihubmix_model_example.py
+++ b/examples/models/aihubmix_model_example.py
@@ -26,7 +26,7 @@ from camel.types import ModelPlatformType, ModelType
def test_aihubmix_model() -> None:
r"""Test AIHubMix model using ModelFactory."""
-
+
# Set up the model
# You need to set AIHUBMIX_API_KEY in your environment variables
# or directly pass it as api_key parameter
@@ -58,7 +58,7 @@ def test_aihubmix_model() -> None:
def test_aihubmix_with_custom_model() -> None:
r"""Test AIHubMix model with a custom model name."""
-
+
# Set up the model
api_key = os.environ.get("AIHUBMIX_API_KEY")
if not api_key:
@@ -90,7 +90,7 @@ def main():
r"""Main function to test AIHubMix models."""
print("Testing AIHubMix models:")
print("=" * 40)
-
+
test_aihubmix_model()
print("-" * 40)
test_aihubmix_with_custom_model()