camel-ai 0.2.5__py3-none-any.whl → 0.2.6__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/agents/chat_agent.py +7 -1
- camel/configs/__init__.py +0 -4
- camel/configs/samba_config.py +1 -38
- camel/models/samba_model.py +1 -1
- {camel_ai-0.2.5.dist-info → camel_ai-0.2.6.dist-info}/METADATA +2 -2
- {camel_ai-0.2.5.dist-info → camel_ai-0.2.6.dist-info}/RECORD +9 -9
- {camel_ai-0.2.5.dist-info → camel_ai-0.2.6.dist-info}/LICENSE +0 -0
- {camel_ai-0.2.5.dist-info → camel_ai-0.2.6.dist-info}/WHEEL +0 -0
camel/__init__.py
CHANGED
camel/agents/chat_agent.py
CHANGED
|
@@ -217,6 +217,8 @@ class ChatAgent(BaseAgent):
|
|
|
217
217
|
self.response_terminators = response_terminators or []
|
|
218
218
|
self.init_messages()
|
|
219
219
|
|
|
220
|
+
self.tool_prompt_added = False
|
|
221
|
+
|
|
220
222
|
# ruff: noqa: E501
|
|
221
223
|
def _generate_tool_prompt(self, tool_schema_list: List[Dict]) -> str:
|
|
222
224
|
tool_prompts = []
|
|
@@ -448,7 +450,10 @@ class ChatAgent(BaseAgent):
|
|
|
448
450
|
)
|
|
449
451
|
|
|
450
452
|
if "llama" in self.model_type.lower():
|
|
451
|
-
if
|
|
453
|
+
if (
|
|
454
|
+
self.model_backend.model_config_dict.get("tools", None)
|
|
455
|
+
and not self.tool_prompt_added
|
|
456
|
+
):
|
|
452
457
|
tool_prompt = self._generate_tool_prompt(self.tool_schema_list)
|
|
453
458
|
|
|
454
459
|
tool_sys_msg = BaseMessage.make_assistant_message(
|
|
@@ -457,6 +462,7 @@ class ChatAgent(BaseAgent):
|
|
|
457
462
|
)
|
|
458
463
|
|
|
459
464
|
self.update_memory(tool_sys_msg, OpenAIBackendRole.SYSTEM)
|
|
465
|
+
self.tool_prompt_added = True
|
|
460
466
|
|
|
461
467
|
self.update_memory(input_message, OpenAIBackendRole.USER)
|
|
462
468
|
|
camel/configs/__init__.py
CHANGED
|
@@ -22,10 +22,8 @@ from .openai_config import OPENAI_API_PARAMS, ChatGPTConfig
|
|
|
22
22
|
from .reka_config import REKA_API_PARAMS, RekaConfig
|
|
23
23
|
from .samba_config import (
|
|
24
24
|
SAMBA_CLOUD_API_PARAMS,
|
|
25
|
-
SAMBA_FAST_API_PARAMS,
|
|
26
25
|
SAMBA_VERSE_API_PARAMS,
|
|
27
26
|
SambaCloudAPIConfig,
|
|
28
|
-
SambaFastAPIConfig,
|
|
29
27
|
SambaVerseAPIConfig,
|
|
30
28
|
)
|
|
31
29
|
from .togetherai_config import TOGETHERAI_API_PARAMS, TogetherAIConfig
|
|
@@ -54,8 +52,6 @@ __all__ = [
|
|
|
54
52
|
'MISTRAL_API_PARAMS',
|
|
55
53
|
'RekaConfig',
|
|
56
54
|
'REKA_API_PARAMS',
|
|
57
|
-
'SambaFastAPIConfig',
|
|
58
|
-
'SAMBA_FAST_API_PARAMS',
|
|
59
55
|
'SambaVerseAPIConfig',
|
|
60
56
|
'SAMBA_VERSE_API_PARAMS',
|
|
61
57
|
'SambaCloudAPIConfig',
|
camel/configs/samba_config.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
|
-
from typing import Any,
|
|
16
|
+
from typing import Any, Optional, Sequence, Union
|
|
17
17
|
|
|
18
18
|
from pydantic import Field
|
|
19
19
|
|
|
@@ -21,43 +21,6 @@ from camel.configs.base_config import BaseConfig
|
|
|
21
21
|
from camel.types import NOT_GIVEN, NotGiven
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class SambaFastAPIConfig(BaseConfig):
|
|
25
|
-
r"""Defines the parameters for generating chat completions using the
|
|
26
|
-
SambaNova Fast API.
|
|
27
|
-
|
|
28
|
-
Args:
|
|
29
|
-
max_tokens (Optional[int], optional): the maximum number of tokens to
|
|
30
|
-
generate, e.g. 100.
|
|
31
|
-
(default: :obj:`2048`)
|
|
32
|
-
stop (Optional[Union[str,list[str]]]): Stop generation if this token
|
|
33
|
-
is detected. Or if one of these tokens is detected when providing
|
|
34
|
-
a string list.
|
|
35
|
-
(default: :obj:`None`)
|
|
36
|
-
stream (Optional[bool]): If True, partial message deltas will be sent
|
|
37
|
-
as data-only server-sent events as they become available.
|
|
38
|
-
Currently SambaNova Fast API only support stream mode.
|
|
39
|
-
(default: :obj:`True`)
|
|
40
|
-
stream_options (Optional[Dict]): Additional options for streaming.
|
|
41
|
-
(default: :obj:`{"include_usage": True}`)
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
max_tokens: Optional[int] = 2048
|
|
45
|
-
stop: Optional[Union[str, list[str]]] = None
|
|
46
|
-
stream: Optional[bool] = True
|
|
47
|
-
stream_options: Optional[Dict] = {"include_usage": True} # noqa: RUF012
|
|
48
|
-
|
|
49
|
-
def as_dict(self) -> dict[str, Any]:
|
|
50
|
-
config_dict = super().as_dict()
|
|
51
|
-
if "tools" in config_dict:
|
|
52
|
-
del config_dict["tools"] # SambaNova does not support tool calling
|
|
53
|
-
return config_dict
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
SAMBA_FAST_API_PARAMS = {
|
|
57
|
-
param for param in SambaFastAPIConfig().model_fields.keys()
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
24
|
class SambaVerseAPIConfig(BaseConfig):
|
|
62
25
|
r"""Defines the parameters for generating chat completions using the
|
|
63
26
|
SambaVerse API.
|
camel/models/samba_model.py
CHANGED
|
@@ -147,7 +147,7 @@ class SambaModel(BaseModelBackend):
|
|
|
147
147
|
def run( # type: ignore[misc]
|
|
148
148
|
self, messages: List[OpenAIMessage]
|
|
149
149
|
) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
150
|
-
r"""Runs SambaNova's
|
|
150
|
+
r"""Runs SambaNova's service.
|
|
151
151
|
|
|
152
152
|
Args:
|
|
153
153
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Communicative Agents for AI Society Study
|
|
5
5
|
Home-page: https://www.camel-ai.org/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -221,7 +221,7 @@ conda create --name camel python=3.10
|
|
|
221
221
|
conda activate camel
|
|
222
222
|
|
|
223
223
|
# Clone github repo
|
|
224
|
-
git clone -b v0.2.
|
|
224
|
+
git clone -b v0.2.6 https://github.com/camel-ai/camel.git
|
|
225
225
|
|
|
226
226
|
# Change directory into project directory
|
|
227
227
|
cd camel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
camel/__init__.py,sha256=
|
|
1
|
+
camel/__init__.py,sha256=kQJbo-CyZTi3aBL5-8hXGherAGh6ZlE1O_BxJfCayco,778
|
|
2
2
|
camel/agents/__init__.py,sha256=SSU1wbhZXWwQnE0rRxkpyN57kEu72KklsZNcdLkXfTs,1551
|
|
3
3
|
camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
|
|
4
|
-
camel/agents/chat_agent.py,sha256
|
|
4
|
+
camel/agents/chat_agent.py,sha256=-Ug-nS40SmhVyzQuNU6xkzwd4s5cc2BAR6a8a5VPMkM,44929
|
|
5
5
|
camel/agents/critic_agent.py,sha256=To-istnO-9Eb0iabdeIDrgfvkxYYfsdX9xIZiSrc3oM,7493
|
|
6
6
|
camel/agents/deductive_reasoner_agent.py,sha256=49vwglWYHgXf-VRftdMN9OFGOwqdsXyTt45PP6z-pbg,13473
|
|
7
7
|
camel/agents/embodied_agent.py,sha256=3ABuiRQXBpplKbuhPY5KNLJyKc6Z8SgXgzIges3ZwVs,7542
|
|
@@ -18,7 +18,7 @@ camel/bots/slack/__init__.py,sha256=6DvvD5-9phNWdF8fDEYWU6ZaQo6fuOkRbFp2Y-jzKpw,
|
|
|
18
18
|
camel/bots/slack/models.py,sha256=cb3rD6vWPMTremG5wiqylJL1-I6AghrdlmaihE-xFok,5149
|
|
19
19
|
camel/bots/slack/slack_app.py,sha256=umTiWpMYv65i6rV3MR2jjdwswUfWLzX1C2s1--NCRtI,9950
|
|
20
20
|
camel/bots/telegram_bot.py,sha256=MM91afWKUtEZLOoybFY7LGisQJFypc_p_P8kQOUlXwg,2747
|
|
21
|
-
camel/configs/__init__.py,sha256=
|
|
21
|
+
camel/configs/__init__.py,sha256=uAuaQHWfy499kd2ESY_wA5FPxtXjUq2mmVXf3lwIW0k,2193
|
|
22
22
|
camel/configs/anthropic_config.py,sha256=ie4un-NMWARs_ALaq-0LTqcZOkft5bAS4Ybv_mfigjQ,3284
|
|
23
23
|
camel/configs/base_config.py,sha256=JBrIAGoPHjTJwsWTuyfdtMFa0TpVRsddNpSr8KgggcQ,2473
|
|
24
24
|
camel/configs/gemini_config.py,sha256=qhGdWMRP87E99ApQdRrf9UyFpp2R0k6Y2n9ZV27qpzs,6879
|
|
@@ -28,7 +28,7 @@ camel/configs/mistral_config.py,sha256=G9LuY0-3S6az-8j8kpqB-4asgoaxTOsZVYeZBYJl6
|
|
|
28
28
|
camel/configs/ollama_config.py,sha256=4Qw5V89wljCj7ie3zI6wXL7XqdCFmRH2TzVM6uqSV1k,4354
|
|
29
29
|
camel/configs/openai_config.py,sha256=Q-V3GmU08wiXxEIqsaPSWLN1GonRVXUFt-VWUAhD0KU,6477
|
|
30
30
|
camel/configs/reka_config.py,sha256=ECYg3BT7onwZX-iKLq-5TBhCFdm70rV-9hZ_G6Ye8-k,3504
|
|
31
|
-
camel/configs/samba_config.py,sha256=
|
|
31
|
+
camel/configs/samba_config.py,sha256=JhCWdJZpaOFr3N6MK3ocqM37T4d39GgyYnWG7chO3Gg,8831
|
|
32
32
|
camel/configs/togetherai_config.py,sha256=-yUZWvD138PX2uvTzAv1WaFBwz5ViFeGl-S0xn7en-0,5661
|
|
33
33
|
camel/configs/vllm_config.py,sha256=zz0NlIE3Xd_2YT5iJk2OwnFvvTIVz5vMb79QUnhDf6o,5514
|
|
34
34
|
camel/configs/zhipuai_config.py,sha256=VW1s4cgT375ALk-W4SRvnJmGCNsZEtDpDb8MSi5tkqs,3595
|
|
@@ -80,7 +80,7 @@ camel/models/openai_audio_models.py,sha256=_ddOxqzFZCVZaK6h33Z0THU6HXk2XlJTxVWqu
|
|
|
80
80
|
camel/models/openai_compatible_model.py,sha256=ToABSdpKaqmLsQeGlGUCwZoT2UvLIyVEYfMzxOumumY,4064
|
|
81
81
|
camel/models/openai_model.py,sha256=3RC-8GsI0dTY3zu9JZQCdgNTQq5UFPrVCUYfxTcYeug,6089
|
|
82
82
|
camel/models/reka_model.py,sha256=KZYNQFN2Wey0qe7i25yo7YIW5ciTH03fnxXZk-UaYWk,8283
|
|
83
|
-
camel/models/samba_model.py,sha256=
|
|
83
|
+
camel/models/samba_model.py,sha256=9smEGflYNpM9wIcfW3GYpGlqhAhiCYc2m22HAEF0gkM,14392
|
|
84
84
|
camel/models/stub_model.py,sha256=ewwO7AMQ3BbbO7Yk8wkVVXWy27yv9aNgxu4QU_e-ZWE,3709
|
|
85
85
|
camel/models/togetherai_model.py,sha256=gEf8r2d5z4hPqvW8TKiyMOja9iWrNTwdSk9ljiYzFsQ,5251
|
|
86
86
|
camel/models/vllm_model.py,sha256=eUUZOeyuBIrGKhbJg0slpwPCGHcr30EJWhL8kF3Zu3w,5655
|
|
@@ -202,7 +202,7 @@ camel/utils/async_func.py,sha256=_N3HIrQ9QagXjHzgTd_OKHDlmi059yPw2_lf8Pb6NHQ,156
|
|
|
202
202
|
camel/utils/commons.py,sha256=Bj_QzhNddDRqKqgLBOBL9lMl0jvmbaE-YU3a72IzSjs,17533
|
|
203
203
|
camel/utils/constants.py,sha256=8n4F8Y-DZy4z2F0hRvAq6f-d9SbS59kK5FyLrnJ3mkY,1360
|
|
204
204
|
camel/utils/token_counting.py,sha256=6mc5PmyN5sOP02u02r7Jjxki75hjk9z1KPaIx_0wFmY,14624
|
|
205
|
-
camel_ai-0.2.
|
|
206
|
-
camel_ai-0.2.
|
|
207
|
-
camel_ai-0.2.
|
|
208
|
-
camel_ai-0.2.
|
|
205
|
+
camel_ai-0.2.6.dist-info/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
|
|
206
|
+
camel_ai-0.2.6.dist-info/METADATA,sha256=v5s7R1MITxOaDYtxjIdjmcElIUj0VQ1CxXwiNqatYMw,23181
|
|
207
|
+
camel_ai-0.2.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
208
|
+
camel_ai-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|