orchestrator-client 5.5.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.
- orchestrator_client-5.5.2/PKG-INFO +108 -0
- orchestrator_client-5.5.2/README.md +92 -0
- orchestrator_client-5.5.2/orchestrator_client/__init__.py +157 -0
- orchestrator_client-5.5.2/orchestrator_client/client.py +1456 -0
- orchestrator_client-5.5.2/orchestrator_client/config.py +63 -0
- orchestrator_client-5.5.2/orchestrator_client/exceptions.py +74 -0
- orchestrator_client-5.5.2/orchestrator_client/models.py +513 -0
- orchestrator_client-5.5.2/orchestrator_client/socketio.py +255 -0
- orchestrator_client-5.5.2/orchestrator_client/sync_client.py +698 -0
- orchestrator_client-5.5.2/orchestrator_client.egg-info/PKG-INFO +108 -0
- orchestrator_client-5.5.2/orchestrator_client.egg-info/SOURCES.txt +17 -0
- orchestrator_client-5.5.2/orchestrator_client.egg-info/dependency_links.txt +1 -0
- orchestrator_client-5.5.2/orchestrator_client.egg-info/requires.txt +9 -0
- orchestrator_client-5.5.2/orchestrator_client.egg-info/top_level.txt +1 -0
- orchestrator_client-5.5.2/pyproject.toml +40 -0
- orchestrator_client-5.5.2/setup.cfg +4 -0
- orchestrator_client-5.5.2/tests/test_client.py +368 -0
- orchestrator_client-5.5.2/tests/test_integration.py +393 -0
- orchestrator_client-5.5.2/tests/test_sync_client.py +86 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: orchestrator-client
|
|
3
|
+
Version: 5.5.2
|
|
4
|
+
Summary: Async Python client for the DAMIT AIOps Orchestrator REST API and Socket.IO realtime events
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: httpx>=0.28
|
|
9
|
+
Requires-Dist: python-socketio[asyncio_client]>=5.12
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff>=0.8; extra == "dev"
|
|
14
|
+
Requires-Dist: respx>=0.22; extra == "dev"
|
|
15
|
+
Requires-Dist: python-dotenv>=1.0; extra == "dev"
|
|
16
|
+
|
|
17
|
+
# orchestrator-client
|
|
18
|
+
|
|
19
|
+
Python client for the [DAMIT AIOps Orchestrator](https://github.com/DamitDev/orchestrator) REST API and Socket.IO realtime events.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install orchestrator-client
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Requires Python >= 3.12.
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from orchestrator_client import Orchestrator
|
|
33
|
+
|
|
34
|
+
client = Orchestrator(base_url="http://localhost:8080")
|
|
35
|
+
|
|
36
|
+
# Create a task
|
|
37
|
+
task = client.create_task(
|
|
38
|
+
workflow_id="proactive",
|
|
39
|
+
goal_prompt="Analyze system logs for errors",
|
|
40
|
+
max_iterations=50,
|
|
41
|
+
)
|
|
42
|
+
print(f"Created: {task.task_id}")
|
|
43
|
+
|
|
44
|
+
# Poll status
|
|
45
|
+
status = client.get_task_status(task.task_id)
|
|
46
|
+
print(f"Status: {status.status}, iteration {status.iteration}/{status.max_iterations}")
|
|
47
|
+
|
|
48
|
+
# List tasks
|
|
49
|
+
tasks = client.list_tasks(workflow_id="proactive", limit=10)
|
|
50
|
+
for t in tasks.tasks:
|
|
51
|
+
print(f" {t.id}: {t.status}")
|
|
52
|
+
|
|
53
|
+
# Cancel
|
|
54
|
+
client.cancel_task(task.task_id)
|
|
55
|
+
|
|
56
|
+
client.close()
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Environment Variables
|
|
60
|
+
|
|
61
|
+
| Variable | Default | Description |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `ORCHESTRATOR_URL` | `http://localhost:8080` | Base URL (supports subpath) |
|
|
64
|
+
| `ORCHESTRATOR_API_KEY` | — | Optional bearer token |
|
|
65
|
+
| `ORCHESTRATOR_TIMEOUT` | `30.0` | HTTP timeout (seconds) |
|
|
66
|
+
| `ORCHESTRATOR_MAX_RETRIES` | `3` | Max retry attempts |
|
|
67
|
+
|
|
68
|
+
## Async Variant
|
|
69
|
+
|
|
70
|
+
For use inside async code (e.g. FastAPI, asyncio scripts):
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from orchestrator_client import OrchestratorAsync
|
|
74
|
+
|
|
75
|
+
async with OrchestratorAsync() as client:
|
|
76
|
+
status = await client.get_task_status("task-abc123")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Exceptions
|
|
80
|
+
|
|
81
|
+
All inherit from `OrchestratorError` and carry `status_code` and `error_code`:
|
|
82
|
+
|
|
83
|
+
| Exception | Meaning |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `OrchestratorConnectionError` | Network / DNS / timeout |
|
|
86
|
+
| `OrchestratorAuthError` | 401/403 |
|
|
87
|
+
| `OrchestratorNotFoundError` | 404 |
|
|
88
|
+
| `OrchestratorAPIError` | 400/500 with error code |
|
|
89
|
+
| `OrchestratorConfigError` | Bad env vars / missing config |
|
|
90
|
+
|
|
91
|
+
## Documentation
|
|
92
|
+
|
|
93
|
+
Detailed docs with full method listings and examples:
|
|
94
|
+
|
|
95
|
+
- [REST API client](docs/client.md) — all endpoints, workflow interactions, configuration
|
|
96
|
+
- [Socket.IO realtime](docs/realtime.md) — event types, room subscriptions, streaming
|
|
97
|
+
- [SSE status stream](docs/sse.md) — lightweight status-only monitoring
|
|
98
|
+
|
|
99
|
+
## Testing
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pip install -e ".[dev]"
|
|
103
|
+
pytest
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
Apache 2.0
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# orchestrator-client
|
|
2
|
+
|
|
3
|
+
Python client for the [DAMIT AIOps Orchestrator](https://github.com/DamitDev/orchestrator) REST API and Socket.IO realtime events.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install orchestrator-client
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Python >= 3.12.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from orchestrator_client import Orchestrator
|
|
17
|
+
|
|
18
|
+
client = Orchestrator(base_url="http://localhost:8080")
|
|
19
|
+
|
|
20
|
+
# Create a task
|
|
21
|
+
task = client.create_task(
|
|
22
|
+
workflow_id="proactive",
|
|
23
|
+
goal_prompt="Analyze system logs for errors",
|
|
24
|
+
max_iterations=50,
|
|
25
|
+
)
|
|
26
|
+
print(f"Created: {task.task_id}")
|
|
27
|
+
|
|
28
|
+
# Poll status
|
|
29
|
+
status = client.get_task_status(task.task_id)
|
|
30
|
+
print(f"Status: {status.status}, iteration {status.iteration}/{status.max_iterations}")
|
|
31
|
+
|
|
32
|
+
# List tasks
|
|
33
|
+
tasks = client.list_tasks(workflow_id="proactive", limit=10)
|
|
34
|
+
for t in tasks.tasks:
|
|
35
|
+
print(f" {t.id}: {t.status}")
|
|
36
|
+
|
|
37
|
+
# Cancel
|
|
38
|
+
client.cancel_task(task.task_id)
|
|
39
|
+
|
|
40
|
+
client.close()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Environment Variables
|
|
44
|
+
|
|
45
|
+
| Variable | Default | Description |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `ORCHESTRATOR_URL` | `http://localhost:8080` | Base URL (supports subpath) |
|
|
48
|
+
| `ORCHESTRATOR_API_KEY` | — | Optional bearer token |
|
|
49
|
+
| `ORCHESTRATOR_TIMEOUT` | `30.0` | HTTP timeout (seconds) |
|
|
50
|
+
| `ORCHESTRATOR_MAX_RETRIES` | `3` | Max retry attempts |
|
|
51
|
+
|
|
52
|
+
## Async Variant
|
|
53
|
+
|
|
54
|
+
For use inside async code (e.g. FastAPI, asyncio scripts):
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from orchestrator_client import OrchestratorAsync
|
|
58
|
+
|
|
59
|
+
async with OrchestratorAsync() as client:
|
|
60
|
+
status = await client.get_task_status("task-abc123")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Exceptions
|
|
64
|
+
|
|
65
|
+
All inherit from `OrchestratorError` and carry `status_code` and `error_code`:
|
|
66
|
+
|
|
67
|
+
| Exception | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `OrchestratorConnectionError` | Network / DNS / timeout |
|
|
70
|
+
| `OrchestratorAuthError` | 401/403 |
|
|
71
|
+
| `OrchestratorNotFoundError` | 404 |
|
|
72
|
+
| `OrchestratorAPIError` | 400/500 with error code |
|
|
73
|
+
| `OrchestratorConfigError` | Bad env vars / missing config |
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
Detailed docs with full method listings and examples:
|
|
78
|
+
|
|
79
|
+
- [REST API client](docs/client.md) — all endpoints, workflow interactions, configuration
|
|
80
|
+
- [Socket.IO realtime](docs/realtime.md) — event types, room subscriptions, streaming
|
|
81
|
+
- [SSE status stream](docs/sse.md) — lightweight status-only monitoring
|
|
82
|
+
|
|
83
|
+
## Testing
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install -e ".[dev]"
|
|
87
|
+
pytest
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
Apache 2.0
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""orchestrator-client — async Python client for the DAMIT AIOps Orchestrator.
|
|
2
|
+
|
|
3
|
+
Provides a complete wrapper for the orchestrator's REST API and
|
|
4
|
+
Socket.IO realtime events, with typed responses, automatic retry,
|
|
5
|
+
and configurable auth.
|
|
6
|
+
|
|
7
|
+
Main components:
|
|
8
|
+
|
|
9
|
+
* :class:`Orchestrator` — synchronous REST client (primary interface)
|
|
10
|
+
* :class:`OrchestratorAsync` — async REST client (for async contexts)
|
|
11
|
+
* :class:`RealtimeClient` — Socket.IO event subscription layer
|
|
12
|
+
* Typed exception hierarchy (:class:`OrchestratorError` and subclasses)
|
|
13
|
+
* Typed response models (dataclasses for all response shapes)
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
__version__ = version("orchestrator-client")
|
|
20
|
+
except PackageNotFoundError:
|
|
21
|
+
__version__ = "0.0.0.dev"
|
|
22
|
+
|
|
23
|
+
from orchestrator_client.client import OrchestratorAsync
|
|
24
|
+
from orchestrator_client.config import OrchestratorConfig, load_config
|
|
25
|
+
from orchestrator_client.exceptions import (
|
|
26
|
+
OrchestratorAPIError,
|
|
27
|
+
OrchestratorAuthError,
|
|
28
|
+
OrchestratorConfigError,
|
|
29
|
+
OrchestratorConnectionError,
|
|
30
|
+
OrchestratorError,
|
|
31
|
+
OrchestratorNotFoundError,
|
|
32
|
+
)
|
|
33
|
+
from orchestrator_client.models import (
|
|
34
|
+
ArchivedContent,
|
|
35
|
+
AttachmentMeta,
|
|
36
|
+
# Attachments
|
|
37
|
+
AttachmentUploadResponse,
|
|
38
|
+
# Auth / WebSocket
|
|
39
|
+
AuthConfig,
|
|
40
|
+
# Compaction / Journal
|
|
41
|
+
CompactionEvent,
|
|
42
|
+
ConfigurationStatus,
|
|
43
|
+
ConversationResult,
|
|
44
|
+
ErrorCountResult,
|
|
45
|
+
# Error events
|
|
46
|
+
ErrorEvent,
|
|
47
|
+
ErrorEventDetail,
|
|
48
|
+
ErrorPurgeResult,
|
|
49
|
+
ErrorStatsResult,
|
|
50
|
+
HealthDetail,
|
|
51
|
+
# Health / Metrics
|
|
52
|
+
HealthStatus,
|
|
53
|
+
LeaderStatus,
|
|
54
|
+
MatrixConversationResult,
|
|
55
|
+
# Conversation
|
|
56
|
+
Message,
|
|
57
|
+
MetricSnapshot,
|
|
58
|
+
MioContext,
|
|
59
|
+
Pagination,
|
|
60
|
+
ReadinessResult,
|
|
61
|
+
SlotsStatus,
|
|
62
|
+
# Workflow-specific
|
|
63
|
+
SuccessResponse,
|
|
64
|
+
SummaryWorkerStatus,
|
|
65
|
+
# Configuration
|
|
66
|
+
SystemStatus,
|
|
67
|
+
SystemStatusSettings,
|
|
68
|
+
TaskCancelResponse,
|
|
69
|
+
TaskCreateResponse,
|
|
70
|
+
TaskDeleteResult,
|
|
71
|
+
TaskDetail,
|
|
72
|
+
TaskHandlerStatus,
|
|
73
|
+
TaskHandlerStatusLocal,
|
|
74
|
+
TaskJournal,
|
|
75
|
+
TaskListResult,
|
|
76
|
+
# Core task models
|
|
77
|
+
TaskSummary,
|
|
78
|
+
TokenWorkerStatus,
|
|
79
|
+
ToolCall,
|
|
80
|
+
# Tools
|
|
81
|
+
ToolInfo,
|
|
82
|
+
ToolsListResult,
|
|
83
|
+
VSATaskCreateResponse,
|
|
84
|
+
WebSocketStatus,
|
|
85
|
+
WorkflowStates,
|
|
86
|
+
)
|
|
87
|
+
from orchestrator_client.socketio import RealtimeClient
|
|
88
|
+
from orchestrator_client.sync_client import Orchestrator
|
|
89
|
+
|
|
90
|
+
__all__ = [
|
|
91
|
+
# Client classes
|
|
92
|
+
"Orchestrator",
|
|
93
|
+
"OrchestratorAsync",
|
|
94
|
+
"RealtimeClient",
|
|
95
|
+
# Config
|
|
96
|
+
"OrchestratorConfig",
|
|
97
|
+
"load_config",
|
|
98
|
+
# Exceptions
|
|
99
|
+
"OrchestratorError",
|
|
100
|
+
"OrchestratorConnectionError",
|
|
101
|
+
"OrchestratorAuthError",
|
|
102
|
+
"OrchestratorNotFoundError",
|
|
103
|
+
"OrchestratorAPIError",
|
|
104
|
+
"OrchestratorConfigError",
|
|
105
|
+
# Task models
|
|
106
|
+
"TaskSummary",
|
|
107
|
+
"TaskDetail",
|
|
108
|
+
"TaskListResult",
|
|
109
|
+
"TaskCreateResponse",
|
|
110
|
+
"TaskCancelResponse",
|
|
111
|
+
"TaskDeleteResult",
|
|
112
|
+
"Pagination",
|
|
113
|
+
# Conversation
|
|
114
|
+
"Message",
|
|
115
|
+
"ConversationResult",
|
|
116
|
+
"AttachmentMeta",
|
|
117
|
+
"ToolCall",
|
|
118
|
+
"ArchivedContent",
|
|
119
|
+
# Compaction / Journal
|
|
120
|
+
"CompactionEvent",
|
|
121
|
+
"TaskJournal",
|
|
122
|
+
# Attachments
|
|
123
|
+
"AttachmentUploadResponse",
|
|
124
|
+
# Tools
|
|
125
|
+
"ToolInfo",
|
|
126
|
+
"ToolsListResult",
|
|
127
|
+
# Error events
|
|
128
|
+
"ErrorEvent",
|
|
129
|
+
"ErrorEventDetail",
|
|
130
|
+
"ErrorStatsResult",
|
|
131
|
+
"ErrorCountResult",
|
|
132
|
+
"ErrorPurgeResult",
|
|
133
|
+
# Configuration
|
|
134
|
+
"SystemStatus",
|
|
135
|
+
"SystemStatusSettings",
|
|
136
|
+
"ConfigurationStatus",
|
|
137
|
+
"TaskHandlerStatus",
|
|
138
|
+
"TaskHandlerStatusLocal",
|
|
139
|
+
"SummaryWorkerStatus",
|
|
140
|
+
"TokenWorkerStatus",
|
|
141
|
+
"SlotsStatus",
|
|
142
|
+
# Health / Metrics
|
|
143
|
+
"HealthStatus",
|
|
144
|
+
"HealthDetail",
|
|
145
|
+
"ReadinessResult",
|
|
146
|
+
"LeaderStatus",
|
|
147
|
+
"MetricSnapshot",
|
|
148
|
+
# Auth / WebSocket
|
|
149
|
+
"AuthConfig",
|
|
150
|
+
"WebSocketStatus",
|
|
151
|
+
# Workflow-specific
|
|
152
|
+
"SuccessResponse",
|
|
153
|
+
"MioContext",
|
|
154
|
+
"MatrixConversationResult",
|
|
155
|
+
"VSATaskCreateResponse",
|
|
156
|
+
"WorkflowStates",
|
|
157
|
+
]
|