vaiae 0.1.0__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.
- vaiae-0.1.0/PKG-INFO +431 -0
- vaiae-0.1.0/README.md +408 -0
- vaiae-0.1.0/pyproject.toml +45 -0
- vaiae-0.1.0/setup.cfg +4 -0
- vaiae-0.1.0/src/vaiae/__init__.py +5 -0
- vaiae-0.1.0/src/vaiae/commands.py +193 -0
- vaiae-0.1.0/src/vaiae/constants.py +3 -0
- vaiae-0.1.0/src/vaiae/core.py +372 -0
- vaiae-0.1.0/src/vaiae/logger.py +70 -0
- vaiae-0.1.0/src/vaiae/util.py +107 -0
- vaiae-0.1.0/src/vaiae.egg-info/PKG-INFO +431 -0
- vaiae-0.1.0/src/vaiae.egg-info/SOURCES.txt +16 -0
- vaiae-0.1.0/src/vaiae.egg-info/dependency_links.txt +1 -0
- vaiae-0.1.0/src/vaiae.egg-info/entry_points.txt +2 -0
- vaiae-0.1.0/src/vaiae.egg-info/requires.txt +10 -0
- vaiae-0.1.0/src/vaiae.egg-info/top_level.txt +1 -0
- vaiae-0.1.0/tests/test_commands.py +372 -0
- vaiae-0.1.0/tests/test_util.py +175 -0
vaiae-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vaiae
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Vertex AI Agent Engine CLI.
|
|
5
|
+
Author-email: Hiroshi Toyama <toyama0919@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/toyama0919/vaiae
|
|
7
|
+
Keywords: ai,vertex-ai,deploy,agent,agent-engine,tool,gcp
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: tabulate
|
|
15
|
+
Requires-Dist: google-cloud-aiplatform[adk,agent_engines]
|
|
16
|
+
Requires-Dist: google-adk
|
|
17
|
+
Requires-Dist: click>=7.0
|
|
18
|
+
Requires-Dist: pyyaml
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: tox; extra == "test"
|
|
21
|
+
Requires-Dist: pytest; extra == "test"
|
|
22
|
+
Requires-Dist: mock; extra == "test"
|
|
23
|
+
|
|
24
|
+
# vaiae
|
|
25
|
+
|
|
26
|
+
[](https://badge.fury.io/py/vaiae)
|
|
27
|
+
[](https://github.com/toyama0919/vaiae/actions/workflows/ci.yml)
|
|
28
|
+
[](https://pypi.org/project/vaiae/)
|
|
29
|
+
[](https://github.com/toyama0919/vaiae/blob/main/LICENSE)
|
|
30
|
+
|
|
31
|
+
A command-line tool for deploying and managing **Vertex AI Agent Engine**.
|
|
32
|
+
|
|
33
|
+
Easily create, update, delete, and send messages to agent engines using YAML-based configuration files.
|
|
34
|
+
|
|
35
|
+
## ๐ Features
|
|
36
|
+
|
|
37
|
+
- **Easy Deployment**: Define agent engines in YAML files and deploy with a single command
|
|
38
|
+
- **Profile Management**: Manage multiple environment configurations (dev, prod, etc.) in one file
|
|
39
|
+
- **Interactive Messaging**: Chat with your deployed agents
|
|
40
|
+
- **Comprehensive Management**: Create, update, delete, and list agent engines
|
|
41
|
+
- **Python API**: Use as a Python library in addition to the CLI
|
|
42
|
+
- **Dry Run Support**: Preview operations before executing them
|
|
43
|
+
|
|
44
|
+
## ๐ Requirements
|
|
45
|
+
|
|
46
|
+
- Python 3.10 or higher
|
|
47
|
+
- Google Cloud Platform account
|
|
48
|
+
- Vertex AI API enabled
|
|
49
|
+
|
|
50
|
+
## ๐ง Installation
|
|
51
|
+
|
|
52
|
+
### Install from PyPI
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install vaiae
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Install Development Version
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/toyama0919/vaiae.git
|
|
62
|
+
cd vaiae
|
|
63
|
+
pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## โ๏ธ Initial Setup
|
|
67
|
+
|
|
68
|
+
### Authentication Setup
|
|
69
|
+
|
|
70
|
+
Configure Google Cloud authentication:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Using Application Default Credentials
|
|
74
|
+
gcloud auth application-default login
|
|
75
|
+
|
|
76
|
+
# Using service account key
|
|
77
|
+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## ๐ Configuration File
|
|
81
|
+
|
|
82
|
+
Create a `.agent-engine.yml` file in your project root to define agent engine configurations.
|
|
83
|
+
|
|
84
|
+
### Basic Configuration Example
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
# Default profile
|
|
88
|
+
default:
|
|
89
|
+
# Vertex AI settings
|
|
90
|
+
vertex_ai:
|
|
91
|
+
project: "my-gcp-project"
|
|
92
|
+
location: "asia-northeast1"
|
|
93
|
+
staging_bucket: "my-staging-bucket"
|
|
94
|
+
|
|
95
|
+
display_name: "my-agent-engine"
|
|
96
|
+
description: "My custom agent engine"
|
|
97
|
+
gcs_dir_name: "my-agent/1.0.0"
|
|
98
|
+
|
|
99
|
+
# Agent configuration
|
|
100
|
+
agent_engine:
|
|
101
|
+
instance_path: "my_package.agents.main_agent"
|
|
102
|
+
|
|
103
|
+
# Environment variables
|
|
104
|
+
env_vars:
|
|
105
|
+
API_KEY: "your-api-key"
|
|
106
|
+
SLACK_WEBHOOK_URL:
|
|
107
|
+
secret: "slack-webhook-url"
|
|
108
|
+
version: "latest"
|
|
109
|
+
|
|
110
|
+
# Dependencies
|
|
111
|
+
requirements:
|
|
112
|
+
- "google-cloud-aiplatform[adk,agent_engines]==1.96.0"
|
|
113
|
+
- "google-adk"
|
|
114
|
+
- "requests"
|
|
115
|
+
|
|
116
|
+
# Extra packages
|
|
117
|
+
extra_packages:
|
|
118
|
+
- "my-custom-package-1.0.0-py3-none-any.whl"
|
|
119
|
+
|
|
120
|
+
# Development environment
|
|
121
|
+
development:
|
|
122
|
+
vertex_ai:
|
|
123
|
+
project: "dev-project"
|
|
124
|
+
location: "asia-northeast1"
|
|
125
|
+
display_name: "my-agent-dev"
|
|
126
|
+
description: "Development environment agent"
|
|
127
|
+
# Other settings inherit from default
|
|
128
|
+
|
|
129
|
+
# Production environment
|
|
130
|
+
production:
|
|
131
|
+
vertex_ai:
|
|
132
|
+
project: "prod-project"
|
|
133
|
+
location: "asia-northeast1"
|
|
134
|
+
display_name: "my-agent-prod"
|
|
135
|
+
description: "Production environment agent"
|
|
136
|
+
# Other settings inherit from default
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Agent Configuration
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
agent_engine:
|
|
143
|
+
instance_path: "my_package.agents.root_agent"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Dynamically imports and uses an existing agent instance.
|
|
147
|
+
|
|
148
|
+
### Deploy Agent Engine
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Dry run to preview deployment
|
|
152
|
+
vaiae deploy --dry-run
|
|
153
|
+
|
|
154
|
+
# Actually deploy
|
|
155
|
+
vaiae deploy
|
|
156
|
+
|
|
157
|
+
# Use specific profile
|
|
158
|
+
vaiae --profile production deploy
|
|
159
|
+
|
|
160
|
+
# Use custom config file
|
|
161
|
+
vaiae --yaml-file custom-config.yml deploy
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### List Deployed Agent Engines
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
vaiae list
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Send Messages to Agent
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Basic message sending
|
|
174
|
+
vaiae send -m "Hello, please perform analysis" -d "my-agent-engine"
|
|
175
|
+
|
|
176
|
+
# Continue conversation with session ID
|
|
177
|
+
vaiae send -m "Please continue" -d "my-agent-engine" -s "session-123"
|
|
178
|
+
|
|
179
|
+
# Specify user ID
|
|
180
|
+
vaiae send -m "Create a report" -d "my-agent-engine" -u "user-456"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Delete Agent Engine
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Delete by name (dry run)
|
|
187
|
+
vaiae delete -n "my-agent-engine" --dry-run
|
|
188
|
+
|
|
189
|
+
# Actually delete
|
|
190
|
+
vaiae delete -n "my-agent-engine"
|
|
191
|
+
|
|
192
|
+
# Delete using current profile configuration
|
|
193
|
+
vaiae delete --dry-run
|
|
194
|
+
|
|
195
|
+
# Force delete (including child resources)
|
|
196
|
+
vaiae delete -n "my-agent-engine" --force
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Debug Mode
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Debug with verbose logging
|
|
203
|
+
vaiae --debug deploy
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## ๐ Python API Usage
|
|
207
|
+
|
|
208
|
+
### Basic Usage
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
from vaiae.core import Core
|
|
212
|
+
|
|
213
|
+
# Initialize Core instance
|
|
214
|
+
core = Core(
|
|
215
|
+
yaml_file_path=".agent-engine.yml",
|
|
216
|
+
profile="default"
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
# Deploy
|
|
220
|
+
core.create_or_update_from_yaml(dry_run=False)
|
|
221
|
+
|
|
222
|
+
# Send message
|
|
223
|
+
response = core.send_message(
|
|
224
|
+
message="Please perform analysis",
|
|
225
|
+
display_name="my-agent-engine",
|
|
226
|
+
user_id="user123"
|
|
227
|
+
)
|
|
228
|
+
print(response)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Profile-based Deployment
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
from vaiae.core import Core
|
|
235
|
+
|
|
236
|
+
# Deploy to development environment
|
|
237
|
+
dev_core = Core(yaml_file_path=".agent-engine.yml", profile="development")
|
|
238
|
+
dev_core.create_or_update_from_yaml(dry_run=False)
|
|
239
|
+
|
|
240
|
+
# Deploy to production environment
|
|
241
|
+
prod_core = Core(yaml_file_path=".agent-engine.yml", profile="production")
|
|
242
|
+
prod_core.create_or_update_from_yaml(dry_run=False)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Override Configuration
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
from vaiae.core import Core
|
|
249
|
+
|
|
250
|
+
core = Core(yaml_file_path=".agent-engine.yml", profile="development")
|
|
251
|
+
|
|
252
|
+
# Partially override YAML configuration
|
|
253
|
+
core.create_or_update_from_yaml(
|
|
254
|
+
dry_run=False,
|
|
255
|
+
description="Custom description",
|
|
256
|
+
env_vars={
|
|
257
|
+
"CUSTOM_VAR": "custom_value",
|
|
258
|
+
"API_ENDPOINT": "https://api.example.com"
|
|
259
|
+
},
|
|
260
|
+
requirements=["additional-package==1.0.0"]
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Agent Engine Management
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
from vaiae.core import Core
|
|
268
|
+
|
|
269
|
+
core = Core(yaml_file_path=".agent-engine.yml", profile="default")
|
|
270
|
+
|
|
271
|
+
# List agent engines
|
|
272
|
+
agent_engines = core.list_agent_engine()
|
|
273
|
+
for engine in agent_engines:
|
|
274
|
+
print(f"Name: {engine.display_name}")
|
|
275
|
+
print(f"Resource: {engine.resource_name}")
|
|
276
|
+
|
|
277
|
+
# Delete
|
|
278
|
+
core.delete_agent_engine_from_yaml(
|
|
279
|
+
force=False,
|
|
280
|
+
dry_run=False
|
|
281
|
+
)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## ๐ Troubleshooting
|
|
285
|
+
|
|
286
|
+
### Common Issues and Solutions
|
|
287
|
+
|
|
288
|
+
#### Authentication Error
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
Error: Could not automatically determine credentials
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Solution:**
|
|
295
|
+
```bash
|
|
296
|
+
gcloud auth application-default login
|
|
297
|
+
# or
|
|
298
|
+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
#### Permission Denied Error
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
Error: Permission denied
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Solution:**
|
|
308
|
+
- The service account or user needs the following permissions:
|
|
309
|
+
- `aiplatform.agentEngines.create`
|
|
310
|
+
- `aiplatform.agentEngines.update`
|
|
311
|
+
- `aiplatform.agentEngines.delete`
|
|
312
|
+
- `aiplatform.agentEngines.list`
|
|
313
|
+
|
|
314
|
+
#### YAML Configuration Error
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
Error: Invalid YAML configuration
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Solution:**
|
|
321
|
+
- Check YAML syntax is correct
|
|
322
|
+
- Verify required fields are configured
|
|
323
|
+
- Verify indentation is correct
|
|
324
|
+
|
|
325
|
+
### Debugging
|
|
326
|
+
|
|
327
|
+
For detailed logs:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
vaiae --debug deploy
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## ๐งช Development & Testing
|
|
334
|
+
|
|
335
|
+
### Development Environment Setup
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
git clone https://github.com/toyama0919/vaiae.git
|
|
339
|
+
cd vaiae
|
|
340
|
+
|
|
341
|
+
# Install development dependencies
|
|
342
|
+
pip install -e ".[test]"
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Run Tests
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
# Install test packages
|
|
349
|
+
./scripts/ci.sh install
|
|
350
|
+
|
|
351
|
+
# Run tests
|
|
352
|
+
./scripts/ci.sh run-test
|
|
353
|
+
|
|
354
|
+
# Run individual tests
|
|
355
|
+
pytest tests/test_commands.py
|
|
356
|
+
pytest tests/test_util.py
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Code Quality Checks
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# Run flake8, black, pytest
|
|
363
|
+
./scripts/ci.sh run-test
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Release
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# Create version tag and PyPI release
|
|
370
|
+
./scripts/ci.sh release
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## ๐ API Reference
|
|
374
|
+
|
|
375
|
+
### Core Class
|
|
376
|
+
|
|
377
|
+
Main API class.
|
|
378
|
+
|
|
379
|
+
#### Initialization
|
|
380
|
+
|
|
381
|
+
```python
|
|
382
|
+
Core(
|
|
383
|
+
yaml_file_path: str = None,
|
|
384
|
+
profile: str = "default",
|
|
385
|
+
project: str = None,
|
|
386
|
+
location: str = None,
|
|
387
|
+
staging_bucket: str = None,
|
|
388
|
+
debug: bool = False
|
|
389
|
+
)
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
#### Main Methods
|
|
393
|
+
|
|
394
|
+
- `create_or_update_from_yaml(dry_run=False, **overrides)`: Deploy agent engine
|
|
395
|
+
- `delete_agent_engine_from_yaml(force=False, dry_run=False)`: Delete agent engine
|
|
396
|
+
- `send_message(message, display_name, session_id=None, user_id=None)`: Send message
|
|
397
|
+
- `list_agent_engine()`: List agent engines
|
|
398
|
+
|
|
399
|
+
## ๐ค Contributing
|
|
400
|
+
|
|
401
|
+
Contributions to the project are welcome!
|
|
402
|
+
|
|
403
|
+
### How to Contribute
|
|
404
|
+
|
|
405
|
+
1. Fork this repository
|
|
406
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
407
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
408
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
409
|
+
5. Create a Pull Request
|
|
410
|
+
|
|
411
|
+
### Development Guidelines
|
|
412
|
+
|
|
413
|
+
- Code style: Black + flake8
|
|
414
|
+
- Testing: pytest
|
|
415
|
+
- Commit messages: Keep them concise and in English
|
|
416
|
+
- Documentation: Add appropriate documentation for new features
|
|
417
|
+
|
|
418
|
+
## ๐ License
|
|
419
|
+
|
|
420
|
+
This project is released under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
421
|
+
|
|
422
|
+
## ๐จโ๐ป Author
|
|
423
|
+
|
|
424
|
+
**Hiroshi Toyama** - [toyama0919@gmail.com](mailto:toyama0919@gmail.com)
|
|
425
|
+
|
|
426
|
+
## ๐ Related Links
|
|
427
|
+
|
|
428
|
+
- [PyPI Package](https://pypi.org/project/vaiae/)
|
|
429
|
+
- [GitHub Repository](https://github.com/toyama0919/vaiae)
|
|
430
|
+
- [Google Cloud Vertex AI](https://cloud.google.com/vertex-ai)
|
|
431
|
+
- [Vertex AI Agent Builder](https://cloud.google.com/vertex-ai/docs/agent-builder)
|