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.
- camel/__init__.py +1 -1
- camel/configs/__init__.py +3 -0
- camel/configs/qianfan_config.py +85 -0
- camel/environments/__init__.py +12 -0
- camel/environments/rlcards_env.py +860 -0
- camel/interpreters/docker/Dockerfile +2 -5
- camel/loaders/firecrawl_reader.py +4 -4
- camel/memories/blocks/vectordb_block.py +8 -1
- camel/memories/context_creators/score_based.py +123 -19
- camel/models/__init__.py +2 -0
- camel/models/aiml_model.py +8 -0
- camel/models/anthropic_model.py +122 -2
- camel/models/aws_bedrock_model.py +8 -0
- camel/models/azure_openai_model.py +14 -5
- camel/models/base_model.py +4 -0
- camel/models/cohere_model.py +9 -2
- camel/models/crynux_model.py +8 -0
- camel/models/deepseek_model.py +8 -0
- camel/models/gemini_model.py +8 -0
- camel/models/groq_model.py +8 -0
- camel/models/internlm_model.py +8 -0
- camel/models/litellm_model.py +5 -0
- camel/models/lmstudio_model.py +14 -1
- camel/models/mistral_model.py +15 -1
- camel/models/model_factory.py +6 -0
- camel/models/modelscope_model.py +8 -0
- camel/models/moonshot_model.py +8 -0
- camel/models/nemotron_model.py +17 -2
- camel/models/netmind_model.py +8 -0
- camel/models/novita_model.py +8 -0
- camel/models/nvidia_model.py +8 -0
- camel/models/ollama_model.py +8 -0
- camel/models/openai_compatible_model.py +23 -5
- camel/models/openai_model.py +21 -4
- camel/models/openrouter_model.py +8 -0
- camel/models/ppio_model.py +8 -0
- camel/models/qianfan_model.py +104 -0
- camel/models/qwen_model.py +8 -0
- camel/models/reka_model.py +18 -3
- camel/models/samba_model.py +17 -3
- camel/models/sglang_model.py +20 -5
- camel/models/siliconflow_model.py +8 -0
- camel/models/stub_model.py +8 -1
- camel/models/togetherai_model.py +8 -0
- camel/models/vllm_model.py +7 -0
- camel/models/volcano_model.py +14 -1
- camel/models/watsonx_model.py +4 -1
- camel/models/yi_model.py +8 -0
- camel/models/zhipuai_model.py +8 -0
- camel/societies/workforce/prompts.py +71 -22
- camel/societies/workforce/role_playing_worker.py +3 -8
- camel/societies/workforce/single_agent_worker.py +37 -9
- camel/societies/workforce/task_channel.py +25 -20
- camel/societies/workforce/utils.py +104 -14
- camel/societies/workforce/worker.py +98 -16
- camel/societies/workforce/workforce.py +1289 -101
- camel/societies/workforce/workforce_logger.py +613 -0
- camel/tasks/task.py +16 -5
- camel/toolkits/__init__.py +2 -0
- camel/toolkits/code_execution.py +1 -1
- camel/toolkits/playwright_mcp_toolkit.py +2 -1
- camel/toolkits/pptx_toolkit.py +4 -4
- camel/types/enums.py +32 -0
- camel/types/unified_model_type.py +5 -0
- {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/METADATA +4 -3
- {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/RECORD +68 -64
- {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.66.dist-info → camel_ai-0.2.68.dist-info}/licenses/LICENSE +0 -0
camel/__init__.py
CHANGED
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()}
|
camel/environments/__init__.py
CHANGED
|
@@ -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
|
]
|