camel-ai 0.2.66__py3-none-any.whl → 0.2.68__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.

Files changed (68) hide show
  1. camel/__init__.py +1 -1
  2. camel/configs/__init__.py +3 -0
  3. camel/configs/qianfan_config.py +85 -0
  4. camel/environments/__init__.py +12 -0
  5. camel/environments/rlcards_env.py +860 -0
  6. camel/interpreters/docker/Dockerfile +2 -5
  7. camel/loaders/firecrawl_reader.py +4 -4
  8. camel/memories/blocks/vectordb_block.py +8 -1
  9. camel/memories/context_creators/score_based.py +123 -19
  10. camel/models/__init__.py +2 -0
  11. camel/models/aiml_model.py +8 -0
  12. camel/models/anthropic_model.py +122 -2
  13. camel/models/aws_bedrock_model.py +8 -0
  14. camel/models/azure_openai_model.py +14 -5
  15. camel/models/base_model.py +4 -0
  16. camel/models/cohere_model.py +9 -2
  17. camel/models/crynux_model.py +8 -0
  18. camel/models/deepseek_model.py +8 -0
  19. camel/models/gemini_model.py +8 -0
  20. camel/models/groq_model.py +8 -0
  21. camel/models/internlm_model.py +8 -0
  22. camel/models/litellm_model.py +5 -0
  23. camel/models/lmstudio_model.py +14 -1
  24. camel/models/mistral_model.py +15 -1
  25. camel/models/model_factory.py +6 -0
  26. camel/models/modelscope_model.py +8 -0
  27. camel/models/moonshot_model.py +8 -0
  28. camel/models/nemotron_model.py +17 -2
  29. camel/models/netmind_model.py +8 -0
  30. camel/models/novita_model.py +8 -0
  31. camel/models/nvidia_model.py +8 -0
  32. camel/models/ollama_model.py +8 -0
  33. camel/models/openai_compatible_model.py +23 -5
  34. camel/models/openai_model.py +21 -4
  35. camel/models/openrouter_model.py +8 -0
  36. camel/models/ppio_model.py +8 -0
  37. camel/models/qianfan_model.py +104 -0
  38. camel/models/qwen_model.py +8 -0
  39. camel/models/reka_model.py +18 -3
  40. camel/models/samba_model.py +17 -3
  41. camel/models/sglang_model.py +20 -5
  42. camel/models/siliconflow_model.py +8 -0
  43. camel/models/stub_model.py +8 -1
  44. camel/models/togetherai_model.py +8 -0
  45. camel/models/vllm_model.py +7 -0
  46. camel/models/volcano_model.py +14 -1
  47. camel/models/watsonx_model.py +4 -1
  48. camel/models/yi_model.py +8 -0
  49. camel/models/zhipuai_model.py +8 -0
  50. camel/societies/workforce/prompts.py +71 -22
  51. camel/societies/workforce/role_playing_worker.py +3 -8
  52. camel/societies/workforce/single_agent_worker.py +37 -9
  53. camel/societies/workforce/task_channel.py +25 -20
  54. camel/societies/workforce/utils.py +104 -14
  55. camel/societies/workforce/worker.py +98 -16
  56. camel/societies/workforce/workforce.py +1289 -101
  57. camel/societies/workforce/workforce_logger.py +613 -0
  58. camel/tasks/task.py +16 -5
  59. camel/toolkits/__init__.py +2 -0
  60. camel/toolkits/code_execution.py +1 -1
  61. camel/toolkits/playwright_mcp_toolkit.py +2 -1
  62. camel/toolkits/pptx_toolkit.py +4 -4
  63. camel/types/enums.py +32 -0
  64. camel/types/unified_model_type.py +5 -0
  65. {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/METADATA +4 -3
  66. {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/RECORD +68 -64
  67. {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/WHEEL +0 -0
  68. {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/licenses/LICENSE +0 -0
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.66'
17
+ __version__ = '0.2.68'
18
18
 
19
19
  __all__ = [
20
20
  '__version__',
camel/configs/__init__.py CHANGED
@@ -33,6 +33,7 @@ from .ollama_config import OLLAMA_API_PARAMS, OllamaConfig
33
33
  from .openai_config import OPENAI_API_PARAMS, ChatGPTConfig
34
34
  from .openrouter_config import OPENROUTER_API_PARAMS, OpenRouterConfig
35
35
  from .ppio_config import PPIO_API_PARAMS, PPIOConfig
36
+ from .qianfan_config import QIANFAN_API_PARAMS, QianfanConfig
36
37
  from .qwen_config import QWEN_API_PARAMS, QwenConfig
37
38
  from .reka_config import REKA_API_PARAMS, RekaConfig
38
39
  from .samba_config import (
@@ -113,6 +114,8 @@ __all__ = [
113
114
  'LMStudioConfig',
114
115
  'WatsonXConfig',
115
116
  'WATSONX_API_PARAMS',
117
+ 'QianfanConfig',
118
+ 'QIANFAN_API_PARAMS',
116
119
  'CrynuxConfig',
117
120
  'CRYNUX_API_PARAMS',
118
121
  ]
@@ -0,0 +1,85 @@
1
+ # ========= Copyright 2023-2024 @ 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-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
+ from __future__ import annotations
15
+
16
+ from typing import Dict, List, Optional, Union
17
+
18
+ from pydantic import Field
19
+
20
+ from camel.configs.base_config import BaseConfig
21
+ from camel.types import NotGiven
22
+
23
+
24
+ class QianfanConfig(BaseConfig):
25
+ r"""Defines the parameters for generating chat completions using OpenAI
26
+ compatibility.
27
+
28
+ Reference: https://cloud.baidu.com/doc/qianfan-api/s/3m7of64lb
29
+
30
+ Args:
31
+ presence_penalty (float, optional): Number between :obj:`-2.0` and
32
+ :obj:`2.0`. Positive values penalize new tokens based on whether
33
+ they appear in the text so far, increasing the model's likelihood
34
+ to talk about new topics. See more information about frequency and
35
+ presence penalties. (default: :obj:`None`)
36
+ frequency_penalty (float, optional): Number between :obj:`-2.0` and
37
+ :obj:`2.0`. Positive values penalize new tokens based on their
38
+ existing frequency in the text so far, decreasing the model's
39
+ likelihood to repeat the same line verbatim. See more information
40
+ about frequency and presence penalties. (default: :obj:`None`)
41
+ repetition_penalty (float, optional): Penalizes new tokens based on
42
+ their appearance in the prompt and generated text.
43
+ (default: :obj:`None`)
44
+ stream (bool, optional): Whether to stream the response.
45
+ (default: :obj:`None`)
46
+ temperature (float, optional): Controls randomness in the response.
47
+ Higher values make output more random, lower values make it more
48
+ deterministic. Range: [0.0, 2.0]. (default: :obj:`None`)
49
+ top_p (float, optional): Controls diversity via nucleus sampling.
50
+ Range: [0.0, 1.0]. (default: :obj:`None`)
51
+ logit_bias (dict, optional): Modify the likelihood of specified tokens
52
+ appearing in the completion. Accepts a json object that maps tokens
53
+ (specified by their token ID in the tokenizer) to an associated
54
+ bias value from :obj:`-100` to :obj:`100`. Mathematically, the bias
55
+ is added to the logits generated by the model prior to sampling.
56
+ The exact effect will vary per model, but values between:obj:` -1`
57
+ and :obj:`1` should decrease or increase likelihood of selection;
58
+ values like :obj:`-100` or :obj:`100` should result in a ban or
59
+ exclusive selection of the relevant token. (default: :obj:`None`)
60
+ max_tokens (Union[int, NotGiven], optional): Maximum number of tokens
61
+ to generate. If not provided, model will use its default maximum.
62
+ (default: :obj:`None`)
63
+ stop (Optional[List[str]], optional): List of stop sequences.
64
+ (default: :obj:`None`)
65
+ n (Optional[int], optional): Number of chat completion choices to
66
+ generate for each input message. (default: :obj:`None`)
67
+ tools (List, optional): Specifies an array of tools that the model can
68
+ call. It can contain one or more tool objects. During a function
69
+ call process, the model will select one tool from the array.
70
+ (default: :obj:`None`)
71
+ """
72
+
73
+ stream: Optional[bool] = Field(default=None)
74
+ temperature: Optional[float] = Field(default=None)
75
+ top_p: Optional[float] = Field(default=None)
76
+ presence_penalty: Optional[float] = Field(default=None)
77
+ frequency_penalty: Optional[float] = Field(default=None)
78
+ repetition_penalty: Optional[float] = Field(default=None)
79
+ max_tokens: Optional[Union[int, NotGiven]] = Field(default=None)
80
+ stop: Optional[List[str]] = Field(default=None)
81
+ n: Optional[int] = Field(default=None)
82
+ logit_bias: Optional[Dict[str, float]] = Field(default=None)
83
+
84
+
85
+ QIANFAN_API_PARAMS = {param for param in QianfanConfig.model_fields.keys()}
@@ -13,6 +13,13 @@
13
13
  # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
14
  from .models import Action, Environment, Observation, StepResult
15
15
  from .multi_step import MultiStepEnv
16
+ from .rlcards_env import (
17
+ ActionExtractor,
18
+ BlackjackEnv,
19
+ DoudizhuEnv,
20
+ LeducHoldemEnv,
21
+ RLCardsEnv,
22
+ )
16
23
  from .single_step import SingleStepEnv
17
24
  from .tic_tac_toe import Opponent, TicTacToeEnv
18
25
 
@@ -25,4 +32,9 @@ __all__ = [
25
32
  "StepResult",
26
33
  "TicTacToeEnv",
27
34
  "Opponent",
35
+ "RLCardsEnv",
36
+ "BlackjackEnv",
37
+ "LeducHoldemEnv",
38
+ "ActionExtractor",
39
+ "DoudizhuEnv",
28
40
  ]