camel-ai 0.1.1__py3-none-any.whl → 0.1.4__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 -11
- camel/agents/__init__.py +7 -5
- camel/agents/chat_agent.py +134 -86
- camel/agents/critic_agent.py +28 -17
- camel/agents/deductive_reasoner_agent.py +235 -0
- camel/agents/embodied_agent.py +92 -40
- camel/agents/knowledge_graph_agent.py +221 -0
- camel/agents/role_assignment_agent.py +27 -17
- camel/agents/task_agent.py +60 -34
- camel/agents/tool_agents/base.py +0 -1
- camel/agents/tool_agents/hugging_face_tool_agent.py +7 -4
- camel/configs/__init__.py +29 -0
- camel/configs/anthropic_config.py +73 -0
- camel/configs/base_config.py +22 -0
- camel/{configs.py → configs/openai_config.py} +37 -64
- camel/embeddings/__init__.py +2 -0
- camel/embeddings/base.py +3 -2
- camel/embeddings/openai_embedding.py +10 -5
- camel/embeddings/sentence_transformers_embeddings.py +65 -0
- camel/functions/__init__.py +18 -3
- camel/functions/google_maps_function.py +335 -0
- camel/functions/math_functions.py +7 -7
- camel/functions/open_api_function.py +380 -0
- camel/functions/open_api_specs/coursera/__init__.py +13 -0
- camel/functions/open_api_specs/coursera/openapi.yaml +82 -0
- camel/functions/open_api_specs/klarna/__init__.py +13 -0
- camel/functions/open_api_specs/klarna/openapi.yaml +87 -0
- camel/functions/open_api_specs/speak/__init__.py +13 -0
- camel/functions/open_api_specs/speak/openapi.yaml +151 -0
- camel/functions/openai_function.py +346 -42
- camel/functions/retrieval_functions.py +61 -0
- camel/functions/search_functions.py +100 -35
- camel/functions/slack_functions.py +275 -0
- camel/functions/twitter_function.py +484 -0
- camel/functions/weather_functions.py +36 -23
- camel/generators.py +65 -46
- camel/human.py +17 -11
- camel/interpreters/__init__.py +25 -0
- camel/interpreters/base.py +49 -0
- camel/{utils/python_interpreter.py → interpreters/internal_python_interpreter.py} +129 -48
- camel/interpreters/interpreter_error.py +19 -0
- camel/interpreters/subprocess_interpreter.py +190 -0
- camel/loaders/__init__.py +22 -0
- camel/{functions/base_io_functions.py → loaders/base_io.py} +38 -35
- camel/{functions/unstructured_io_fuctions.py → loaders/unstructured_io.py} +199 -110
- camel/memories/__init__.py +17 -7
- camel/memories/agent_memories.py +156 -0
- camel/memories/base.py +97 -32
- camel/memories/blocks/__init__.py +21 -0
- camel/memories/{chat_history_memory.py → blocks/chat_history_block.py} +34 -34
- camel/memories/blocks/vectordb_block.py +101 -0
- camel/memories/context_creators/__init__.py +3 -2
- camel/memories/context_creators/score_based.py +32 -20
- camel/memories/records.py +6 -5
- camel/messages/__init__.py +2 -2
- camel/messages/base.py +99 -16
- camel/messages/func_message.py +7 -4
- camel/models/__init__.py +6 -2
- camel/models/anthropic_model.py +146 -0
- camel/models/base_model.py +10 -3
- camel/models/model_factory.py +17 -11
- camel/models/open_source_model.py +25 -13
- camel/models/openai_audio_models.py +251 -0
- camel/models/openai_model.py +20 -13
- camel/models/stub_model.py +10 -5
- camel/prompts/__init__.py +7 -5
- camel/prompts/ai_society.py +21 -14
- camel/prompts/base.py +54 -47
- camel/prompts/code.py +22 -14
- camel/prompts/evaluation.py +8 -5
- camel/prompts/misalignment.py +26 -19
- camel/prompts/object_recognition.py +35 -0
- camel/prompts/prompt_templates.py +14 -8
- camel/prompts/role_description_prompt_template.py +16 -10
- camel/prompts/solution_extraction.py +9 -5
- camel/prompts/task_prompt_template.py +24 -21
- camel/prompts/translation.py +9 -5
- camel/responses/agent_responses.py +5 -2
- camel/retrievers/__init__.py +26 -0
- camel/retrievers/auto_retriever.py +330 -0
- camel/retrievers/base.py +69 -0
- camel/retrievers/bm25_retriever.py +140 -0
- camel/retrievers/cohere_rerank_retriever.py +108 -0
- camel/retrievers/vector_retriever.py +183 -0
- camel/societies/__init__.py +1 -1
- camel/societies/babyagi_playing.py +56 -32
- camel/societies/role_playing.py +188 -133
- camel/storages/__init__.py +18 -0
- camel/storages/graph_storages/__init__.py +23 -0
- camel/storages/graph_storages/base.py +82 -0
- camel/storages/graph_storages/graph_element.py +74 -0
- camel/storages/graph_storages/neo4j_graph.py +582 -0
- camel/storages/key_value_storages/base.py +1 -2
- camel/storages/key_value_storages/in_memory.py +1 -2
- camel/storages/key_value_storages/json.py +8 -13
- camel/storages/vectordb_storages/__init__.py +33 -0
- camel/storages/vectordb_storages/base.py +202 -0
- camel/storages/vectordb_storages/milvus.py +396 -0
- camel/storages/vectordb_storages/qdrant.py +373 -0
- camel/terminators/__init__.py +1 -1
- camel/terminators/base.py +2 -3
- camel/terminators/response_terminator.py +21 -12
- camel/terminators/token_limit_terminator.py +5 -3
- camel/toolkits/__init__.py +21 -0
- camel/toolkits/base.py +22 -0
- camel/toolkits/github_toolkit.py +245 -0
- camel/types/__init__.py +18 -6
- camel/types/enums.py +129 -15
- camel/types/openai_types.py +10 -5
- camel/utils/__init__.py +20 -13
- camel/utils/commons.py +170 -85
- camel/utils/token_counting.py +135 -15
- {camel_ai-0.1.1.dist-info → camel_ai-0.1.4.dist-info}/METADATA +123 -75
- camel_ai-0.1.4.dist-info/RECORD +119 -0
- {camel_ai-0.1.1.dist-info → camel_ai-0.1.4.dist-info}/WHEEL +1 -1
- camel/memories/context_creators/base.py +0 -72
- camel_ai-0.1.1.dist-info/RECORD +0 -75
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Communicative Agents for AI Society Study
|
|
5
5
|
Home-page: https://www.camel-ai.org/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -13,74 +13,77 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Provides-Extra: all
|
|
16
|
+
Provides-Extra: encoders
|
|
17
|
+
Provides-Extra: graph-storages
|
|
16
18
|
Provides-Extra: huggingface-agent
|
|
19
|
+
Provides-Extra: retrievers
|
|
17
20
|
Provides-Extra: test
|
|
18
21
|
Provides-Extra: tools
|
|
22
|
+
Provides-Extra: vector-databases
|
|
19
23
|
Requires-Dist: PyMuPDF (>=1.22.5,<2.0.0) ; extra == "tools" or extra == "all"
|
|
20
24
|
Requires-Dist: accelerate (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
21
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: anthropic (>=0.21.3,<0.22.0)
|
|
22
26
|
Requires-Dist: beautifulsoup4 (>=4,<5) ; extra == "tools" or extra == "all"
|
|
27
|
+
Requires-Dist: cohere (>=4.56,<5.0) ; extra == "retrievers" or extra == "all"
|
|
23
28
|
Requires-Dist: colorama (>=0,<1)
|
|
24
29
|
Requires-Dist: datasets (>=2,<3) ; extra == "huggingface-agent" or extra == "all"
|
|
25
30
|
Requires-Dist: diffusers (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
31
|
+
Requires-Dist: docstring-parser (>=0.15,<0.16)
|
|
26
32
|
Requires-Dist: docx2txt (>=0.8,<0.9) ; extra == "tools" or extra == "all"
|
|
33
|
+
Requires-Dist: googlemaps (>=4.10.0,<5.0.0) ; extra == "tools" or extra == "all"
|
|
27
34
|
Requires-Dist: jsonschema (>=4,<5)
|
|
28
35
|
Requires-Dist: mock (>=5,<6) ; extra == "test"
|
|
36
|
+
Requires-Dist: neo4j (>=5.18.0,<6.0.0) ; extra == "graph-storages" or extra == "all"
|
|
29
37
|
Requires-Dist: numpy (>=1,<2)
|
|
30
38
|
Requires-Dist: openai (>=1.2.3,<2.0.0)
|
|
39
|
+
Requires-Dist: openapi-spec-validator (>=0.7.1,<0.8.0) ; extra == "tools" or extra == "all"
|
|
31
40
|
Requires-Dist: opencv-python (>=4,<5) ; extra == "huggingface-agent" or extra == "all"
|
|
41
|
+
Requires-Dist: pathlib (>=1.0.1,<2.0.0)
|
|
42
|
+
Requires-Dist: prance (>=23.6.21.0,<24.0.0.0) ; extra == "tools" or extra == "all"
|
|
32
43
|
Requires-Dist: protobuf (>=4,<5)
|
|
44
|
+
Requires-Dist: pydantic (>=1.9,<3)
|
|
45
|
+
Requires-Dist: pydub (>=0.25.1,<0.26.0) ; extra == "tools" or extra == "all"
|
|
46
|
+
Requires-Dist: pygithub (>=2.3.0,<3.0.0) ; extra == "tools" or extra == "all"
|
|
47
|
+
Requires-Dist: pymilvus (>=2.4.0,<3.0.0) ; extra == "vector-databases" or extra == "all"
|
|
33
48
|
Requires-Dist: pyowm (>=3.3.0,<4.0.0) ; extra == "tools" or extra == "all"
|
|
34
49
|
Requires-Dist: pytest (>=7,<8) ; extra == "test"
|
|
50
|
+
Requires-Dist: qdrant-client (>=1.9.0,<2.0.0) ; extra == "vector-databases" or extra == "all"
|
|
51
|
+
Requires-Dist: rank-bm25 (>=0.2.2,<0.3.0) ; extra == "retrievers" or extra == "all"
|
|
52
|
+
Requires-Dist: requests_oauthlib (>=1.3.1,<2.0.0) ; extra == "tools" or extra == "all"
|
|
53
|
+
Requires-Dist: sentence-transformers (>=2.2.2,<3.0.0) ; extra == "encoders" or extra == "all"
|
|
35
54
|
Requires-Dist: sentencepiece (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
55
|
+
Requires-Dist: slack-sdk (>=3.27.2,<4.0.0) ; extra == "tools" or extra == "all"
|
|
36
56
|
Requires-Dist: soundfile (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
37
|
-
Requires-Dist: tiktoken (>=0,<
|
|
57
|
+
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
|
|
38
58
|
Requires-Dist: torch (>=1,<2) ; extra == "huggingface-agent" or extra == "all"
|
|
39
59
|
Requires-Dist: transformers (>=4,<5) ; extra == "huggingface-agent" or extra == "all"
|
|
40
|
-
Requires-Dist: unstructured (>=0.10.30,<0.11.0) ; extra == "tools" or extra == "all"
|
|
60
|
+
Requires-Dist: unstructured[all-docs] (>=0.10.30,<0.11.0) ; extra == "tools" or extra == "all"
|
|
41
61
|
Requires-Dist: wikipedia (>=1,<2) ; extra == "tools" or extra == "all"
|
|
62
|
+
Requires-Dist: wolframalpha (>=5.0.0,<6.0.0) ; extra == "tools" or extra == "all"
|
|
42
63
|
Project-URL: Documentation, https://docs.camel-ai.org
|
|
43
64
|
Project-URL: Repository, https://github.com/camel-ai/camel
|
|
44
65
|
Description-Content-Type: text/markdown
|
|
45
66
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/CamelAIOrg?style=social&color=brightgreen&logo=twitter" />
|
|
64
|
-
</a>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
# CAMEL: Communicative Agents for “Mind” Exploration of Large Scale Language Model Society
|
|
68
|
-
|
|
69
|
-
<div align="center">
|
|
70
|
-
|
|
71
|
-
<a></a>
|
|
72
|
-
<a href="https://github.com/camel-ai/camel/actions/workflows/pytest_package.yml"></a>
|
|
73
|
-
<a href="https://camel-ai.github.io/camel/">
|
|
74
|
-

|
|
75
|
-
</a>
|
|
76
|
-
<a href="https://github.com/camel-ai/camel/stargazers" target="_blank">
|
|
77
|
-
<img alt="GitHub Repo Stars" src="https://img.shields.io/github/stars/camel-ai/camel?label=stars&logo=github&color=brightgreen" />
|
|
78
|
-
</a>
|
|
79
|
-
<a href="https://github.com/camel-ai/camel/blob/master/licenses/LICENSE"></a>
|
|
80
|
-
</div>
|
|
67
|
+
[![Colab][colab-image]][colab-url]
|
|
68
|
+
[![Hugging Face][huggingface-image]][huggingface-url]
|
|
69
|
+
[![Slack][slack-image]][slack-url]
|
|
70
|
+
[![Discord][discord-image]][discord-url]
|
|
71
|
+
[![Wechat][wechat-image]][wechat-url]
|
|
72
|
+
[![Twitter][twitter-image]][twitter-url]
|
|
73
|
+
|
|
74
|
+
______________________________________________________________________
|
|
75
|
+
|
|
76
|
+
# CAMEL: Communicative Agents for “Mind” Exploration of Large Language Model Society
|
|
77
|
+
|
|
78
|
+
[![Python Version][python-image]][python-url]
|
|
79
|
+
[![PyTest Status][pytest-image]][pytest-url]
|
|
80
|
+
[![Documentation][docs-image]][docs-url]
|
|
81
|
+
[![Star][star-image]][star-url]
|
|
82
|
+
[![Package License][package-license-image]][package-license-url]
|
|
83
|
+
[![Data License][data-license-image]][data-license-url]
|
|
81
84
|
|
|
82
85
|
<p align="center">
|
|
83
|
-
|
|
86
|
+
<a href="https://github.com/camel-ai/camel#community">Community</a> |
|
|
84
87
|
<a href="https://github.com/camel-ai/camel#installation">Installation</a> |
|
|
85
88
|
<a href="https://camel-ai.github.io/camel/">Documentation</a> |
|
|
86
89
|
<a href="https://github.com/camel-ai/camel/tree/HEAD/examples">Examples</a> |
|
|
@@ -91,7 +94,7 @@ Description-Content-Type: text/markdown
|
|
|
91
94
|
</p>
|
|
92
95
|
|
|
93
96
|
<p align="center">
|
|
94
|
-
<img src='
|
|
97
|
+
<img src='https://raw.githubusercontent.com/camel-ai/camel/master/misc/primary_logo.png' width=800>
|
|
95
98
|
</p>
|
|
96
99
|
|
|
97
100
|
## Overview
|
|
@@ -100,28 +103,46 @@ The rapid advancement of conversational and chat-based language models has led t
|
|
|
100
103
|
## Community
|
|
101
104
|
🐫 CAMEL is an open-source library designed for the study of autonomous and communicative agents. We believe that studying these agents on a large scale offers valuable insights into their behaviors, capabilities, and potential risks. To facilitate research in this field, we implement and support various types of agents, tasks, prompts, models, and simulated environments.
|
|
102
105
|
|
|
103
|
-
Join us ([*Slack*](https://join.slack.com/t/camel-
|
|
106
|
+
Join us ([*Slack*](https://join.slack.com/t/camel-ai/shared_invite/zt-2g7xc41gy-_7rcrNNAArIP6sLQqldkqQ), [*Discord*](https://discord.gg/CNcNpquyDc) or [*WeChat*](https://ghli.org/camel/wechat.png)) in pushing the boundaries of building AI Society.
|
|
104
107
|
|
|
105
108
|
## Try it yourself
|
|
106
109
|
We provide a [](https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing) demo showcasing a conversation between two ChatGPT agents playing roles as a python programmer and a stock trader collaborating on developing a trading bot for stock market.
|
|
107
110
|
|
|
108
111
|
<p align="center">
|
|
109
|
-
<img src='
|
|
112
|
+
<img src='https://raw.githubusercontent.com/camel-ai/camel/master/misc/framework.png' width=800>
|
|
110
113
|
</p>
|
|
111
114
|
|
|
112
|
-
##
|
|
115
|
+
## Installation
|
|
113
116
|
|
|
114
|
-
|
|
117
|
+
### From PyPI
|
|
115
118
|
|
|
116
|
-
|
|
119
|
+
To install the base CAMEL library:
|
|
120
|
+
```bash
|
|
121
|
+
pip install camel-ai
|
|
122
|
+
```
|
|
123
|
+
Some features require extra dependencies:
|
|
124
|
+
- To use the HuggingFace agents:
|
|
125
|
+
```bash
|
|
126
|
+
pip install 'camel-ai[huggingface-agent]'
|
|
127
|
+
```
|
|
128
|
+
- To enable RAG or use agent memory:
|
|
129
|
+
```bash
|
|
130
|
+
pip install 'camel-ai[tools]'
|
|
131
|
+
```
|
|
132
|
+
- To install with all dependencies:
|
|
133
|
+
```bash
|
|
134
|
+
pip install 'camel-ai[all]'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### From Source
|
|
117
138
|
|
|
118
139
|
Install `CAMEL` from source with poetry (Recommended):
|
|
119
140
|
```sh
|
|
141
|
+
# Make sure your python version is later than 3.9
|
|
142
|
+
# You can use pyenv to manage multiple python verisons in your sytstem
|
|
143
|
+
|
|
120
144
|
# Clone github repo
|
|
121
|
-
# For the latest code:
|
|
122
145
|
git clone https://github.com/camel-ai/camel.git
|
|
123
|
-
# Or for the stable code:
|
|
124
|
-
git clone -b v0.1.0 https://github.com/camel-ai/camel.git
|
|
125
146
|
|
|
126
147
|
# Change directory into project directory
|
|
127
148
|
cd camel
|
|
@@ -133,10 +154,8 @@ poetry shell
|
|
|
133
154
|
# It takes about 90 seconds to resolve dependencies
|
|
134
155
|
poetry install
|
|
135
156
|
|
|
136
|
-
# Or if you want to use
|
|
137
|
-
poetry install -E
|
|
138
|
-
|
|
139
|
-
# do something with camel
|
|
157
|
+
# Or if you want to use all other extra packages
|
|
158
|
+
poetry install -E all # (Optional)
|
|
140
159
|
|
|
141
160
|
# Exit the virtual environment
|
|
142
161
|
exit
|
|
@@ -151,7 +170,7 @@ conda create --name camel python=3.10
|
|
|
151
170
|
conda activate camel
|
|
152
171
|
|
|
153
172
|
# Clone github repo
|
|
154
|
-
git clone -b v0.1.
|
|
173
|
+
git clone -b v0.1.4 https://github.com/camel-ai/camel.git
|
|
155
174
|
|
|
156
175
|
# Change directory into project directory
|
|
157
176
|
cd camel
|
|
@@ -159,13 +178,19 @@ cd camel
|
|
|
159
178
|
# Install camel from source
|
|
160
179
|
pip install -e .
|
|
161
180
|
|
|
162
|
-
# Or if you want to use
|
|
163
|
-
pip install -e .[
|
|
181
|
+
# Or if you want to use all other extra packages
|
|
182
|
+
pip install -e .[all] # (Optional)
|
|
164
183
|
```
|
|
184
|
+
|
|
185
|
+
## Documentation
|
|
186
|
+
|
|
187
|
+
[CAMEL package documentation pages](https://camel-ai.github.io/camel/).
|
|
188
|
+
|
|
165
189
|
## Example
|
|
166
|
-
You can find a list of tasks for different set of assistant and user role pairs [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link)
|
|
167
190
|
|
|
168
|
-
|
|
191
|
+
You can find a list of tasks for different sets of assistant and user role pairs [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link).
|
|
192
|
+
|
|
193
|
+
As an example, to run the `role_playing.py` script:
|
|
169
194
|
|
|
170
195
|
First, you need to add your OpenAI API key to system environment variables. The method to do this depends on your operating system and the shell you're using.
|
|
171
196
|
|
|
@@ -191,7 +216,6 @@ set OPENAI_API_BASE_URL=<inert your OpenAI API BASE URL> #(Should you utilize a
|
|
|
191
216
|
# Export your OpenAI API key
|
|
192
217
|
$env:OPENAI_API_KEY="<insert your OpenAI API key>"
|
|
193
218
|
$env:OPENAI_API_BASE_URL="<inert your OpenAI API BASE URL>" #(Should you utilize an OpenAI proxy service, kindly specify this)
|
|
194
|
-
|
|
195
219
|
```
|
|
196
220
|
|
|
197
221
|
Replace `<insert your OpenAI API key>` with your actual OpenAI API key in each case. Make sure there are no spaces around the `=` sign.
|
|
@@ -208,7 +232,7 @@ Please note that the environment variable is session-specific. If you open a new
|
|
|
208
232
|
|
|
209
233
|
## Use Open-Source Models as Backends
|
|
210
234
|
|
|
211
|
-
The basic workflow of using an open-sourced model as the backend is based on an external server running LLM inference service, e.g. during the development we chose [FastChat](https://github.com/lm-sys/FastChat) to run the service.
|
|
235
|
+
The basic workflow of using an open-sourced model as the backend is based on an external server running LLM inference service, e.g. during the development we chose [FastChat](https://github.com/lm-sys/FastChat) to run the service.
|
|
212
236
|
|
|
213
237
|
We do not fix the choice of server to decouple the implementation of any specific LLM inference server with CAMEL (indicating the server needs to be deployed by the user himself). But the server to be deployed must satisfy that **it supports OpenAI-compatible APIs, especially the method `openai.ChatCompletion.create`**.
|
|
214
238
|
|
|
@@ -227,7 +251,7 @@ python3 -m fastchat.serve.model_worker --model-path meta-llama/Llama-2-7b-chat-h
|
|
|
227
251
|
python3 -m fastchat.serve.openai_api_server --host localhost --port 8000
|
|
228
252
|
```
|
|
229
253
|
|
|
230
|
-
2. After observing the controller successfully receiving the heart beat signal from the worker, the server should be ready for use at http://localhost:8000/v1.
|
|
254
|
+
2. After observing the controller successfully receiving the heart beat signal from the worker, the server should be ready for use at http://localhost:8000/v1.
|
|
231
255
|
|
|
232
256
|
3. Then we can try on running `role_playing_with_open_source_model.py`, where each agent in this example is initialized with specifying the `model_path` and `server_url`, similar to the example code below:
|
|
233
257
|
|
|
@@ -256,21 +280,21 @@ agent = ChatAgent(
|
|
|
256
280
|
- example: [lmsys/vicuna-7b-v1.5](https://huggingface.co/lmsys/vicuna-7b-v1.5)
|
|
257
281
|
|
|
258
282
|
## Data (Hosted on Hugging Face)
|
|
259
|
-
| Dataset
|
|
260
|
-
|
|
283
|
+
| Dataset | Chat format | Instruction format | Chat format (translated) |
|
|
284
|
+
|----------------|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
|
|
261
285
|
| **AI Society** | [Chat format](https://huggingface.co/datasets/camel-ai/ai_society/blob/main/ai_society_chat.tar.gz) | [Instruction format](https://huggingface.co/datasets/camel-ai/ai_society/blob/main/ai_society_instructions.json) | [Chat format (translated)](https://huggingface.co/datasets/camel-ai/ai_society_translated) |
|
|
262
|
-
| **Code**
|
|
263
|
-
| **Math**
|
|
264
|
-
| **Physics**
|
|
265
|
-
| **Chemistry**
|
|
266
|
-
| **Biology**
|
|
286
|
+
| **Code** | [Chat format](https://huggingface.co/datasets/camel-ai/code/blob/main/code_chat.tar.gz) | [Instruction format](https://huggingface.co/datasets/camel-ai/code/blob/main/code_instructions.json) | x |
|
|
287
|
+
| **Math** | [Chat format](https://huggingface.co/datasets/camel-ai/math) | x | x |
|
|
288
|
+
| **Physics** | [Chat format](https://huggingface.co/datasets/camel-ai/physics) | x | x |
|
|
289
|
+
| **Chemistry** | [Chat format](https://huggingface.co/datasets/camel-ai/chemistry) | x | x |
|
|
290
|
+
| **Biology** | [Chat format](https://huggingface.co/datasets/camel-ai/biology) | x | x |
|
|
267
291
|
|
|
268
292
|
## Visualizations of Instructions and Tasks
|
|
269
293
|
|
|
270
|
-
| Dataset
|
|
271
|
-
|
|
272
|
-
| **AI Society**
|
|
273
|
-
| **Code**
|
|
294
|
+
| Dataset | Instructions | Tasks |
|
|
295
|
+
|------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
|
|
296
|
+
| **AI Society** | [Instructions](https://atlas.nomic.ai/map/3a559a06-87d0-4476-a879-962656242452/db961915-b254-48e8-8e5c-917f827b74c6) | [Tasks](https://atlas.nomic.ai/map/cb96f41b-a6fd-4fe4-ac40-08e101714483/ae06156c-a572-46e9-8345-ebe18586d02b) |
|
|
297
|
+
| **Code** | [Instructions](https://atlas.nomic.ai/map/902d6ccb-0bbb-4294-83a8-1c7d2dae03c8/ace2e146-e49f-41db-a1f4-25a2c4be2457) | [Tasks](https://atlas.nomic.ai/map/efc38617-9180-490a-8630-43a05b35d22d/2576addf-a133-45d5-89a9-6b067b6652dd) |
|
|
274
298
|
| **Misalignment** | [Instructions](https://atlas.nomic.ai/map/5c491035-a26e-4a05-9593-82ffb2c3ab40/2bd98896-894e-4807-9ed8-a203ccb14d5e) | [Tasks](https://atlas.nomic.ai/map/abc357dd-9c04-4913-9541-63e259d7ac1f/825139a4-af66-427c-9d0e-f36b5492ab3f) |
|
|
275
299
|
|
|
276
300
|
## Implemented Research Ideas from Other Works
|
|
@@ -293,12 +317,10 @@ We implemented amazing research ideas from other works for you to build, compare
|
|
|
293
317
|
## Acknowledgement
|
|
294
318
|
Special thanks to [Nomic AI](https://home.nomic.ai/) for giving us extended access to their data set exploration tool (Atlas).
|
|
295
319
|
|
|
296
|
-
We would also like to thank Haya Hammoud for designing the logo of our project.
|
|
320
|
+
We would also like to thank Haya Hammoud for designing the initial logo of our project.
|
|
297
321
|
|
|
298
322
|
## License
|
|
299
323
|
|
|
300
|
-
The intended purpose and licensing of CAMEL is solely for research use.
|
|
301
|
-
|
|
302
324
|
The source code is licensed under Apache 2.0.
|
|
303
325
|
|
|
304
326
|
The datasets are licensed under CC BY NC 4.0, which permits only non-commercial usage. It is advised that any models trained using the dataset should not be utilized for anything other than research purposes.
|
|
@@ -309,3 +331,29 @@ We appreciate your interest in contributing to our open-source initiative. We pr
|
|
|
309
331
|
## Contact
|
|
310
332
|
For more information please contact camel.ai.team@gmail.com.
|
|
311
333
|
|
|
334
|
+
[python-image]: https://img.shields.io/badge/Python-3.9%2B-brightgreen.svg
|
|
335
|
+
[python-url]: https://docs.python.org/3.9/
|
|
336
|
+
[pytest-image]: https://github.com/camel-ai/camel/actions/workflows/pytest_package.yml/badge.svg
|
|
337
|
+
[pytest-url]: https://github.com/camel-ai/camel/actions/workflows/pytest_package.yml
|
|
338
|
+
[docs-image]: https://img.shields.io/badge/Documentation-grey.svg?logo=github
|
|
339
|
+
[docs-url]: https://camel-ai.github.io/camel/index.html
|
|
340
|
+
[star-image]: https://img.shields.io/github/stars/camel-ai/camel?label=stars&logo=github&color=brightgreen
|
|
341
|
+
[star-url]: https://github.com/camel-ai/camel/stargazers
|
|
342
|
+
[package-license-image]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
343
|
+
[package-license-url]: https://github.com/camel-ai/camel/blob/master/licenses/LICENSE
|
|
344
|
+
[data-license-image]: https://img.shields.io/badge/License-CC_BY--NC_4.0-lightgrey.svg
|
|
345
|
+
[data-license-url]: https://github.com/camel-ai/camel/blob/master/licenses/DATA_LICENSE
|
|
346
|
+
|
|
347
|
+
[colab-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
|
|
348
|
+
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg
|
|
349
|
+
[huggingface-url]: https://huggingface.co/camel-ai
|
|
350
|
+
[huggingface-image]: https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-CAMEL--AI-ffc107?color=ffc107&logoColor=white
|
|
351
|
+
[slack-url]: https://join.slack.com/t/camel-ai/shared_invite/zt-2g7xc41gy-_7rcrNNAArIP6sLQqldkqQ
|
|
352
|
+
[slack-image]: https://img.shields.io/badge/Slack-CAMEL--AI-blueviolet?logo=slack
|
|
353
|
+
[discord-url]: https://discord.gg/CNcNpquyDc
|
|
354
|
+
[discord-image]: https://img.shields.io/badge/Discord-CAMEL--AI-7289da?logo=discord&logoColor=white&color=7289da
|
|
355
|
+
[wechat-url]: https://ghli.org/camel/wechat.png
|
|
356
|
+
[wechat-image]: https://img.shields.io/badge/WeChat-CamelAIOrg-brightgreen?logo=wechat&logoColor=white
|
|
357
|
+
[twitter-url]: https://twitter.com/CamelAIOrg
|
|
358
|
+
[twitter-image]: https://img.shields.io/twitter/follow/CamelAIOrg?style=social&color=brightgreen&logo=twitter
|
|
359
|
+
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
camel/__init__.py,sha256=1Fkgjrsb9S3gkSvU6XAgzS9jiDXKy06aXdQkPRJfGBI,778
|
|
2
|
+
camel/agents/__init__.py,sha256=1wFs2lO08qkvsQq1ZOsRSmN79Mx1SDe044ABgMz2zNU,1494
|
|
3
|
+
camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
|
|
4
|
+
camel/agents/chat_agent.py,sha256=Ogfkai6ZJTi1w3ag5wlYpknqgUfv3oE1mvkm1EsaI6c,21701
|
|
5
|
+
camel/agents/critic_agent.py,sha256=Etxti9XKOut_KqMQHI8IKNMg8zUUM13trep7axZK0Qs,7377
|
|
6
|
+
camel/agents/deductive_reasoner_agent.py,sha256=ACHN-y4Vg3l3vMw1Nhd7vLtZtlCvstfbGGnIWeJers4,13050
|
|
7
|
+
camel/agents/embodied_agent.py,sha256=E0N63uOkfw02MdPTEX_ImUAzaNuapnPyU3iBJQSqeKU,7322
|
|
8
|
+
camel/agents/knowledge_graph_agent.py,sha256=YbHem9UdexvSWMnm7_Plv-V-t-rMvmtafshpA_UASSY,8783
|
|
9
|
+
camel/agents/role_assignment_agent.py,sha256=P3QAuPPxc9fbKL9GrOEQWDY4m8tfjLpdPxyhph2OCwc,4879
|
|
10
|
+
camel/agents/task_agent.py,sha256=Dip1nAd3oGtxVIi3laP65hOp5VwlajAbtotendtNMvs,14907
|
|
11
|
+
camel/agents/tool_agents/__init__.py,sha256=ulTNWU2qoFGe3pvVmCq_sdfeSX3NKZ0due66TYvsL-M,862
|
|
12
|
+
camel/agents/tool_agents/base.py,sha256=nQAhfWi8a_bCgzlf5-G-tmj1fKm6AjpRc89NQkWwpnc,1399
|
|
13
|
+
camel/agents/tool_agents/hugging_face_tool_agent.py,sha256=1Z5tG6f_86eL0vmtRZ-BJvoLDFFLhoHt8JtDvgat1xU,8723
|
|
14
|
+
camel/configs/__init__.py,sha256=8fRAyzN-35UT8_BBhwEYmTmiBHOI6MqrmyGTddBinJU,1061
|
|
15
|
+
camel/configs/anthropic_config.py,sha256=WZ6qMSMIUXCRRSC8smHfqJmfjkbYMSAc4aE6Nwi2dKI,3315
|
|
16
|
+
camel/configs/base_config.py,sha256=CEF8ryl_dkH6LgOhwuP5_EgjaWCUCB-E3GcMWR-2YFE,870
|
|
17
|
+
camel/configs/openai_config.py,sha256=UKTnpzRcAsQtxgvPJNgLHoMGuXWOrQyJsz0MBNsjALM,6603
|
|
18
|
+
camel/embeddings/__init__.py,sha256=A7h2IAtP-1Rp3hn4SDwSYEGytuWsoti1v5Iw1Ktu0es,952
|
|
19
|
+
camel/embeddings/base.py,sha256=nauXLNEJlPnk2sKigFzvNTk_RKsC_2l_EQiyPyj_ATo,2208
|
|
20
|
+
camel/embeddings/openai_embedding.py,sha256=wP6LtA34Va_2N7QwSRkqhfMHuKxE2h4EDrmChDyoREs,2873
|
|
21
|
+
camel/embeddings/sentence_transformers_embeddings.py,sha256=o0_lXMxqdNMycZ79Pj97MWwoTyvTASfo-23P3SZ_VF8,2312
|
|
22
|
+
camel/functions/__init__.py,sha256=a_MHon_5zLz7iZCXQ7Ed2tZ0KrN_IRR07zgqHkht2x8,1452
|
|
23
|
+
camel/functions/google_maps_function.py,sha256=AmhlIyqkrkZF6Vb4O-wdtEKTQjRh5mMjHjS56ciGgjk,12468
|
|
24
|
+
camel/functions/math_functions.py,sha256=sPHSEOdHOmL38wZWcdyiBj0VEmf7mhQ0MBzya1SFNL0,1703
|
|
25
|
+
camel/functions/open_api_function.py,sha256=giZPODzpXG9YOmFItbqCrupVmR4e-WljZmXTfeLsfzk,15036
|
|
26
|
+
camel/functions/open_api_specs/coursera/__init__.py,sha256=f3LXNDzN2XWWoF2D0nesG8VuEA6Zd14i2aiTDbCm5bA,708
|
|
27
|
+
camel/functions/open_api_specs/coursera/openapi.yaml,sha256=iouLcNNpVvXLfmkyKrbJlS3MEjBJ7TgVR48UID8dwfE,1981
|
|
28
|
+
camel/functions/open_api_specs/klarna/__init__.py,sha256=f3LXNDzN2XWWoF2D0nesG8VuEA6Zd14i2aiTDbCm5bA,708
|
|
29
|
+
camel/functions/open_api_specs/klarna/openapi.yaml,sha256=9wpwRn8NLZL1reN6YUPsZP24hbDJJYvOJeeoWTk7ojQ,2887
|
|
30
|
+
camel/functions/open_api_specs/speak/__init__.py,sha256=f3LXNDzN2XWWoF2D0nesG8VuEA6Zd14i2aiTDbCm5bA,708
|
|
31
|
+
camel/functions/open_api_specs/speak/openapi.yaml,sha256=rmM_-E4tYJ2LOpUlcQxfQtcQSRkVnsBkQWMmKdW2QqQ,6557
|
|
32
|
+
camel/functions/openai_function.py,sha256=tsAcxDNVV4OSu2bi3l2lfNtyOQSoJn5OqV3oMsFlTlM,14933
|
|
33
|
+
camel/functions/retrieval_functions.py,sha256=ZBwQhBeun86k6AnMDCpf0U-JYNaU0alDJAS1hdnumAQ,2281
|
|
34
|
+
camel/functions/search_functions.py,sha256=qfN8nEnR9cMlRXkEXBbbcuifaXfIMe29hrY2Q4IljtM,12639
|
|
35
|
+
camel/functions/slack_functions.py,sha256=f1-aeuANOUf3OSnbeltaepEsu507omhXxE9AgQJ5dTQ,8789
|
|
36
|
+
camel/functions/twitter_function.py,sha256=xL-GKU69WrcTUm3lQl1yPgJFxtBJKRmWN3zx9AfGNKI,17254
|
|
37
|
+
camel/functions/weather_functions.py,sha256=W2jMFqxq5M7Dan7cgEpnvzBk0SV_MduMbCuvHBsgo-c,5881
|
|
38
|
+
camel/generators.py,sha256=tcYDoHwSKN0rBiu7u4rWN9pb61O8OaclrNaasCqHSJM,10437
|
|
39
|
+
camel/human.py,sha256=JQMdOP1uDXEo4uSLKpqi1I1KblxsLkrcs6Ekavm40C0,4949
|
|
40
|
+
camel/interpreters/__init__.py,sha256=iGaeff8zeVDHr_5qHGmMuDzo8gz8vnW4yA7NMhk3-hg,1040
|
|
41
|
+
camel/interpreters/base.py,sha256=JZpQmxYBflPcDerj-R6TB6nnKvhnZR3Drraxo84JuxE,1904
|
|
42
|
+
camel/interpreters/internal_python_interpreter.py,sha256=ZbVmSB2zvWbvvTOL0xpDlJel-I9rv13w1rP4RvtpNiE,21866
|
|
43
|
+
camel/interpreters/interpreter_error.py,sha256=4pI_dKohUKcQOrqJafolyjRfOHwBUuUBXCwwD46P4wE,886
|
|
44
|
+
camel/interpreters/subprocess_interpreter.py,sha256=nKxFXZJ9zGYlKdNlz6Ln7bvg65ejKZ8yAHgIFuR2WzM,6835
|
|
45
|
+
camel/loaders/__init__.py,sha256=TYKJlSEUCajdXVWLNHBL8qQO0WYdQwut4gO-r3-SaMY,856
|
|
46
|
+
camel/loaders/base_io.py,sha256=-2TrzGdieR8NwwY_g588zr4K7pSy9mpwu4eOstniyNU,8664
|
|
47
|
+
camel/loaders/unstructured_io.py,sha256=p2oJ1eIfuzYTZZon58qfobNI91fTtHWbZP7GAUWJaV8,25870
|
|
48
|
+
camel/memories/__init__.py,sha256=ml1Uj4Y_1Q2LfrTXOY38niF0x1H-N-u_zoN_VvR939U,1364
|
|
49
|
+
camel/memories/agent_memories.py,sha256=XxZCNSqMy2zME-vYjy9EBpQc9WzW1vOIFwdAoxImvtY,6110
|
|
50
|
+
camel/memories/base.py,sha256=kbyAmKkOfFdOKfHxwao8bIAbRSuOEXyzxPFd0NlvUCE,5003
|
|
51
|
+
camel/memories/blocks/__init__.py,sha256=5oPXhzoZke5d-4R8jmP54o8O2mmBvJB30oukRNrRX50,860
|
|
52
|
+
camel/memories/blocks/chat_history_block.py,sha256=USDGp5pDlp6PrClmAVi3WqwAjE6wrWwpJBoqG_yvX9A,4609
|
|
53
|
+
camel/memories/blocks/vectordb_block.py,sha256=qgW-hr-TptXwirrtO5RrFlvD6r3BPFXvvz3hJzs4Zjg,3850
|
|
54
|
+
camel/memories/context_creators/__init__.py,sha256=0uLLP3YD46gOOh39her_weJo3viHmE4IWyWBLlutnqs,806
|
|
55
|
+
camel/memories/context_creators/score_based.py,sha256=o3h4Rst9vzdgMg8-MbUMDLVaMBMqy4ZeFgHejyGQTJY,5378
|
|
56
|
+
camel/memories/records.py,sha256=zmZsYHVuq6fYqJDkzhNXF02uWLzdBemaEZeG0Ls90pU,3618
|
|
57
|
+
camel/messages/__init__.py,sha256=djLvpz6AmjeLzuUSQl7J6T2O4x8MwSdcH0l9fbj_3yg,1468
|
|
58
|
+
camel/messages/base.py,sha256=iiJj39NljLLgiiUSATDXpPR448zsX137FMKZdDZDoEs,10131
|
|
59
|
+
camel/messages/func_message.py,sha256=CCVkbz-2pdxXV0vBETI0xt7d7uiN8zACpRI7lCnfTFQ,3841
|
|
60
|
+
camel/models/__init__.py,sha256=U2fnPOgxlNRQV3U58EcQ_K5nZuP29dATstn7jV5JFj8,1168
|
|
61
|
+
camel/models/anthropic_model.py,sha256=l2lNFyyO1kAN587KB9xg_k9V515WanhLM3CRXal0ivc,5112
|
|
62
|
+
camel/models/base_model.py,sha256=9PgWNbG1ZY4KTzw_UyY26UG63Jqd_VWWjog5uBK6lHw,3904
|
|
63
|
+
camel/models/model_factory.py,sha256=3f1jUpF1Or6liMk9iH0OfXECpi6i4Toj20tk-T9gqAc,2418
|
|
64
|
+
camel/models/open_source_model.py,sha256=-coKi0GPc1uBzAGL8vcS4Aun0GV0RCSwxbhMdkM6bgA,5856
|
|
65
|
+
camel/models/openai_audio_models.py,sha256=Jpd_B-5R8d8s3qYo_0x-Ahw5icMCysGEjaDtssV34dg,9799
|
|
66
|
+
camel/models/openai_model.py,sha256=XhcirU6QqkHP_hRNNuB1xak_9IKtZE0ZZMLGE-FvVHc,4164
|
|
67
|
+
camel/models/stub_model.py,sha256=hbfS6A83vY4TaFK_7Q9jA4Gbrkp0Hlmq2IEZ1z81L8E,3631
|
|
68
|
+
camel/prompts/__init__.py,sha256=hO7NyBQ-1u-AysgjNkvrTSe-CFCtWZLtYP6IBDmotyc,1790
|
|
69
|
+
camel/prompts/ai_society.py,sha256=ApgvIED1Z_mdsWDNc2_u35Ktp7pEKksMrOIQKo_q5cI,6306
|
|
70
|
+
camel/prompts/base.py,sha256=70Fmp0bJk2hlLQtwzCx29PIpSwLNgOo7S1cDLE7bOb4,8452
|
|
71
|
+
camel/prompts/code.py,sha256=vrv2mPjlakPlqVLQt_rA1veP79EN1t3iM41bkACrc9I,5865
|
|
72
|
+
camel/prompts/evaluation.py,sha256=4zm5ZVy3CSb2NdFWnS43ejK8Cu_pU8iUIj06ofpuZpg,1596
|
|
73
|
+
camel/prompts/misalignment.py,sha256=aL3W5WvTJBfF-1vWQse_tn3zAOaezHGU510HLs0AlQo,4537
|
|
74
|
+
camel/prompts/object_recognition.py,sha256=L_YM_c8AxwO6MvwuUdeuluwhBPXedNxNIzOv5yF9Dag,1422
|
|
75
|
+
camel/prompts/prompt_templates.py,sha256=PeOp_eUgyZyJ7BCwA2cvSx8O3QPu9ftjgaZ6Al8zlJQ,4134
|
|
76
|
+
camel/prompts/role_description_prompt_template.py,sha256=k9p3NlxY1MWKzhoRpeQeuz0oHDQYo63WoPdWcUmHr_A,2544
|
|
77
|
+
camel/prompts/solution_extraction.py,sha256=5vTSaeQoBSvaur3cKgqQ9kLxSA5QIOBI4OPQzXWbQFg,2109
|
|
78
|
+
camel/prompts/task_prompt_template.py,sha256=ZdldtlHMB1d4nnANOwdaPFOif3BjrDEgyTw995r9t0o,2590
|
|
79
|
+
camel/prompts/translation.py,sha256=V_40Ko2is5dAOCZ8DzsHo6DO7l8_jnEV9KjCKH7GxtY,1902
|
|
80
|
+
camel/responses/__init__.py,sha256=edtTQskOgq5obyITziRFL62HTJP9sAikAtP9vrFacEQ,795
|
|
81
|
+
camel/responses/agent_responses.py,sha256=UsTZHi4jPs2wfChPQWttVNyHneoGdQtdrRouatywE4w,1714
|
|
82
|
+
camel/retrievers/__init__.py,sha256=CuP3B77zl2PoF-W2y9xSkTGRzoK2J4TlUHdCtuJD8dg,1059
|
|
83
|
+
camel/retrievers/auto_retriever.py,sha256=9CjwTiNkkqUUd1HRwiHB1Uf_mvokkg51IUj1wzfbGrY,13364
|
|
84
|
+
camel/retrievers/base.py,sha256=6ygOuHeSKd5rUJZ8QJe0uhDqbDeu7VU2t8F1qbv1gWM,2624
|
|
85
|
+
camel/retrievers/bm25_retriever.py,sha256=cejqk4UpuWAEVraa3Oz65gI9L4F-MOKdon_FtrdW7D8,5180
|
|
86
|
+
camel/retrievers/cohere_rerank_retriever.py,sha256=6BhXLRsibUnlK2ejNnZ82pcct1HghZgTDBDo61GpMO4,4123
|
|
87
|
+
camel/retrievers/vector_retriever.py,sha256=88EmQxTTICUPXI4c-iRx9wqWp1TYyvcag7aOEXmYg6o,7185
|
|
88
|
+
camel/societies/__init__.py,sha256=JhGwUHjht4CewzC3shKuxmgB3oS7FIxIxmiKyhNsfIs,832
|
|
89
|
+
camel/societies/babyagi_playing.py,sha256=b4xu1djq6In0XU1btbKKbG2EnIHGG1Jyfx32TBntfE8,11770
|
|
90
|
+
camel/societies/role_playing.py,sha256=EubYCFsd6W8eLJ51JmvnWZfCPsMyM6S5b3Fb5no_21c,22079
|
|
91
|
+
camel/storages/__init__.py,sha256=crRaZKmgvs8RCzfffREYIVo09J4q_HVu44JGb4CJMfo,1480
|
|
92
|
+
camel/storages/graph_storages/__init__.py,sha256=vsJZkedaCS-cLQ-KgMqio8cxXvbousBWVqzZJvlimT8,897
|
|
93
|
+
camel/storages/graph_storages/base.py,sha256=4Os_Zlp_ENIZ07Emm7s3jK9-Jcglq4y2UsKcqAhTz6A,2857
|
|
94
|
+
camel/storages/graph_storages/graph_element.py,sha256=fQNxY-BHCRlTT9I_VY3NODysxW4vuqk-zjvTCMwAoH4,2356
|
|
95
|
+
camel/storages/graph_storages/neo4j_graph.py,sha256=EWNaKAVaFtYn81JSgj-INSDo3zPYBXuICs-MCiA9Prc,22055
|
|
96
|
+
camel/storages/key_value_storages/__init__.py,sha256=lZOFtqj1iTQ9pRB4DkCYSMyPwEwaJDVzU06kM5jxFd4,916
|
|
97
|
+
camel/storages/key_value_storages/base.py,sha256=knxni8WiyTXJ2emZQO-JIsbxw6Ei7EO6dj-bU2YCoSY,2183
|
|
98
|
+
camel/storages/key_value_storages/in_memory.py,sha256=pAcKkVd7jlPS6seR31agdyjx9TNIIRMIyx497XWXwbs,1955
|
|
99
|
+
camel/storages/key_value_storages/json.py,sha256=BlOhuyWbSjzKixtA5e9O0z8BFK4pi96OcPNxnFfDPQw,3471
|
|
100
|
+
camel/storages/vectordb_storages/__init__.py,sha256=hEhPyCPlzyXUsDFDzKRdLBj09rO1b5bsn76AJrDcaG4,1076
|
|
101
|
+
camel/storages/vectordb_storages/base.py,sha256=BGINA2TWqLu2IYFgAKwWDFVb0A1q27WjF_5XYPtyFP0,6001
|
|
102
|
+
camel/storages/vectordb_storages/milvus.py,sha256=09YariTfaXLLwRipb5SQ5ocz8trigAoN2e8iu0ejcs8,13589
|
|
103
|
+
camel/storages/vectordb_storages/qdrant.py,sha256=fnAPhWubLWnMa7eNTmK13gLNC2j6jnP1OF_OCHZoDzE,13618
|
|
104
|
+
camel/terminators/__init__.py,sha256=pE7fcfDUNngdbm1BhzSQPRMXNbdd28rl9YbF4gKWwXE,997
|
|
105
|
+
camel/terminators/base.py,sha256=TSkl3maNEsdjyAniJaSgFfD4UF8RQ1LwNIiGw0dN8Gg,1396
|
|
106
|
+
camel/terminators/response_terminator.py,sha256=zcXuigbvlclUoBv4xcVbfU36ZohUT1RhI-rSnukloUY,4951
|
|
107
|
+
camel/terminators/token_limit_terminator.py,sha256=mK30wVUnoqNAvIo-wxkqY5gUSNay2M04rsAktKqoiOI,2087
|
|
108
|
+
camel/toolkits/__init__.py,sha256=2-z9eGt53U6_1uwMtiu0-GgU7k5iFkS3HEMXuB3Qs2A,836
|
|
109
|
+
camel/toolkits/base.py,sha256=znjnZtgxA5gbT7OMnrKQF_a9FK3A7Xk5s_lP94u76vI,923
|
|
110
|
+
camel/toolkits/github_toolkit.py,sha256=E1QljXDQFzN8pv4q6eiX9_Hzqe_VaOZlKcm1QCNKu3g,8822
|
|
111
|
+
camel/types/__init__.py,sha256=fnl0QojBD7yULxSWDyfEYkkHjBu0L8D_fXolq764DVc,1902
|
|
112
|
+
camel/types/enums.py,sha256=b7gK0O64bo63ejPY6m2TxHpAEuOTdsKH72cw8yMEry4,8302
|
|
113
|
+
camel/types/openai_types.py,sha256=BNQ6iCzKTjSvgcXFsAFIgrUS_YUFZBU6bDoyAp387hI,2045
|
|
114
|
+
camel/utils/__init__.py,sha256=d1AXtotuw9i0c61HRuhM-c4zqfMracoYoyZAGiL5Bcs,1616
|
|
115
|
+
camel/utils/commons.py,sha256=sK7DfG7CUZrcxrEnTztN-UQsZ34SxPRIxzs42e0AoIo,9930
|
|
116
|
+
camel/utils/token_counting.py,sha256=2tLoQAOSF_0VewmF3cKXoRvQ_RJ2iZbjjpCPZxdx07k,12674
|
|
117
|
+
camel_ai-0.1.4.dist-info/METADATA,sha256=YaKzgZss9LPDrOu_ENRe85E-xY0OM3SaFKv32fazMjk,21185
|
|
118
|
+
camel_ai-0.1.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
119
|
+
camel_ai-0.1.4.dist-info/RECORD,,
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# =========== Copyright 2023 @ 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 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
|
-
from abc import ABC, abstractmethod
|
|
15
|
-
from typing import List, Tuple
|
|
16
|
-
|
|
17
|
-
from camel.memories import ContextRecord
|
|
18
|
-
from camel.messages import OpenAIMessage
|
|
19
|
-
from camel.utils import BaseTokenCounter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class BaseContextCreator(ABC):
|
|
23
|
-
r"""An abstract base class defining the interface for context creation
|
|
24
|
-
strategies.
|
|
25
|
-
|
|
26
|
-
This class provides a foundational structure for different strategies to
|
|
27
|
-
generate conversational context from a list of context records. The
|
|
28
|
-
primary goal is to create a context that is aligned with a specified token
|
|
29
|
-
count limit, allowing subclasses to define their specific approach.
|
|
30
|
-
|
|
31
|
-
Subclasses should implement the `token_counter`, `token_limit`, and
|
|
32
|
-
`create_context` methods to provide specific context creation logic.
|
|
33
|
-
|
|
34
|
-
Attributes:
|
|
35
|
-
token_counter (BaseTokenCounter): A token counter instance responsible
|
|
36
|
-
for counting tokens in a message.
|
|
37
|
-
token_limit (int): The maximum number of tokens allowed in the
|
|
38
|
-
generated context.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
@abstractmethod
|
|
43
|
-
def token_counter(self) -> BaseTokenCounter:
|
|
44
|
-
pass
|
|
45
|
-
|
|
46
|
-
@property
|
|
47
|
-
@abstractmethod
|
|
48
|
-
def token_limit(self) -> int:
|
|
49
|
-
pass
|
|
50
|
-
|
|
51
|
-
@abstractmethod
|
|
52
|
-
def create_context(
|
|
53
|
-
self,
|
|
54
|
-
records: List[ContextRecord],
|
|
55
|
-
) -> Tuple[List[OpenAIMessage], int]:
|
|
56
|
-
r"""An abstract method to create conversational context from the chat
|
|
57
|
-
history.
|
|
58
|
-
|
|
59
|
-
Constructs the context from provided records. The specifics of how this
|
|
60
|
-
is done and how the token count is managed should be provided by
|
|
61
|
-
subclasses implementing this method. The the output messages order
|
|
62
|
-
should keep same as the input order.
|
|
63
|
-
|
|
64
|
-
Args:
|
|
65
|
-
records (List[ContextRecord]): A list of context records from
|
|
66
|
-
which to generate the context.
|
|
67
|
-
|
|
68
|
-
Returns:
|
|
69
|
-
Tuple[List[OpenAIMessage], int]: A tuple containing the constructed
|
|
70
|
-
context in OpenAIMessage format and the total token count.
|
|
71
|
-
"""
|
|
72
|
-
pass
|
camel_ai-0.1.1.dist-info/RECORD
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
camel/__init__.py,sha256=npVuV2hbipntfiNEuiTNH-1n3SNZ_ZsO79FoNanuscY,991
|
|
2
|
-
camel/agents/__init__.py,sha256=PX0mqooxrfYsYqaGA30bMiFz7PGNvLlS_R_yV-2z_YU,1412
|
|
3
|
-
camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
|
|
4
|
-
camel/agents/chat_agent.py,sha256=eq0kOYCu1xWVBZMHcC_tCjZieqBD4-VDgh92YHPcNao,21214
|
|
5
|
-
camel/agents/critic_agent.py,sha256=hEAzHw9ZmM5SNOsY3qBz8lzaV6ki7j5YxdrBENbbvrE,7303
|
|
6
|
-
camel/agents/embodied_agent.py,sha256=4xIgJSp0X35vq1ckQOYOfY_G1sm27gcsfpE36oQU20E,5847
|
|
7
|
-
camel/agents/role_assignment_agent.py,sha256=BiAQYunjQEm6zsPRTQj5nN4SaXumIPfWyQL4m9O0qlo,4755
|
|
8
|
-
camel/agents/task_agent.py,sha256=trx5jc27veMxIg8eFAl4Z5nErqw6Yis08ZIWM0PIpN8,14785
|
|
9
|
-
camel/agents/tool_agents/__init__.py,sha256=ulTNWU2qoFGe3pvVmCq_sdfeSX3NKZ0due66TYvsL-M,862
|
|
10
|
-
camel/agents/tool_agents/base.py,sha256=derH3sS0seYViuLaci7OT6ACnsXJ_iPi1dxpWLtljzo,1400
|
|
11
|
-
camel/agents/tool_agents/hugging_face_tool_agent.py,sha256=HEs7eLcfKjRxp5w4aDyLGKZVFWY9IKYAnSGBKTKut-w,8691
|
|
12
|
-
camel/configs.py,sha256=SOz-N09ffOcIEUrjL_fZTIgtrbS5Q7a6pEsj7W-L4NM,7440
|
|
13
|
-
camel/embeddings/__init__.py,sha256=zPLJAYf6aBh4VK7GE3_f1FMLM8oxvC0Mh9UvQwjQRoA,845
|
|
14
|
-
camel/embeddings/base.py,sha256=asXZ_VYMf3UkhrsLFKzoPNf1XCP5W30n7nmt5XpB4Gg,2166
|
|
15
|
-
camel/embeddings/openai_embedding.py,sha256=3WfHlzNO77l8DPACLEknKjhZIHvGN3bV5JoTAYH4jO8,2583
|
|
16
|
-
camel/functions/__init__.py,sha256=CkJb-dPAF_RCzuTE7-oO7vWRhp_Sdgz11NqkjiD76FI,1061
|
|
17
|
-
camel/functions/base_io_functions.py,sha256=Yxdy6uenhyuXPJUq0sYNHXjz2yxuYYKKDq2CS785_Eg,8619
|
|
18
|
-
camel/functions/math_functions.py,sha256=f8eFp02GrFSeKUB7ypmpvx8xnxpXR81hQ33S1RKQjSQ,1712
|
|
19
|
-
camel/functions/openai_function.py,sha256=DXEB1yFlBmvblNebtLYNErSUyUEviOM5aHULml_5Ef0,3699
|
|
20
|
-
camel/functions/search_functions.py,sha256=2NycgwRqraU_hVELysMN6ooPRs7-s1IcrKmfWxUKSCg,10601
|
|
21
|
-
camel/functions/unstructured_io_fuctions.py,sha256=oPQknC3KqxTV1e0AZYPiNW5YYnc4etO14pLGJB8dJo8,23865
|
|
22
|
-
camel/functions/weather_functions.py,sha256=WDhFlRPcUFQK4eRv7fmz_2ZWFi7j0aLjodikM3AkZbg,5731
|
|
23
|
-
camel/generators.py,sha256=VSeF3Ub60fJU__1NF9gKY4o2zKUZ5-162SjBQHKINZ8,10132
|
|
24
|
-
camel/human.py,sha256=FvlGfOO7cTDGChF-IKyonf5fmD8zqxEEeeQ5SEbBsjc,4922
|
|
25
|
-
camel/memories/__init__.py,sha256=6C0Jpat5vXDjN9DrbbQRCEafHEf2I_DMkmDeszK3wus,1116
|
|
26
|
-
camel/memories/base.py,sha256=CXjjEaFvCqBjADlTKWNx_WqpZf7n-2rhMv1re87vGHE,3026
|
|
27
|
-
camel/memories/chat_history_memory.py,sha256=hzLjA1YrvbQMhZ2HfofJWVtJN-1lTkzvssUBAOGm3HU,4821
|
|
28
|
-
camel/memories/context_creators/__init__.py,sha256=SzGpby1l8zLgkpXXrysXt4Mf-ykmrAHnvp2BWzNBbuY,858
|
|
29
|
-
camel/memories/context_creators/base.py,sha256=_mXCA8_zsItkMNKijoZhF1HU1R2hxQeQqxvW4eF5jTI,2743
|
|
30
|
-
camel/memories/context_creators/score_based.py,sha256=mpGVUUumL6Q2Mx73a77t7WqB6VxwiOp7cHAfrCatGz8,5065
|
|
31
|
-
camel/memories/records.py,sha256=ZYxai8_YbX2wRGaqF-KjBPD4mN479a4iZIH2yiR-hig,3618
|
|
32
|
-
camel/messages/__init__.py,sha256=xdg847kZH0ybo8Ue0Hafdxmdevz0xg7r9ET2Tbjy9IY,1468
|
|
33
|
-
camel/messages/base.py,sha256=2XQBCoKFdjQ-ASgtotcBnQGcvxwaGLYr0wPuDQud1pE,7872
|
|
34
|
-
camel/messages/func_message.py,sha256=nus7RHB055ygSlraLFtEhDLBLxtnL1PhIbdE94YfI98,3809
|
|
35
|
-
camel/models/__init__.py,sha256=PXumsv1-lURUMSsDNFQTtZTWshC2LRoOs6Duwjf3bxI,1026
|
|
36
|
-
camel/models/base_model.py,sha256=_2GnBwhXVoxb1r32sDbAar8FBtcPK_XRmSOUl2soZCU,3703
|
|
37
|
-
camel/models/model_factory.py,sha256=W-KAO0MoEGyQPUNKOHs_gReAEOp4IXNETVuu8tUaa3U,2007
|
|
38
|
-
camel/models/open_source_model.py,sha256=NW9cF6ustrjW7hoqGCYO3xRHe9Np7f-A8eafOUbp7fk,5702
|
|
39
|
-
camel/models/openai_model.py,sha256=35bYVX-tknwGdxqw6RAxRv2fnmvfsx0eEEqMo5wWtU4,3902
|
|
40
|
-
camel/models/stub_model.py,sha256=vm79L-hYy6SI3y_Y1XLx6vojkICrRwU4s684FCjksF0,3520
|
|
41
|
-
camel/prompts/__init__.py,sha256=ZzZW1Tlo5ALUansPrb6kJbGLwnBU9xB7ltqb5LgM_k8,1679
|
|
42
|
-
camel/prompts/ai_society.py,sha256=SVMDDgUC4RMcSixFD2KImsOfW2prWv0M-9QxAd_eEug,6226
|
|
43
|
-
camel/prompts/base.py,sha256=uLXK7S4kCFCU3gaq45pxTzzUhHvtOwpWhuMDFXzrMio,8272
|
|
44
|
-
camel/prompts/code.py,sha256=5LTlIzPHMtzDHSER5VDNrpsfxjBr8tAl75nV2ARrceQ,5784
|
|
45
|
-
camel/prompts/evaluation.py,sha256=2PCf1g47RdkJ1dlLCFlFsacQmtqNso97QHWEq9xbypA,1556
|
|
46
|
-
camel/prompts/misalignment.py,sha256=_mS07PnIIVikcrmbmJRQZaCIe3npap3NemOSx2yIEFo,4478
|
|
47
|
-
camel/prompts/prompt_templates.py,sha256=O3XcQT_vMJ3DCOelg03OH6uotFMS1P0mMkfPJctJVjw,4074
|
|
48
|
-
camel/prompts/role_description_prompt_template.py,sha256=qo8alwzCYDyGjoL_DUhu06el_ukYgedBMTerfARThYY,2499
|
|
49
|
-
camel/prompts/solution_extraction.py,sha256=SHfJEaZ6Ugknp3KodmdMUrmxuz3C2csTw90LoxkZ38Y,2068
|
|
50
|
-
camel/prompts/task_prompt_template.py,sha256=zNVYJ3xHdoZWXX8jm6Qd1xcJNsbSooOD6OALLpd0n0E,2197
|
|
51
|
-
camel/prompts/translation.py,sha256=DCQdjPHriaDm13LsKdPqWmpjPn8S8wZCu68OgsHLbxo,1861
|
|
52
|
-
camel/responses/__init__.py,sha256=edtTQskOgq5obyITziRFL62HTJP9sAikAtP9vrFacEQ,795
|
|
53
|
-
camel/responses/agent_responses.py,sha256=0wNmd9MkIbdvZzKUey_RI2OKfAnFUytnSSBJTdKvNN4,1698
|
|
54
|
-
camel/societies/__init__.py,sha256=HT6Gomxg5Rt03mUMvSDbdZtB1fAEpj7I9-ZAkRj9Jco,832
|
|
55
|
-
camel/societies/babyagi_playing.py,sha256=Pf4_F_aQS4AcTNS9Rv9EDwGguGyWyLmceakLWZ3J4IA,11768
|
|
56
|
-
camel/societies/role_playing.py,sha256=_VFnuPP7wfC3u3-RsdnX34qFxhXzruzaflC-upGUkx8,21327
|
|
57
|
-
camel/storages/__init__.py,sha256=ykzsUd2GL33MuwsjWaaK1JwBNpOm2qfKXYwx72G81E0,973
|
|
58
|
-
camel/storages/key_value_storages/__init__.py,sha256=lZOFtqj1iTQ9pRB4DkCYSMyPwEwaJDVzU06kM5jxFd4,916
|
|
59
|
-
camel/storages/key_value_storages/base.py,sha256=YqBFEU1IFYkpleHfLvK-sLFIWj7DgWn1t4KSsQzThks,2192
|
|
60
|
-
camel/storages/key_value_storages/in_memory.py,sha256=DRHSf_qGCcXAGDtI7nO0GMTewxxZWKrP3BZ9CgkwZfY,1964
|
|
61
|
-
camel/storages/key_value_storages/json.py,sha256=vgTr4gjFzaZceOZVd-ZHw7mht87uTXZXCBaYeY2FQ9I,3482
|
|
62
|
-
camel/terminators/__init__.py,sha256=CMOw8F8pdfUDzTl0SeeNpyOQgM_I0hAG95eouhCN0AY,997
|
|
63
|
-
camel/terminators/base.py,sha256=9ZI4pzQxWw1VmfXUCT9hwW0M64YVfo_ORMLMTq6G5Jk,1397
|
|
64
|
-
camel/terminators/response_terminator.py,sha256=IULccJ5bGfbkn3yMWD7enHM3xwlDfCWF8CZF9MKgxWQ,4910
|
|
65
|
-
camel/terminators/token_limit_terminator.py,sha256=fQAxKXVA4uc2H5ekovOm8gEAHlW5CpVutXwuIIORd2A,2065
|
|
66
|
-
camel/types/__init__.py,sha256=qpQU0gEOeNFZacjPd-ZJn2LJCPAUzVpSwfit2fA-Tgg,1656
|
|
67
|
-
camel/types/enums.py,sha256=KPKb45vR6WfDYANp0UTSK7m-pBbrm5VbPvIXnzc8MvU,5460
|
|
68
|
-
camel/types/openai_types.py,sha256=0jdELjDh4igCWNoyOQ2F3fTfnWeI5gXwNR0PVWM3ECk,2045
|
|
69
|
-
camel/utils/__init__.py,sha256=0dmETCrosrdVyFRqnbrlPd3AsUW_8SqPO8ho1NXX_Us,1490
|
|
70
|
-
camel/utils/commons.py,sha256=lWU1_D75e2ffEHXPI1_KfS0HWR2w3FC_uDhPPkqFS1w,7105
|
|
71
|
-
camel/utils/python_interpreter.py,sha256=mwG5IYh7EeF7cNP8WOqOpxH3l_j4rw-SL9v-Cv0RD2Q,18989
|
|
72
|
-
camel/utils/token_counting.py,sha256=ItoIxeAQl1gTDjPE1q8_8v5PAvvu3O6YK2zkD66HH0M,8061
|
|
73
|
-
camel_ai-0.1.1.dist-info/METADATA,sha256=e9I3e5_mJ146J8LoWwKEhFnymDAE2hdfpjvpci17RWs,18492
|
|
74
|
-
camel_ai-0.1.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
75
|
-
camel_ai-0.1.1.dist-info/RECORD,,
|