camel-ai 0.2.21__py3-none-any.whl → 0.2.22__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/datagen/self_instruct/self_instruct.py +1 -1
- camel/embeddings/openai_embedding.py +10 -1
- camel/interpreters/docker/Dockerfile +12 -0
- camel/interpreters/docker_interpreter.py +19 -1
- camel/interpreters/subprocess_interpreter.py +42 -17
- camel/loaders/__init__.py +2 -0
- camel/loaders/mineru_extractor.py +250 -0
- camel/models/base_model.py +54 -1
- camel/models/deepseek_model.py +0 -18
- camel/toolkits/__init__.py +5 -2
- camel/toolkits/mineru_toolkit.py +178 -0
- camel/toolkits/sympy_toolkit.py +38 -0
- {camel_ai-0.2.21.dist-info → camel_ai-0.2.22.dist-info}/METADATA +1 -2
- {camel_ai-0.2.21.dist-info → camel_ai-0.2.22.dist-info}/RECORD +17 -14
- {camel_ai-0.2.21.dist-info → camel_ai-0.2.22.dist-info}/WHEEL +1 -1
- {camel_ai-0.2.21.dist-info → camel_ai-0.2.22.dist-info}/LICENSE +0 -0
camel/__init__.py
CHANGED
|
@@ -361,7 +361,7 @@ class SelfInstructPipeline:
|
|
|
361
361
|
in JSON format.
|
|
362
362
|
"""
|
|
363
363
|
with open(self.data_output_path, 'w') as f:
|
|
364
|
-
json.dump(self.machine_tasks, f, indent=4)
|
|
364
|
+
json.dump(self.machine_tasks, f, indent=4, ensure_ascii=False)
|
|
365
365
|
|
|
366
366
|
def generate(self):
|
|
367
367
|
r"""Execute the entire pipeline to generate machine instructions
|
|
@@ -30,6 +30,8 @@ class OpenAIEmbedding(BaseEmbedding[str]):
|
|
|
30
30
|
model_type (EmbeddingModelType, optional): The model type to be
|
|
31
31
|
used for text embeddings.
|
|
32
32
|
(default: :obj:`TEXT_EMBEDDING_3_SMALL`)
|
|
33
|
+
url (Optional[str], optional): The url to the OpenAI service.
|
|
34
|
+
(default: :obj:`None`)
|
|
33
35
|
api_key (str, optional): The API key for authenticating with the
|
|
34
36
|
OpenAI service. (default: :obj:`None`)
|
|
35
37
|
dimensions (int, optional): The text embedding output dimensions.
|
|
@@ -49,6 +51,7 @@ class OpenAIEmbedding(BaseEmbedding[str]):
|
|
|
49
51
|
model_type: EmbeddingModelType = (
|
|
50
52
|
EmbeddingModelType.TEXT_EMBEDDING_3_SMALL
|
|
51
53
|
),
|
|
54
|
+
url: str | None = None,
|
|
52
55
|
api_key: str | None = None,
|
|
53
56
|
dimensions: int | NotGiven = NOT_GIVEN,
|
|
54
57
|
) -> None:
|
|
@@ -61,7 +64,13 @@ class OpenAIEmbedding(BaseEmbedding[str]):
|
|
|
61
64
|
assert isinstance(dimensions, int)
|
|
62
65
|
self.output_dim = dimensions
|
|
63
66
|
self._api_key = api_key or os.environ.get("OPENAI_API_KEY")
|
|
64
|
-
self.
|
|
67
|
+
self._url = url or os.environ.get("OPENAI_API_BASE_URL")
|
|
68
|
+
self.client = OpenAI(
|
|
69
|
+
timeout=180,
|
|
70
|
+
max_retries=3,
|
|
71
|
+
base_url=self._url,
|
|
72
|
+
api_key=self._api_key,
|
|
73
|
+
)
|
|
65
74
|
|
|
66
75
|
def embed_list(
|
|
67
76
|
self,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
FROM python:3.9-slim
|
|
2
|
+
|
|
3
|
+
# Install R and required dependencies
|
|
4
|
+
RUN apt-get update && apt-get install -y \
|
|
5
|
+
r-base \
|
|
6
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
7
|
+
|
|
8
|
+
# Set working directory
|
|
9
|
+
WORKDIR /workspace
|
|
10
|
+
|
|
11
|
+
# Keep container running
|
|
12
|
+
CMD ["tail", "-f", "/dev/null"]
|
|
@@ -52,11 +52,13 @@ class DockerInterpreter(BaseInterpreter):
|
|
|
52
52
|
_CODE_EXECUTE_CMD_MAPPING: ClassVar[Dict[str, str]] = {
|
|
53
53
|
"python": "python {file_name}",
|
|
54
54
|
"bash": "bash {file_name}",
|
|
55
|
+
"r": "Rscript {file_name}",
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
_CODE_EXTENSION_MAPPING: ClassVar[Dict[str, str]] = {
|
|
58
59
|
"python": "py",
|
|
59
60
|
"bash": "sh",
|
|
61
|
+
"r": "R",
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
_CODE_TYPE_MAPPING: ClassVar[Dict[str, str]] = {
|
|
@@ -67,6 +69,8 @@ class DockerInterpreter(BaseInterpreter):
|
|
|
67
69
|
"shell": "bash",
|
|
68
70
|
"bash": "bash",
|
|
69
71
|
"sh": "bash",
|
|
72
|
+
"r": "r",
|
|
73
|
+
"R": "r",
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
def __init__(
|
|
@@ -104,8 +108,22 @@ class DockerInterpreter(BaseInterpreter):
|
|
|
104
108
|
import docker
|
|
105
109
|
|
|
106
110
|
client = docker.from_env()
|
|
111
|
+
|
|
112
|
+
# Build custom image with Python and R
|
|
113
|
+
dockerfile_path = Path(__file__).parent / "docker"
|
|
114
|
+
image_tag = "camel-interpreter:latest"
|
|
115
|
+
try:
|
|
116
|
+
client.images.get(image_tag)
|
|
117
|
+
except docker.errors.ImageNotFound:
|
|
118
|
+
logger.info("Building custom interpreter image...")
|
|
119
|
+
client.images.build(
|
|
120
|
+
path=str(dockerfile_path),
|
|
121
|
+
tag=image_tag,
|
|
122
|
+
rm=True,
|
|
123
|
+
)
|
|
124
|
+
|
|
107
125
|
self._container = client.containers.run(
|
|
108
|
-
|
|
126
|
+
image_tag,
|
|
109
127
|
detach=True,
|
|
110
128
|
name=f"camel-interpreter-{uuid.uuid4()}",
|
|
111
129
|
command="tail -f /dev/null",
|
|
@@ -48,11 +48,13 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
48
48
|
_CODE_EXECUTE_CMD_MAPPING: ClassVar[Dict[str, str]] = {
|
|
49
49
|
"python": "python {file_name}",
|
|
50
50
|
"bash": "bash {file_name}",
|
|
51
|
+
"r": "Rscript {file_name}",
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
_CODE_EXTENSION_MAPPING: ClassVar[Dict[str, str]] = {
|
|
54
55
|
"python": "py",
|
|
55
56
|
"bash": "sh",
|
|
57
|
+
"r": "R",
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
_CODE_TYPE_MAPPING: ClassVar[Dict[str, str]] = {
|
|
@@ -63,6 +65,8 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
63
65
|
"shell": "bash",
|
|
64
66
|
"bash": "bash",
|
|
65
67
|
"sh": "bash",
|
|
68
|
+
"r": "r",
|
|
69
|
+
"R": "r",
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
def __init__(
|
|
@@ -98,7 +102,7 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
98
102
|
if not file.is_file():
|
|
99
103
|
raise RuntimeError(f"{file} is not a file.")
|
|
100
104
|
code_type = self._check_code_type(code_type)
|
|
101
|
-
if code_type == "python":
|
|
105
|
+
if self._CODE_TYPE_MAPPING[code_type] == "python":
|
|
102
106
|
# For Python code, use ast to analyze and modify the code
|
|
103
107
|
import ast
|
|
104
108
|
|
|
@@ -113,23 +117,41 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
113
117
|
# Get the last node
|
|
114
118
|
if tree.body:
|
|
115
119
|
last_node = tree.body[-1]
|
|
116
|
-
#
|
|
120
|
+
# Handle expressions that would normally not produce output
|
|
121
|
+
# For example: In a REPL, typing '1 + 2' should show '3'
|
|
122
|
+
|
|
117
123
|
if isinstance(last_node, ast.Expr):
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
# Only wrap in print(repr()) if it's not already a
|
|
125
|
+
# print call
|
|
126
|
+
if not (
|
|
127
|
+
isinstance(last_node.value, ast.Call)
|
|
128
|
+
and isinstance(last_node.value.func, ast.Name)
|
|
129
|
+
and last_node.value.func.id == 'print'
|
|
130
|
+
):
|
|
131
|
+
# Transform the AST to wrap the expression in print
|
|
132
|
+
# (repr())
|
|
133
|
+
# Example transformation:
|
|
134
|
+
# Before: x + y
|
|
135
|
+
# After: print(repr(x + y))
|
|
136
|
+
tree.body[-1] = ast.Expr(
|
|
137
|
+
value=ast.Call(
|
|
138
|
+
# Create print() function call
|
|
139
|
+
func=ast.Name(id='print', ctx=ast.Load()),
|
|
140
|
+
args=[
|
|
141
|
+
ast.Call(
|
|
142
|
+
# Create repr() function call
|
|
143
|
+
func=ast.Name(
|
|
144
|
+
id='repr', ctx=ast.Load()
|
|
145
|
+
),
|
|
146
|
+
# Pass the original expression as
|
|
147
|
+
# argument to repr()
|
|
148
|
+
args=[last_node.value],
|
|
149
|
+
keywords=[],
|
|
150
|
+
)
|
|
151
|
+
],
|
|
152
|
+
keywords=[],
|
|
153
|
+
)
|
|
131
154
|
)
|
|
132
|
-
)
|
|
133
155
|
# Fix missing source locations
|
|
134
156
|
ast.fix_missing_locations(tree)
|
|
135
157
|
# Convert back to source
|
|
@@ -159,7 +181,10 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
159
181
|
return_code = proc.returncode
|
|
160
182
|
|
|
161
183
|
# Clean up temporary file if it was created
|
|
162
|
-
if
|
|
184
|
+
if (
|
|
185
|
+
self._CODE_TYPE_MAPPING[code_type] == "python"
|
|
186
|
+
and 'temp_file' in locals()
|
|
187
|
+
):
|
|
163
188
|
temp_file.unlink()
|
|
164
189
|
|
|
165
190
|
if self.print_stdout and stdout:
|
camel/loaders/__init__.py
CHANGED
|
@@ -17,6 +17,7 @@ from .base_io import File, create_file, create_file_from_raw_bytes
|
|
|
17
17
|
from .chunkr_reader import ChunkrReader
|
|
18
18
|
from .firecrawl_reader import Firecrawl
|
|
19
19
|
from .jina_url_reader import JinaURLReader
|
|
20
|
+
from .mineru_extractor import MinerU
|
|
20
21
|
from .panda_reader import PandaReader
|
|
21
22
|
from .unstructured_io import UnstructuredIO
|
|
22
23
|
|
|
@@ -30,4 +31,5 @@ __all__ = [
|
|
|
30
31
|
'Apify',
|
|
31
32
|
'ChunkrReader',
|
|
32
33
|
'PandaReader',
|
|
34
|
+
'MinerU',
|
|
33
35
|
]
|
|
@@ -0,0 +1,250 @@
|
|
|
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
|
+
|
|
15
|
+
import os
|
|
16
|
+
import time
|
|
17
|
+
from typing import Dict, List, Optional, Union
|
|
18
|
+
|
|
19
|
+
import requests
|
|
20
|
+
|
|
21
|
+
from camel.utils import api_keys_required
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class MinerU:
|
|
25
|
+
r"""Document extraction service supporting OCR, formula recognition
|
|
26
|
+
and tables.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
api_key (str, optional): Authentication key for MinerU API service.
|
|
30
|
+
If not provided, will use MINERU_API_KEY environment variable.
|
|
31
|
+
(default: :obj:`None`)
|
|
32
|
+
api_url (str, optional): Base URL endpoint for the MinerU API service.
|
|
33
|
+
(default: :obj:`"https://mineru.net/api/v4"`)
|
|
34
|
+
|
|
35
|
+
Note:
|
|
36
|
+
- Single file size limit: 200MB
|
|
37
|
+
- Page limit per file: 600 pages
|
|
38
|
+
- Daily high-priority parsing quota: 2000 pages
|
|
39
|
+
- Some URLs (GitHub, AWS) may timeout due to network restrictions
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
@api_keys_required(
|
|
43
|
+
[
|
|
44
|
+
("api_key", "MINERU_API_KEY"),
|
|
45
|
+
]
|
|
46
|
+
)
|
|
47
|
+
def __init__(
|
|
48
|
+
self,
|
|
49
|
+
api_key: Optional[str] = None,
|
|
50
|
+
api_url: Optional[str] = "https://mineru.net/api/v4",
|
|
51
|
+
is_ocr: bool = False,
|
|
52
|
+
enable_formula: bool = False,
|
|
53
|
+
enable_table: bool = True,
|
|
54
|
+
layout_model: str = "doclayout_yolo",
|
|
55
|
+
language: str = "en",
|
|
56
|
+
) -> None:
|
|
57
|
+
r"""Initialize MinerU extractor.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
api_key (str, optional): Authentication key for MinerU API service.
|
|
61
|
+
If not provided, will use MINERU_API_KEY environment variable.
|
|
62
|
+
api_url (str, optional): Base URL endpoint for MinerU API service.
|
|
63
|
+
(default: "https://mineru.net/api/v4")
|
|
64
|
+
is_ocr (bool, optional): Enable optical character recognition.
|
|
65
|
+
(default: :obj:`False`)
|
|
66
|
+
enable_formula (bool, optional): Enable formula recognition.
|
|
67
|
+
(default: :obj:`False`)
|
|
68
|
+
enable_table (bool, optional): Enable table detection, extraction.
|
|
69
|
+
(default: :obj:`True`)
|
|
70
|
+
layout_model (str, optional): Model for document layout detection.
|
|
71
|
+
Options are 'doclayout_yolo' or 'layoutlmv3'.
|
|
72
|
+
(default: :obj:`"doclayout_yolo"`)
|
|
73
|
+
language (str, optional): Primary language of the document.
|
|
74
|
+
(default: :obj:`"en"`)
|
|
75
|
+
"""
|
|
76
|
+
self._api_key = api_key or os.environ.get("MINERU_API_KEY")
|
|
77
|
+
self._api_url = api_url
|
|
78
|
+
self._headers = {
|
|
79
|
+
"Authorization": f"Bearer {self._api_key}",
|
|
80
|
+
"Content-Type": "application/json",
|
|
81
|
+
"Accept": "*/*",
|
|
82
|
+
}
|
|
83
|
+
self.is_ocr = is_ocr
|
|
84
|
+
self.enable_formula = enable_formula
|
|
85
|
+
self.enable_table = enable_table
|
|
86
|
+
self.layout_model = layout_model
|
|
87
|
+
self.language = language
|
|
88
|
+
|
|
89
|
+
def extract_url(self, url: str) -> Dict:
|
|
90
|
+
r"""Extract content from a URL document.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
url (str): Document URL to extract content from.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
Dict: Task identifier for tracking extraction progress.
|
|
97
|
+
"""
|
|
98
|
+
endpoint = f"{self._api_url}/extract/task"
|
|
99
|
+
payload = {"url": url}
|
|
100
|
+
|
|
101
|
+
try:
|
|
102
|
+
response = requests.post(
|
|
103
|
+
endpoint,
|
|
104
|
+
headers=self._headers,
|
|
105
|
+
json=payload,
|
|
106
|
+
)
|
|
107
|
+
response.raise_for_status()
|
|
108
|
+
return response.json()["data"]
|
|
109
|
+
except Exception as e:
|
|
110
|
+
raise RuntimeError(f"Failed to extract URL: {e}")
|
|
111
|
+
|
|
112
|
+
def batch_extract_urls(
|
|
113
|
+
self,
|
|
114
|
+
files: List[Dict[str, Union[str, bool]]],
|
|
115
|
+
) -> str:
|
|
116
|
+
r"""Extract content from multiple document URLs in batch.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
files (List[Dict[str, Union[str, bool]]]): List of document
|
|
120
|
+
configurations. Each document requires 'url' and optionally
|
|
121
|
+
'is_ocr' and 'data_id' parameters.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
str: Batch identifier for tracking extraction progress.
|
|
125
|
+
"""
|
|
126
|
+
endpoint = f"{self._api_url}/extract/task/batch"
|
|
127
|
+
payload = {"files": files}
|
|
128
|
+
|
|
129
|
+
try:
|
|
130
|
+
response = requests.post(
|
|
131
|
+
endpoint,
|
|
132
|
+
headers=self._headers,
|
|
133
|
+
json=payload,
|
|
134
|
+
)
|
|
135
|
+
response.raise_for_status()
|
|
136
|
+
return response.json()["data"]["batch_id"]
|
|
137
|
+
except Exception as e:
|
|
138
|
+
raise RuntimeError(f"Failed to batch extract URLs: {e}")
|
|
139
|
+
|
|
140
|
+
def get_task_status(self, task_id: str) -> Dict:
|
|
141
|
+
r"""Retrieve status of a single extraction task.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
task_id (str): Unique identifier of the extraction task.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
Dict: Current task status and results if completed.
|
|
148
|
+
"""
|
|
149
|
+
endpoint = f"{self._api_url}/extract/task/{task_id}"
|
|
150
|
+
|
|
151
|
+
try:
|
|
152
|
+
response = requests.get(endpoint, headers=self._headers)
|
|
153
|
+
response.raise_for_status()
|
|
154
|
+
return response.json()["data"]
|
|
155
|
+
except Exception as e:
|
|
156
|
+
raise RuntimeError(f"Failed to get task status: {e}")
|
|
157
|
+
|
|
158
|
+
def get_batch_status(self, batch_id: str) -> Dict:
|
|
159
|
+
r"""Retrieve status of a batch extraction task.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
batch_id (str): Unique identifier of the batch extraction task.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Dict: Current status and results for all documents in the batch.
|
|
166
|
+
"""
|
|
167
|
+
endpoint = f"{self._api_url}/extract-results/batch/{batch_id}"
|
|
168
|
+
|
|
169
|
+
try:
|
|
170
|
+
response = requests.get(endpoint, headers=self._headers)
|
|
171
|
+
response.raise_for_status()
|
|
172
|
+
return response.json()["data"]
|
|
173
|
+
except Exception as e:
|
|
174
|
+
raise RuntimeError(f"Failed to get batch status: {e}")
|
|
175
|
+
|
|
176
|
+
def wait_for_completion(
|
|
177
|
+
self,
|
|
178
|
+
task_id: str,
|
|
179
|
+
is_batch: bool = False,
|
|
180
|
+
timeout: float = 100,
|
|
181
|
+
check_interval: float = 5,
|
|
182
|
+
) -> Dict:
|
|
183
|
+
r"""Monitor task until completion or timeout.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
task_id (str): Unique identifier of the task or batch.
|
|
187
|
+
is_batch (bool, optional): Indicates if task is a batch operation.
|
|
188
|
+
(default: :obj:`False`)
|
|
189
|
+
timeout (float, optional): Maximum wait time in seconds.
|
|
190
|
+
(default: :obj:`100`)
|
|
191
|
+
check_interval (float, optional): Time between status checks in
|
|
192
|
+
seconds. (default: :obj:`5`)
|
|
193
|
+
|
|
194
|
+
Returns:
|
|
195
|
+
Dict: Final task status and extraction results.
|
|
196
|
+
|
|
197
|
+
Raises:
|
|
198
|
+
TimeoutError: If task exceeds specified timeout duration.
|
|
199
|
+
RuntimeError: If task fails or encounters processing error.
|
|
200
|
+
"""
|
|
201
|
+
start_time = time.time()
|
|
202
|
+
while True:
|
|
203
|
+
if time.time() - start_time > timeout:
|
|
204
|
+
raise TimeoutError(
|
|
205
|
+
f"Task {task_id} timed out after {timeout}s"
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
try:
|
|
209
|
+
status = (
|
|
210
|
+
self.get_batch_status(task_id)
|
|
211
|
+
if is_batch
|
|
212
|
+
else self.get_task_status(task_id)
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
if is_batch:
|
|
216
|
+
# Check batch status
|
|
217
|
+
all_done = True
|
|
218
|
+
failed_tasks = []
|
|
219
|
+
for result in status.get('extract_result', []):
|
|
220
|
+
if result.get('state') == 'failed':
|
|
221
|
+
failed_tasks.append(
|
|
222
|
+
f"{result.get('data_id')}:"
|
|
223
|
+
f" {result.get('err_msg')}"
|
|
224
|
+
)
|
|
225
|
+
elif result.get('state') != 'done':
|
|
226
|
+
all_done = False
|
|
227
|
+
break
|
|
228
|
+
|
|
229
|
+
if failed_tasks:
|
|
230
|
+
raise RuntimeError(
|
|
231
|
+
f"Batch tasks failed: {'; '.join(failed_tasks)}"
|
|
232
|
+
)
|
|
233
|
+
if all_done:
|
|
234
|
+
return status
|
|
235
|
+
else:
|
|
236
|
+
# Check single task status
|
|
237
|
+
state = status.get('state')
|
|
238
|
+
if state == 'failed':
|
|
239
|
+
raise RuntimeError(
|
|
240
|
+
f"Task failed: {status.get('err_msg')}"
|
|
241
|
+
)
|
|
242
|
+
elif state == 'done':
|
|
243
|
+
return status
|
|
244
|
+
|
|
245
|
+
except Exception as e:
|
|
246
|
+
if not isinstance(e, RuntimeError):
|
|
247
|
+
raise RuntimeError(f"Error checking status: {e}")
|
|
248
|
+
raise
|
|
249
|
+
|
|
250
|
+
time.sleep(check_interval)
|
camel/models/base_model.py
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
# See the License for the specific language governing permissions and
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
|
+
import abc
|
|
15
|
+
import re
|
|
14
16
|
from abc import ABC, abstractmethod
|
|
15
17
|
from typing import Any, Dict, List, Optional, Union
|
|
16
18
|
|
|
@@ -27,7 +29,30 @@ from camel.types import (
|
|
|
27
29
|
from camel.utils import BaseTokenCounter
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
class
|
|
32
|
+
class ModelBackendMeta(abc.ABCMeta):
|
|
33
|
+
r"""Metaclass that automatically preprocesses messages in run method.
|
|
34
|
+
|
|
35
|
+
Automatically wraps the run method of any class inheriting from
|
|
36
|
+
BaseModelBackend to preprocess messages (remove <think> tags) before they
|
|
37
|
+
are sent to the model.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __new__(mcs, name, bases, namespace):
|
|
41
|
+
r"""Wraps run method with preprocessing if it exists in the class."""
|
|
42
|
+
if 'run' in namespace:
|
|
43
|
+
original_run = namespace['run']
|
|
44
|
+
|
|
45
|
+
def wrapped_run(
|
|
46
|
+
self, messages: List[OpenAIMessage], *args, **kwargs
|
|
47
|
+
):
|
|
48
|
+
messages = self.preprocess_messages(messages)
|
|
49
|
+
return original_run(self, messages, *args, **kwargs)
|
|
50
|
+
|
|
51
|
+
namespace['run'] = wrapped_run
|
|
52
|
+
return super().__new__(mcs, name, bases, namespace)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class BaseModelBackend(ABC, metaclass=ModelBackendMeta):
|
|
31
56
|
r"""Base class for different model backends.
|
|
32
57
|
It may be OpenAI API, a local LLM, a stub for unit tests, etc.
|
|
33
58
|
|
|
@@ -73,6 +98,34 @@ class BaseModelBackend(ABC):
|
|
|
73
98
|
"""
|
|
74
99
|
pass
|
|
75
100
|
|
|
101
|
+
def preprocess_messages(
|
|
102
|
+
self, messages: List[OpenAIMessage]
|
|
103
|
+
) -> List[OpenAIMessage]:
|
|
104
|
+
r"""Preprocess messages before sending to model API.
|
|
105
|
+
Removes thinking content and other model-specific preprocessing.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
messages (List[OpenAIMessage]): Original messages
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
List[OpenAIMessage]: Preprocessed messages
|
|
112
|
+
"""
|
|
113
|
+
# Remove thinking content from messages before sending to API
|
|
114
|
+
# This ensures only the final response is sent, excluding
|
|
115
|
+
# intermediate thought processes
|
|
116
|
+
return [
|
|
117
|
+
{ # type: ignore[misc]
|
|
118
|
+
**msg,
|
|
119
|
+
'content': re.sub(
|
|
120
|
+
r'<think>.*?</think>',
|
|
121
|
+
'',
|
|
122
|
+
msg['content'], # type: ignore[arg-type]
|
|
123
|
+
flags=re.DOTALL,
|
|
124
|
+
).strip(),
|
|
125
|
+
}
|
|
126
|
+
for msg in messages
|
|
127
|
+
]
|
|
128
|
+
|
|
76
129
|
@abstractmethod
|
|
77
130
|
def run(
|
|
78
131
|
self,
|
camel/models/deepseek_model.py
CHANGED
|
@@ -118,8 +118,6 @@ class DeepSeekModel(BaseModelBackend):
|
|
|
118
118
|
if self.model_type in [
|
|
119
119
|
ModelType.DEEPSEEK_REASONER,
|
|
120
120
|
]:
|
|
121
|
-
import re
|
|
122
|
-
|
|
123
121
|
logger.warning(
|
|
124
122
|
"You are using a DeepSeek Reasoner model, "
|
|
125
123
|
"which has certain limitations, reference: "
|
|
@@ -141,22 +139,6 @@ class DeepSeekModel(BaseModelBackend):
|
|
|
141
139
|
if key in self.model_config_dict:
|
|
142
140
|
del self.model_config_dict[key]
|
|
143
141
|
|
|
144
|
-
# Remove thinking content from messages before sending to API
|
|
145
|
-
# This ensures only the final response is sent, excluding
|
|
146
|
-
# intermediate thought processes
|
|
147
|
-
messages = [
|
|
148
|
-
{ # type: ignore[misc]
|
|
149
|
-
**msg,
|
|
150
|
-
'content': re.sub(
|
|
151
|
-
r'<think>.*?</think>',
|
|
152
|
-
'',
|
|
153
|
-
msg['content'], # type: ignore[arg-type]
|
|
154
|
-
flags=re.DOTALL,
|
|
155
|
-
).strip(),
|
|
156
|
-
}
|
|
157
|
-
for msg in messages
|
|
158
|
-
]
|
|
159
|
-
|
|
160
142
|
response = self._client.chat.completions.create(
|
|
161
143
|
messages=messages,
|
|
162
144
|
model=self.model_type,
|
camel/toolkits/__init__.py
CHANGED
|
@@ -45,8 +45,10 @@ from .human_toolkit import HumanToolkit
|
|
|
45
45
|
from .stripe_toolkit import StripeToolkit
|
|
46
46
|
from .video_toolkit import VideoDownloaderToolkit
|
|
47
47
|
from .dappier_toolkit import DappierToolkit
|
|
48
|
-
from .sympy_toolkit import SymPyToolkit
|
|
49
48
|
from .semantic_scholar_toolkit import SemanticScholarToolkit
|
|
49
|
+
from .sympy_toolkit import SymPyToolkit
|
|
50
|
+
from .mineru_toolkit import MinerUToolkit
|
|
51
|
+
|
|
50
52
|
|
|
51
53
|
__all__ = [
|
|
52
54
|
'BaseToolkit',
|
|
@@ -79,6 +81,7 @@ __all__ = [
|
|
|
79
81
|
'MeshyToolkit',
|
|
80
82
|
'OpenBBToolkit',
|
|
81
83
|
'DappierToolkit',
|
|
82
|
-
'SymPyToolkit',
|
|
83
84
|
'SemanticScholarToolkit',
|
|
85
|
+
'SymPyToolkit',
|
|
86
|
+
'MinerUToolkit',
|
|
84
87
|
]
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
|
|
15
|
+
from typing import Dict, List, Optional
|
|
16
|
+
|
|
17
|
+
from camel.loaders.mineru_extractor import MinerU
|
|
18
|
+
from camel.toolkits.base import BaseToolkit
|
|
19
|
+
from camel.toolkits.function_tool import FunctionTool
|
|
20
|
+
from camel.utils import api_keys_required
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class MinerUToolkit(BaseToolkit):
|
|
24
|
+
r"""Toolkit for extracting and processing document content
|
|
25
|
+
using MinerU API.
|
|
26
|
+
|
|
27
|
+
Provides comprehensive document processing capabilities including content
|
|
28
|
+
extraction from URLs and files, with support for OCR, formula recognition,
|
|
29
|
+
and table detection through the MinerU API service.
|
|
30
|
+
|
|
31
|
+
Note:
|
|
32
|
+
- Maximum file size: 200MB per file
|
|
33
|
+
- Maximum pages: 600 pages per file
|
|
34
|
+
- Daily quota: 2000 pages for high-priority parsing
|
|
35
|
+
- Network restrictions may affect certain URLs (e.g., GitHub, AWS)
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
@api_keys_required(
|
|
39
|
+
[
|
|
40
|
+
(None, "MINERU_API_KEY"),
|
|
41
|
+
]
|
|
42
|
+
)
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
api_key: Optional[str] = None,
|
|
46
|
+
api_url: Optional[str] = "https://mineru.net/api/v4",
|
|
47
|
+
is_ocr: bool = False,
|
|
48
|
+
enable_formula: bool = False,
|
|
49
|
+
enable_table: bool = True,
|
|
50
|
+
layout_model: str = "doclayout_yolo",
|
|
51
|
+
language: str = "en",
|
|
52
|
+
wait: bool = True,
|
|
53
|
+
timeout: float = 300,
|
|
54
|
+
) -> None:
|
|
55
|
+
r"""Initialize the MinerU document processing toolkit.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
api_key (Optional[str]): Authentication key for MinerU API access.
|
|
59
|
+
If not provided, uses MINERU_API_KEY environment variable.
|
|
60
|
+
(default: :obj:`None`)
|
|
61
|
+
api_url (Optional[str]): Base endpoint URL for MinerU API service.
|
|
62
|
+
(default: :obj:`"https://mineru.net/api/v4"`)
|
|
63
|
+
is_ocr (bool): Enable Optical Character Recognition for image-based
|
|
64
|
+
text extraction. (default: :obj:`False`)
|
|
65
|
+
enable_formula (bool): Enable mathematical formula detection and
|
|
66
|
+
recognition. (default: :obj:`False`)
|
|
67
|
+
enable_table (bool): Enable table structure detection and
|
|
68
|
+
extraction. (default: :obj:`True`)
|
|
69
|
+
layout_model (str): Document layout analysis model selection.
|
|
70
|
+
Available options: 'doclayout_yolo', 'layoutlmv3'.
|
|
71
|
+
(default: :obj:`"doclayout_yolo"`)
|
|
72
|
+
language (str): Primary language of the document for processing.
|
|
73
|
+
(default: :obj:`"en"`)
|
|
74
|
+
wait (bool): Block execution until processing completion.
|
|
75
|
+
(default: :obj:`True`)
|
|
76
|
+
timeout (float): Maximum duration in seconds to wait for task
|
|
77
|
+
completion. (default: :obj:`300`)
|
|
78
|
+
"""
|
|
79
|
+
self.client = MinerU(
|
|
80
|
+
api_key=api_key,
|
|
81
|
+
api_url=api_url,
|
|
82
|
+
is_ocr=is_ocr,
|
|
83
|
+
enable_formula=enable_formula,
|
|
84
|
+
enable_table=enable_table,
|
|
85
|
+
layout_model=layout_model,
|
|
86
|
+
language=language,
|
|
87
|
+
)
|
|
88
|
+
self.wait = wait
|
|
89
|
+
self.timeout = timeout
|
|
90
|
+
|
|
91
|
+
def extract_from_urls(
|
|
92
|
+
self,
|
|
93
|
+
urls: str | List[str],
|
|
94
|
+
) -> Dict:
|
|
95
|
+
r"""Process and extract content from one or multiple URLs.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
urls (str | List[str]): Target URL or list of URLs for content
|
|
99
|
+
extraction. Supports both single URL string and multiple URLs
|
|
100
|
+
in a list.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
Dict: Response containing either completed task results when wait
|
|
104
|
+
is True, or task/batch identifiers for status tracking when
|
|
105
|
+
wait is False.
|
|
106
|
+
"""
|
|
107
|
+
if isinstance(urls, str):
|
|
108
|
+
# Single URL case
|
|
109
|
+
response = self.client.extract_url(url=urls)
|
|
110
|
+
|
|
111
|
+
if self.wait:
|
|
112
|
+
return self.client.wait_for_completion(
|
|
113
|
+
response['task_id'],
|
|
114
|
+
timeout=self.timeout,
|
|
115
|
+
)
|
|
116
|
+
return response
|
|
117
|
+
else:
|
|
118
|
+
# Multiple URLs case
|
|
119
|
+
files: List[Dict[str, str | bool]] = [
|
|
120
|
+
{"url": str(url)} for url in urls
|
|
121
|
+
]
|
|
122
|
+
batch_id = self.client.batch_extract_urls(files=files)
|
|
123
|
+
|
|
124
|
+
if self.wait:
|
|
125
|
+
return self.client.wait_for_completion(
|
|
126
|
+
batch_id,
|
|
127
|
+
is_batch=True,
|
|
128
|
+
timeout=self.timeout if self.timeout > 300 else 600,
|
|
129
|
+
)
|
|
130
|
+
return {"batch_id": batch_id}
|
|
131
|
+
|
|
132
|
+
def get_task_status(self, task_id: str) -> Dict:
|
|
133
|
+
r"""Retrieve current status of an individual extraction task.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
task_id (str): Unique identifier for the extraction task to check.
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
Dict: Status information and results (if task is completed) for
|
|
140
|
+
the specified task.
|
|
141
|
+
|
|
142
|
+
Note:
|
|
143
|
+
This is a low-level status checking method. For most use cases,
|
|
144
|
+
prefer using extract_from_url with wait=True for automatic
|
|
145
|
+
completion handling.
|
|
146
|
+
"""
|
|
147
|
+
return self.client.get_task_status(task_id)
|
|
148
|
+
|
|
149
|
+
def get_batch_status(self, batch_id: str) -> Dict:
|
|
150
|
+
r"""Retrieve current status of a batch extraction task.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
batch_id (str): Unique identifier for the batch extraction task
|
|
154
|
+
to check.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
Dict: Comprehensive status information and results for all files
|
|
158
|
+
in the batch task.
|
|
159
|
+
|
|
160
|
+
Note:
|
|
161
|
+
This is a low-level status checking method. For most use cases,
|
|
162
|
+
prefer using batch_extract_from_urls with wait=True for automatic
|
|
163
|
+
completion handling.
|
|
164
|
+
"""
|
|
165
|
+
return self.client.get_batch_status(batch_id)
|
|
166
|
+
|
|
167
|
+
def get_tools(self) -> List[FunctionTool]:
|
|
168
|
+
r"""Retrieve available toolkit functions as FunctionTool objects.
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
List[FunctionTool]: Collection of FunctionTool objects representing
|
|
172
|
+
the available document processing functions in this toolkit.
|
|
173
|
+
"""
|
|
174
|
+
return [
|
|
175
|
+
FunctionTool(self.extract_from_urls),
|
|
176
|
+
FunctionTool(self.get_task_status),
|
|
177
|
+
FunctionTool(self.get_batch_status),
|
|
178
|
+
]
|
camel/toolkits/sympy_toolkit.py
CHANGED
|
@@ -721,6 +721,43 @@ class SymPyToolkit(BaseToolkit):
|
|
|
721
721
|
except Exception as e:
|
|
722
722
|
return self.handle_exception("compute_rank", e)
|
|
723
723
|
|
|
724
|
+
def compute_inner_product(
|
|
725
|
+
self, vector1: List[float], vector2: List[float]
|
|
726
|
+
) -> str:
|
|
727
|
+
r"""Computes the inner (dot) product of two vectors.
|
|
728
|
+
|
|
729
|
+
Args:
|
|
730
|
+
vector1 (List[float]): The first vector as a list of floats.
|
|
731
|
+
vector2 (List[float]): The second vector as a list of floats.
|
|
732
|
+
|
|
733
|
+
Returns:
|
|
734
|
+
str: JSON string containing the inner product in the `"result"`
|
|
735
|
+
field. If an error occurs, the JSON string will include an
|
|
736
|
+
`"error"` field with the corresponding error message.
|
|
737
|
+
|
|
738
|
+
Raises:
|
|
739
|
+
ValueError: If the vectors have different dimensions.
|
|
740
|
+
"""
|
|
741
|
+
import sympy as sp
|
|
742
|
+
|
|
743
|
+
try:
|
|
744
|
+
# Convert the lists into sympy Matrix objects (column vectors)
|
|
745
|
+
v1 = sp.Matrix(vector1)
|
|
746
|
+
v2 = sp.Matrix(vector2)
|
|
747
|
+
|
|
748
|
+
# Check that the vectors have the same dimensions.
|
|
749
|
+
if v1.shape != v2.shape:
|
|
750
|
+
raise ValueError(
|
|
751
|
+
"Vectors must have the same dimensions to compute "
|
|
752
|
+
"the inner product."
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
# Compute the dot (inner) product.
|
|
756
|
+
inner_product = v1.dot(v2)
|
|
757
|
+
return json.dumps({"result": str(inner_product)})
|
|
758
|
+
except Exception as e:
|
|
759
|
+
return self.handle_exception("compute_inner_product", e)
|
|
760
|
+
|
|
724
761
|
def handle_exception(self, func_name: str, error: Exception) -> str:
|
|
725
762
|
r"""Handles exceptions by logging and returning error details.
|
|
726
763
|
|
|
@@ -775,4 +812,5 @@ class SymPyToolkit(BaseToolkit):
|
|
|
775
812
|
FunctionTool(self.compute_eigenvectors),
|
|
776
813
|
FunctionTool(self.compute_nullspace),
|
|
777
814
|
FunctionTool(self.compute_rank),
|
|
815
|
+
FunctionTool(self.compute_inner_product),
|
|
778
816
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.22
|
|
4
4
|
Summary: Communicative Agents for AI Society Study
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: communicative-ai,ai-societies,artificial-intelligence,deep-learning,multi-agent-systems,cooperative-ai,natural-language-processing,large-language-models
|
|
@@ -91,7 +91,6 @@ Requires-Dist: pymilvus (>=2.4.0,<3.0.0) ; extra == "rag" or extra == "storage"
|
|
|
91
91
|
Requires-Dist: pyowm (>=3.3.0,<4.0.0) ; extra == "web-tools" or extra == "all"
|
|
92
92
|
Requires-Dist: pytest (>=7,<8) ; extra == "test"
|
|
93
93
|
Requires-Dist: pytest-asyncio (>=0.23.0,<0.24.0) ; extra == "test"
|
|
94
|
-
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
|
|
95
94
|
Requires-Dist: qdrant-client (>=1.9.0,<2.0.0) ; extra == "rag" or extra == "storage" or extra == "all"
|
|
96
95
|
Requires-Dist: rank-bm25 (>=0.2.2,<0.3.0) ; extra == "rag" or extra == "all"
|
|
97
96
|
Requires-Dist: redis (>=5.0.6,<6.0.0) ; extra == "storage" or extra == "all"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
camel/__init__.py,sha256=
|
|
1
|
+
camel/__init__.py,sha256=zMzBK9_6Ke7uNJPWsQiOL7N99FVfyYbf6eEIFJfZqp4,912
|
|
2
2
|
camel/agents/__init__.py,sha256=LcS4m8s97-yADfznvcaAdUe9W0E9h3m6zrSc9H6m9so,1545
|
|
3
3
|
camel/agents/base.py,sha256=c4bJYL3G3Z41SaFdMPMn8ZjLdFiFaVOFO6EQIfuCVR8,1124
|
|
4
4
|
camel/agents/chat_agent.py,sha256=mnJNJbklukwGVsDPpPwzd1z8gMeKv3_TG55rbS28NPo,56492
|
|
@@ -66,7 +66,7 @@ camel/datagen/self_instruct/filter/__init__.py,sha256=UiGBfDRYO-3Z3dhaxAFVh4F8PF
|
|
|
66
66
|
camel/datagen/self_instruct/filter/filter_function.py,sha256=-voPwP83c_bkZrSAhwludBCtfsKDFG_jlDHcNUOLV7o,6691
|
|
67
67
|
camel/datagen/self_instruct/filter/filter_registry.py,sha256=5M_aNIopBeBj7U4fUsrAQpXQ2cZT6o6GaIIo0briFw0,2125
|
|
68
68
|
camel/datagen/self_instruct/filter/instruction_filter.py,sha256=la_7P5bVdrk2qffnYFI2Ie3cjCEEHBxe4HB8PZ5jMq0,3426
|
|
69
|
-
camel/datagen/self_instruct/self_instruct.py,sha256=
|
|
69
|
+
camel/datagen/self_instruct/self_instruct.py,sha256=zcq5006W6rsVLS4uIhv0xPpLCYhknLzoVJ5Jw_O0LLQ,14096
|
|
70
70
|
camel/datagen/self_instruct/templates.py,sha256=7YMOUcIig6vLjqSwkWCq8XeRCjWq0Mfyzptn7DOmeAo,19480
|
|
71
71
|
camel/datagen/source2synth/__init__.py,sha256=Kd6BBgIPRBm_VPAbJb-V_QKYyRDcX3fTQTm2Bl0Vkpc,1056
|
|
72
72
|
camel/datagen/source2synth/data_processor.py,sha256=2_E1sS4BZNiAUMuB4ItomhU2oIFI6PwQKqDVlSv5ILc,17783
|
|
@@ -81,25 +81,27 @@ camel/embeddings/base.py,sha256=mxqFkWh2AfbxuVKPOqVx16fCznmuSh9QXGjaEeZHvoY,2190
|
|
|
81
81
|
camel/embeddings/jina_embedding.py,sha256=6aakojtsJ6KLp3nqYLhEOtoFm2shoXlRzxb1YYN_uwo,6623
|
|
82
82
|
camel/embeddings/mistral_embedding.py,sha256=JaHjcHrc4U216QfGA4NxOSLrgYB9lM19VR2mIMAkuvk,3287
|
|
83
83
|
camel/embeddings/openai_compatible_embedding.py,sha256=48T1fNUkgifoPiVHPJ7HJERekP1sENy3t07S1ENiwWk,3158
|
|
84
|
-
camel/embeddings/openai_embedding.py,sha256=
|
|
84
|
+
camel/embeddings/openai_embedding.py,sha256=9kJBKUWkjEyxtn50V4MDjuOT2syIwWEnZeEHkbqIocg,3936
|
|
85
85
|
camel/embeddings/sentence_transformers_embeddings.py,sha256=E7a8lN50CtDBsFO-NOFQ6qfCnbH41O0_kTTg7dG3sOo,2724
|
|
86
86
|
camel/embeddings/vlm_embedding.py,sha256=HZFdcz1YzkFPzMj45_jaCVmDQJyccoXN561aLWlrYmo,5497
|
|
87
87
|
camel/generators.py,sha256=JRqj9_m1PF4qT6UtybzTQ-KBT9MJQt18OAAYvQ_fr2o,13844
|
|
88
88
|
camel/human.py,sha256=9X09UmxI2JqQnhrFfnZ3B9EzFmVfdSWQcjLWTIXKXe0,4962
|
|
89
89
|
camel/interpreters/__init__.py,sha256=NOQUsg7gR84zO8nBXu4JGUatsxSDJqZS6otltjXfop4,1265
|
|
90
90
|
camel/interpreters/base.py,sha256=F026f2ZnvHwikSMbk6APYNvB9qP4Ye5quSkTbFKV3O0,1898
|
|
91
|
-
camel/interpreters/
|
|
91
|
+
camel/interpreters/docker/Dockerfile,sha256=6_k33dlpxgf8V9vfywWmjLuOgHmT2s-a8Lb8VbFRv4s,253
|
|
92
|
+
camel/interpreters/docker_interpreter.py,sha256=K4J49oc-GnMtEKbvn3wNokWgWU97-vRgSfWSNadO9LU,9249
|
|
92
93
|
camel/interpreters/e2b_interpreter.py,sha256=UC0en39x705cnnMCX4GxN7Tx0gCpu5yuWOFSBl_TagE,4815
|
|
93
94
|
camel/interpreters/internal_python_interpreter.py,sha256=9psFm8mkN5-5WdTW__VBjDoh_u-PCifJMQYeo0DEoZo,22464
|
|
94
95
|
camel/interpreters/interpreter_error.py,sha256=uEhcmHmmcajt5C9PLeHs21h1fE6cmyt23tCAGie1kTA,880
|
|
95
96
|
camel/interpreters/ipython_interpreter.py,sha256=-erOR6imuh5pUtpbUYky3zoLDr30Y5E7lm59BwwxzNs,5976
|
|
96
|
-
camel/interpreters/subprocess_interpreter.py,sha256=
|
|
97
|
-
camel/loaders/__init__.py,sha256=
|
|
97
|
+
camel/interpreters/subprocess_interpreter.py,sha256=v-JU5KstsxhgSa_cKKYiEq5jZx6fTcbfyZ013uAChts,10769
|
|
98
|
+
camel/loaders/__init__.py,sha256=AJnrCWXkD0he3uJDxs7arMGf8nFqNYz3SK0JagMEO7A,1250
|
|
98
99
|
camel/loaders/apify_reader.py,sha256=oaVjKyNhJhG-hTuIwrpZ2hsB4XTL0M-kUksgSL2R0ck,7952
|
|
99
100
|
camel/loaders/base_io.py,sha256=SAJInsmIYin45lXMSAhzWEFl7FjQ4WswqRU0D7sihRs,10170
|
|
100
101
|
camel/loaders/chunkr_reader.py,sha256=OhoJoXOjuI-XvJ4GOmiN_wB2NRQRHO4qk5PG4MHGMG0,6120
|
|
101
102
|
camel/loaders/firecrawl_reader.py,sha256=wCPHEWbfLv_q2x9MdTiSvJ_LDqUPO88lzPf0mmOBsME,5667
|
|
102
103
|
camel/loaders/jina_url_reader.py,sha256=dL9J5JlsFKEhi4gU_vYIxKvvf_RJ4LY9gG6i8P8JpcA,3601
|
|
104
|
+
camel/loaders/mineru_extractor.py,sha256=nKa5n7f3ergv1TURcbXZJP5mQpnSCIFdlWrxWn4hBz8,9070
|
|
103
105
|
camel/loaders/panda_reader.py,sha256=7z9mA869LTEI48VhPQc0t2fnIUZc4MGngIXCh6lff18,11361
|
|
104
106
|
camel/loaders/unstructured_io.py,sha256=Dh-MB02nrhVXFyQCUrYt4DATd12zi5bNWE47cPC5yBs,17429
|
|
105
107
|
camel/logger.py,sha256=j6mPsLJyKOn16o6Um57882mHsURQ8h-jia6Jd_34wRA,4239
|
|
@@ -126,9 +128,9 @@ camel/models/__init__.py,sha256=np8pj6JClpO5HzL_EQb_tkX5-SFTwozy2QUmMQuO7lU,2570
|
|
|
126
128
|
camel/models/aiml_model.py,sha256=ItiTNq3IhvnGclT9Lwm_3NFzK-yIK2wIhevLfyn5oeU,5222
|
|
127
129
|
camel/models/anthropic_model.py,sha256=BOj4vEtYVWbgy3DmBBlFh6LPXHbi1-LCPWzIxFuw9u4,5829
|
|
128
130
|
camel/models/azure_openai_model.py,sha256=ptL4YK8KkAbOA6XDxIhcEqxPOVGrYmzXqBzdsZAyHss,6083
|
|
129
|
-
camel/models/base_model.py,sha256=
|
|
131
|
+
camel/models/base_model.py,sha256=RUUHAD85MCIiPP2uxrGm7s0SRfAJpYcX16Sq21tA2BY,7557
|
|
130
132
|
camel/models/cohere_model.py,sha256=4Sm-YvQnSquz8L4EN9qGn0qz6WTz4cm_BQtP7_NZOHQ,10731
|
|
131
|
-
camel/models/deepseek_model.py,sha256=
|
|
133
|
+
camel/models/deepseek_model.py,sha256=8KODWkub8wNW_63q2xn-Kh_Otvf4CghAlHrihrM9DQE,7515
|
|
132
134
|
camel/models/fish_audio_model.py,sha256=mid-wdV_hkxHay-vgnF3zshwdXLyO4eM31139_0BXzo,5586
|
|
133
135
|
camel/models/gemini_model.py,sha256=mS3_91vlLifsIolDR3TYRFzpV67iAnFiIRAZ8F5O7Qc,5462
|
|
134
136
|
camel/models/groq_model.py,sha256=gDLv1_gOIioNmTh7I_efM5FMEsELqeQGAtY7ipd85TU,4922
|
|
@@ -240,7 +242,7 @@ camel/terminators/__init__.py,sha256=t8uqrkUnXEOYMXQDgaBkMFJ0EXFKI0kmx4cUimli3Ls
|
|
|
240
242
|
camel/terminators/base.py,sha256=xmJzERX7GdSXcxZjAHHODa0rOxRChMSRboDCNHWSscs,1511
|
|
241
243
|
camel/terminators/response_terminator.py,sha256=n3G5KP6Oj7-7WlRN0yFcrtLpqAJKaKS0bmhrWlFfCgQ,4982
|
|
242
244
|
camel/terminators/token_limit_terminator.py,sha256=YWv6ZR8R9yI2Qnf_3xES5bEE_O5bb2CxQ0EUXfMh34c,2118
|
|
243
|
-
camel/toolkits/__init__.py,sha256=
|
|
245
|
+
camel/toolkits/__init__.py,sha256=moyiULPxdXNOpbRBc-sHMV_dewyd_cGks21YRYbM7lY,2918
|
|
244
246
|
camel/toolkits/arxiv_toolkit.py,sha256=I9WEUturZhbL5gQIgX_8bKttuJUlMKHcvUfhcidFVhs,6204
|
|
245
247
|
camel/toolkits/ask_news_toolkit.py,sha256=PIFGGVHpSOXs2lg-zA6qhlHF17f1CyCjGbpud90yG8I,23158
|
|
246
248
|
camel/toolkits/base.py,sha256=XnERVclg201dG7BrawwbuSeSlkz1ngIfatES1ingpkA,1264
|
|
@@ -256,6 +258,7 @@ camel/toolkits/human_toolkit.py,sha256=4YsZrCSFaMceM1MpGa-tg5gkmbdcZrm0qe3j2JRgf
|
|
|
256
258
|
camel/toolkits/linkedin_toolkit.py,sha256=r1q8Ds95chC9vxtsaUYUDEitM8tDjUw_MrkpWpM4W8s,7911
|
|
257
259
|
camel/toolkits/math_toolkit.py,sha256=5yVF0bKuwkZIV01uICd3TOfktXlTERjKt4DrFyz_oaE,3639
|
|
258
260
|
camel/toolkits/meshy_toolkit.py,sha256=8989arDOaD8KQuaHsRu3bfYoqEoZdvcpiWDXcQ_iN0Q,6378
|
|
261
|
+
camel/toolkits/mineru_toolkit.py,sha256=24XmZ1s8Wc1_Qsx2OLakMQi3sCSJYoN-vwxZdBreQLU,6807
|
|
259
262
|
camel/toolkits/notion_toolkit.py,sha256=JZSQaM2V0hxPga4Qk-HR5kcQLeHR3gEriovd48Vy43o,9507
|
|
260
263
|
camel/toolkits/open_api_specs/biztoc/__init__.py,sha256=OKCZrQCDwaWtXIN_2rA9FSqEvgpQRieRoHh7Ek6N16A,702
|
|
261
264
|
camel/toolkits/open_api_specs/biztoc/ai-plugin.json,sha256=IJinQbLv5MFPGFwdN7PbOhwArFVExSEZdJspe-mOBIo,866
|
|
@@ -290,7 +293,7 @@ camel/toolkits/search_toolkit.py,sha256=4yTYkook3E3Yb-EOaio2O6FBcvzIXlVVC4WOvNSa
|
|
|
290
293
|
camel/toolkits/semantic_scholar_toolkit.py,sha256=z7xF3lPtBVXbpYMBDX9eVeHKpTZAg5rKiDnB1bCkhvU,11472
|
|
291
294
|
camel/toolkits/slack_toolkit.py,sha256=n8cn3kZIc27B-2KMTRK6Nsdan37SwMqBiBi1PMtuUvQ,10744
|
|
292
295
|
camel/toolkits/stripe_toolkit.py,sha256=cQJlzu7qXSiClazgr-D3xRAcI_PK_csTT-xcwaTrHYc,9623
|
|
293
|
-
camel/toolkits/sympy_toolkit.py,sha256=
|
|
296
|
+
camel/toolkits/sympy_toolkit.py,sha256=RCwgMTJxFnMpzexl-aDpeT6104HOyfyHxqRRijRGx5g,32654
|
|
294
297
|
camel/toolkits/twitter_toolkit.py,sha256=a2OLSJSW2wY7pOwOApb1qchZPXzH22Rbgm9Yd7-7vrA,15826
|
|
295
298
|
camel/toolkits/video_toolkit.py,sha256=n1P7F_cjdnC2jfUQQiJnhueRYA83GIjUF7HWIrES5xs,7089
|
|
296
299
|
camel/toolkits/weather_toolkit.py,sha256=qHAMD56zqd5GWnEWiaA_0aBDwvgacdx0pAHScinY4GY,6965
|
|
@@ -306,7 +309,7 @@ camel/utils/constants.py,sha256=MQD3bgLIq_NATp0D1iFkrwfkCwVX-PAOSXheTkkEdkY,1410
|
|
|
306
309
|
camel/utils/deduplication.py,sha256=UHikAtOW1TTDunf2t_wa2kFbmkrXWf7HfOKwLvwCxzo,8958
|
|
307
310
|
camel/utils/response_format.py,sha256=9KrbwtOM9cA3LSjTgLiK7oKy-53_uMh1cvpyNwwJpng,2419
|
|
308
311
|
camel/utils/token_counting.py,sha256=n5JsWuG6fiuMUgpsKUPMF1NKQJLle9ad1I88_aS4cMM,14018
|
|
309
|
-
camel_ai-0.2.
|
|
310
|
-
camel_ai-0.2.
|
|
311
|
-
camel_ai-0.2.
|
|
312
|
-
camel_ai-0.2.
|
|
312
|
+
camel_ai-0.2.22.dist-info/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
|
|
313
|
+
camel_ai-0.2.22.dist-info/METADATA,sha256=356SEI4dv3R-Te3OL1Q6GndV89WHugGhhROb-nz27RI,36421
|
|
314
|
+
camel_ai-0.2.22.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
|
|
315
|
+
camel_ai-0.2.22.dist-info/RECORD,,
|
|
File without changes
|