camel-ai 0.2.69a6__py3-none-any.whl → 0.2.69a7__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/tasks/task.py CHANGED
@@ -25,7 +25,8 @@ from typing import (
25
25
  Union,
26
26
  )
27
27
 
28
- from pydantic import BaseModel, Field
28
+ from PIL import Image
29
+ from pydantic import BaseModel, ConfigDict, Field
29
30
 
30
31
  if TYPE_CHECKING:
31
32
  from camel.agents import ChatAgent
@@ -158,6 +159,14 @@ class Task(BaseModel):
158
159
  (default: :obj:`0`)
159
160
  additional_info (Optional[Dict[str, Any]]): Additional information for
160
161
  the task. (default: :obj:`None`)
162
+ image_list (Optional[List[Image.Image]]): Optional list of PIL Image
163
+ objects associated with the task. (default: :obj:`None`)
164
+ image_detail (Literal["auto", "low", "high"]): Detail level of the
165
+ images associated with the task. (default: :obj:`auto`)
166
+ video_bytes (Optional[bytes]): Optional bytes of a video associated
167
+ with the task. (default: :obj:`None`)
168
+ video_detail (Literal["auto", "low", "high"]): Detail level of the
169
+ videos associated with the task. (default: :obj:`auto`)
161
170
  """
162
171
 
163
172
  content: str
@@ -180,6 +189,16 @@ class Task(BaseModel):
180
189
 
181
190
  additional_info: Optional[Dict[str, Any]] = None
182
191
 
192
+ image_list: Optional[List[Image.Image]] = None
193
+
194
+ image_detail: Literal["auto", "low", "high"] = "auto"
195
+
196
+ video_bytes: Optional[bytes] = None
197
+
198
+ video_detail: Literal["auto", "low", "high"] = "auto"
199
+
200
+ model_config = ConfigDict(arbitrary_types_allowed=True)
201
+
183
202
  def __repr__(self) -> str:
184
203
  r"""Return a string representation of the task."""
185
204
  content_preview = self.content
@@ -363,6 +382,10 @@ class Task(BaseModel):
363
382
  role_name=role_name,
364
383
  content=self.content,
365
384
  additional_info=self.additional_info,
385
+ image_list=self.image_list,
386
+ image_detail=self.image_detail,
387
+ video_bytes=self.video_bytes,
388
+ video_detail=self.video_detail,
366
389
  other_results=sub_tasks_result,
367
390
  )
368
391
  msg = BaseMessage.make_user_message(
@@ -513,7 +536,12 @@ class TaskManager:
513
536
  role_name = agent.role_name
514
537
  content = template.format(role_name=role_name, content=task.content)
515
538
  msg = BaseMessage.make_user_message(
516
- role_name=role_name, content=content
539
+ role_name=role_name,
540
+ content=content,
541
+ image_list=task.image_list,
542
+ image_detail=task.image_detail,
543
+ video_bytes=task.video_bytes,
544
+ video_detail=task.video_detail,
517
545
  )
518
546
  response = agent.step(msg)
519
547
  if task_parser is None:
@@ -79,10 +79,10 @@ from .wolfram_alpha_toolkit import WolframAlphaToolkit
79
79
  from .task_planning_toolkit import TaskPlanningToolkit
80
80
  from .non_visual_browser_toolkit import BrowserNonVisualToolkit
81
81
  from .edgeone_pages_mcp_toolkit import EdgeOnePagesMCPToolkit
82
+ from .google_drive_mcp_toolkit import GoogleDriveMCPToolkit
82
83
  from .craw4ai_toolkit import Crawl4AIToolkit
83
84
  from .markitdown_toolkit import MarkItDownToolkit
84
85
 
85
-
86
86
  __all__ = [
87
87
  'BaseToolkit',
88
88
  'FunctionTool',
@@ -148,6 +148,7 @@ __all__ = [
148
148
  'TaskPlanningToolkit',
149
149
  'BrowserNonVisualToolkit',
150
150
  'EdgeOnePagesMCPToolkit',
151
+ 'GoogleDriveMCPToolkit',
151
152
  'Crawl4AIToolkit',
152
153
  'MarkItDownToolkit',
153
154
  ]