cellcog 2.0.0__tar.gz → 2.0.2__tar.gz
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.
- cellcog-2.0.2/PKG-INFO +235 -0
- cellcog-2.0.2/README.md +203 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/__init__.py +1 -1
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/docs/api_reference.md +92 -34
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/docs/support.md +53 -16
- {cellcog-2.0.0 → cellcog-2.0.2}/pyproject.toml +1 -1
- cellcog-2.0.0/PKG-INFO +0 -262
- cellcog-2.0.0/README.md +0 -230
- {cellcog-2.0.0 → cellcog-2.0.2}/.convex/.gitignore +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/.convex/local/default/config.json +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/.convex/local/default/convex_local_backend.sqlite3 +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/.convex/local/default/convex_local_storage/modules/18330a2b-2cf5-4f51-89a5-8d97a422e7a2.blob +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/.gitignore +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/LICENSE +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/auth.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/chat.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/client.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/config.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/daemon/__init__.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/daemon/delivery.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/daemon/main.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/daemon/state.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/docs/__init__.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/exceptions.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/files.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/message_formatter.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/cellcog/message_processor.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/examples/basic_usage.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/examples/file_handling.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/examples/streaming_usage.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/examples/sync_usage.py +0 -0
- {cellcog-2.0.0 → cellcog-2.0.2}/examples/workflow_usage.py +0 -0
cellcog-2.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cellcog
|
|
3
|
+
Version: 2.0.2
|
|
4
|
+
Summary: Python SDK for CellCog - Any-to-Any AI for agents. Fire-and-forget pattern with WebSocket notifications.
|
|
5
|
+
Project-URL: Homepage, https://cellcog.ai
|
|
6
|
+
Project-URL: Documentation, https://cellcog.ai/developer/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/CellCog/cellcog_python
|
|
8
|
+
Project-URL: Issues, https://github.com/CellCog/cellcog_python/issues
|
|
9
|
+
Author-email: CellCog <support@cellcog.ai>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,ai,image,multimodal,openclaw,pdf,research,video
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
24
|
+
Requires-Dist: requests>=2.28.0
|
|
25
|
+
Requires-Dist: websockets>=11.0.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# CellCog Python SDK
|
|
34
|
+
|
|
35
|
+
**CellCog: Any-to-Any AI for Agents** — Your sub-agent for quality work.
|
|
36
|
+
|
|
37
|
+
When you need depth, accuracy, or complex deliverables — research reports, interactive apps, videos, images, podcasts, documents, spreadsheets, and more — use CellCog.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install cellcog
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
export CELLCOG_API_KEY="sk_..." # Get from https://cellcog.ai/profile?tab=api-keys
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Any agent (blocks until done):**
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from cellcog import CellCogClient
|
|
55
|
+
|
|
56
|
+
client = CellCogClient()
|
|
57
|
+
|
|
58
|
+
result = client.create_chat(
|
|
59
|
+
prompt="Research quantum computing advances in 2026",
|
|
60
|
+
task_label="quantum-research",
|
|
61
|
+
chat_mode="agent",
|
|
62
|
+
)
|
|
63
|
+
# Blocks until done — result contains everything
|
|
64
|
+
print(result["message"])
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**OpenClaw agents (fire-and-forget):**
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
result = client.create_chat(
|
|
71
|
+
prompt="Research quantum computing advances in 2026",
|
|
72
|
+
notify_session_key="agent:main:main", # OpenClaw session key
|
|
73
|
+
task_label="quantum-research",
|
|
74
|
+
chat_mode="agent",
|
|
75
|
+
)
|
|
76
|
+
# Returns immediately — daemon delivers results to your session
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## How It Works
|
|
80
|
+
|
|
81
|
+
**Two delivery modes:**
|
|
82
|
+
|
|
83
|
+
- **Wait for Completion (default)** — Blocks until CellCog finishes and returns the full result. Works with any agent — OpenClaw, Claude Code, Cursor, or any Python environment.
|
|
84
|
+
|
|
85
|
+
- **Fire-and-Forget (OpenClaw)** — Returns immediately. A background daemon monitors via WebSocket and delivers results to your OpenClaw session when done. Requires `sessions_send` on OpenClaw Gateway.
|
|
86
|
+
|
|
87
|
+
All methods return the same unified shape:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
{
|
|
91
|
+
"chat_id": str,
|
|
92
|
+
"is_operating": bool,
|
|
93
|
+
"status": str, # "completed" | "tracking" | "timeout" | "operating"
|
|
94
|
+
"message": str, # Always print this in full
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
export CELLCOG_API_KEY="sk_..."
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Get your API key:**
|
|
105
|
+
1. Create account: https://cellcog.ai/signup
|
|
106
|
+
2. Add payment: https://cellcog.ai/profile?tab=billing
|
|
107
|
+
3. Get API key: https://cellcog.ai/profile?tab=api-keys
|
|
108
|
+
|
|
109
|
+
## API Reference
|
|
110
|
+
|
|
111
|
+
### Core Methods
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# Create chat — wait mode (default, universal)
|
|
115
|
+
result = client.create_chat(
|
|
116
|
+
prompt="Your task...",
|
|
117
|
+
task_label="my-task",
|
|
118
|
+
chat_mode="agent", # "agent" | "agent core" | "agent team" | "agent team max"
|
|
119
|
+
timeout=1800, # 30 min default; use 3600 for complex jobs
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# Create chat — notify mode (OpenClaw only)
|
|
123
|
+
result = client.create_chat(
|
|
124
|
+
prompt="Your task...",
|
|
125
|
+
notify_session_key="agent:main:main",
|
|
126
|
+
task_label="my-task",
|
|
127
|
+
chat_mode="agent",
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
# Send follow-up message
|
|
131
|
+
result = client.send_message(chat_id="abc123", message="Now create a PDF summary")
|
|
132
|
+
|
|
133
|
+
# Get full history
|
|
134
|
+
result = client.get_history(chat_id="abc123")
|
|
135
|
+
|
|
136
|
+
# Quick status check
|
|
137
|
+
status = client.get_status(chat_id="abc123")
|
|
138
|
+
|
|
139
|
+
# Resume waiting after timeout
|
|
140
|
+
result = client.wait_for_completion(chat_id="abc123", timeout=1800)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Optional Parameters
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
result = client.create_chat(
|
|
147
|
+
prompt="...",
|
|
148
|
+
task_label="...",
|
|
149
|
+
chat_mode="agent",
|
|
150
|
+
project_id="...", # CellCog project for document context
|
|
151
|
+
agent_role_id="...", # Specialized agent role
|
|
152
|
+
enable_cowork=True, # Direct machine access via CellCog Desktop
|
|
153
|
+
cowork_working_directory="/Users/...", # Working directory for co-work
|
|
154
|
+
)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## File Handling
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
# Send files to CellCog
|
|
161
|
+
result = client.create_chat(
|
|
162
|
+
prompt='Analyze this data: <SHOW_FILE>/path/to/sales.csv</SHOW_FILE>',
|
|
163
|
+
task_label="data-analysis",
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
# Request output at specific path
|
|
167
|
+
result = client.create_chat(
|
|
168
|
+
prompt='Create a report: <GENERATE_FILE>/output/report.pdf</GENERATE_FILE>',
|
|
169
|
+
task_label="report",
|
|
170
|
+
)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Generated files auto-download to `~/.cellcog/chats/{chat_id}/` or to `GENERATE_FILE` paths if specified.
|
|
174
|
+
|
|
175
|
+
## Chat Modes
|
|
176
|
+
|
|
177
|
+
| Mode | Speed | Min Credits | Best For |
|
|
178
|
+
|------|-------|-------------|----------|
|
|
179
|
+
| `"agent"` | Fast | 100 | Most tasks — research, images, audio, documents |
|
|
180
|
+
| `"agent core"` | Fast | 50 | Coding, co-work, terminal operations |
|
|
181
|
+
| `"agent team"` | 5–60 min | 500 | Deep research & multi-angled reasoning |
|
|
182
|
+
| `"agent team max"` | Slowest | 2,000 | High-stakes — legal, financial, academic |
|
|
183
|
+
|
|
184
|
+
## 35 Skills — The Cog Family
|
|
185
|
+
|
|
186
|
+
| Category | Skills |
|
|
187
|
+
|----------|--------|
|
|
188
|
+
| **Research & Analysis** | `research-cog` `fin-cog` `crypto-cog` `data-cog` `news-cog` |
|
|
189
|
+
| **Video & Cinema** | `video-cog` `cine-cog` `insta-cog` `tube-cog` `seedance-cog` |
|
|
190
|
+
| **Images & Design** | `image-cog` `brand-cog` `meme-cog` `banana-cog` `3d-cog` |
|
|
191
|
+
| **Audio & Music** | `audio-cog` `music-cog` `pod-cog` |
|
|
192
|
+
| **Documents & Slides** | `docs-cog` `slides-cog` `sheet-cog` `resume-cog` `legal-cog` |
|
|
193
|
+
| **Apps & Prototypes** | `dash-cog` `game-cog` `proto-cog` |
|
|
194
|
+
| **Creative** | `comi-cog` `story-cog` `learn-cog` `travel-cog` |
|
|
195
|
+
| **Development** | `code-cog` `cowork-cog` `project-cog` `think-cog` |
|
|
196
|
+
|
|
197
|
+
Browse all skills: https://cellcog.ai/skills
|
|
198
|
+
|
|
199
|
+
## Error Handling
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
from cellcog import (
|
|
203
|
+
CellCogClient,
|
|
204
|
+
PaymentRequiredError,
|
|
205
|
+
MaxConcurrencyError,
|
|
206
|
+
GatewayConfigError,
|
|
207
|
+
SDKUpgradeRequiredError,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
client = CellCogClient()
|
|
211
|
+
|
|
212
|
+
try:
|
|
213
|
+
result = client.create_chat(...)
|
|
214
|
+
except PaymentRequiredError as e:
|
|
215
|
+
print(f"Add credits: {e.billing_url}")
|
|
216
|
+
except MaxConcurrencyError as e:
|
|
217
|
+
print(f"Too many parallel chats: {e.operating_count}/{e.max_parallel}")
|
|
218
|
+
except GatewayConfigError as e:
|
|
219
|
+
print(f"Fix: {e.fix_command}") # OpenClaw notify mode only
|
|
220
|
+
except SDKUpgradeRequiredError as e:
|
|
221
|
+
print(f"Upgrade: pip install cellcog>={e.minimum_version}")
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Links
|
|
225
|
+
|
|
226
|
+
- **CellCog Platform:** https://cellcog.ai
|
|
227
|
+
- **Skills Catalog:** https://cellcog.ai/skills
|
|
228
|
+
- **GitHub:** https://github.com/CellCog/cellcog_python
|
|
229
|
+
- **ClawHub Skills:** https://clawhub.ai
|
|
230
|
+
- **API Docs:** https://cellcog.ai/developer/docs
|
|
231
|
+
- **Get API Key:** https://cellcog.ai/profile?tab=api-keys
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
cellcog-2.0.2/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# CellCog Python SDK
|
|
2
|
+
|
|
3
|
+
**CellCog: Any-to-Any AI for Agents** — Your sub-agent for quality work.
|
|
4
|
+
|
|
5
|
+
When you need depth, accuracy, or complex deliverables — research reports, interactive apps, videos, images, podcasts, documents, spreadsheets, and more — use CellCog.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install cellcog
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
export CELLCOG_API_KEY="sk_..." # Get from https://cellcog.ai/profile?tab=api-keys
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Any agent (blocks until done):**
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from cellcog import CellCogClient
|
|
23
|
+
|
|
24
|
+
client = CellCogClient()
|
|
25
|
+
|
|
26
|
+
result = client.create_chat(
|
|
27
|
+
prompt="Research quantum computing advances in 2026",
|
|
28
|
+
task_label="quantum-research",
|
|
29
|
+
chat_mode="agent",
|
|
30
|
+
)
|
|
31
|
+
# Blocks until done — result contains everything
|
|
32
|
+
print(result["message"])
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**OpenClaw agents (fire-and-forget):**
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
result = client.create_chat(
|
|
39
|
+
prompt="Research quantum computing advances in 2026",
|
|
40
|
+
notify_session_key="agent:main:main", # OpenClaw session key
|
|
41
|
+
task_label="quantum-research",
|
|
42
|
+
chat_mode="agent",
|
|
43
|
+
)
|
|
44
|
+
# Returns immediately — daemon delivers results to your session
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## How It Works
|
|
48
|
+
|
|
49
|
+
**Two delivery modes:**
|
|
50
|
+
|
|
51
|
+
- **Wait for Completion (default)** — Blocks until CellCog finishes and returns the full result. Works with any agent — OpenClaw, Claude Code, Cursor, or any Python environment.
|
|
52
|
+
|
|
53
|
+
- **Fire-and-Forget (OpenClaw)** — Returns immediately. A background daemon monitors via WebSocket and delivers results to your OpenClaw session when done. Requires `sessions_send` on OpenClaw Gateway.
|
|
54
|
+
|
|
55
|
+
All methods return the same unified shape:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
{
|
|
59
|
+
"chat_id": str,
|
|
60
|
+
"is_operating": bool,
|
|
61
|
+
"status": str, # "completed" | "tracking" | "timeout" | "operating"
|
|
62
|
+
"message": str, # Always print this in full
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
export CELLCOG_API_KEY="sk_..."
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Get your API key:**
|
|
73
|
+
1. Create account: https://cellcog.ai/signup
|
|
74
|
+
2. Add payment: https://cellcog.ai/profile?tab=billing
|
|
75
|
+
3. Get API key: https://cellcog.ai/profile?tab=api-keys
|
|
76
|
+
|
|
77
|
+
## API Reference
|
|
78
|
+
|
|
79
|
+
### Core Methods
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
# Create chat — wait mode (default, universal)
|
|
83
|
+
result = client.create_chat(
|
|
84
|
+
prompt="Your task...",
|
|
85
|
+
task_label="my-task",
|
|
86
|
+
chat_mode="agent", # "agent" | "agent core" | "agent team" | "agent team max"
|
|
87
|
+
timeout=1800, # 30 min default; use 3600 for complex jobs
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
# Create chat — notify mode (OpenClaw only)
|
|
91
|
+
result = client.create_chat(
|
|
92
|
+
prompt="Your task...",
|
|
93
|
+
notify_session_key="agent:main:main",
|
|
94
|
+
task_label="my-task",
|
|
95
|
+
chat_mode="agent",
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
# Send follow-up message
|
|
99
|
+
result = client.send_message(chat_id="abc123", message="Now create a PDF summary")
|
|
100
|
+
|
|
101
|
+
# Get full history
|
|
102
|
+
result = client.get_history(chat_id="abc123")
|
|
103
|
+
|
|
104
|
+
# Quick status check
|
|
105
|
+
status = client.get_status(chat_id="abc123")
|
|
106
|
+
|
|
107
|
+
# Resume waiting after timeout
|
|
108
|
+
result = client.wait_for_completion(chat_id="abc123", timeout=1800)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Optional Parameters
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
result = client.create_chat(
|
|
115
|
+
prompt="...",
|
|
116
|
+
task_label="...",
|
|
117
|
+
chat_mode="agent",
|
|
118
|
+
project_id="...", # CellCog project for document context
|
|
119
|
+
agent_role_id="...", # Specialized agent role
|
|
120
|
+
enable_cowork=True, # Direct machine access via CellCog Desktop
|
|
121
|
+
cowork_working_directory="/Users/...", # Working directory for co-work
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## File Handling
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
# Send files to CellCog
|
|
129
|
+
result = client.create_chat(
|
|
130
|
+
prompt='Analyze this data: <SHOW_FILE>/path/to/sales.csv</SHOW_FILE>',
|
|
131
|
+
task_label="data-analysis",
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Request output at specific path
|
|
135
|
+
result = client.create_chat(
|
|
136
|
+
prompt='Create a report: <GENERATE_FILE>/output/report.pdf</GENERATE_FILE>',
|
|
137
|
+
task_label="report",
|
|
138
|
+
)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Generated files auto-download to `~/.cellcog/chats/{chat_id}/` or to `GENERATE_FILE` paths if specified.
|
|
142
|
+
|
|
143
|
+
## Chat Modes
|
|
144
|
+
|
|
145
|
+
| Mode | Speed | Min Credits | Best For |
|
|
146
|
+
|------|-------|-------------|----------|
|
|
147
|
+
| `"agent"` | Fast | 100 | Most tasks — research, images, audio, documents |
|
|
148
|
+
| `"agent core"` | Fast | 50 | Coding, co-work, terminal operations |
|
|
149
|
+
| `"agent team"` | 5–60 min | 500 | Deep research & multi-angled reasoning |
|
|
150
|
+
| `"agent team max"` | Slowest | 2,000 | High-stakes — legal, financial, academic |
|
|
151
|
+
|
|
152
|
+
## 35 Skills — The Cog Family
|
|
153
|
+
|
|
154
|
+
| Category | Skills |
|
|
155
|
+
|----------|--------|
|
|
156
|
+
| **Research & Analysis** | `research-cog` `fin-cog` `crypto-cog` `data-cog` `news-cog` |
|
|
157
|
+
| **Video & Cinema** | `video-cog` `cine-cog` `insta-cog` `tube-cog` `seedance-cog` |
|
|
158
|
+
| **Images & Design** | `image-cog` `brand-cog` `meme-cog` `banana-cog` `3d-cog` |
|
|
159
|
+
| **Audio & Music** | `audio-cog` `music-cog` `pod-cog` |
|
|
160
|
+
| **Documents & Slides** | `docs-cog` `slides-cog` `sheet-cog` `resume-cog` `legal-cog` |
|
|
161
|
+
| **Apps & Prototypes** | `dash-cog` `game-cog` `proto-cog` |
|
|
162
|
+
| **Creative** | `comi-cog` `story-cog` `learn-cog` `travel-cog` |
|
|
163
|
+
| **Development** | `code-cog` `cowork-cog` `project-cog` `think-cog` |
|
|
164
|
+
|
|
165
|
+
Browse all skills: https://cellcog.ai/skills
|
|
166
|
+
|
|
167
|
+
## Error Handling
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from cellcog import (
|
|
171
|
+
CellCogClient,
|
|
172
|
+
PaymentRequiredError,
|
|
173
|
+
MaxConcurrencyError,
|
|
174
|
+
GatewayConfigError,
|
|
175
|
+
SDKUpgradeRequiredError,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
client = CellCogClient()
|
|
179
|
+
|
|
180
|
+
try:
|
|
181
|
+
result = client.create_chat(...)
|
|
182
|
+
except PaymentRequiredError as e:
|
|
183
|
+
print(f"Add credits: {e.billing_url}")
|
|
184
|
+
except MaxConcurrencyError as e:
|
|
185
|
+
print(f"Too many parallel chats: {e.operating_count}/{e.max_parallel}")
|
|
186
|
+
except GatewayConfigError as e:
|
|
187
|
+
print(f"Fix: {e.fix_command}") # OpenClaw notify mode only
|
|
188
|
+
except SDKUpgradeRequiredError as e:
|
|
189
|
+
print(f"Upgrade: pip install cellcog>={e.minimum_version}")
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Links
|
|
193
|
+
|
|
194
|
+
- **CellCog Platform:** https://cellcog.ai
|
|
195
|
+
- **Skills Catalog:** https://cellcog.ai/skills
|
|
196
|
+
- **GitHub:** https://github.com/CellCog/cellcog_python
|
|
197
|
+
- **ClawHub Skills:** https://clawhub.ai
|
|
198
|
+
- **API Docs:** https://cellcog.ai/developer/docs
|
|
199
|
+
- **Get API Key:** https://cellcog.ai/profile?tab=api-keys
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
@@ -13,13 +13,18 @@ client = CellCogClient(config_path=None)
|
|
|
13
13
|
|
|
14
14
|
### create_chat()
|
|
15
15
|
|
|
16
|
-
Create a new CellCog task.
|
|
16
|
+
Create a new CellCog task. Two delivery modes:
|
|
17
|
+
- `wait_for_completion` (default): Blocks until done. Works with any agent.
|
|
18
|
+
- `notify_on_completion`: Returns immediately. OpenClaw only.
|
|
17
19
|
|
|
18
20
|
```python
|
|
19
21
|
result = client.create_chat(
|
|
20
22
|
prompt: str, # Task description (required)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
task_label: str = "", # Human-readable label
|
|
24
|
+
delivery: str = "wait_for_completion",# "wait_for_completion" or "notify_on_completion"
|
|
25
|
+
timeout: int = 1800, # Max wait seconds (wait mode only)
|
|
26
|
+
notify_session_key: str = None, # OpenClaw session key (notify mode only)
|
|
27
|
+
gateway_url: str = None, # OpenClaw Gateway URL (notify mode only)
|
|
23
28
|
chat_mode: str = "agent", # "agent", "agent core", "agent team", "agent team max"
|
|
24
29
|
project_id: str = None, # Project context (see project-cog)
|
|
25
30
|
agent_role_id: str = None, # Specialized role (requires project_id)
|
|
@@ -28,31 +33,43 @@ result = client.create_chat(
|
|
|
28
33
|
)
|
|
29
34
|
```
|
|
30
35
|
|
|
31
|
-
**Returns
|
|
36
|
+
**Returns (all modes):**
|
|
37
|
+
```python
|
|
38
|
+
{
|
|
39
|
+
"chat_id": str, # CellCog chat ID
|
|
40
|
+
"is_operating": bool, # True = still working, False = done
|
|
41
|
+
"status": str, # "completed" | "tracking" | "timeout"
|
|
42
|
+
"message": str, # THE printable message — always print in full
|
|
43
|
+
}
|
|
44
|
+
```
|
|
32
45
|
|
|
33
46
|
**Raises:**
|
|
34
47
|
- `PaymentRequiredError` (402) — insufficient credits
|
|
35
48
|
- `MaxConcurrencyError` (429) — too many parallel chats
|
|
36
49
|
- `AccountDisabledError` (403) — account flagged or disabled
|
|
50
|
+
- `GatewayConfigError` — sessions_send blocked (notify mode only)
|
|
37
51
|
|
|
38
52
|
### send_message()
|
|
39
53
|
|
|
40
|
-
Continue an existing conversation.
|
|
54
|
+
Continue an existing conversation. Same delivery modes as `create_chat()`.
|
|
41
55
|
|
|
42
56
|
```python
|
|
43
57
|
result = client.send_message(
|
|
44
58
|
chat_id: str, # Existing chat (required)
|
|
45
59
|
message: str, # Follow-up message (required)
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
task_label: str = None, # Label for this message
|
|
61
|
+
delivery: str = "wait_for_completion",# "wait_for_completion" or "notify_on_completion"
|
|
62
|
+
timeout: int = 1800, # Max wait seconds (wait mode only)
|
|
63
|
+
notify_session_key: str = None, # OpenClaw session key (notify mode only)
|
|
64
|
+
gateway_url: str = None, # OpenClaw Gateway URL (notify mode only)
|
|
48
65
|
)
|
|
49
66
|
```
|
|
50
67
|
|
|
51
|
-
**Returns:** `{
|
|
68
|
+
**Returns:** Same `{chat_id, is_operating, status, message}` shape.
|
|
52
69
|
|
|
53
70
|
### wait_for_completion()
|
|
54
71
|
|
|
55
|
-
Block until a chat finishes operating.
|
|
72
|
+
Block until a chat finishes operating. Use to resume waiting after a timeout.
|
|
56
73
|
|
|
57
74
|
```python
|
|
58
75
|
completion = client.wait_for_completion(
|
|
@@ -61,39 +78,36 @@ completion = client.wait_for_completion(
|
|
|
61
78
|
)
|
|
62
79
|
```
|
|
63
80
|
|
|
64
|
-
**Returns:**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"chat_id": str,
|
|
68
|
-
"is_operating": bool, # False = done, True = timeout reached
|
|
69
|
-
"status": str, # "completed" | "waiting"
|
|
70
|
-
"status_message": str
|
|
71
|
-
}
|
|
72
|
-
```
|
|
81
|
+
**Returns:** Same `{chat_id, is_operating, status, message}` shape.
|
|
82
|
+
- `status: "completed"` — chat finished, `message` contains full results
|
|
83
|
+
- `status: "timeout"` — still working, `message` contains progress
|
|
73
84
|
|
|
74
|
-
###
|
|
85
|
+
### get_history()
|
|
75
86
|
|
|
76
|
-
|
|
87
|
+
Full chat history. Use when original delivery was missed or for manual inspection.
|
|
77
88
|
|
|
78
89
|
```python
|
|
79
|
-
|
|
90
|
+
result = client.get_history(
|
|
91
|
+
chat_id: str,
|
|
92
|
+
download_files: bool = True,
|
|
93
|
+
)
|
|
80
94
|
```
|
|
81
95
|
|
|
82
|
-
**Returns:** `{
|
|
96
|
+
**Returns:** Same `{chat_id, is_operating, status, message}` shape with full history.
|
|
83
97
|
|
|
84
|
-
###
|
|
98
|
+
### get_status()
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
Quick status check (no message content).
|
|
87
101
|
|
|
88
102
|
```python
|
|
89
|
-
|
|
103
|
+
status = client.get_status(chat_id: str)
|
|
90
104
|
```
|
|
91
105
|
|
|
92
|
-
**Returns:** `{"is_operating": bool, "
|
|
106
|
+
**Returns:** `{"is_operating": bool, "status": str, "name": str, ...}`
|
|
93
107
|
|
|
94
108
|
### delete_chat()
|
|
95
109
|
|
|
96
|
-
Permanently delete a chat and all server-side data.
|
|
110
|
+
Permanently delete a chat and all server-side data (~15 seconds).
|
|
97
111
|
|
|
98
112
|
```python
|
|
99
113
|
result = client.delete_chat(chat_id: str)
|
|
@@ -141,7 +155,7 @@ Check if CellCog Desktop is connected.
|
|
|
141
155
|
|
|
142
156
|
```python
|
|
143
157
|
status = client.get_desktop_status()
|
|
144
|
-
# {"connected": bool, ...}
|
|
158
|
+
# {"connected": bool, "system_info": {...} | None, ...}
|
|
145
159
|
```
|
|
146
160
|
|
|
147
161
|
### get_desktop_download_urls()
|
|
@@ -150,7 +164,7 @@ Get platform-specific download URLs and install commands.
|
|
|
150
164
|
|
|
151
165
|
```python
|
|
152
166
|
info = client.get_desktop_download_urls()
|
|
153
|
-
# {"
|
|
167
|
+
# {"mac": {"url": str, "install_commands": [...]}, "windows": {...}, "linux": {...}, "post_install": str}
|
|
154
168
|
```
|
|
155
169
|
|
|
156
170
|
---
|
|
@@ -161,6 +175,7 @@ info = client.get_desktop_download_urls()
|
|
|
161
175
|
|
|
162
176
|
```python
|
|
163
177
|
projects = client.list_projects()
|
|
178
|
+
# {"projects": [{"id", "name", "is_admin", "context_tree_id", ...}]}
|
|
164
179
|
```
|
|
165
180
|
|
|
166
181
|
### create_project()
|
|
@@ -178,7 +193,7 @@ project = client.get_project(project_id: str)
|
|
|
178
193
|
### update_project()
|
|
179
194
|
|
|
180
195
|
```python
|
|
181
|
-
|
|
196
|
+
result = client.update_project(project_id: str, name: str = None, instructions: str = None)
|
|
182
197
|
```
|
|
183
198
|
|
|
184
199
|
### delete_project()
|
|
@@ -205,7 +220,6 @@ docs = client.list_documents(context_tree_id: str)
|
|
|
205
220
|
result = client.upload_document(
|
|
206
221
|
context_tree_id: str,
|
|
207
222
|
file_path: str,
|
|
208
|
-
target_path: str = None,
|
|
209
223
|
brief_context: str = None,
|
|
210
224
|
)
|
|
211
225
|
```
|
|
@@ -216,6 +230,13 @@ result = client.upload_document(
|
|
|
216
230
|
result = client.delete_document(context_tree_id: str, file_id: str)
|
|
217
231
|
```
|
|
218
232
|
|
|
233
|
+
### bulk_delete_documents()
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
result = client.bulk_delete_documents(context_tree_id: str, file_ids: list)
|
|
237
|
+
# {"deleted": int, "failed": int, "results": {...}}
|
|
238
|
+
```
|
|
239
|
+
|
|
219
240
|
### get_context_tree_markdown()
|
|
220
241
|
|
|
221
242
|
```python
|
|
@@ -225,7 +246,21 @@ tree = client.get_context_tree_markdown(context_tree_id: str, include_long_descr
|
|
|
225
246
|
### get_document_signed_urls()
|
|
226
247
|
|
|
227
248
|
```python
|
|
228
|
-
urls = client.get_document_signed_urls(context_tree_id: str, file_ids: list)
|
|
249
|
+
urls = client.get_document_signed_urls(context_tree_id: str, file_ids: list, expiration_hours: int = 1)
|
|
250
|
+
# {"urls": {file_id: url_or_null}, "errors": {file_id: error_msg}}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### get_document_signed_urls_by_path()
|
|
254
|
+
|
|
255
|
+
Get signed URLs using file paths from the context tree markdown (no file IDs needed).
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
urls = client.get_document_signed_urls_by_path(
|
|
259
|
+
context_tree_id: str,
|
|
260
|
+
file_paths: list,
|
|
261
|
+
expiration_hours: int = 1,
|
|
262
|
+
)
|
|
263
|
+
# {"urls": {path: url_or_null}, "errors": {path: error_msg}}
|
|
229
264
|
```
|
|
230
265
|
|
|
231
266
|
---
|
|
@@ -238,7 +273,7 @@ urls = client.get_document_signed_urls(context_tree_id: str, file_ids: list)
|
|
|
238
273
|
result = client.create_ticket(
|
|
239
274
|
type: str, # "support", "feedback", "feature_request", "bug_report"
|
|
240
275
|
title: str,
|
|
241
|
-
description: str
|
|
276
|
+
description: str,
|
|
242
277
|
chat_id: str = None,
|
|
243
278
|
tags: list = None,
|
|
244
279
|
priority: str = "medium", # "low", "medium", "high", "critical"
|
|
@@ -247,6 +282,22 @@ result = client.create_ticket(
|
|
|
247
282
|
|
|
248
283
|
---
|
|
249
284
|
|
|
285
|
+
## Documentation
|
|
286
|
+
|
|
287
|
+
### get_support_docs()
|
|
288
|
+
|
|
289
|
+
```python
|
|
290
|
+
docs = client.get_support_docs() # Returns markdown string
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### get_api_reference()
|
|
294
|
+
|
|
295
|
+
```python
|
|
296
|
+
docs = client.get_api_reference() # Returns markdown string
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
250
301
|
## Exception Classes
|
|
251
302
|
|
|
252
303
|
```python
|
|
@@ -258,7 +309,10 @@ from cellcog.exceptions import (
|
|
|
258
309
|
PaymentRequiredError, # Insufficient credits (includes top_ups, billing_url)
|
|
259
310
|
MaxConcurrencyError, # Too many parallel chats
|
|
260
311
|
AccountDisabledError, # Account flagged or disabled
|
|
261
|
-
|
|
312
|
+
SDKUpgradeRequiredError, # SDK version too old
|
|
313
|
+
GatewayConfigError, # sessions_send blocked on OpenClaw Gateway
|
|
314
|
+
FileUploadError, # File upload failed
|
|
315
|
+
FileDownloadError, # File download failed
|
|
262
316
|
)
|
|
263
317
|
```
|
|
264
318
|
|
|
@@ -274,3 +328,7 @@ from cellcog.exceptions import (
|
|
|
274
328
|
- `max_parallel`: Maximum allowed with current balance
|
|
275
329
|
- `effective_balance`: Current credit balance
|
|
276
330
|
- `credits_per_slot`: Credits per additional slot (500)
|
|
331
|
+
|
|
332
|
+
### GatewayConfigError Attributes
|
|
333
|
+
- `gateway_url`: The Gateway URL that was checked
|
|
334
|
+
- `fix_command`: The exact command to run to fix the issue
|