camel-ai 0.2.31__py3-none-any.whl → 0.2.33__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
@@ -14,7 +14,7 @@
14
14
 
15
15
  from camel.logger import disable_logging, enable_logging, set_log_level
16
16
 
17
- __version__ = '0.2.31'
17
+ __version__ = '0.2.33'
18
18
 
19
19
  __all__ = [
20
20
  '__version__',
@@ -446,7 +446,6 @@ class ChatAgent(BaseAgent):
446
446
  self,
447
447
  input_message: Union[BaseMessage, str],
448
448
  response_format: Optional[Type[BaseModel]] = None,
449
- reason_params: Optional[Dict[str, Any]] = None,
450
449
  ) -> ChatAgentResponse:
451
450
  r"""Executes a single step in the chat session, generating a response
452
451
  to the input message.
@@ -459,13 +458,6 @@ class ChatAgent(BaseAgent):
459
458
  model defining the expected structure of the response. Used to
460
459
  generate a structured response if provided. (default:
461
460
  :obj:`None`)
462
- reason_params (Optional[Dict[str, Any]], optional): A dictionary
463
- containing the parameters for the reasoning step.
464
- Argument `choices` is the number of choices/candidates to
465
- consider.
466
- Argument `threshold` is the threshold for the probability of
467
- the choices.
468
- (default: :obj:`None`)
469
461
 
470
462
  Returns:
471
463
  ChatAgentResponse: Contains output messages, a termination status
@@ -478,9 +470,6 @@ class ChatAgent(BaseAgent):
478
470
  role_name="User", content=input_message
479
471
  )
480
472
 
481
- # Inject thinking steps
482
- input_message = self._update_reasoning(input_message, reason_params)
483
-
484
473
  # Add user input to memory
485
474
  self.update_memory(input_message, OpenAIBackendRole.USER)
486
475
 
@@ -522,47 +511,6 @@ class ChatAgent(BaseAgent):
522
511
  response, tool_call_records, num_tokens, external_tool_call_request
523
512
  )
524
513
 
525
- def _update_reasoning(
526
- self,
527
- input_message: BaseMessage,
528
- reason_params: Optional[Dict[str, Any]] = None,
529
- ) -> BaseMessage:
530
- r"""Updates the input message to include reasoning instructions and
531
- adds human interaction capability.
532
-
533
- Args:
534
- input_message (BaseMessage): The message to be updated with
535
- reasoning instructions.
536
- reason_params (Optional[Dict[str, Any]], optional): Parameters for
537
- the reasoning process.
538
-
539
- Returns:
540
- BaseMessage: The updated message with reasoning instructions.
541
- """
542
- if reason_params is None:
543
- return input_message
544
- choices = reason_params.get("choices", 3)
545
- threshold = reason_params.get("threshold", 0.5)
546
-
547
- input_message.content += f"""First, come up with potential {choices}
548
- choices/candidates.
549
- Next, assign a probability/credibility between 0 and 1 to each choice
550
- (make sure they add up to 1).
551
- Finally, if only one choice has a probability/credibility greater than
552
- {threshold}, continue with that choice.
553
- Otherwise, call tool `ask_human_via_console` to ask the user to decide
554
- which one to continue with, give user the probability/credibility of
555
- all choices, and the reason for each choice.
556
- """
557
-
558
- # Add tools to agent
559
- from camel.toolkits.human_toolkit import HumanToolkit
560
-
561
- human_toolkit = HumanToolkit()
562
- self.add_tool(human_toolkit.ask_human_via_console)
563
-
564
- return input_message
565
-
566
514
  @property
567
515
  def chat_history(self) -> List[OpenAIMessage]:
568
516
  openai_messages, _ = self.memory.get_context()
@@ -102,8 +102,12 @@ class _MCPServer(BaseToolkit):
102
102
  sse_client(self.command_or_url)
103
103
  )
104
104
  else:
105
+ command = self.command_or_url
106
+ if os.name == "nt" and command.lower() == "npx":
107
+ command = "npx.cmd"
108
+
105
109
  server_parameters = StdioServerParameters(
106
- command=self.command_or_url, args=self.args, env=self.env
110
+ command=command, args=self.args, env=self.env
107
111
  )
108
112
  (
109
113
  read_stream,
camel/types/enums.py CHANGED
@@ -217,6 +217,14 @@ class ModelType(UnifiedModelType, Enum):
217
217
  def __new__(cls, value) -> "ModelType":
218
218
  return cast("ModelType", UnifiedModelType.__new__(cls, value))
219
219
 
220
+ @classmethod
221
+ def from_name(cls, name):
222
+ r"""Returns the ModelType enum value from a string."""
223
+ for model_type in cls:
224
+ if model_type.value == name:
225
+ return model_type
226
+ raise ValueError(f"Unknown ModelType name: {name}")
227
+
220
228
  @property
221
229
  def value_for_tiktoken(self) -> str:
222
230
  if self.is_openai:
@@ -895,6 +903,14 @@ class ModelPlatformType(Enum):
895
903
  AIML = "aiml"
896
904
  VOLCANO = "volcano"
897
905
 
906
+ @classmethod
907
+ def from_name(cls, name):
908
+ r"""Returns the ModelPlatformType enum value from a string."""
909
+ for model_platfrom_type in cls:
910
+ if model_platfrom_type.value == name:
911
+ return model_platfrom_type
912
+ raise ValueError(f"Unknown ModelPlatformType name: {name}")
913
+
898
914
  @property
899
915
  def is_openai(self) -> bool:
900
916
  r"""Returns whether this platform is openai."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camel-ai
3
- Version: 0.2.31
3
+ Version: 0.2.33
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Project-URL: Homepage, https://www.camel-ai.org/
6
6
  Project-URL: Repository, https://github.com/camel-ai/camel
@@ -11,14 +11,11 @@ License-File: LICENSE
11
11
  Keywords: ai-societies,artificial-intelligence,communicative-ai,cooperative-ai,deep-learning,large-language-models,multi-agent-systems,natural-language-processing
12
12
  Requires-Python: <3.13,>=3.10
13
13
  Requires-Dist: colorama<0.5,>=0.4.6
14
- Requires-Dist: curl-cffi==0.6.2
15
14
  Requires-Dist: docstring-parser<0.16,>=0.15
16
- Requires-Dist: eval-type-backport==0.2.0
17
15
  Requires-Dist: httpx<1.0.0dev,>=0.28.0
18
16
  Requires-Dist: jsonschema<5,>=4
19
17
  Requires-Dist: numpy~=1.26
20
18
  Requires-Dist: openai<2,>=1.59.7
21
- Requires-Dist: protobuf<6,>=5
22
19
  Requires-Dist: psutil<6,>=5.9.8
23
20
  Requires-Dist: pydantic<2.10,>=1.9
24
21
  Requires-Dist: pyyaml<7,>=6.0.2
@@ -1,4 +1,4 @@
1
- camel/__init__.py,sha256=3AYfBXH_CPMAtsuXZIspxxR0qgvvNc2dxiWqXFh_I98,912
1
+ camel/__init__.py,sha256=Q_RC3OPH8ujkn_GqJ7EW_kZRJ9RUjf_TsGpjyRxBvy8,912
2
2
  camel/generators.py,sha256=JRqj9_m1PF4qT6UtybzTQ-KBT9MJQt18OAAYvQ_fr2o,13844
3
3
  camel/human.py,sha256=9X09UmxI2JqQnhrFfnZ3B9EzFmVfdSWQcjLWTIXKXe0,4962
4
4
  camel/logger.py,sha256=rZVeOVYuQ9RYJ5Tqyv0usqy0g4zaVEq4qSfZ9nd2640,5755
@@ -7,7 +7,7 @@ camel/agents/__init__.py,sha256=LcS4m8s97-yADfznvcaAdUe9W0E9h3m6zrSc9H6m9so,1545
7
7
  camel/agents/_types.py,sha256=GGpZ9FGq_SGla_Vz-YcYW7KMQzwE8lfM4Ga0QaGzKxk,1423
8
8
  camel/agents/_utils.py,sha256=0O9YjIin-ZSEux2fQ2NPuB2YIxXsPyd9Ws1Kll6Vxhw,6248
9
9
  camel/agents/base.py,sha256=c4bJYL3G3Z41SaFdMPMn8ZjLdFiFaVOFO6EQIfuCVR8,1124
10
- camel/agents/chat_agent.py,sha256=hd47ZXj0Hh0_5EI1T0pkS_lHt0h5M9iY9Ju3T22Yt_I,48036
10
+ camel/agents/chat_agent.py,sha256=19JMd5Rz06I5m5X36MsXshrmjB5QoJfR8oN9bfgMlWw,45888
11
11
  camel/agents/critic_agent.py,sha256=qFVlHlQo0CVgmPWfWYLT8_oP_KyzCLFsQw_nN_vu5Bs,7487
12
12
  camel/agents/deductive_reasoner_agent.py,sha256=6BZGaq1hR6hKJuQtOfoYQnk_AkZpw_Mr7mUy2MspQgs,13540
13
13
  camel/agents/embodied_agent.py,sha256=XBxBu5ZMmSJ4B2U3Z7SMwvLlgp6yNpaBe8HNQmY9CZA,7536
@@ -280,7 +280,7 @@ camel/toolkits/human_toolkit.py,sha256=9CjB1flGXIx7mzkIliDjcwXATUvZNdrRCKWyEgR9E
280
280
  camel/toolkits/image_analysis_toolkit.py,sha256=dpvT8n49s8B8AhJ8aFdy4OONb8E8r_Cwxpx-ByFruy8,7209
281
281
  camel/toolkits/linkedin_toolkit.py,sha256=5ZSMG01RXjibJ2CtB1vLlQ4B-rv4sqf_2cUZC78WTE8,8041
282
282
  camel/toolkits/math_toolkit.py,sha256=5yVF0bKuwkZIV01uICd3TOfktXlTERjKt4DrFyz_oaE,3639
283
- camel/toolkits/mcp_toolkit.py,sha256=emglu4H4Kg_CGku9_8xKUqUwCzjXCIlgilGT-v7qlPE,17647
283
+ camel/toolkits/mcp_toolkit.py,sha256=j4twcLhZiEQCAEH0N3eQ_RLqDd59ObH93gyZMes3c84,17787
284
284
  camel/toolkits/meshy_toolkit.py,sha256=Fd6sQV2JtduxyvHxCBA0_zl2OCgJRAlvDEe58hX8gRg,6463
285
285
  camel/toolkits/mineru_toolkit.py,sha256=vRX9LholLNkpbJ6axfEN4pTG85aWb0PDmlVy3rAAXhg,6868
286
286
  camel/toolkits/networkx_toolkit.py,sha256=Zdnk5zmM_xzyoQ0qH0YRu8HY1Y0Uojg69sg1VVBvPcQ,8523
@@ -329,7 +329,7 @@ camel/toolkits/open_api_specs/web_scraper/openapi.yaml,sha256=u_WalQ01e8W1D27VnZ
329
329
  camel/toolkits/open_api_specs/web_scraper/paths/__init__.py,sha256=OKCZrQCDwaWtXIN_2rA9FSqEvgpQRieRoHh7Ek6N16A,702
330
330
  camel/toolkits/open_api_specs/web_scraper/paths/scraper.py,sha256=aWy1_ppV4NVVEZfnbN3tu9XA9yAPAC9bRStJ5JuXMRU,1117
331
331
  camel/types/__init__.py,sha256=VLWhAt857IFct3XepY5BNOIhyhDhfmODTezr9jhO_TI,2251
332
- camel/types/enums.py,sha256=zIgu5av92E1PPoDbU0ezvCNmp-aOuOBn4IFWhrG_Ymg,34448
332
+ camel/types/enums.py,sha256=ZZjClKeJB-ggpAmyyus713mks1C6aSxgx9hLwbULQ_8,35045
333
333
  camel/types/openai_types.py,sha256=8ZFzLe-zGmKNPfuVZFzxlxAX98lGf18gtrPhOgMmzus,2104
334
334
  camel/types/unified_model_type.py,sha256=GP5GYtA3RfvLsqnk1c4UcOaRKMFhjDgZrLr0ln6JFw8,4253
335
335
  camel/types/agents/__init__.py,sha256=cbvVkogPoZgcwZrgxLH6EtpGXk0kavF79nOic0Dc1vg,786
@@ -345,7 +345,7 @@ camel/verifiers/__init__.py,sha256=p6UEyvaOlwUQaFACGB4C07fL1xSnpTouElt19YRuneQ,9
345
345
  camel/verifiers/base.py,sha256=efWZV9g58IHzJ24U4zr109y34CaAi8tV9WZPMCzP3YI,12017
346
346
  camel/verifiers/models.py,sha256=hC6m_YxEX-mqi_tkCNZHZWLBWf04ZTyv5vfKR-BEyU4,2818
347
347
  camel/verifiers/python_verifier.py,sha256=bj-UGxeJTZzxVVa3a8IEQ1lNOpSaaW3JdGnUEoPeQD0,7519
348
- camel_ai-0.2.31.dist-info/METADATA,sha256=ikaZBrxTm9AelDQjHjCXFsWwrA_sqwPWcAMUzLYaYRI,38046
349
- camel_ai-0.2.31.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
350
- camel_ai-0.2.31.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
351
- camel_ai-0.2.31.dist-info/RECORD,,
348
+ camel_ai-0.2.33.dist-info/METADATA,sha256=uotZV26ym_vANuecQgdJuw59ohFnOcdToDElDaQ9wpk,37943
349
+ camel_ai-0.2.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
350
+ camel_ai-0.2.33.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
351
+ camel_ai-0.2.33.dist-info/RECORD,,