Skip to content

Commit 8eef8e3

Browse files
authored
chore: remove model config check (#2990)
1 parent 530e720 commit 8eef8e3

File tree

81 files changed

+173
-1348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+173
-1348
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ body:
2626
attributes:
2727
label: What version of camel are you using?
2828
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
29-
placeholder: E.g., 0.2.74
29+
placeholder: E.g., 0.2.75a0
3030
validations:
3131
required: true
3232

camel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from camel.logger import disable_logging, enable_logging, set_log_level
1616

17-
__version__ = '0.2.74'
17+
__version__ = '0.2.75a0'
1818

1919
__all__ = [
2020
'__version__',

camel/models/aiml_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import os
1515
from typing import Any, Dict, Optional, Union
1616

17-
from camel.configs import AIML_API_PARAMS, AIMLConfig
17+
from camel.configs import AIMLConfig
1818
from camel.models.openai_compatible_model import OpenAICompatibleModel
1919
from camel.types import ModelType
2020
from camel.utils import (
@@ -82,18 +82,3 @@ def __init__(
8282
max_retries=max_retries,
8383
**kwargs,
8484
)
85-
86-
def check_model_config(self):
87-
r"""Check whether the model configuration contains any
88-
unexpected arguments to AIML API.
89-
90-
Raises:
91-
ValueError: If the model configuration dictionary contains any
92-
unexpected arguments to AIML API.
93-
"""
94-
for param in self.model_config_dict:
95-
if param not in AIML_API_PARAMS:
96-
raise ValueError(
97-
f"Unexpected argument `{param}` is "
98-
"input into AIML model backend."
99-
)

camel/models/anthropic_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from openai import AsyncStream, Stream
1818

19-
from camel.configs import ANTHROPIC_API_PARAMS, AnthropicConfig
19+
from camel.configs import AnthropicConfig
2020
from camel.messages import OpenAIMessage
2121
from camel.models.openai_compatible_model import OpenAICompatibleModel
2222
from camel.types import ChatCompletion, ChatCompletionChunk, ModelType
@@ -150,21 +150,6 @@ def token_counter(self) -> BaseTokenCounter:
150150
self._token_counter = OpenAITokenCounter(ModelType.GPT_4O_MINI)
151151
return self._token_counter
152152

153-
def check_model_config(self):
154-
r"""Check whether the model configuration is valid for anthropic
155-
model backends.
156-
157-
Raises:
158-
ValueError: If the model configuration dictionary contains any
159-
unexpected arguments to Anthropic API.
160-
"""
161-
for param in self.model_config_dict:
162-
if param not in ANTHROPIC_API_PARAMS:
163-
raise ValueError(
164-
f"Unexpected argument `{param}` is "
165-
"input into Anthropic model backend."
166-
)
167-
168153
def _request_chat_completion(
169154
self,
170155
messages: List[OpenAIMessage],

camel/models/aws_bedrock_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from openai import AsyncStream
1919
from pydantic import BaseModel
2020

21-
from camel.configs import BEDROCK_API_PARAMS, BedrockConfig
21+
from camel.configs import BedrockConfig
2222
from camel.messages import OpenAIMessage
2323
from camel.models.openai_compatible_model import OpenAICompatibleModel
2424
from camel.types import (
@@ -103,18 +103,3 @@ async def _arun(
103103
raise NotImplementedError(
104104
"AWS Bedrock does not support async inference."
105105
)
106-
107-
def check_model_config(self):
108-
r"""Check whether the input model configuration contains unexpected
109-
arguments.
110-
111-
Raises:
112-
ValueError: If the model configuration dictionary contains any
113-
unexpected argument for this model class.
114-
"""
115-
for param in self.model_config_dict:
116-
if param not in BEDROCK_API_PARAMS:
117-
raise ValueError(
118-
f"Invalid parameter '{param}' in model_config_dict. "
119-
f"Valid parameters are: {BEDROCK_API_PARAMS}"
120-
)

camel/models/azure_openai_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323
from pydantic import BaseModel
2424

25-
from camel.configs import OPENAI_API_PARAMS, ChatGPTConfig
25+
from camel.configs import ChatGPTConfig
2626
from camel.messages import OpenAIMessage
2727
from camel.models.base_model import BaseModelBackend
2828
from camel.types import (
@@ -452,21 +452,6 @@ async def _arequest_stream_parse(
452452
**request_config,
453453
)
454454

455-
def check_model_config(self):
456-
r"""Check whether the model configuration contains any
457-
unexpected arguments to Azure OpenAI API.
458-
459-
Raises:
460-
ValueError: If the model configuration dictionary contains any
461-
unexpected arguments to Azure OpenAI API.
462-
"""
463-
for param in self.model_config_dict:
464-
if param not in OPENAI_API_PARAMS:
465-
raise ValueError(
466-
f"Unexpected argument `{param}` is "
467-
"input into Azure OpenAI model backend."
468-
)
469-
470455
@property
471456
def stream(self) -> bool:
472457
r"""Returns whether the model is in stream mode,

camel/models/base_model.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def __init__(
105105
== "true"
106106
)
107107
self._log_dir = os.environ.get("CAMEL_LOG_DIR", "camel_logs")
108-
self.check_model_config()
109108

110109
@property
111110
@abstractmethod
@@ -457,17 +456,6 @@ async def arun(
457456

458457
return result
459458

460-
@abstractmethod
461-
def check_model_config(self):
462-
r"""Check whether the input model configuration contains unexpected
463-
arguments
464-
465-
Raises:
466-
ValueError: If the model configuration dictionary contains any
467-
unexpected argument for this model class.
468-
"""
469-
pass
470-
471459
def count_tokens_from_messages(self, messages: List[OpenAIMessage]) -> int:
472460
r"""Count the number of tokens in the messages using the specific
473461
tokenizer.

camel/models/cohere_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ChatResponse,
2727
)
2828

29-
from camel.configs import COHERE_API_PARAMS, CohereConfig
29+
from camel.configs import CohereConfig
3030
from camel.messages import OpenAIMessage
3131
from camel.models import BaseModelBackend
3232
from camel.models._utils import try_modify_message_with_format
@@ -454,21 +454,6 @@ async def _arun(
454454

455455
return openai_response
456456

457-
def check_model_config(self):
458-
r"""Check whether the model configuration contains any unexpected
459-
arguments to Cohere API.
460-
461-
Raises:
462-
ValueError: If the model configuration dictionary contains any
463-
unexpected arguments to Cohere API.
464-
"""
465-
for param in self.model_config_dict:
466-
if param not in COHERE_API_PARAMS:
467-
raise ValueError(
468-
f"Unexpected argument `{param}` is "
469-
"input into Cohere model backend."
470-
)
471-
472457
@property
473458
def stream(self) -> bool:
474459
r"""Returns whether the model is in stream mode, which sends partial

camel/models/crynux_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
from typing import Any, Dict, Optional, Union
1717

18-
from camel.configs import CRYNUX_API_PARAMS, CrynuxConfig
18+
from camel.configs import CrynuxConfig
1919
from camel.models.openai_compatible_model import OpenAICompatibleModel
2020
from camel.types import ModelType
2121
from camel.utils import (
@@ -85,18 +85,3 @@ def __init__(
8585
max_retries=max_retries,
8686
**kwargs,
8787
)
88-
89-
def check_model_config(self):
90-
r"""Check whether the model configuration contains any
91-
unexpected arguments to Crynux API.
92-
93-
Raises:
94-
ValueError: If the model configuration dictionary contains any
95-
unexpected arguments to Crynux API.
96-
"""
97-
for param in self.model_config_dict:
98-
if param not in CRYNUX_API_PARAMS:
99-
raise ValueError(
100-
f"Unexpected argument `{param}` is "
101-
"input into Crynux model backend."
102-
)

camel/models/deepseek_model.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from openai import AsyncStream, Stream
1919
from pydantic import BaseModel
2020

21-
from camel.configs import DEEPSEEK_API_PARAMS, DeepSeekConfig
21+
from camel.configs import DeepSeekConfig
2222
from camel.logger import get_logger
2323
from camel.messages import OpenAIMessage
2424
from camel.models._utils import try_modify_message_with_format
@@ -287,18 +287,3 @@ async def _arun(
287287
)
288288

289289
return self._post_handle_response(response)
290-
291-
def check_model_config(self):
292-
r"""Check whether the model configuration contains any
293-
unexpected arguments to DeepSeek API.
294-
295-
Raises:
296-
ValueError: If the model configuration dictionary contains any
297-
unexpected arguments to DeepSeek API.
298-
"""
299-
for param in self.model_config_dict:
300-
if param not in DEEPSEEK_API_PARAMS:
301-
raise ValueError(
302-
f"Unexpected argument `{param}` is "
303-
"input into DeepSeek model backend."
304-
)

0 commit comments

Comments
 (0)