camel-ai 0.2.4a0__py3-none-any.whl → 0.2.4a1__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 CHANGED
@@ -12,7 +12,7 @@
12
12
  # limitations under the License.
13
13
  # =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
14
14
 
15
- __version__ = '0.2.4a'
15
+ __version__ = '0.2.4a1'
16
16
 
17
17
  __all__ = [
18
18
  '__version__',
@@ -11,8 +11,6 @@
11
11
  # See the License for the specific language governing permissions and
12
12
  # limitations under the License.
13
13
  # =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
14
- import datetime
15
- import os
16
14
  import re
17
15
  import uuid
18
16
  from typing import (
@@ -31,7 +29,6 @@ from camel.storages import (
31
29
  BaseVectorStorage,
32
30
  MilvusStorage,
33
31
  QdrantStorage,
34
- VectorDBQuery,
35
32
  )
36
33
  from camel.types import StorageType
37
34
  from camel.utils import Constants
@@ -126,62 +123,6 @@ class AutoRetriever:
126
123
 
127
124
  return collection_name
128
125
 
129
- def _get_file_modified_date_from_file(
130
- self, content_input_path: str
131
- ) -> str:
132
- r"""Retrieves the last modified date and time of a given file. This
133
- function takes a file path as input and returns the last modified date
134
- and time of that file.
135
-
136
- Args:
137
- content_input_path (str): The file path of the content whose
138
- modified date is to be retrieved.
139
-
140
- Returns:
141
- str: The last modified time from file.
142
- """
143
- mod_time = os.path.getmtime(content_input_path)
144
- readable_mod_time = datetime.datetime.fromtimestamp(
145
- mod_time
146
- ).isoformat(timespec='seconds')
147
- return readable_mod_time
148
-
149
- def _get_file_modified_date_from_storage(
150
- self, vector_storage_instance: BaseVectorStorage
151
- ) -> str:
152
- r"""Retrieves the last modified date and time of a given file. This
153
- function takes vector storage instance as input and returns the last
154
- modified date from the metadata.
155
-
156
- Args:
157
- vector_storage_instance (BaseVectorStorage): The vector storage
158
- where modified date is to be retrieved from metadata.
159
-
160
- Returns:
161
- str: The last modified date from vector storage.
162
- """
163
-
164
- # Insert any query to get modified date from vector db
165
- # NOTE: Can be optimized when CAMEL vector storage support
166
- # direct chunk payload extraction
167
- query_vector_any = self.embedding_model.embed(obj="any_query")
168
- query_any = VectorDBQuery(query_vector_any, top_k=1)
169
- result_any = vector_storage_instance.query(query_any)
170
-
171
- # Extract the file's last modified date from the metadata
172
- # in the query result
173
- if result_any[0].record.payload is not None:
174
- file_modified_date_from_meta = result_any[0].record.payload[
175
- "metadata"
176
- ]['last_modified']
177
- else:
178
- raise ValueError(
179
- "The vector storage exits but the payload is None,"
180
- "please check the collection"
181
- )
182
-
183
- return file_modified_date_from_meta
184
-
185
126
  def run_vector_retriever(
186
127
  self,
187
128
  query: str,
@@ -246,34 +187,7 @@ class AutoRetriever:
246
187
  collection_name
247
188
  )
248
189
 
249
- # Check the modified time of the input file path, only works
250
- # for local path since no standard way for remote url
251
- file_is_modified = False # initialize with a default value
252
- if (
253
- vector_storage_instance.status().vector_count != 0
254
- and isinstance(content, str)
255
- and os.path.exists(content)
256
- ):
257
- # Get original modified date from file
258
- modified_date_from_file = (
259
- self._get_file_modified_date_from_file(content)
260
- )
261
- # Get modified date from vector storage
262
- modified_date_from_storage = (
263
- self._get_file_modified_date_from_storage(
264
- vector_storage_instance
265
- )
266
- )
267
- # Determine if the file has been modified since the last
268
- # check
269
- file_is_modified = (
270
- modified_date_from_file != modified_date_from_storage
271
- )
272
-
273
- if (
274
- vector_storage_instance.status().vector_count == 0
275
- or file_is_modified
276
- ):
190
+ if vector_storage_instance.status().vector_count == 0:
277
191
  # Clear the vector storage
278
192
  vector_storage_instance.clear()
279
193
  # Process and store the content to the vector storage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: camel-ai
3
- Version: 0.2.4a0
3
+ Version: 0.2.4a1
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.4a https://github.com/camel-ai/camel.git
224
+ git clone -b v0.2.4a1 https://github.com/camel-ai/camel.git
225
225
 
226
226
  # Change directory into project directory
227
227
  cd camel
@@ -1,4 +1,4 @@
1
- camel/__init__.py,sha256=I4MEIgT9cQYnIJCfLDD7vczcL81hEfFuBK41Wz9bJDw,779
1
+ camel/__init__.py,sha256=4Z31wagjSWE2vH1tPJq9xBkFDjV5v9Rg33B_1T_-c_U,780
2
2
  camel/agents/__init__.py,sha256=SSU1wbhZXWwQnE0rRxkpyN57kEu72KklsZNcdLkXfTs,1551
3
3
  camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
4
4
  camel/agents/chat_agent.py,sha256=eA7kuzbfQkEdnvefxk6t_-MhB64ibSgSiQ54ztiqvJI,44764
@@ -104,7 +104,7 @@ camel/prompts/video_description_prompt.py,sha256=HRd3fHXftKwBm5QH7Tvm3FabgZPCoAv
104
104
  camel/responses/__init__.py,sha256=edtTQskOgq5obyITziRFL62HTJP9sAikAtP9vrFacEQ,795
105
105
  camel/responses/agent_responses.py,sha256=sGlGwXz2brWI-FpiU5EhVRpZvcfGWUmooAF0ukqAF3I,1771
106
106
  camel/retrievers/__init__.py,sha256=CuP3B77zl2PoF-W2y9xSkTGRzoK2J4TlUHdCtuJD8dg,1059
107
- camel/retrievers/auto_retriever.py,sha256=WJ1b-xOGu13nSqb1Sz5gs0xVRvVnbp71Lp9lXJ2Yq2Y,13010
107
+ camel/retrievers/auto_retriever.py,sha256=EVbm0aTWcOZ8foZ-GY9-msuDoz0tBM5sOveWypy7A9M,9587
108
108
  camel/retrievers/base.py,sha256=sgqaJDwIkWluEgPBlukFN7RYZJnrp0imCAOEWm6bZ40,2646
109
109
  camel/retrievers/bm25_retriever.py,sha256=Dr7Yfkjw45sovI1EVNByGIMj7KERWrr8JHlh8csSF1s,5155
110
110
  camel/retrievers/cohere_rerank_retriever.py,sha256=HvnFqXpsX9EdBOab0kFLDyxxJnknPFMVxyQJQDlHbOA,4100
@@ -202,7 +202,7 @@ camel/workforce/task_channel.py,sha256=WE3SHp5TKaXDzKnoul9KPfk-PkBMcGT6akVId0RtW
202
202
  camel/workforce/utils.py,sha256=kBrjA_k9BblJBT13kW0eQYcBDjetyjOUHMbRuh_IfPM,2270
203
203
  camel/workforce/worker.py,sha256=oZtl3PhxgpizKy7W_wB94Qm4Z2Tw4k1SQsqAGAi_XoI,3844
204
204
  camel/workforce/workforce.py,sha256=IV911OlzSng_qR8KafFlDvkUEzEFa6A_upTgi8kZKxI,18191
205
- camel_ai-0.2.4a0.dist-info/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
206
- camel_ai-0.2.4a0.dist-info/METADATA,sha256=Zv3sAPnj-Q5zRNMUAMtZPkgNpVaYPfcG2cCWmOlQ2iM,23184
207
- camel_ai-0.2.4a0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
208
- camel_ai-0.2.4a0.dist-info/RECORD,,
205
+ camel_ai-0.2.4a1.dist-info/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
206
+ camel_ai-0.2.4a1.dist-info/METADATA,sha256=5dUdUp3RvqeFVF0B7Hr9ID6IFF3-dO2XAy91uc56qUk,23185
207
+ camel_ai-0.2.4a1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
208
+ camel_ai-0.2.4a1.dist-info/RECORD,,