camel-ai 0.2.74a4__py3-none-any.whl → 0.2.75a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of camel-ai might be problematic. Click here for more details.
- camel/__init__.py +1 -1
- camel/interpreters/e2b_interpreter.py +34 -1
- camel/models/aiml_model.py +1 -16
- camel/models/anthropic_model.py +6 -19
- camel/models/aws_bedrock_model.py +1 -16
- camel/models/azure_openai_model.py +1 -16
- camel/models/base_model.py +0 -12
- camel/models/cohere_model.py +1 -16
- camel/models/crynux_model.py +1 -16
- camel/models/deepseek_model.py +1 -16
- camel/models/gemini_model.py +1 -16
- camel/models/groq_model.py +1 -17
- camel/models/internlm_model.py +1 -16
- camel/models/litellm_model.py +1 -16
- camel/models/lmstudio_model.py +1 -17
- camel/models/mistral_model.py +1 -16
- camel/models/modelscope_model.py +1 -16
- camel/models/moonshot_model.py +1 -16
- camel/models/nemotron_model.py +0 -5
- camel/models/netmind_model.py +1 -16
- camel/models/novita_model.py +1 -16
- camel/models/nvidia_model.py +1 -16
- camel/models/ollama_model.py +1 -16
- camel/models/openai_compatible_model.py +0 -3
- camel/models/openai_model.py +1 -16
- camel/models/openrouter_model.py +1 -17
- camel/models/ppio_model.py +1 -16
- camel/models/qianfan_model.py +1 -16
- camel/models/qwen_model.py +1 -16
- camel/models/reka_model.py +1 -16
- camel/models/samba_model.py +0 -32
- camel/models/sglang_model.py +1 -16
- camel/models/siliconflow_model.py +1 -16
- camel/models/stub_model.py +0 -4
- camel/models/togetherai_model.py +1 -16
- camel/models/vllm_model.py +1 -16
- camel/models/volcano_model.py +0 -17
- camel/models/watsonx_model.py +1 -16
- camel/models/yi_model.py +1 -16
- camel/models/zhipuai_model.py +1 -16
- camel/toolkits/hybrid_browser_toolkit/config_loader.py +3 -0
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit_ts.py +225 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/browser-session.ts +164 -8
- camel/toolkits/hybrid_browser_toolkit/ts/src/config-loader.ts +2 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/hybrid-browser-toolkit.ts +106 -1
- camel/toolkits/hybrid_browser_toolkit/ts/src/types.ts +19 -1
- camel/toolkits/hybrid_browser_toolkit/ts/websocket-server.js +20 -0
- camel/toolkits/hybrid_browser_toolkit/ws_wrapper.py +41 -0
- camel/toolkits/hybrid_browser_toolkit_py/actions.py +158 -0
- camel/toolkits/hybrid_browser_toolkit_py/browser_session.py +55 -8
- camel/toolkits/hybrid_browser_toolkit_py/config_loader.py +43 -0
- camel/toolkits/hybrid_browser_toolkit_py/hybrid_browser_toolkit.py +312 -3
- camel/toolkits/hybrid_browser_toolkit_py/snapshot.py +10 -4
- camel/toolkits/hybrid_browser_toolkit_py/unified_analyzer.js +45 -4
- camel/toolkits/note_taking_toolkit.py +3 -4
- camel/toolkits/search_toolkit.py +182 -30
- camel/types/enums.py +9 -0
- camel/utils/mcp.py +2 -2
- camel/utils/token_counting.py +13 -2
- {camel_ai-0.2.74a4.dist-info → camel_ai-0.2.75a0.dist-info}/METADATA +6 -6
- {camel_ai-0.2.74a4.dist-info → camel_ai-0.2.75a0.dist-info}/RECORD +63 -63
- {camel_ai-0.2.74a4.dist-info → camel_ai-0.2.75a0.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.74a4.dist-info → camel_ai-0.2.75a0.dist-info}/licenses/LICENSE +0 -0
camel/models/openai_model.py
CHANGED
|
@@ -22,7 +22,7 @@ from openai.lib.streaming.chat import (
|
|
|
22
22
|
)
|
|
23
23
|
from pydantic import BaseModel
|
|
24
24
|
|
|
25
|
-
from camel.configs import
|
|
25
|
+
from camel.configs import ChatGPTConfig
|
|
26
26
|
from camel.logger import get_logger
|
|
27
27
|
from camel.messages import OpenAIMessage
|
|
28
28
|
from camel.models import BaseModelBackend
|
|
@@ -545,21 +545,6 @@ class OpenAIModel(BaseModelBackend):
|
|
|
545
545
|
**request_config,
|
|
546
546
|
)
|
|
547
547
|
|
|
548
|
-
def check_model_config(self):
|
|
549
|
-
r"""Check whether the model configuration contains any
|
|
550
|
-
unexpected arguments to OpenAI API.
|
|
551
|
-
|
|
552
|
-
Raises:
|
|
553
|
-
ValueError: If the model configuration dictionary contains any
|
|
554
|
-
unexpected arguments to OpenAI API.
|
|
555
|
-
"""
|
|
556
|
-
for param in self.model_config_dict:
|
|
557
|
-
if param not in OPENAI_API_PARAMS:
|
|
558
|
-
raise ValueError(
|
|
559
|
-
f"Unexpected argument `{param}` is "
|
|
560
|
-
"input into OpenAI model backend."
|
|
561
|
-
)
|
|
562
|
-
|
|
563
548
|
@property
|
|
564
549
|
def stream(self) -> bool:
|
|
565
550
|
r"""Returns whether the model is in stream mode, which sends partial
|
camel/models/openrouter_model.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import os
|
|
15
15
|
from typing import Any, Dict, Optional, Union
|
|
16
16
|
|
|
17
|
-
from camel.configs import
|
|
17
|
+
from camel.configs import OpenRouterConfig
|
|
18
18
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
19
19
|
from camel.types import ModelType
|
|
20
20
|
from camel.utils import (
|
|
@@ -81,19 +81,3 @@ class OpenRouterModel(OpenAICompatibleModel):
|
|
|
81
81
|
max_retries=max_retries,
|
|
82
82
|
**kwargs,
|
|
83
83
|
)
|
|
84
|
-
|
|
85
|
-
def check_model_config(self):
|
|
86
|
-
r"""Check whether the model configuration contains any unexpected
|
|
87
|
-
arguments to OpenRouter API. But OpenRouter API does not have any
|
|
88
|
-
additional arguments to check.
|
|
89
|
-
|
|
90
|
-
Raises:
|
|
91
|
-
ValueError: If the model configuration dictionary contains any
|
|
92
|
-
unexpected arguments to OpenRouter API.
|
|
93
|
-
"""
|
|
94
|
-
for param in self.model_config_dict:
|
|
95
|
-
if param not in OPENROUTER_API_PARAMS:
|
|
96
|
-
raise ValueError(
|
|
97
|
-
f"Unexpected argument `{param}` is "
|
|
98
|
-
"input into OpenRouter model backend."
|
|
99
|
-
)
|
camel/models/ppio_model.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import PPIOConfig
|
|
19
19
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
20
|
from camel.types import ModelType
|
|
21
21
|
from camel.utils import (
|
|
@@ -86,18 +86,3 @@ class PPIOModel(OpenAICompatibleModel):
|
|
|
86
86
|
max_retries=max_retries,
|
|
87
87
|
**kwargs,
|
|
88
88
|
)
|
|
89
|
-
|
|
90
|
-
def check_model_config(self):
|
|
91
|
-
r"""Check whether the model configuration contains any
|
|
92
|
-
unexpected arguments to PPIO API.
|
|
93
|
-
|
|
94
|
-
Raises:
|
|
95
|
-
ValueError: If the model configuration dictionary contains any
|
|
96
|
-
unexpected arguments to PPIO API.
|
|
97
|
-
"""
|
|
98
|
-
for param in self.model_config_dict:
|
|
99
|
-
if param not in PPIO_API_PARAMS:
|
|
100
|
-
raise ValueError(
|
|
101
|
-
f"Unexpected argument `{param}` is "
|
|
102
|
-
"input into PPIO model backend."
|
|
103
|
-
)
|
camel/models/qianfan_model.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import QianfanConfig
|
|
19
19
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
20
|
from camel.types import ModelType
|
|
21
21
|
from camel.utils import (
|
|
@@ -87,18 +87,3 @@ class QianfanModel(OpenAICompatibleModel):
|
|
|
87
87
|
max_retries=max_retries,
|
|
88
88
|
**kwargs,
|
|
89
89
|
)
|
|
90
|
-
|
|
91
|
-
def check_model_config(self):
|
|
92
|
-
r"""Check whether the model configuration contains any
|
|
93
|
-
unexpected arguments to Qianfan API.
|
|
94
|
-
|
|
95
|
-
Raises:
|
|
96
|
-
ValueError: If the model configuration dictionary contains any
|
|
97
|
-
unexpected arguments to Qianfan API.
|
|
98
|
-
"""
|
|
99
|
-
for param in self.model_config_dict:
|
|
100
|
-
if param not in QIANFAN_API_PARAMS:
|
|
101
|
-
raise ValueError(
|
|
102
|
-
f"Unexpected argument `{param}` is "
|
|
103
|
-
"input into QIANFAN model backend."
|
|
104
|
-
)
|
camel/models/qwen_model.py
CHANGED
|
@@ -18,7 +18,7 @@ from typing import Any, Dict, List, Optional, Union
|
|
|
18
18
|
|
|
19
19
|
from openai import AsyncStream, Stream
|
|
20
20
|
|
|
21
|
-
from camel.configs import
|
|
21
|
+
from camel.configs import QwenConfig
|
|
22
22
|
from camel.messages import OpenAIMessage
|
|
23
23
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
24
24
|
from camel.types import (
|
|
@@ -259,18 +259,3 @@ class QwenModel(OpenAICompatibleModel):
|
|
|
259
259
|
**request_config,
|
|
260
260
|
)
|
|
261
261
|
return self._post_handle_response(response)
|
|
262
|
-
|
|
263
|
-
def check_model_config(self):
|
|
264
|
-
r"""Check whether the model configuration contains any
|
|
265
|
-
unexpected arguments to Qwen API.
|
|
266
|
-
|
|
267
|
-
Raises:
|
|
268
|
-
ValueError: If the model configuration dictionary contains any
|
|
269
|
-
unexpected arguments to Qwen API.
|
|
270
|
-
"""
|
|
271
|
-
for param in self.model_config_dict:
|
|
272
|
-
if param not in QWEN_API_PARAMS:
|
|
273
|
-
raise ValueError(
|
|
274
|
-
f"Unexpected argument `{param}` is "
|
|
275
|
-
"input into Qwen model backend."
|
|
276
|
-
)
|
camel/models/reka_model.py
CHANGED
|
@@ -16,7 +16,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, Union
|
|
|
16
16
|
|
|
17
17
|
from pydantic import BaseModel
|
|
18
18
|
|
|
19
|
-
from camel.configs import
|
|
19
|
+
from camel.configs import RekaConfig
|
|
20
20
|
from camel.messages import OpenAIMessage
|
|
21
21
|
from camel.models import BaseModelBackend
|
|
22
22
|
from camel.types import ChatCompletion, ModelType
|
|
@@ -354,21 +354,6 @@ class RekaModel(BaseModelBackend):
|
|
|
354
354
|
|
|
355
355
|
return openai_response
|
|
356
356
|
|
|
357
|
-
def check_model_config(self):
|
|
358
|
-
r"""Check whether the model configuration contains any
|
|
359
|
-
unexpected arguments to Reka API.
|
|
360
|
-
|
|
361
|
-
Raises:
|
|
362
|
-
ValueError: If the model configuration dictionary contains any
|
|
363
|
-
unexpected arguments to Reka API.
|
|
364
|
-
"""
|
|
365
|
-
for param in self.model_config_dict:
|
|
366
|
-
if param not in REKA_API_PARAMS:
|
|
367
|
-
raise ValueError(
|
|
368
|
-
f"Unexpected argument `{param}` is "
|
|
369
|
-
"input into Reka model backend."
|
|
370
|
-
)
|
|
371
|
-
|
|
372
357
|
@property
|
|
373
358
|
def stream(self) -> bool:
|
|
374
359
|
r"""Returns whether the model is in stream mode, which sends partial
|
camel/models/samba_model.py
CHANGED
|
@@ -22,8 +22,6 @@ from openai import AsyncOpenAI, AsyncStream, OpenAI, Stream
|
|
|
22
22
|
from pydantic import BaseModel
|
|
23
23
|
|
|
24
24
|
from camel.configs import (
|
|
25
|
-
SAMBA_CLOUD_API_PARAMS,
|
|
26
|
-
SAMBA_VERSE_API_PARAMS,
|
|
27
25
|
SambaCloudAPIConfig,
|
|
28
26
|
)
|
|
29
27
|
from camel.messages import OpenAIMessage
|
|
@@ -156,36 +154,6 @@ class SambaModel(BaseModelBackend):
|
|
|
156
154
|
self._token_counter = OpenAITokenCounter(ModelType.GPT_4O_MINI)
|
|
157
155
|
return self._token_counter
|
|
158
156
|
|
|
159
|
-
def check_model_config(self):
|
|
160
|
-
r"""Check whether the model configuration contains any
|
|
161
|
-
unexpected arguments to SambaNova API.
|
|
162
|
-
|
|
163
|
-
Raises:
|
|
164
|
-
ValueError: If the model configuration dictionary contains any
|
|
165
|
-
unexpected arguments to SambaNova API.
|
|
166
|
-
"""
|
|
167
|
-
if self._url == "https://sambaverse.sambanova.ai/api/predict":
|
|
168
|
-
for param in self.model_config_dict:
|
|
169
|
-
if param not in SAMBA_VERSE_API_PARAMS:
|
|
170
|
-
raise ValueError(
|
|
171
|
-
f"Unexpected argument `{param}` is "
|
|
172
|
-
"input into SambaVerse API."
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
elif self._url == "https://api.sambanova.ai/v1":
|
|
176
|
-
for param in self.model_config_dict:
|
|
177
|
-
if param not in SAMBA_CLOUD_API_PARAMS:
|
|
178
|
-
raise ValueError(
|
|
179
|
-
f"Unexpected argument `{param}` is "
|
|
180
|
-
"input into SambaCloud API."
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
else:
|
|
184
|
-
raise ValueError(
|
|
185
|
-
f"{self._url} is not supported, please check the url to the"
|
|
186
|
-
" SambaNova service"
|
|
187
|
-
)
|
|
188
|
-
|
|
189
157
|
@observe(as_type="generation")
|
|
190
158
|
async def _arun( # type: ignore[misc]
|
|
191
159
|
self,
|
camel/models/sglang_model.py
CHANGED
|
@@ -21,7 +21,7 @@ from typing import Any, Dict, List, Optional, Type, Union
|
|
|
21
21
|
from openai import AsyncOpenAI, AsyncStream, OpenAI, Stream
|
|
22
22
|
from pydantic import BaseModel
|
|
23
23
|
|
|
24
|
-
from camel.configs import
|
|
24
|
+
from camel.configs import SGLangConfig
|
|
25
25
|
from camel.messages import OpenAIMessage
|
|
26
26
|
from camel.models import BaseModelBackend
|
|
27
27
|
from camel.types import (
|
|
@@ -209,21 +209,6 @@ class SGLangModel(BaseModelBackend):
|
|
|
209
209
|
self._token_counter = OpenAITokenCounter(ModelType.GPT_4O_MINI)
|
|
210
210
|
return self._token_counter
|
|
211
211
|
|
|
212
|
-
def check_model_config(self):
|
|
213
|
-
r"""Check whether the model configuration contains any
|
|
214
|
-
unexpected arguments to SGLang API.
|
|
215
|
-
|
|
216
|
-
Raises:
|
|
217
|
-
ValueError: If the model configuration dictionary contains any
|
|
218
|
-
unexpected arguments to OpenAI API.
|
|
219
|
-
"""
|
|
220
|
-
for param in self.model_config_dict:
|
|
221
|
-
if param not in SGLANG_API_PARAMS:
|
|
222
|
-
raise ValueError(
|
|
223
|
-
f"Unexpected argument `{param}` is "
|
|
224
|
-
"input into SGLang model backend."
|
|
225
|
-
)
|
|
226
|
-
|
|
227
212
|
@observe(as_type='generation')
|
|
228
213
|
async def _arun(
|
|
229
214
|
self,
|
|
@@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Type, Union
|
|
|
17
17
|
from openai import AsyncStream
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
|
|
20
|
-
from camel.configs import
|
|
20
|
+
from camel.configs import SiliconFlowConfig
|
|
21
21
|
from camel.messages import OpenAIMessage
|
|
22
22
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
23
23
|
from camel.types import (
|
|
@@ -104,18 +104,3 @@ class SiliconFlowModel(OpenAICompatibleModel):
|
|
|
104
104
|
raise NotImplementedError(
|
|
105
105
|
"SiliconFlow does not support async inference."
|
|
106
106
|
)
|
|
107
|
-
|
|
108
|
-
def check_model_config(self):
|
|
109
|
-
r"""Check whether the model configuration contains any
|
|
110
|
-
unexpected arguments to SiliconFlow API.
|
|
111
|
-
|
|
112
|
-
Raises:
|
|
113
|
-
ValueError: If the model configuration dictionary contains any
|
|
114
|
-
unexpected arguments to SiliconFlow API.
|
|
115
|
-
"""
|
|
116
|
-
for param in self.model_config_dict:
|
|
117
|
-
if param not in SILICONFLOW_API_PARAMS:
|
|
118
|
-
raise ValueError(
|
|
119
|
-
f"Unexpected argument `{param}` is "
|
|
120
|
-
"input into SiliconFlow model backend."
|
|
121
|
-
)
|
camel/models/stub_model.py
CHANGED
camel/models/togetherai_model.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import TogetherAIConfig
|
|
19
19
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
20
|
from camel.types import ModelType
|
|
21
21
|
from camel.utils import (
|
|
@@ -86,18 +86,3 @@ class TogetherAIModel(OpenAICompatibleModel):
|
|
|
86
86
|
max_retries=max_retries,
|
|
87
87
|
**kwargs,
|
|
88
88
|
)
|
|
89
|
-
|
|
90
|
-
def check_model_config(self):
|
|
91
|
-
r"""Check whether the model configuration contains any
|
|
92
|
-
unexpected arguments to TogetherAI API.
|
|
93
|
-
|
|
94
|
-
Raises:
|
|
95
|
-
ValueError: If the model configuration dictionary contains any
|
|
96
|
-
unexpected arguments to TogetherAI API.
|
|
97
|
-
"""
|
|
98
|
-
for param in self.model_config_dict:
|
|
99
|
-
if param not in TOGETHERAI_API_PARAMS:
|
|
100
|
-
raise ValueError(
|
|
101
|
-
f"Unexpected argument `{param}` is "
|
|
102
|
-
"input into TogetherAI model backend."
|
|
103
|
-
)
|
camel/models/vllm_model.py
CHANGED
|
@@ -15,7 +15,7 @@ import os
|
|
|
15
15
|
import subprocess
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import VLLMConfig
|
|
19
19
|
from camel.logger import get_logger
|
|
20
20
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
21
21
|
from camel.types import ModelType
|
|
@@ -103,18 +103,3 @@ class VLLMModel(OpenAICompatibleModel):
|
|
|
103
103
|
)
|
|
104
104
|
except Exception as e:
|
|
105
105
|
logger.error(f"Failed to start vllm server: {e}.")
|
|
106
|
-
|
|
107
|
-
def check_model_config(self):
|
|
108
|
-
r"""Check whether the model configuration contains any
|
|
109
|
-
unexpected arguments to vLLM API.
|
|
110
|
-
|
|
111
|
-
Raises:
|
|
112
|
-
ValueError: If the model configuration dictionary contains any
|
|
113
|
-
unexpected arguments to OpenAI API.
|
|
114
|
-
"""
|
|
115
|
-
for param in self.model_config_dict:
|
|
116
|
-
if param not in VLLM_API_PARAMS:
|
|
117
|
-
raise ValueError(
|
|
118
|
-
f"Unexpected argument `{param}` is "
|
|
119
|
-
"input into vLLM model backend."
|
|
120
|
-
)
|
camel/models/volcano_model.py
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import OPENAI_API_PARAMS
|
|
19
18
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
19
|
from camel.types import ModelType
|
|
21
20
|
from camel.utils import (
|
|
@@ -86,19 +85,3 @@ class VolcanoModel(OpenAICompatibleModel):
|
|
|
86
85
|
max_retries,
|
|
87
86
|
**kwargs,
|
|
88
87
|
)
|
|
89
|
-
|
|
90
|
-
def check_model_config(self):
|
|
91
|
-
r"""Check whether the model configuration is valid for Volcano
|
|
92
|
-
model backends.
|
|
93
|
-
|
|
94
|
-
Raises:
|
|
95
|
-
ValueError: If the model configuration dictionary contains any
|
|
96
|
-
unexpected arguments to Volcano API.
|
|
97
|
-
"""
|
|
98
|
-
# Using OpenAI API params as Volcano Engine API is OpenAI-compatible
|
|
99
|
-
for param in self.model_config_dict:
|
|
100
|
-
if param not in OPENAI_API_PARAMS:
|
|
101
|
-
raise ValueError(
|
|
102
|
-
f"Unexpected argument `{param}` is "
|
|
103
|
-
"input into Volcano model backend."
|
|
104
|
-
)
|
camel/models/watsonx_model.py
CHANGED
|
@@ -16,7 +16,7 @@ from typing import Any, Dict, List, Optional, Type, Union
|
|
|
16
16
|
|
|
17
17
|
from pydantic import BaseModel
|
|
18
18
|
|
|
19
|
-
from camel.configs import
|
|
19
|
+
from camel.configs import WatsonXConfig
|
|
20
20
|
from camel.logger import get_logger
|
|
21
21
|
from camel.messages import OpenAIMessage
|
|
22
22
|
from camel.models import BaseModelBackend
|
|
@@ -292,21 +292,6 @@ class WatsonXModel(BaseModelBackend):
|
|
|
292
292
|
logger.error(f"Unexpected error when calling WatsonX API: {e!s}")
|
|
293
293
|
raise
|
|
294
294
|
|
|
295
|
-
def check_model_config(self):
|
|
296
|
-
r"""Check whether the model configuration contains any unexpected
|
|
297
|
-
arguments to WatsonX API.
|
|
298
|
-
|
|
299
|
-
Raises:
|
|
300
|
-
ValueError: If the model configuration dictionary contains any
|
|
301
|
-
unexpected arguments to WatsonX API.
|
|
302
|
-
"""
|
|
303
|
-
for param in self.model_config_dict:
|
|
304
|
-
if param not in WATSONX_API_PARAMS:
|
|
305
|
-
raise ValueError(
|
|
306
|
-
f"Unexpected argument `{param}` is "
|
|
307
|
-
"input into WatsonX model backend."
|
|
308
|
-
)
|
|
309
|
-
|
|
310
295
|
@property
|
|
311
296
|
def stream(self) -> bool:
|
|
312
297
|
r"""Returns whether the model is in stream mode, which sends partial
|
camel/models/yi_model.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import YiConfig
|
|
19
19
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
20
|
from camel.types import ModelType
|
|
21
21
|
from camel.utils import (
|
|
@@ -85,18 +85,3 @@ class YiModel(OpenAICompatibleModel):
|
|
|
85
85
|
max_retries=max_retries,
|
|
86
86
|
**kwargs,
|
|
87
87
|
)
|
|
88
|
-
|
|
89
|
-
def check_model_config(self):
|
|
90
|
-
r"""Check whether the model configuration contains any
|
|
91
|
-
unexpected arguments to Yi API.
|
|
92
|
-
|
|
93
|
-
Raises:
|
|
94
|
-
ValueError: If the model configuration dictionary contains any
|
|
95
|
-
unexpected arguments to Yi API.
|
|
96
|
-
"""
|
|
97
|
-
for param in self.model_config_dict:
|
|
98
|
-
if param not in YI_API_PARAMS:
|
|
99
|
-
raise ValueError(
|
|
100
|
-
f"Unexpected argument `{param}` is "
|
|
101
|
-
"input into Yi model backend."
|
|
102
|
-
)
|
camel/models/zhipuai_model.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
|
-
from camel.configs import
|
|
18
|
+
from camel.configs import ZhipuAIConfig
|
|
19
19
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
20
|
from camel.types import ModelType
|
|
21
21
|
from camel.utils import (
|
|
@@ -85,18 +85,3 @@ class ZhipuAIModel(OpenAICompatibleModel):
|
|
|
85
85
|
max_retries=max_retries,
|
|
86
86
|
**kwargs,
|
|
87
87
|
)
|
|
88
|
-
|
|
89
|
-
def check_model_config(self):
|
|
90
|
-
r"""Check whether the model configuration contains any
|
|
91
|
-
unexpected arguments to OpenAI API.
|
|
92
|
-
|
|
93
|
-
Raises:
|
|
94
|
-
ValueError: If the model configuration dictionary contains any
|
|
95
|
-
unexpected arguments to ZhipuAI API.
|
|
96
|
-
"""
|
|
97
|
-
for param in self.model_config_dict:
|
|
98
|
-
if param not in ZHIPUAI_API_PARAMS:
|
|
99
|
-
raise ValueError(
|
|
100
|
-
f"Unexpected argument `{param}` is "
|
|
101
|
-
"input into ZhipuAI model backend."
|
|
102
|
-
)
|
|
@@ -23,6 +23,7 @@ class BrowserConfig:
|
|
|
23
23
|
headless: bool = True
|
|
24
24
|
user_data_dir: Optional[str] = None
|
|
25
25
|
stealth: bool = False
|
|
26
|
+
console_log_limit: int = 1000
|
|
26
27
|
|
|
27
28
|
# Default settings
|
|
28
29
|
default_start_url: str = "https://google.com/"
|
|
@@ -105,6 +106,8 @@ class ConfigLoader:
|
|
|
105
106
|
browser_kwargs["connect_over_cdp"] = value
|
|
106
107
|
elif key == "cdpUrl":
|
|
107
108
|
browser_kwargs["cdp_url"] = value
|
|
109
|
+
elif key == "consoleLogLimit":
|
|
110
|
+
browser_kwargs["console_log_limit"] = value
|
|
108
111
|
elif key == "cacheDir":
|
|
109
112
|
toolkit_kwargs["cache_dir"] = value
|
|
110
113
|
elif key == "browserLogToFile":
|