dataflow.platform.models¶
Platform Models - Pydantic-First Architecture with Intelligent Inheritance
This module provides the complete set of platform models for the unified Haive ecosystem. All models use pure Pydantic architecture with no __init__ methods and intelligent inheritance patterns.
Architecture Overview:¶
Base Platform Layer: - BasePlatform: Foundation for all platform models - PlatformStatus: Common status enumeration
Specialized Platforms: - MCPPlatform: MCP-specific platform (inherits BasePlatform) - PluginPlatform: Base for all plugins (inherits BasePlatform)
Server Hierarchy: - BaseServerInfo: Foundation for all servers - MCPServerInfo: MCP-specific servers (inherits BaseServerInfo) - DownloadedServerInfo: Our 63 downloaded servers (inherits MCPServerInfo)
Configuration Models: - PluginConfig: Plugin configuration - APIConfig: FastAPI configuration - DiscoveryConfig: Service discovery configuration - ConnectionConfig: Server connection configuration
Enumerations: - ServerSource: Where servers come from - ServerStatus: Server operational status - MCPTransport: MCP transport protocols - HealthStatus: Health check status
Key Features:¶
Pure Pydantic Models: - No __init__ methods anywhere - All configuration via Field definitions - Comprehensive validation through field validators - Clean inheritance patterns
Intelligent Inheritance: - BasePlatform provides core platform functionality - Specialized platforms extend with domain-specific features - Server hierarchy supports multiple server types - Consistent patterns across all models
Real-World Integration: - DownloadedServerInfo works with our 63 downloaded servers - Factory methods for creating from CSV and install report data - Connection configurations for actual server types
Comprehensive Validation: - Field validators for IDs, URLs, versions - Cross-field validation where needed - Sensible defaults and examples
Usage Examples:¶
- Basic Platform Creation:
>>> from haive.dataflow.platform.models import MCPPlatform >>> platform = MCPPlatform() # Uses intelligent defaults >>> print(platform.platform_name) "Haive MCP Platform"
- Plugin Configuration:
>>> from haive.dataflow.platform.models import PluginConfig >>> plugin = PluginConfig( ... name="mcp-browser", ... entry_point="haive.mcp.plugins:MCPBrowserPlugin" ... )
- Server from Download Data:
>>> from haive.dataflow.platform.models import DownloadedServerInfo >>> server = DownloadedServerInfo.from_csv_and_install_report( ... csv_data, install_report, "session-123" ... )
- Inheritance Validation:
>>> isinstance(platform, BasePlatform) # True >>> isinstance(server, BaseServerInfo) # True >>> isinstance(server, MCPServerInfo) # True