10xscale-agentflow-cli 0.1.5__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.
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/PKG-INFO +458 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/SOURCES.txt +88 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/dependency_links.txt +1 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/entry_points.txt +2 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/not-zip-safe +1 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/requires.txt +27 -0
- 10xscale_agentflow_cli-0.1.5/10xscale_agentflow_cli.egg-info/top_level.txt +1 -0
- 10xscale_agentflow_cli-0.1.5/MANIFEST.in +16 -0
- 10xscale_agentflow_cli-0.1.5/PKG-INFO +458 -0
- 10xscale_agentflow_cli-0.1.5/README.md +409 -0
- 10xscale_agentflow_cli-0.1.5/Task.md +31 -0
- 10xscale_agentflow_cli-0.1.5/agentflow.json +10 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/__init__.py +16 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/__init__.py +3 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/commands/__init__.py +49 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/commands/api.py +98 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/commands/build.py +222 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/commands/init.py +129 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/commands/version.py +50 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/constants.py +84 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/core/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/core/config.py +245 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/core/output.py +213 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/core/validation.py +258 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/exceptions.py +102 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/logger.py +109 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/main.py +261 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/templates/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/cli/templates/defaults.py +603 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/__init__.py +13 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/__init__.py +15 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/auth/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/auth/auth_backend.py +33 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/auth/base_auth.py +24 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/auth/jwt_auth.py +78 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/graph_config.py +88 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/sentry_config.py +45 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/settings.py +91 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/setup_logs.py +68 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/setup_middleware.py +94 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/config/worker_middleware.py +99 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/exceptions/__init__.py +17 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/exceptions/general_exception.py +58 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/exceptions/handle_errors.py +96 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/exceptions/resources_exceptions.py +72 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/core/exceptions/user_exception.py +56 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/loader.py +185 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/main.py +82 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/__init__.py +4 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/__init__.py +1 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/router.py +447 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/schemas/__init__.py +1 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/schemas/checkpointer_schemas.py +112 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/services/__init__.py +1 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/checkpointer/services/checkpointer_service.py +231 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/__init__.py +6 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/router.py +182 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/schemas/__init__.py +1 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/schemas/graph_schemas.py +129 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/services/__init__.py +1 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/graph/services/graph_service.py +386 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/ping/__init__.py +4 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/ping/router.py +28 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/setup_router.py +23 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/__init__.py +4 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/router.py +224 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/schemas/__init__.py +28 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/schemas/store_schemas.py +170 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/services/__init__.py +4 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/routers/store/services/store_service.py +163 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/tasks/__init__.py +0 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/tasks/user_tasks.py +38 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/__init__.py +9 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/callable_helper.py +26 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/parse_output.py +17 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/response_helper.py +129 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/schemas/__init__.py +11 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/schemas/output_schemas.py +28 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/schemas/user_schemas.py +13 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/snowflake_id_generator.py +99 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/utils/swagger_helper.py +160 -0
- 10xscale_agentflow_cli-0.1.5/agentflow_cli/src/app/worker.py +91 -0
- 10xscale_agentflow_cli-0.1.5/graph/__init__.py +4 -0
- 10xscale_agentflow_cli-0.1.5/graph/react.py +134 -0
- 10xscale_agentflow_cli-0.1.5/pyproject.toml +251 -0
- 10xscale_agentflow_cli-0.1.5/scripts/generate_docs.py +21 -0
- 10xscale_agentflow_cli-0.1.5/setup.cfg +4 -0
- 10xscale_agentflow_cli-0.1.5/tests/test_utils_parse_and_callable.py +77 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: 10xscale-agentflow-cli
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: CLI and API for 10xscale AgentFlow
|
|
5
|
+
Author-email: 10xscale <contact@10xscale.ai>
|
|
6
|
+
Maintainer-email: Shudipto Trafder <shudiptotrafder@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/10xHub/agentflow-cli
|
|
9
|
+
Project-URL: Repository, https://github.com/10xHub/agentflow-cli
|
|
10
|
+
Project-URL: Issues, https://github.com/10xHub/agentflow-cli/issues
|
|
11
|
+
Project-URL: Documentation, https://agentflow-cli.readthedocs.io/
|
|
12
|
+
Keywords: 10xscale AgentFlow,api,fastapi,cli,agentflow
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
Requires-Dist: 10xscale-agentflow>=0.4.0
|
|
28
|
+
Requires-Dist: fastapi
|
|
29
|
+
Requires-Dist: gunicorn==23.0.0
|
|
30
|
+
Requires-Dist: orjson
|
|
31
|
+
Requires-Dist: python-multipart==0.0.19
|
|
32
|
+
Requires-Dist: pydantic==2.8.2
|
|
33
|
+
Requires-Dist: pydantic-settings==2.3.4
|
|
34
|
+
Requires-Dist: uvicorn==0.30.1
|
|
35
|
+
Requires-Dist: typer
|
|
36
|
+
Requires-Dist: python-dotenv
|
|
37
|
+
Requires-Dist: PyJWT==2.8.0
|
|
38
|
+
Provides-Extra: sentry
|
|
39
|
+
Requires-Dist: sentry-sdk==2.10.0; extra == "sentry"
|
|
40
|
+
Provides-Extra: firebase
|
|
41
|
+
Requires-Dist: firebase-admin==6.5.0; extra == "firebase"
|
|
42
|
+
Requires-Dist: oauth2client==4.1.3; extra == "firebase"
|
|
43
|
+
Provides-Extra: snowflakekit
|
|
44
|
+
Requires-Dist: snowflakekit; extra == "snowflakekit"
|
|
45
|
+
Provides-Extra: redis
|
|
46
|
+
Requires-Dist: redis==5.0.7; extra == "redis"
|
|
47
|
+
Provides-Extra: gcloud
|
|
48
|
+
Requires-Dist: google-cloud-logging; extra == "gcloud"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# AgentFlow CLI
|
|
52
|
+
|
|
53
|
+
A Python API framework with GraphQL support, task management, and CLI tools for building scalable web applications.
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
### From PyPI (Recommended)
|
|
58
|
+
```bash
|
|
59
|
+
pip install agentflow-cli
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### From Source
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/Iamsdt/agentflow-cli.git
|
|
65
|
+
cd agentflow-cli
|
|
66
|
+
pip install -e .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Quick Start
|
|
70
|
+
|
|
71
|
+
1. **Initialize a new project:**
|
|
72
|
+
```bash
|
|
73
|
+
agentflow init
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. **Start the API server with default configuration:**
|
|
77
|
+
```bash
|
|
78
|
+
agentflow api
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. **Start the API server with custom configuration:**
|
|
82
|
+
```bash
|
|
83
|
+
agentflow api --config custom-config.json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
4. **Start the API server on different host/port:**
|
|
87
|
+
```bash
|
|
88
|
+
agentflow api --host 127.0.0.1 --port 9000
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
5. **Generate a Dockerfile for containerization:**
|
|
92
|
+
```bash
|
|
93
|
+
agentflow build
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## CLI Commands
|
|
97
|
+
|
|
98
|
+
The `agentflow` command provides the following subcommands:
|
|
99
|
+
|
|
100
|
+
### `agentflow api`
|
|
101
|
+
Start the Pyagenity API server.
|
|
102
|
+
|
|
103
|
+
**Options:**
|
|
104
|
+
- `--config TEXT`: Path to config file (default: agentflow.json)
|
|
105
|
+
- `--host TEXT`: Host to run the API on (default: 0.0.0.0)
|
|
106
|
+
- `--port INTEGER`: Port to run the API on (default: 8000)
|
|
107
|
+
- `--reload/--no-reload`: Enable auto-reload (default: enabled)
|
|
108
|
+
|
|
109
|
+
**Examples:**
|
|
110
|
+
```bash
|
|
111
|
+
# Start with default configuration
|
|
112
|
+
agentflow api
|
|
113
|
+
|
|
114
|
+
# Start with custom config file
|
|
115
|
+
agentflow api --config my-config.json
|
|
116
|
+
|
|
117
|
+
# Start on localhost only, port 9000
|
|
118
|
+
agentflow api --host 127.0.0.1 --port 9000
|
|
119
|
+
|
|
120
|
+
# Start without auto-reload
|
|
121
|
+
agentflow api --no-reload
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `agentflow init`
|
|
125
|
+
Initialize a new config file with default settings.
|
|
126
|
+
|
|
127
|
+
**Options:**
|
|
128
|
+
- `--output TEXT`: Output config file path (default: agentflow.json)
|
|
129
|
+
- `--force`: Overwrite existing config file
|
|
130
|
+
|
|
131
|
+
**Examples:**
|
|
132
|
+
```bash
|
|
133
|
+
# Create default config
|
|
134
|
+
agentflow init
|
|
135
|
+
|
|
136
|
+
# Create config with custom name
|
|
137
|
+
agentflow init --output custom-config.json
|
|
138
|
+
|
|
139
|
+
# Overwrite existing config
|
|
140
|
+
agentflow init --force
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `agentflow version`
|
|
144
|
+
Show the CLI version information.
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
agentflow version
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `agentflow build`
|
|
151
|
+
Generate a Dockerfile for the Pyagenity API application.
|
|
152
|
+
|
|
153
|
+
**Options:**
|
|
154
|
+
- `--output TEXT`: Output Dockerfile path (default: Dockerfile)
|
|
155
|
+
- `--force/--no-force`: Overwrite existing Dockerfile (default: no-force)
|
|
156
|
+
- `--python-version TEXT`: Python version to use (default: 3.11)
|
|
157
|
+
- `--port INTEGER`: Port to expose in the container (default: 8000)
|
|
158
|
+
|
|
159
|
+
**Examples:**
|
|
160
|
+
```bash
|
|
161
|
+
# Generate default Dockerfile
|
|
162
|
+
agentflow build
|
|
163
|
+
|
|
164
|
+
# Generate with custom Python version and port
|
|
165
|
+
agentflow build --python-version 3.12 --port 9000
|
|
166
|
+
|
|
167
|
+
# Overwrite existing Dockerfile
|
|
168
|
+
agentflow build --force
|
|
169
|
+
|
|
170
|
+
# Generate with custom filename
|
|
171
|
+
agentflow build --output MyDockerfile
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Features:**
|
|
175
|
+
- 🔍 **Automatic requirements.txt detection**: Searches for requirements files in multiple locations
|
|
176
|
+
- ⚠️ **Smart fallback**: If no requirements.txt found, installs agentflow-cli from PyPI
|
|
177
|
+
- 🐳 **Production-ready**: Generates optimized Dockerfile with security best practices
|
|
178
|
+
- 🔧 **Customizable**: Supports custom Python versions, ports, and output paths
|
|
179
|
+
- 🏥 **Health checks**: Includes built-in health check endpoint
|
|
180
|
+
- 👤 **Non-root user**: Runs container as non-root for security
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
The configuration file (`agentflow.json`) supports the following structure:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"app": {
|
|
189
|
+
"name": "Pyagenity API",
|
|
190
|
+
"version": "1.0.0",
|
|
191
|
+
"debug": true
|
|
192
|
+
},
|
|
193
|
+
"server": {
|
|
194
|
+
"host": "0.0.0.0",
|
|
195
|
+
"port": 8000,
|
|
196
|
+
"workers": 1
|
|
197
|
+
},
|
|
198
|
+
"database": {
|
|
199
|
+
"url": "sqlite://./agentflowdb"
|
|
200
|
+
},
|
|
201
|
+
"redis": {
|
|
202
|
+
"url": "redis://localhost:6379"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## File Resolution
|
|
208
|
+
|
|
209
|
+
The CLI automatically finds your config file in this order:
|
|
210
|
+
1. Absolute path (if provided with `--config`)
|
|
211
|
+
2. Current working directory
|
|
212
|
+
3. Relative to script location (for development)
|
|
213
|
+
4. Package installation directory (fallback)
|
|
214
|
+
|
|
215
|
+
## Project Structure
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
agentflow-cli/
|
|
219
|
+
├── pyagenity_api/ # Main package directory
|
|
220
|
+
│ ├── __init__.py # Package initialization
|
|
221
|
+
│ ├── cli.py # CLI module
|
|
222
|
+
│ └── src/ # Source code
|
|
223
|
+
│ └── app/ # FastAPI application
|
|
224
|
+
│ ├── main.py # FastAPI app entry point
|
|
225
|
+
│ ├── core/ # Core functionality
|
|
226
|
+
│ ├── routers/ # API routes
|
|
227
|
+
│ └── tasks/ # Background tasks
|
|
228
|
+
├── graph/ # Graph implementation
|
|
229
|
+
├── migrations/ # Database migrations
|
|
230
|
+
├── scripts/ # Utility scripts
|
|
231
|
+
├── docs/ # Documentation
|
|
232
|
+
├── pyproject.toml # Project configuration
|
|
233
|
+
├── requirements.txt # Dependencies
|
|
234
|
+
├── Makefile # Development commands
|
|
235
|
+
├── MANIFEST.in # Package manifest
|
|
236
|
+
└── README.md # This file
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Features
|
|
240
|
+
|
|
241
|
+
- **FastAPI Backend**: High-performance async web framework
|
|
242
|
+
- **GraphQL Support**: Built-in GraphQL API with Strawberry
|
|
243
|
+
- **Task Management**: Background task processing with Taskiq
|
|
244
|
+
- **CLI Tools**: Command-line interface for easy management
|
|
245
|
+
- **Database Integration**: Support for multiple databases via Tortoise ORM
|
|
246
|
+
- **Redis Integration**: Caching and session management
|
|
247
|
+
- **Authentication**: Firebase authentication support
|
|
248
|
+
- **Development Tools**: Pre-commit hooks, linting, testing
|
|
249
|
+
- **Docker Support**: Container deployment ready
|
|
250
|
+
|
|
251
|
+
## Setup
|
|
252
|
+
|
|
253
|
+
### Prerequisites
|
|
254
|
+
- Python 3.x
|
|
255
|
+
- pip
|
|
256
|
+
- [Any other prerequisites]
|
|
257
|
+
|
|
258
|
+
### Installation
|
|
259
|
+
1. Clone the repository:
|
|
260
|
+
```bash
|
|
261
|
+
git clone https://github.com/10XScale-in/backend-base.git
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
2. Create a virtual environment and activate:
|
|
265
|
+
```bash
|
|
266
|
+
python -m venv venv
|
|
267
|
+
source venv/bin/activate
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
3. Install dependencies:
|
|
271
|
+
```bash
|
|
272
|
+
pip install -r requirements.txt
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Database
|
|
276
|
+
|
|
277
|
+
### Database Configuration
|
|
278
|
+
The database configuration is located in `src/app/db/setup_database.py`.
|
|
279
|
+
|
|
280
|
+
### Database Migration
|
|
281
|
+
We use Aerich for database migrations. Follow these steps to manage your database:
|
|
282
|
+
|
|
283
|
+
1. Initialize the database initially:
|
|
284
|
+
```bash
|
|
285
|
+
aerich init -t src.app.db.setup_database.TORTOISE_ORM
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
2. Create initial database schema:
|
|
289
|
+
```bash
|
|
290
|
+
aerich init-db
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
3. Generate migration files:
|
|
294
|
+
```bash
|
|
295
|
+
aerich migrate
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
4. Apply migrations:
|
|
299
|
+
```bash
|
|
300
|
+
aerich upgrade
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
5. Revert migrations (if needed):
|
|
304
|
+
```bash
|
|
305
|
+
aerich downgrade
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Running the Application
|
|
309
|
+
|
|
310
|
+
### Command Line
|
|
311
|
+
To run the FastAPI application using Uvicorn:
|
|
312
|
+
1. Start the application:
|
|
313
|
+
```bash
|
|
314
|
+
uvicorn src.app.main:app --reload
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
2. You can also run the debugger.
|
|
318
|
+
|
|
319
|
+
### VS Code
|
|
320
|
+
Add the following configuration to your `.vscode/launch.json` file:
|
|
321
|
+
```json
|
|
322
|
+
{
|
|
323
|
+
"version": "0.2.0",
|
|
324
|
+
"configurations": [
|
|
325
|
+
{
|
|
326
|
+
"name": "Python: FastAPI",
|
|
327
|
+
"type": "python",
|
|
328
|
+
"request": "launch",
|
|
329
|
+
"module": "uvicorn",
|
|
330
|
+
"args": [
|
|
331
|
+
"src.app.main:app",
|
|
332
|
+
"--host",
|
|
333
|
+
"localhost",
|
|
334
|
+
"--port",
|
|
335
|
+
"8880"
|
|
336
|
+
],
|
|
337
|
+
"jinja": true,
|
|
338
|
+
"justMyCode": true
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
Then you can run and debug the application using the VS Code debugger.
|
|
344
|
+
### Run the Broker
|
|
345
|
+
1. Run the taskiq worker
|
|
346
|
+
```taskiq worker src.app.worker:broker -fsd -tp 'src/**/*_tasks.py' --reload
|
|
347
|
+
```
|
|
348
|
+
## Development
|
|
349
|
+
|
|
350
|
+
### Using the Makefile
|
|
351
|
+
|
|
352
|
+
The project includes a comprehensive Makefile for development tasks:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# Show all available commands
|
|
356
|
+
make help
|
|
357
|
+
|
|
358
|
+
# Install package in development mode
|
|
359
|
+
make dev-install
|
|
360
|
+
|
|
361
|
+
# Run tests
|
|
362
|
+
make test
|
|
363
|
+
|
|
364
|
+
# Test CLI installation
|
|
365
|
+
make test-cli
|
|
366
|
+
|
|
367
|
+
# Format code
|
|
368
|
+
make format
|
|
369
|
+
|
|
370
|
+
# Run linting
|
|
371
|
+
make lint
|
|
372
|
+
|
|
373
|
+
# Run all checks (lint + test)
|
|
374
|
+
make check
|
|
375
|
+
|
|
376
|
+
# Clean build artifacts
|
|
377
|
+
make clean
|
|
378
|
+
|
|
379
|
+
# Build package
|
|
380
|
+
make build
|
|
381
|
+
|
|
382
|
+
# Publish to TestPyPI
|
|
383
|
+
make publish-test
|
|
384
|
+
|
|
385
|
+
# Publish to PyPI
|
|
386
|
+
make publish
|
|
387
|
+
|
|
388
|
+
# Complete release workflow
|
|
389
|
+
make release
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Manual Development Setup
|
|
393
|
+
|
|
394
|
+
If you prefer manual setup:
|
|
395
|
+
|
|
396
|
+
1. **Clone the repository:**
|
|
397
|
+
```bash
|
|
398
|
+
git clone https://github.com/Iamsdt/agentflow-cli.git
|
|
399
|
+
cd agentflow-cli
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
2. **Create a virtual environment:**
|
|
403
|
+
```bash
|
|
404
|
+
python -m venv .venv
|
|
405
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
3. **Install in development mode:**
|
|
409
|
+
```bash
|
|
410
|
+
pip install -e .
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
4. **Install development dependencies:**
|
|
414
|
+
```bash
|
|
415
|
+
pip install pytest pytest-cov ruff mypy pre-commit
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
5. **Set up pre-commit hooks:**
|
|
419
|
+
```bash
|
|
420
|
+
pre-commit install
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Testing
|
|
424
|
+
|
|
425
|
+
Run tests using pytest:
|
|
426
|
+
```bash
|
|
427
|
+
pytest src/tests/ -v --cov=pyagenity_api
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Or use the Makefile:
|
|
431
|
+
```bash
|
|
432
|
+
make test
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Publishing to PyPI
|
|
436
|
+
|
|
437
|
+
1. **Test your package locally:**
|
|
438
|
+
```bash
|
|
439
|
+
make test-cli
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
2. **Publish to TestPyPI first:**
|
|
443
|
+
```bash
|
|
444
|
+
make publish-test
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
3. **If everything works, publish to PyPI:**
|
|
448
|
+
```bash
|
|
449
|
+
make publish
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
# Resources
|
|
454
|
+
https://keda.sh/
|
|
455
|
+
Get all the fixers
|
|
456
|
+
pytest --fixtures
|
|
457
|
+
https://www.tutorialspoint.com/pytest/pytest_run_tests_in_parallel.html
|
|
458
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
Task.md
|
|
4
|
+
agentflow.json
|
|
5
|
+
pyproject.toml
|
|
6
|
+
10xscale_agentflow_cli.egg-info/PKG-INFO
|
|
7
|
+
10xscale_agentflow_cli.egg-info/SOURCES.txt
|
|
8
|
+
10xscale_agentflow_cli.egg-info/dependency_links.txt
|
|
9
|
+
10xscale_agentflow_cli.egg-info/entry_points.txt
|
|
10
|
+
10xscale_agentflow_cli.egg-info/not-zip-safe
|
|
11
|
+
10xscale_agentflow_cli.egg-info/requires.txt
|
|
12
|
+
10xscale_agentflow_cli.egg-info/top_level.txt
|
|
13
|
+
agentflow_cli/__init__.py
|
|
14
|
+
agentflow_cli/cli/__init__.py
|
|
15
|
+
agentflow_cli/cli/constants.py
|
|
16
|
+
agentflow_cli/cli/exceptions.py
|
|
17
|
+
agentflow_cli/cli/logger.py
|
|
18
|
+
agentflow_cli/cli/main.py
|
|
19
|
+
agentflow_cli/cli/commands/__init__.py
|
|
20
|
+
agentflow_cli/cli/commands/api.py
|
|
21
|
+
agentflow_cli/cli/commands/build.py
|
|
22
|
+
agentflow_cli/cli/commands/init.py
|
|
23
|
+
agentflow_cli/cli/commands/version.py
|
|
24
|
+
agentflow_cli/cli/core/__init__.py
|
|
25
|
+
agentflow_cli/cli/core/config.py
|
|
26
|
+
agentflow_cli/cli/core/output.py
|
|
27
|
+
agentflow_cli/cli/core/validation.py
|
|
28
|
+
agentflow_cli/cli/templates/__init__.py
|
|
29
|
+
agentflow_cli/cli/templates/defaults.py
|
|
30
|
+
agentflow_cli/src/__init__.py
|
|
31
|
+
agentflow_cli/src/app/__init__.py
|
|
32
|
+
agentflow_cli/src/app/loader.py
|
|
33
|
+
agentflow_cli/src/app/main.py
|
|
34
|
+
agentflow_cli/src/app/worker.py
|
|
35
|
+
agentflow_cli/src/app/core/__init__.py
|
|
36
|
+
agentflow_cli/src/app/core/auth/__init__.py
|
|
37
|
+
agentflow_cli/src/app/core/auth/auth_backend.py
|
|
38
|
+
agentflow_cli/src/app/core/auth/base_auth.py
|
|
39
|
+
agentflow_cli/src/app/core/auth/jwt_auth.py
|
|
40
|
+
agentflow_cli/src/app/core/config/__init__.py
|
|
41
|
+
agentflow_cli/src/app/core/config/graph_config.py
|
|
42
|
+
agentflow_cli/src/app/core/config/sentry_config.py
|
|
43
|
+
agentflow_cli/src/app/core/config/settings.py
|
|
44
|
+
agentflow_cli/src/app/core/config/setup_logs.py
|
|
45
|
+
agentflow_cli/src/app/core/config/setup_middleware.py
|
|
46
|
+
agentflow_cli/src/app/core/config/worker_middleware.py
|
|
47
|
+
agentflow_cli/src/app/core/exceptions/__init__.py
|
|
48
|
+
agentflow_cli/src/app/core/exceptions/general_exception.py
|
|
49
|
+
agentflow_cli/src/app/core/exceptions/handle_errors.py
|
|
50
|
+
agentflow_cli/src/app/core/exceptions/resources_exceptions.py
|
|
51
|
+
agentflow_cli/src/app/core/exceptions/user_exception.py
|
|
52
|
+
agentflow_cli/src/app/routers/__init__.py
|
|
53
|
+
agentflow_cli/src/app/routers/setup_router.py
|
|
54
|
+
agentflow_cli/src/app/routers/checkpointer/__init__.py
|
|
55
|
+
agentflow_cli/src/app/routers/checkpointer/router.py
|
|
56
|
+
agentflow_cli/src/app/routers/checkpointer/schemas/__init__.py
|
|
57
|
+
agentflow_cli/src/app/routers/checkpointer/schemas/checkpointer_schemas.py
|
|
58
|
+
agentflow_cli/src/app/routers/checkpointer/services/__init__.py
|
|
59
|
+
agentflow_cli/src/app/routers/checkpointer/services/checkpointer_service.py
|
|
60
|
+
agentflow_cli/src/app/routers/graph/__init__.py
|
|
61
|
+
agentflow_cli/src/app/routers/graph/router.py
|
|
62
|
+
agentflow_cli/src/app/routers/graph/schemas/__init__.py
|
|
63
|
+
agentflow_cli/src/app/routers/graph/schemas/graph_schemas.py
|
|
64
|
+
agentflow_cli/src/app/routers/graph/services/__init__.py
|
|
65
|
+
agentflow_cli/src/app/routers/graph/services/graph_service.py
|
|
66
|
+
agentflow_cli/src/app/routers/ping/__init__.py
|
|
67
|
+
agentflow_cli/src/app/routers/ping/router.py
|
|
68
|
+
agentflow_cli/src/app/routers/store/__init__.py
|
|
69
|
+
agentflow_cli/src/app/routers/store/router.py
|
|
70
|
+
agentflow_cli/src/app/routers/store/schemas/__init__.py
|
|
71
|
+
agentflow_cli/src/app/routers/store/schemas/store_schemas.py
|
|
72
|
+
agentflow_cli/src/app/routers/store/services/__init__.py
|
|
73
|
+
agentflow_cli/src/app/routers/store/services/store_service.py
|
|
74
|
+
agentflow_cli/src/app/tasks/__init__.py
|
|
75
|
+
agentflow_cli/src/app/tasks/user_tasks.py
|
|
76
|
+
agentflow_cli/src/app/utils/__init__.py
|
|
77
|
+
agentflow_cli/src/app/utils/callable_helper.py
|
|
78
|
+
agentflow_cli/src/app/utils/parse_output.py
|
|
79
|
+
agentflow_cli/src/app/utils/response_helper.py
|
|
80
|
+
agentflow_cli/src/app/utils/snowflake_id_generator.py
|
|
81
|
+
agentflow_cli/src/app/utils/swagger_helper.py
|
|
82
|
+
agentflow_cli/src/app/utils/schemas/__init__.py
|
|
83
|
+
agentflow_cli/src/app/utils/schemas/output_schemas.py
|
|
84
|
+
agentflow_cli/src/app/utils/schemas/user_schemas.py
|
|
85
|
+
graph/__init__.py
|
|
86
|
+
graph/react.py
|
|
87
|
+
scripts/generate_docs.py
|
|
88
|
+
tests/test_utils_parse_and_callable.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
10xscale-agentflow>=0.4.0
|
|
2
|
+
fastapi
|
|
3
|
+
gunicorn==23.0.0
|
|
4
|
+
orjson
|
|
5
|
+
python-multipart==0.0.19
|
|
6
|
+
pydantic==2.8.2
|
|
7
|
+
pydantic-settings==2.3.4
|
|
8
|
+
uvicorn==0.30.1
|
|
9
|
+
typer
|
|
10
|
+
python-dotenv
|
|
11
|
+
PyJWT==2.8.0
|
|
12
|
+
|
|
13
|
+
[firebase]
|
|
14
|
+
firebase-admin==6.5.0
|
|
15
|
+
oauth2client==4.1.3
|
|
16
|
+
|
|
17
|
+
[gcloud]
|
|
18
|
+
google-cloud-logging
|
|
19
|
+
|
|
20
|
+
[redis]
|
|
21
|
+
redis==5.0.7
|
|
22
|
+
|
|
23
|
+
[sentry]
|
|
24
|
+
sentry-sdk==2.10.0
|
|
25
|
+
|
|
26
|
+
[snowflakekit]
|
|
27
|
+
snowflakekit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
include agentflow.json
|
|
2
|
+
include *.md
|
|
3
|
+
include LICENSE*
|
|
4
|
+
include requirements.txt
|
|
5
|
+
include example_weather_agent.py
|
|
6
|
+
recursive-include agentflow_cli *.json
|
|
7
|
+
recursive-include agentflow_cli *.yaml
|
|
8
|
+
recursive-include agentflow_cli *.yml
|
|
9
|
+
recursive-include agentflow_cli *.py
|
|
10
|
+
recursive-include src *.json
|
|
11
|
+
recursive-include src *.yaml
|
|
12
|
+
recursive-include src *.yml
|
|
13
|
+
recursive-include graph *.py
|
|
14
|
+
recursive-include graph *.json
|
|
15
|
+
recursive-include migrations *.py
|
|
16
|
+
recursive-include scripts *.py
|