2026-04-24 12:07:20 +08:00

24 lines
770 B
Plaintext

# Get all services for display in services.ui
# This .dspy file uses functions provided by load_hermes_web_cli()
try:
# Use the function provided by the hermes-web-cli module
services = await get_all_services()
# Format services for UI display
result = []
for service in services:
result.append({
"id": service.get("id"),
"name": service.get("name", f"Service {service.get('id')}"),
"endpoint": service.get("service_url", ""),
"description": service.get("description", ""),
"status": service.get("status", "unknown"),
"created_at": service.get("created_at")
})
return result
except Exception as e:
# On error, return empty array
return []