camel-ai 0.1.6.5__py3-none-any.whl → 0.1.6.7__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 +0 -6
- camel/configs/__init__.py +6 -0
- camel/configs/samba_config.py +50 -0
- camel/configs/togetherai_config.py +107 -0
- camel/models/__init__.py +4 -0
- camel/models/groq_model.py +5 -5
- camel/models/litellm_model.py +1 -1
- camel/models/model_factory.py +9 -0
- camel/models/ollama_model.py +6 -4
- camel/models/openai_compatibility_model.py +19 -3
- camel/models/samba_model.py +291 -0
- camel/models/togetherai_model.py +148 -0
- camel/models/vllm_model.py +7 -5
- camel/models/zhipuai_model.py +2 -2
- camel/retrievers/auto_retriever.py +20 -33
- camel/retrievers/vector_retriever.py +24 -10
- camel/toolkits/__init__.py +3 -0
- camel/toolkits/linkedin_toolkit.py +230 -0
- camel/types/enums.py +35 -13
- camel/utils/__init__.py +2 -0
- camel/utils/commons.py +22 -0
- {camel_ai-0.1.6.5.dist-info → camel_ai-0.1.6.7.dist-info}/METADATA +2 -2
- {camel_ai-0.1.6.5.dist-info → camel_ai-0.1.6.7.dist-info}/RECORD +25 -20
- {camel_ai-0.1.6.5.dist-info → camel_ai-0.1.6.7.dist-info}/WHEEL +0 -0
camel/toolkits/__init__.py
CHANGED
|
@@ -28,6 +28,7 @@ from .twitter_toolkit import TWITTER_FUNCS, TwitterToolkit
|
|
|
28
28
|
from .weather_toolkit import WEATHER_FUNCS, WeatherToolkit
|
|
29
29
|
from .slack_toolkit import SLACK_FUNCS, SlackToolkit
|
|
30
30
|
from .dalle_toolkit import DALLE_FUNCS, DalleToolkit
|
|
31
|
+
from .linkedin_toolkit import LINKEDIN_FUNCS, LinkedInToolkit
|
|
31
32
|
|
|
32
33
|
from .base import BaseToolkit
|
|
33
34
|
from .code_execution import CodeExecutionToolkit
|
|
@@ -47,6 +48,7 @@ __all__ = [
|
|
|
47
48
|
'WEATHER_FUNCS',
|
|
48
49
|
'SLACK_FUNCS',
|
|
49
50
|
'DALLE_FUNCS',
|
|
51
|
+
'LINKEDIN_FUNCS',
|
|
50
52
|
'BaseToolkit',
|
|
51
53
|
'GithubToolkit',
|
|
52
54
|
'MathToolkit',
|
|
@@ -58,5 +60,6 @@ __all__ = [
|
|
|
58
60
|
'WeatherToolkit',
|
|
59
61
|
'RetrievalToolkit',
|
|
60
62
|
'OpenAPIToolkit',
|
|
63
|
+
'LinkedInToolkit',
|
|
61
64
|
'CodeExecutionToolkit',
|
|
62
65
|
]
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the “License”);
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an “AS IS” BASIS,
|
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
# See the License for the specific language governing permissions and
|
|
12
|
+
# limitations under the License.
|
|
13
|
+
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
from http import HTTPStatus
|
|
18
|
+
from typing import List
|
|
19
|
+
|
|
20
|
+
import requests
|
|
21
|
+
|
|
22
|
+
from camel.toolkits import OpenAIFunction
|
|
23
|
+
from camel.toolkits.base import BaseToolkit
|
|
24
|
+
from camel.utils import handle_http_error
|
|
25
|
+
|
|
26
|
+
LINKEDIN_POST_LIMIT = 1300
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class LinkedInToolkit(BaseToolkit):
|
|
30
|
+
r"""A class representing a toolkit for LinkedIn operations.
|
|
31
|
+
|
|
32
|
+
This class provides methods for creating a post, deleting a post, and
|
|
33
|
+
retrieving the authenticated user's profile information.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self):
|
|
37
|
+
self._access_token = self._get_access_token()
|
|
38
|
+
|
|
39
|
+
def create_post(self, text: str) -> dict:
|
|
40
|
+
r"""Creates a post on LinkedIn for the authenticated user.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
text (str): The content of the post to be created.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
dict: A dictionary containing the post ID and the content of
|
|
47
|
+
the post. If the post creation fails, the values will be None.
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
Exception: If the post creation fails due to
|
|
51
|
+
an error response from LinkedIn API.
|
|
52
|
+
"""
|
|
53
|
+
url = 'https://api.linkedin.com/v2/ugcPosts'
|
|
54
|
+
urn = self.get_profile(include_id=True)
|
|
55
|
+
|
|
56
|
+
headers = {
|
|
57
|
+
'X-Restli-Protocol-Version': '2.0.0',
|
|
58
|
+
'Content-Type': 'application/json',
|
|
59
|
+
'Authorization': f'Bearer {self._access_token}',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
post_data = {
|
|
63
|
+
"author": urn['id'],
|
|
64
|
+
"lifecycleState": "PUBLISHED",
|
|
65
|
+
"specificContent": {
|
|
66
|
+
"com.linkedin.ugc.ShareContent": {
|
|
67
|
+
"shareCommentary": {"text": text},
|
|
68
|
+
"shareMediaCategory": "NONE",
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"visibility": {
|
|
72
|
+
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
response = requests.post(
|
|
77
|
+
url, headers=headers, data=json.dumps(post_data)
|
|
78
|
+
)
|
|
79
|
+
if response.status_code == 201:
|
|
80
|
+
post_response = response.json()
|
|
81
|
+
post_id = post_response.get('id', None) # Get the ID of the post
|
|
82
|
+
return {'Post ID': post_id, 'Text': text}
|
|
83
|
+
else:
|
|
84
|
+
raise Exception(
|
|
85
|
+
f"Failed to create post. Status code: {response.status_code}, "
|
|
86
|
+
f"Response: {response.text}"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def delete_post(self, post_id: str) -> str:
|
|
90
|
+
r"""Deletes a LinkedIn post with the specified ID
|
|
91
|
+
for an authorized user.
|
|
92
|
+
|
|
93
|
+
This function sends a DELETE request to the LinkedIn API to delete
|
|
94
|
+
a post with the specified ID. Before sending the request, it
|
|
95
|
+
prompts the user to confirm the deletion.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
post_id (str): The ID of the post to delete.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
str: A message indicating the result of the deletion. If the
|
|
102
|
+
deletion was successful, the message includes the ID of the
|
|
103
|
+
deleted post. If the deletion was not successful, the message
|
|
104
|
+
includes an error message.
|
|
105
|
+
|
|
106
|
+
Reference:
|
|
107
|
+
https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api
|
|
108
|
+
"""
|
|
109
|
+
print(
|
|
110
|
+
"You are going to delete a LinkedIn post "
|
|
111
|
+
f"with the following ID: {post_id}"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
confirm = input(
|
|
115
|
+
"Are you sure you want to delete this post? (yes/no): "
|
|
116
|
+
)
|
|
117
|
+
if confirm.lower() != "yes":
|
|
118
|
+
return "Execution cancelled by the user."
|
|
119
|
+
|
|
120
|
+
headers = {
|
|
121
|
+
"Authorization": f"Bearer {self._access_token}",
|
|
122
|
+
"Content-Type": "application/json",
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
response = requests.delete(
|
|
126
|
+
f"https://api.linkedin.com/v2/ugcPosts/{post_id}",
|
|
127
|
+
headers=headers,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if response.status_code != HTTPStatus.NO_CONTENT:
|
|
131
|
+
error_type = handle_http_error(response)
|
|
132
|
+
return (
|
|
133
|
+
f"Request returned a(n) {error_type!s}: "
|
|
134
|
+
f"{response.status_code!s} {response.text}"
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
return f"Post deleted successfully. Post ID: {post_id}."
|
|
138
|
+
|
|
139
|
+
def get_profile(self, include_id: bool = False) -> dict:
|
|
140
|
+
r"""Retrieves the authenticated user's LinkedIn profile info.
|
|
141
|
+
|
|
142
|
+
This function sends a GET request to the LinkedIn API to retrieve the
|
|
143
|
+
authenticated user's profile information. Optionally, it also returns
|
|
144
|
+
the user's LinkedIn ID.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
include_id (bool): Whether to include the LinkedIn profile ID in
|
|
148
|
+
the response.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
dict: A dictionary containing the user's LinkedIn profile
|
|
152
|
+
information. If `include_id` is True, the dictionary will also
|
|
153
|
+
include the profile ID.
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
Exception: If the profile retrieval fails due to an error response
|
|
157
|
+
from LinkedIn API.
|
|
158
|
+
"""
|
|
159
|
+
headers = {
|
|
160
|
+
"Authorization": f"Bearer {self._access_token}",
|
|
161
|
+
'Connection': 'Keep-Alive',
|
|
162
|
+
'Content-Type': 'application/json',
|
|
163
|
+
"X-Restli-Protocol-Version": "2.0.0",
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
response = requests.get(
|
|
167
|
+
"https://api.linkedin.com/v2/userinfo",
|
|
168
|
+
headers=headers,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
if response.status_code != HTTPStatus.OK:
|
|
172
|
+
raise Exception(
|
|
173
|
+
f"Failed to retrieve profile. "
|
|
174
|
+
f"Status code: {response.status_code}, "
|
|
175
|
+
f"Response: {response.text}"
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
json_response = response.json()
|
|
179
|
+
|
|
180
|
+
locale = json_response.get('locale', {})
|
|
181
|
+
country = locale.get('country', 'N/A')
|
|
182
|
+
language = locale.get('language', 'N/A')
|
|
183
|
+
|
|
184
|
+
profile_report = {
|
|
185
|
+
"Country": country,
|
|
186
|
+
"Language": language,
|
|
187
|
+
"First Name": json_response.get('given_name'),
|
|
188
|
+
"Last Name": json_response.get('family_name'),
|
|
189
|
+
"Email": json_response.get('email'),
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if include_id:
|
|
193
|
+
profile_report['id'] = f"urn:li:person:{json_response['sub']}"
|
|
194
|
+
|
|
195
|
+
return profile_report
|
|
196
|
+
|
|
197
|
+
def get_tools(self) -> List[OpenAIFunction]:
|
|
198
|
+
r"""Returns a list of OpenAIFunction objects representing the
|
|
199
|
+
functions in the toolkit.
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
List[OpenAIFunction]: A list of OpenAIFunction objects
|
|
203
|
+
representing the functions in the toolkit.
|
|
204
|
+
"""
|
|
205
|
+
return [
|
|
206
|
+
OpenAIFunction(self.create_post),
|
|
207
|
+
OpenAIFunction(self.delete_post),
|
|
208
|
+
OpenAIFunction(self.get_profile),
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
def _get_access_token(self) -> str:
|
|
212
|
+
r"""Fetches the access token required for making LinkedIn API requests.
|
|
213
|
+
|
|
214
|
+
Returns:
|
|
215
|
+
str: The OAuth 2.0 access token or warming message if the
|
|
216
|
+
environment variable `LINKEDIN_ACCESS_TOKEN` is not set or is
|
|
217
|
+
empty.
|
|
218
|
+
|
|
219
|
+
Reference:
|
|
220
|
+
You can apply for your personal LinkedIn API access token through
|
|
221
|
+
the link below:
|
|
222
|
+
https://www.linkedin.com/developers/apps
|
|
223
|
+
"""
|
|
224
|
+
token = os.getenv("LINKEDIN_ACCESS_TOKEN")
|
|
225
|
+
if not token:
|
|
226
|
+
return "Access token not found. Please set LINKEDIN_ACCESS_TOKEN."
|
|
227
|
+
return token
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
LINKEDIN_FUNCS: List[OpenAIFunction] = LinkedInToolkit().get_tools()
|
camel/types/enums.py
CHANGED
|
@@ -26,7 +26,6 @@ class RoleType(Enum):
|
|
|
26
26
|
class ModelType(Enum):
|
|
27
27
|
GPT_3_5_TURBO = "gpt-3.5-turbo"
|
|
28
28
|
GPT_4 = "gpt-4"
|
|
29
|
-
GPT_4_32K = "gpt-4-32k"
|
|
30
29
|
GPT_4_TURBO = "gpt-4-turbo"
|
|
31
30
|
GPT_4O = "gpt-4o"
|
|
32
31
|
GPT_4O_MINI = "gpt-4o-mini"
|
|
@@ -82,13 +81,16 @@ class ModelType(Enum):
|
|
|
82
81
|
MISTRAL_MIXTRAL_8x22B = "open-mixtral-8x22b"
|
|
83
82
|
MISTRAL_CODESTRAL_MAMBA = "open-codestral-mamba"
|
|
84
83
|
|
|
84
|
+
# SambaNova Model
|
|
85
|
+
SAMBA_LLAMA_3_1_405B = "llama3-405b"
|
|
86
|
+
SAMBA_LLAMA_3_1_70B = "llama3-70b"
|
|
87
|
+
SAMBA_LLAMA_3_1_8B = "llama3-8b"
|
|
88
|
+
|
|
85
89
|
@property
|
|
86
90
|
def value_for_tiktoken(self) -> str:
|
|
87
|
-
|
|
88
|
-
self.value
|
|
89
|
-
|
|
90
|
-
else "gpt-3.5-turbo"
|
|
91
|
-
)
|
|
91
|
+
if self.is_openai:
|
|
92
|
+
return self.value
|
|
93
|
+
return "gpt-3.5-turbo"
|
|
92
94
|
|
|
93
95
|
@property
|
|
94
96
|
def is_openai(self) -> bool:
|
|
@@ -96,7 +98,6 @@ class ModelType(Enum):
|
|
|
96
98
|
return self in {
|
|
97
99
|
ModelType.GPT_3_5_TURBO,
|
|
98
100
|
ModelType.GPT_4,
|
|
99
|
-
ModelType.GPT_4_32K,
|
|
100
101
|
ModelType.GPT_4_TURBO,
|
|
101
102
|
ModelType.GPT_4O,
|
|
102
103
|
ModelType.GPT_4O_MINI,
|
|
@@ -110,7 +111,6 @@ class ModelType(Enum):
|
|
|
110
111
|
return self in {
|
|
111
112
|
ModelType.GPT_3_5_TURBO,
|
|
112
113
|
ModelType.GPT_4,
|
|
113
|
-
ModelType.GPT_4_32K,
|
|
114
114
|
ModelType.GPT_4_TURBO,
|
|
115
115
|
ModelType.GPT_4O,
|
|
116
116
|
}
|
|
@@ -195,6 +195,14 @@ class ModelType(Enum):
|
|
|
195
195
|
def is_gemini(self) -> bool:
|
|
196
196
|
return self in {ModelType.GEMINI_1_5_FLASH, ModelType.GEMINI_1_5_PRO}
|
|
197
197
|
|
|
198
|
+
@property
|
|
199
|
+
def is_samba(self) -> bool:
|
|
200
|
+
return self in {
|
|
201
|
+
ModelType.SAMBA_LLAMA_3_1_405B,
|
|
202
|
+
ModelType.SAMBA_LLAMA_3_1_70B,
|
|
203
|
+
ModelType.SAMBA_LLAMA_3_1_8B,
|
|
204
|
+
}
|
|
205
|
+
|
|
198
206
|
@property
|
|
199
207
|
def token_limit(self) -> int:
|
|
200
208
|
r"""Returns the maximum token limit for a given model.
|
|
@@ -231,7 +239,6 @@ class ModelType(Enum):
|
|
|
231
239
|
}:
|
|
232
240
|
return 16_384
|
|
233
241
|
elif self in {
|
|
234
|
-
ModelType.GPT_4_32K,
|
|
235
242
|
ModelType.MISTRAL_CODESTRAL,
|
|
236
243
|
ModelType.MISTRAL_7B,
|
|
237
244
|
ModelType.MISTRAL_MIXTRAL_8x7B,
|
|
@@ -255,6 +262,9 @@ class ModelType(Enum):
|
|
|
255
262
|
ModelType.GROQ_LLAMA_3_1_8B,
|
|
256
263
|
ModelType.GROQ_LLAMA_3_1_70B,
|
|
257
264
|
ModelType.GROQ_LLAMA_3_1_405B,
|
|
265
|
+
ModelType.SAMBA_LLAMA_3_1_405B,
|
|
266
|
+
ModelType.SAMBA_LLAMA_3_1_70B,
|
|
267
|
+
ModelType.SAMBA_LLAMA_3_1_8B,
|
|
258
268
|
}:
|
|
259
269
|
return 131_072
|
|
260
270
|
elif self in {
|
|
@@ -440,7 +450,7 @@ class ModelPlatformType(Enum):
|
|
|
440
450
|
AZURE = "azure"
|
|
441
451
|
ANTHROPIC = "anthropic"
|
|
442
452
|
GROQ = "groq"
|
|
443
|
-
|
|
453
|
+
OPEN_SOURCE = "open-source"
|
|
444
454
|
OLLAMA = "ollama"
|
|
445
455
|
LITELLM = "litellm"
|
|
446
456
|
ZHIPU = "zhipuai"
|
|
@@ -448,7 +458,9 @@ class ModelPlatformType(Enum):
|
|
|
448
458
|
GEMINI = "gemini"
|
|
449
459
|
VLLM = "vllm"
|
|
450
460
|
MISTRAL = "mistral"
|
|
451
|
-
|
|
461
|
+
TOGETHER = "together"
|
|
462
|
+
OPENAI_COMPATIBILITY_MODEL = "openai-compatibility-model"
|
|
463
|
+
SAMBA = "samba-nova"
|
|
452
464
|
|
|
453
465
|
@property
|
|
454
466
|
def is_openai(self) -> bool:
|
|
@@ -480,6 +492,11 @@ class ModelPlatformType(Enum):
|
|
|
480
492
|
r"""Returns whether this platform is vllm."""
|
|
481
493
|
return self is ModelPlatformType.VLLM
|
|
482
494
|
|
|
495
|
+
@property
|
|
496
|
+
def is_together(self) -> bool:
|
|
497
|
+
r"""Returns whether this platform is together."""
|
|
498
|
+
return self is ModelPlatformType.TOGETHER
|
|
499
|
+
|
|
483
500
|
@property
|
|
484
501
|
def is_litellm(self) -> bool:
|
|
485
502
|
r"""Returns whether this platform is litellm."""
|
|
@@ -498,19 +515,24 @@ class ModelPlatformType(Enum):
|
|
|
498
515
|
@property
|
|
499
516
|
def is_open_source(self) -> bool:
|
|
500
517
|
r"""Returns whether this platform is opensource."""
|
|
501
|
-
return self is ModelPlatformType.
|
|
518
|
+
return self is ModelPlatformType.OPEN_SOURCE
|
|
502
519
|
|
|
503
520
|
@property
|
|
504
521
|
def is_openai_compatibility_model(self) -> bool:
|
|
505
522
|
r"""Returns whether this is a platform supporting openai
|
|
506
523
|
compatibility"""
|
|
507
|
-
return self is ModelPlatformType.
|
|
524
|
+
return self is ModelPlatformType.OPENAI_COMPATIBILITY_MODEL
|
|
508
525
|
|
|
509
526
|
@property
|
|
510
527
|
def is_gemini(self) -> bool:
|
|
511
528
|
r"""Returns whether this platform is Gemini."""
|
|
512
529
|
return self is ModelPlatformType.GEMINI
|
|
513
530
|
|
|
531
|
+
@property
|
|
532
|
+
def is_samba(self) -> bool:
|
|
533
|
+
r"""Returns whether this platform is Samba Nova."""
|
|
534
|
+
return self is ModelPlatformType.SAMBA
|
|
535
|
+
|
|
514
536
|
|
|
515
537
|
class AudioModelType(Enum):
|
|
516
538
|
TTS_1 = "tts-1"
|
camel/utils/__init__.py
CHANGED
|
@@ -27,6 +27,7 @@ from .commons import (
|
|
|
27
27
|
get_pydantic_object_schema,
|
|
28
28
|
get_system_information,
|
|
29
29
|
get_task_list,
|
|
30
|
+
handle_http_error,
|
|
30
31
|
is_docker_running,
|
|
31
32
|
json_to_function_code,
|
|
32
33
|
print_text_animated,
|
|
@@ -76,4 +77,5 @@ __all__ = [
|
|
|
76
77
|
'agentops_decorator',
|
|
77
78
|
'AgentOpsMeta',
|
|
78
79
|
'track_agent',
|
|
80
|
+
'handle_http_error',
|
|
79
81
|
]
|
camel/utils/commons.py
CHANGED
|
@@ -20,6 +20,7 @@ import subprocess
|
|
|
20
20
|
import time
|
|
21
21
|
import zipfile
|
|
22
22
|
from functools import wraps
|
|
23
|
+
from http import HTTPStatus
|
|
23
24
|
from typing import (
|
|
24
25
|
Any,
|
|
25
26
|
Callable,
|
|
@@ -547,3 +548,24 @@ def track_agent(*args, **kwargs):
|
|
|
547
548
|
return f
|
|
548
549
|
|
|
549
550
|
return noop
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def handle_http_error(response: requests.Response) -> str:
|
|
554
|
+
r"""Handles the HTTP errors based on the status code of the response.
|
|
555
|
+
|
|
556
|
+
Args:
|
|
557
|
+
response (requests.Response): The HTTP response from the API call.
|
|
558
|
+
|
|
559
|
+
Returns:
|
|
560
|
+
str: The error type, based on the status code.
|
|
561
|
+
"""
|
|
562
|
+
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
563
|
+
return "Unauthorized. Check your access token."
|
|
564
|
+
elif response.status_code == HTTPStatus.FORBIDDEN:
|
|
565
|
+
return "Forbidden. You do not have permission to perform this action."
|
|
566
|
+
elif response.status_code == HTTPStatus.NOT_FOUND:
|
|
567
|
+
return "Not Found. The resource could not be located."
|
|
568
|
+
elif response.status_code == HTTPStatus.TOO_MANY_REQUESTS:
|
|
569
|
+
return "Too Many Requests. You have hit the rate limit."
|
|
570
|
+
else:
|
|
571
|
+
return "HTTP Error"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.1.6.
|
|
3
|
+
Version: 0.1.6.7
|
|
4
4
|
Summary: Communicative Agents for AI Society Study
|
|
5
5
|
Home-page: https://www.camel-ai.org/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -202,7 +202,7 @@ conda create --name camel python=3.9
|
|
|
202
202
|
conda activate camel
|
|
203
203
|
|
|
204
204
|
# Clone github repo
|
|
205
|
-
git clone -b v0.1.6.
|
|
205
|
+
git clone -b v0.1.6.7 https://github.com/camel-ai/camel.git
|
|
206
206
|
|
|
207
207
|
# Change directory into project directory
|
|
208
208
|
cd camel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
camel/__init__.py,sha256=
|
|
1
|
+
camel/__init__.py,sha256=Q4tnEGASE1QpXVKzXAssI-QfQl5Jf380YtGKUbvGmUg,780
|
|
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=ZwHOVzZUgmGoOTxlYNMI9xNf53JHb756GC7I11GgwLY,35932
|
|
5
5
|
camel/agents/critic_agent.py,sha256=qF7B0nOP7pdUgGZkmW-ZhCLyIEedsufq3Ae1ObAOH_E,7537
|
|
6
6
|
camel/agents/deductive_reasoner_agent.py,sha256=49vwglWYHgXf-VRftdMN9OFGOwqdsXyTt45PP6z-pbg,13473
|
|
7
7
|
camel/agents/embodied_agent.py,sha256=3ABuiRQXBpplKbuhPY5KNLJyKc6Z8SgXgzIges3ZwVs,7542
|
|
@@ -12,7 +12,7 @@ camel/agents/task_agent.py,sha256=n9xIU3QtcptRPSuHZJ4ntQ_M_a8AvJ6U9ZRV8VaxV5A,14
|
|
|
12
12
|
camel/agents/tool_agents/__init__.py,sha256=ulTNWU2qoFGe3pvVmCq_sdfeSX3NKZ0due66TYvsL-M,862
|
|
13
13
|
camel/agents/tool_agents/base.py,sha256=nQAhfWi8a_bCgzlf5-G-tmj1fKm6AjpRc89NQkWwpnc,1399
|
|
14
14
|
camel/agents/tool_agents/hugging_face_tool_agent.py,sha256=1Z5tG6f_86eL0vmtRZ-BJvoLDFFLhoHt8JtDvgat1xU,8723
|
|
15
|
-
camel/configs/__init__.py,sha256=
|
|
15
|
+
camel/configs/__init__.py,sha256=kzvxo8Qkb-JPVBd3XTxcWcDJXDtxt1xgc9JZd9SLs-I,1990
|
|
16
16
|
camel/configs/anthropic_config.py,sha256=DGQoPyYrayhYQ7aSjkYYGHOZ5VdQ9qahtaS0p_GpU0Q,3294
|
|
17
17
|
camel/configs/base_config.py,sha256=gjsDACMCk-hXDBk7qkeHcpbQrWy6jbp4iyzfqgghJEk,2485
|
|
18
18
|
camel/configs/gemini_config.py,sha256=YHJSNEAIxBxPX1NAj2rWvM4OOR7vmIANH88pZO-aOsY,6880
|
|
@@ -21,6 +21,8 @@ camel/configs/litellm_config.py,sha256=77k7HT-0s9Sq_g4KeDjL_MZId0Tx5TB8oupIyGQHx
|
|
|
21
21
|
camel/configs/mistral_config.py,sha256=G9LuY0-3S6az-8j8kpqB-4asgoaxTOsZVYeZBYJl6LI,3634
|
|
22
22
|
camel/configs/ollama_config.py,sha256=xrT-ulqvANjIu0bVxOzN93uaKUs8e2gW1tmYK1jULEM,4357
|
|
23
23
|
camel/configs/openai_config.py,sha256=yQf7lkBcYTtCNAopow3SlZgcDMlMkiCpC5Dvhh9wb9M,7327
|
|
24
|
+
camel/configs/samba_config.py,sha256=PY9it-wRlEUljvTfu_wI-xhhy-emG_iuXYCtEmU0q_8,2166
|
|
25
|
+
camel/configs/togetherai_config.py,sha256=WERo8W6yb-qy_3qa1GUckt58J5XGKwN5X_nC9baL8Cs,5663
|
|
24
26
|
camel/configs/vllm_config.py,sha256=jfeveBnlkkBHC2RFkffG6ZlTkGzkwrX_WXMwHkg36Jg,5516
|
|
25
27
|
camel/configs/zhipuai_config.py,sha256=zU8Zaj3d9d7SCFEFIkCIRNlnJw9z_oFDmIoCQKrerEM,3600
|
|
26
28
|
camel/embeddings/__init__.py,sha256=KTX6IC9b2ifKde-Yh7srSp_gNopvBwtDy8kEzazn5lE,1106
|
|
@@ -55,24 +57,26 @@ camel/memories/records.py,sha256=kcXOATDTRRo-SCAcDpsV8Ttfie7p1GcXYzuXgXKJB0E,368
|
|
|
55
57
|
camel/messages/__init__.py,sha256=djLvpz6AmjeLzuUSQl7J6T2O4x8MwSdcH0l9fbj_3yg,1468
|
|
56
58
|
camel/messages/base.py,sha256=694Zz19D4u-j8mmpRXwCVJ8cd2Wll6h7acbyNRofNTI,13722
|
|
57
59
|
camel/messages/func_message.py,sha256=CCVkbz-2pdxXV0vBETI0xt7d7uiN8zACpRI7lCnfTFQ,3841
|
|
58
|
-
camel/models/__init__.py,sha256=
|
|
60
|
+
camel/models/__init__.py,sha256=jOtxlVp5gd43X4MIoAHmAmqXiC1rMGRptPvqWdHiLew,1920
|
|
59
61
|
camel/models/anthropic_model.py,sha256=_xhnbrMsuumB2jkuv2pVv3MFYxNE5EL5kVlZbYYBo5E,5751
|
|
60
62
|
camel/models/azure_openai_model.py,sha256=r5diPZp4XmCcZClkCqvTHB8frzRNou559j89dryKLKw,6078
|
|
61
63
|
camel/models/base_model.py,sha256=UHyAgo6GzYZNLTZD1T0C3_WmHUPoh9Qoe_SfvdI7HrU,4387
|
|
62
64
|
camel/models/gemini_model.py,sha256=h_kyD8LSpXCn2dQ4OEer5HwwEUwuTD65yRIRV4LD3Vs,7700
|
|
63
|
-
camel/models/groq_model.py,sha256=
|
|
64
|
-
camel/models/litellm_model.py,sha256=
|
|
65
|
+
camel/models/groq_model.py,sha256=Lm1br_2FBdqNQ3pCgMNf3VnjykYzttUKnHWExEXshLo,4753
|
|
66
|
+
camel/models/litellm_model.py,sha256=5sTOzI07FsxDEW3jSK-XXBx91Yo8z9voahyCsK36U6U,5748
|
|
65
67
|
camel/models/mistral_model.py,sha256=39rHJ-z_6Z-UbtUqZPEAbCdFYY1Ft0Drs42jG5hHaho,9517
|
|
66
|
-
camel/models/model_factory.py,sha256=
|
|
68
|
+
camel/models/model_factory.py,sha256=9dFcvN9rFq4ZNeseo1SjxRf_ZBn4a5T1ZLD6syDZvXs,5848
|
|
67
69
|
camel/models/nemotron_model.py,sha256=2Idf4wrZervxvfu6av42EKjefFtDnBb6cKnWCJUkqI4,2682
|
|
68
|
-
camel/models/ollama_model.py,sha256=
|
|
70
|
+
camel/models/ollama_model.py,sha256=RRav-OXKRP41N9thrd_wFTZg7d7ZqlfhpPqkg_Q2LJw,4994
|
|
69
71
|
camel/models/open_source_model.py,sha256=p5a2sCeZl5SyrgkygClndOrHEjpJxmyhE1CqKE2fZSw,6363
|
|
70
72
|
camel/models/openai_audio_models.py,sha256=_ddOxqzFZCVZaK6h33Z0THU6HXk2XlJTxVWquZ3oOaQ,10042
|
|
71
|
-
camel/models/openai_compatibility_model.py,sha256=
|
|
73
|
+
camel/models/openai_compatibility_model.py,sha256=7h1zSFBgg_mQojFvtSqC54tcZOZY0NFsZ7ZNlns5CWk,4229
|
|
72
74
|
camel/models/openai_model.py,sha256=uOtiLmbdH7sDKqk9oV0i1HEVni_4ApPXCukShZwQDKA,4611
|
|
75
|
+
camel/models/samba_model.py,sha256=vu9459hMOTxGDny7IkJEQhtwOlyAs0_haWCFrjoGG5U,10146
|
|
73
76
|
camel/models/stub_model.py,sha256=DuqaBsS55STSbcLJsk025Uwo_u4ixrSSKqKEoZj2ihY,3680
|
|
74
|
-
camel/models/
|
|
75
|
-
camel/models/
|
|
77
|
+
camel/models/togetherai_model.py,sha256=kUFGxb6cXUgkvMNQ0MsDKW27Udw622zt2QIVa3U7iLU,5461
|
|
78
|
+
camel/models/vllm_model.py,sha256=D_o9OYgQi9KCPJn5r-4qTj-IJuQLBHaSv49j0QPcuGs,5129
|
|
79
|
+
camel/models/zhipuai_model.py,sha256=JqJDEMk6vWH-ZnKkMwdG4yDvJWf1xk4PBsp2ifSFGR0,4939
|
|
76
80
|
camel/prompts/__init__.py,sha256=O5bkcuwj2kXTkz5yDPiiMI8KN04vI8bCKG7mGE1SIdI,2326
|
|
77
81
|
camel/prompts/ai_society.py,sha256=ApgvIED1Z_mdsWDNc2_u35Ktp7pEKksMrOIQKo_q5cI,6306
|
|
78
82
|
camel/prompts/base.py,sha256=VMde6w97zHPP03OA628wGwXhtJweoccOK1B1f3aESDo,8464
|
|
@@ -92,11 +96,11 @@ camel/prompts/video_description_prompt.py,sha256=HRd3fHXftKwBm5QH7Tvm3FabgZPCoAv
|
|
|
92
96
|
camel/responses/__init__.py,sha256=edtTQskOgq5obyITziRFL62HTJP9sAikAtP9vrFacEQ,795
|
|
93
97
|
camel/responses/agent_responses.py,sha256=sGlGwXz2brWI-FpiU5EhVRpZvcfGWUmooAF0ukqAF3I,1771
|
|
94
98
|
camel/retrievers/__init__.py,sha256=CuP3B77zl2PoF-W2y9xSkTGRzoK2J4TlUHdCtuJD8dg,1059
|
|
95
|
-
camel/retrievers/auto_retriever.py,sha256=
|
|
99
|
+
camel/retrievers/auto_retriever.py,sha256=6qaFIb11psVtZMJClUXLvV1kIyiD-xdfVgGt_W1TxOY,12397
|
|
96
100
|
camel/retrievers/base.py,sha256=sgqaJDwIkWluEgPBlukFN7RYZJnrp0imCAOEWm6bZ40,2646
|
|
97
101
|
camel/retrievers/bm25_retriever.py,sha256=Dr7Yfkjw45sovI1EVNByGIMj7KERWrr8JHlh8csSF1s,5155
|
|
98
102
|
camel/retrievers/cohere_rerank_retriever.py,sha256=HvnFqXpsX9EdBOab0kFLDyxxJnknPFMVxyQJQDlHbOA,4100
|
|
99
|
-
camel/retrievers/vector_retriever.py,sha256=
|
|
103
|
+
camel/retrievers/vector_retriever.py,sha256=iNYS3A8UxjP6Q7HYqQ05P7sI_2Rmwy-BxsHJR7oYmwY,8019
|
|
100
104
|
camel/societies/__init__.py,sha256=JhGwUHjht4CewzC3shKuxmgB3oS7FIxIxmiKyhNsfIs,832
|
|
101
105
|
camel/societies/babyagi_playing.py,sha256=bDeHFPQ1Zocnb8HSu56xZMlC6-AZACZWqGM5l9KB-EA,11866
|
|
102
106
|
camel/societies/role_playing.py,sha256=VZRethoZxYtm-phEao79ksSyQqo2HHm8taNY-BjFDVE,22262
|
|
@@ -126,12 +130,13 @@ camel/terminators/__init__.py,sha256=pE7fcfDUNngdbm1BhzSQPRMXNbdd28rl9YbF4gKWwXE
|
|
|
126
130
|
camel/terminators/base.py,sha256=TSkl3maNEsdjyAniJaSgFfD4UF8RQ1LwNIiGw0dN8Gg,1396
|
|
127
131
|
camel/terminators/response_terminator.py,sha256=zcXuigbvlclUoBv4xcVbfU36ZohUT1RhI-rSnukloUY,4951
|
|
128
132
|
camel/terminators/token_limit_terminator.py,sha256=mK30wVUnoqNAvIo-wxkqY5gUSNay2M04rsAktKqoiOI,2087
|
|
129
|
-
camel/toolkits/__init__.py,sha256=
|
|
133
|
+
camel/toolkits/__init__.py,sha256=g1QuDKhGrT7gUBneBTkLENqfYV9bAomRIcAqaRCQSb8,2229
|
|
130
134
|
camel/toolkits/base.py,sha256=ez04Ei8jwIAws023bM19EGkOPUkQMouULqBvOKfM4kM,986
|
|
131
135
|
camel/toolkits/code_execution.py,sha256=fWBhn1_3adiv7YYuA0gJzEBlc_dYNS6_hVtDbgB-zX0,2425
|
|
132
136
|
camel/toolkits/dalle_toolkit.py,sha256=IalDFfNCz58LMRdCZNSJfLMiauHGBGN9XNRV7pzuf28,5261
|
|
133
137
|
camel/toolkits/github_toolkit.py,sha256=ZauRY-kW8nx_L6igVEF62hD16j3KhqU2r49t1j6hO78,10979
|
|
134
138
|
camel/toolkits/google_maps_toolkit.py,sha256=uylzlmsbjbcMwjVDPVLTLiZrUKSmGxpfukSqaJ8bM94,14343
|
|
139
|
+
camel/toolkits/linkedin_toolkit.py,sha256=gdqj-6XnVUH-YpkZMS042t-FQ4yB1KRj3syCwjfLrnw,8004
|
|
135
140
|
camel/toolkits/math_toolkit.py,sha256=r-85DHvihR87DU6n_W75pecV1P9xV3Hylfp6u-ue7T4,2521
|
|
136
141
|
camel/toolkits/open_api_specs/biztoc/__init__.py,sha256=f3LXNDzN2XWWoF2D0nesG8VuEA6Zd14i2aiTDbCm5bA,708
|
|
137
142
|
camel/toolkits/open_api_specs/biztoc/ai-plugin.json,sha256=IJinQbLv5MFPGFwdN7PbOhwArFVExSEZdJspe-mOBIo,866
|
|
@@ -166,11 +171,11 @@ camel/toolkits/slack_toolkit.py,sha256=JdgDJe7iExTmG7dDXOG6v5KpVjZ6_My_d_WFTYSxk
|
|
|
166
171
|
camel/toolkits/twitter_toolkit.py,sha256=oQw8wRkU7iDxaocsmWvio4pU75pmq6FJAorPdQ2xEAE,19810
|
|
167
172
|
camel/toolkits/weather_toolkit.py,sha256=n4YrUI_jTIH7oqH918IdHbXLgfQ2BPGIWWK8Jp8G1Uw,7054
|
|
168
173
|
camel/types/__init__.py,sha256=ArKXATj3z_Vv4ISmROVeo6Mv3tj5kE1dTkqfgwyxVY4,1975
|
|
169
|
-
camel/types/enums.py,sha256=
|
|
174
|
+
camel/types/enums.py,sha256=2n2fGnhMywvDzSgKTg82hfLqLB6rVyvPHB8qp5dntXs,16959
|
|
170
175
|
camel/types/openai_types.py,sha256=BNQ6iCzKTjSvgcXFsAFIgrUS_YUFZBU6bDoyAp387hI,2045
|
|
171
|
-
camel/utils/__init__.py,sha256=
|
|
176
|
+
camel/utils/__init__.py,sha256=IdI9v0FetNR-nx-Hg4bmNHoYto6Xfcs_uaomksdewmo,2303
|
|
172
177
|
camel/utils/async_func.py,sha256=SLo8KPkrNKdsONvFf3KBb33EgFn4gH2EKSX1aI_LKes,1578
|
|
173
|
-
camel/utils/commons.py,sha256=
|
|
178
|
+
camel/utils/commons.py,sha256=cTg5yQEdVnqqf0oYa-EUp7Qv0RIBcPD6kSNNJ52UmPw,16451
|
|
174
179
|
camel/utils/constants.py,sha256=BdB5qgphZWsgKZf__gsQal6KiQSapvICGWKwiZlzBvM,1205
|
|
175
180
|
camel/utils/token_counting.py,sha256=G7vBzrxSXm4DzHMOfMXaOYjYf8WJTpxjHjlzmngHlYQ,21004
|
|
176
181
|
camel/workforce/__init__.py,sha256=6jwJWDlESEqcnWCm61WCyjzFUF6KLzXA_fGI86rHfiE,878
|
|
@@ -183,6 +188,6 @@ camel/workforce/utils.py,sha256=Z-kODz5PMPtfeKKVqpcQq-b-B8oqC7XSwi_F3__Ijhs,3526
|
|
|
183
188
|
camel/workforce/worker_node.py,sha256=wsRqk2rugCvvkcmCzvn-y-gQuyuJGAG8PIr1KtgqJFw,3878
|
|
184
189
|
camel/workforce/workforce.py,sha256=SVJJgSSkYvk05RgL9oaJzHwzziH7u51KLINRuzLB8BI,1773
|
|
185
190
|
camel/workforce/workforce_prompt.py,sha256=cAWYEIA0rau5itEekSoUIFttBzpKM9RzB6x-mfukGSU,4665
|
|
186
|
-
camel_ai-0.1.6.
|
|
187
|
-
camel_ai-0.1.6.
|
|
188
|
-
camel_ai-0.1.6.
|
|
191
|
+
camel_ai-0.1.6.7.dist-info/METADATA,sha256=H1Uxbjm4ZMsF0KbA_3FxALIwiA8gFHNSYKCCJh7UAFw,24282
|
|
192
|
+
camel_ai-0.1.6.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
193
|
+
camel_ai-0.1.6.7.dist-info/RECORD,,
|
|
File without changes
|