11# AIP Endpoints
22
3- !!!quote "Complete Client/Server Implementations"
4- Endpoints combine protocol, transport, and resilience components to provide production-ready AIP communication for servers, clients, and orchestrators.
3+ Endpoints combine protocol, transport, and resilience components to provide production-ready AIP communication for servers, clients, and orchestrators.
54
65## Endpoint Types at a Glance
76
@@ -38,15 +37,14 @@ graph TB
3837
3938The dashed arrows indicate capabilities that the base class provides to all subclasses. This inheritance design ensures consistent behavior across all endpoint types while allowing specialization for server, client, and orchestrator roles.
4039
41- !!!info "Base Endpoint Components"
42- All endpoints inherit from ` AIPEndpoint ` , which provides:
43-
44- - ** Protocol** : Message serialization and handling
45- - ** Reconnection Strategy** : Automatic reconnection with backoff
46- - ** Timeout Manager** : Operation timeout management
47- - ** Session Handlers** : Per-session state tracking
40+ ** Base Endpoint Components:**
4841
49- ---
42+ All endpoints inherit from ` AIPEndpoint ` , which provides:
43+
44+ - ** Protocol** : Message serialization and handling
45+ - ** Reconnection Strategy** : Automatic reconnection with backoff
46+ - ** Timeout Manager** : Operation timeout management
47+ - ** Session Handlers** : Per-session state tracking
5048
5149## Base Endpoint: AIPEndpoint
5250
@@ -83,18 +81,17 @@ await endpoint.stop()
8381
8482## DeviceServerEndpoint
8583
86- !!!tip "Server-Side Device Management"
87- Wraps UFO's server-side WebSocket handler with AIP protocol support for managing multiple device connections simultaneously.
84+ Wraps UFO's server-side WebSocket handler with AIP protocol support for managing multiple device connections simultaneously.
8885
8986### Configuration
9087
9188``` python
9289from aip.endpoints import DeviceServerEndpoint
9390
9491endpoint = DeviceServerEndpoint(
95- client_manager = client_manager, # WebSocket connection manager
96- session_manager = session_manager, # Session state manager
97- local = False # Local vs remote deployment
92+ ws_manager = ws_manager, # WebSocket connection manager
93+ session_manager = session_manager, # Session state manager
94+ local = False # Local vs remote deployment
9895)
9996```
10097
@@ -105,7 +102,7 @@ from fastapi import FastAPI, WebSocket
105102from aip.endpoints import DeviceServerEndpoint
106103
107104app = FastAPI()
108- endpoint = DeviceServerEndpoint(client_manager , session_manager)
105+ endpoint = DeviceServerEndpoint(ws_manager , session_manager)
109106
110107@app.websocket (" /ws" )
111108async def websocket_route (websocket : WebSocket):
@@ -122,8 +119,9 @@ async def websocket_route(websocket: WebSocket):
122119| ** Result Aggregation** | Collect and format execution results | Unified response handling |
123120| ** Auto Task Cancellation** | Cancel tasks on disconnect | Prevent orphaned tasks |
124121
125- !!!success "Backward Compatibility"
126- The Device Server Endpoint maintains full compatibility with UFO's existing WebSocket handler.
122+ ** Backward Compatibility:**
123+
124+ The Device Server Endpoint maintains full compatibility with UFO's existing WebSocket handler.
127125
128126### Task Cancellation on Disconnection
129127
@@ -139,8 +137,7 @@ await endpoint.cancel_device_tasks(
139137
140138## DeviceClientEndpoint
141139
142- !!!tip "Client-Side Device Operations"
143- Wraps UFO's client-side WebSocket client with AIP protocol support, automatic reconnection, and heartbeat management.
140+ Wraps UFO's client-side WebSocket client with AIP protocol support, automatic reconnection, and heartbeat management.
144141
145142### Configuration
146143
@@ -159,7 +156,7 @@ endpoint = DeviceClientEndpoint(
159156
160157| Feature | Default Behavior | Configuration |
161158| ---------| ------------------| ---------------|
162- | ** Heartbeat** | Starts on connection | 20s interval (configurable ) |
159+ | ** Heartbeat** | Starts on connection | 20s interval (fixed ) |
163160| ** Reconnection** | Exponential backoff | ` max_retries=3 ` , ` initial_backoff=2.0 ` |
164161| ** Message Routing** | Auto-routes to UFO client | Handled internally |
165162| ** Connection Management** | Auto-connect on start | Transparent to user |
@@ -199,8 +196,7 @@ endpoint = DeviceClientEndpoint(
199196
200197## ConstellationEndpoint
201198
202- !!!tip "Orchestrator-Side Multi-Device Coordination"
203- Enables the ConstellationClient to communicate with multiple devices simultaneously, managing connections, tasks, and queries.
199+ Enables the ConstellationClient to communicate with multiple devices simultaneously, managing connections, tasks, and queries.
204200
205201### Configuration
206202
@@ -234,6 +230,8 @@ connection = await endpoint.connect_to_device(
234230)
235231```
236232
233+ Learn more about [ AgentProfile configuration] ( ../galaxy/client/device_manager.md ) in the Galaxy documentation.
234+
237235### Sending Tasks
238236
239237``` python
@@ -398,8 +396,8 @@ await endpoint.stop()
398396
399397## Resilience Features
400398
401- !!!success "Built-In Resilience"
402- All endpoints include automatic reconnection, timeout management, and heartbeat monitoring.
399+ !!!warning "Built-In Resilience"
400+ All endpoints include automatic reconnection, timeout management, and heartbeat monitoring for production reliability .
403401
404402### Resilience Configuration
405403
@@ -484,12 +482,13 @@ class CustomEndpoint(DeviceClientEndpoint):
484482
485483## Best Practices
486484
487- !!!tip "Endpoint Selection"
488- | Use Case | Endpoint Type |
489- |----------|---------------|
490- | Device agent server | ` DeviceServerEndpoint ` |
491- | Device agent client | ` DeviceClientEndpoint ` |
492- | Multi-device orchestrator | ` ConstellationEndpoint ` |
485+ ** Endpoint Selection:**
486+
487+ | Use Case | Endpoint Type |
488+ | ----------| ---------------|
489+ | Device agent server | ` DeviceServerEndpoint ` |
490+ | Device agent client | ` DeviceClientEndpoint ` |
491+ | Multi-device orchestrator | ` ConstellationEndpoint ` |
493492
494493!!!warning "Configuration Guidelines"
495494 - ** Set appropriate timeouts** based on deployment environment
@@ -539,4 +538,7 @@ from aip.endpoints import (
539538- [ Resilience] ( ./resilience.md ) - Reconnection and heartbeat management
540539- [ Messages] ( ./messages.md ) - Message types and validation
541540- [ Overview] ( ./overview.md ) - System architecture and design
541+ - [ Galaxy Client] ( ../galaxy/client/overview.md ) - Multi-device orchestration with ConstellationClient
542+ - [ UFO Server] ( ../server/websocket_handler.md ) - WebSocket server implementation
543+ - [ UFO Client] ( ../client/websocket_client.md ) - WebSocket client implementation
542544
0 commit comments